[cig-commits] r5027 - in long/3D/Gale/trunk/src/StgFEM: . SLE/SystemSetup/src

walter at geodynamics.org walter at geodynamics.org
Sat Oct 14 11:32:12 PDT 2006


Author: walter
Date: 2006-10-14 11:32:12 -0700 (Sat, 14 Oct 2006)
New Revision: 5027

Modified:
   long/3D/Gale/trunk/src/StgFEM/
   long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.c
   long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.h
   long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.meta
Log:
 r829 at earth:  boo | 2006-10-14 11:31:50 -0700
  r827 at earth (orig r653):  VincentLemiale | 2006-10-12 00:18:21 -0700
  adding an optional flag in non linear solver : nonLinearMinIterations. If used, even if the solver has reached the required tolerance, it will still solve for the same time step until it reaches the minimum required number of iterations. This is potentially useful to ensure that the solver is converging properly, in cases where the tolerance is reached in 1 iteration only (the default value of the tolerance is somewhat arbitrary and might not always be appropriate). 
  Note on doco : this meta file is really out of date - it will soon (if not already) become useless.
  
  
 



Property changes on: long/3D/Gale/trunk/src/StgFEM
___________________________________________________________________
Name: svk:merge
   - 38867592-cf10-0410-9e16-a142ea72ac34:/cig:799
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:652
   + 38867592-cf10-0410-9e16-a142ea72ac34:/cig:829
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:653

Modified: long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.c	2006-10-14 18:31:26 UTC (rev 5026)
+++ long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.c	2006-10-14 18:32:12 UTC (rev 5027)
@@ -139,6 +139,7 @@
 		double                                             nonLinearTolerance,
 		Iteration_Index                                    nonLinearMaxIterations,
 		Bool                                               killNonConvergent,
+		Iteration_Index                                    nonLinearMinIterations,
 		EntryPoint_Register*                               entryPoint_Register,
 		MPI_Comm                                           comm ) 
 {
@@ -176,11 +177,11 @@
 	/* Init NonLinear Stuff */
 	if ( isNonLinear ) 
 		SystemLinearEquations_SetToNonLinear( self );
-	self->nonLinearTolerance     = nonLinearTolerance;
-	self->nonLinearMaxIterations = nonLinearMaxIterations;
-	self->killNonConvergent      = killNonConvergent;
+	self->nonLinearTolerance        = nonLinearTolerance;
+	self->nonLinearMaxIterations    = nonLinearMaxIterations;
+	self->killNonConvergent         = killNonConvergent;
+	self->nonLinearMinIterations    = nonLinearMinIterations;	
 	
-	
 	/* Initialise MG stuff. */
 	self->mgEnabled = False;
 	self->mgUpdate = True;
@@ -236,6 +237,7 @@
 			nonLinearTolerance, 
 			nonLinearMaxIterations,
 			killNonConvergent, 
+			1,//TODO : hack for setting the minimum number of iterations to 1- same hack as above
 			entryPoint_Register,
 			comm );
 }
@@ -358,16 +360,18 @@
 	Bool                    isNonLinear;
 	Bool                    killNonConvergent;
 	Bool                    makeConvergenceFile;
+	Iteration_Index         nonLinearMinIterations;                     
 	
 	solver =  Stg_ComponentFactory_ConstructByKey(  cf,  self->name,  SLE_Solver_Type, SLE_Solver,  False  ) ;
 	
 	/* TODO - Construct Parent */
 
-	makeConvergenceFile    = Stg_ComponentFactory_GetBool(   cf, self->name, "makeConvergenceFile",    False );
-	isNonLinear            = Stg_ComponentFactory_GetBool(   cf, self->name, "isNonLinear",            False );
-	nonLinearTolerance     = Stg_ComponentFactory_GetDouble( cf, self->name, "nonLinearTolerance",     0.01 );
-	nonLinearMaxIterations = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "nonLinearMaxIterations", 500 );
-	killNonConvergent      = Stg_ComponentFactory_GetBool(   cf, self->name, "killNonConvergent",      True );
+	makeConvergenceFile       = Stg_ComponentFactory_GetBool(   cf, self->name, "makeConvergenceFile",    False );
+	isNonLinear               = Stg_ComponentFactory_GetBool(   cf, self->name, "isNonLinear",            False );
+	nonLinearTolerance        = Stg_ComponentFactory_GetDouble( cf, self->name, "nonLinearTolerance",     0.01 );
+	nonLinearMaxIterations    = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "nonLinearMaxIterations", 500 );
+	killNonConvergent         = Stg_ComponentFactory_GetBool(   cf, self->name, "killNonConvergent",      True );
+	nonLinearMinIterations    = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "nonLinearMinIterations", 1 );
 	
 	entryPointRegister = Stg_ObjectList_Get( cf->registerRegister, "EntryPoint_Register" );
 	assert( entryPointRegister );
@@ -383,6 +387,7 @@
 			nonLinearTolerance, 
 			nonLinearMaxIterations,
 			killNonConvergent, 
+			nonLinearMinIterations,
 			entryPointRegister,
 			MPI_COMM_WORLD );
 }
@@ -645,6 +650,7 @@
 	Bool                    converged;
 	Stream*                 errorStream     = Journal_Register( Error_Type, self->type );
 	double					wallTime;
+	Iteration_Index         minIterations   = self->nonLinearMinIterations;
 
 	Journal_Printf( self->info, "In %s\n", __func__ );
 	Stream_IndentBranch( StG_FEM_Debug );
@@ -690,7 +696,7 @@
 			(self->nonLinearIteration_I < maxIterations) ? "" : " - Reached iteration limit",
 			MPI_Wtime() - wallTime );
 		
-		if ( converged )
+		if ( (converged) && (self->nonLinearIteration_I>=minIterations) )
 			break;
 	}
 

Modified: long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.h	2006-10-14 18:31:26 UTC (rev 5026)
+++ long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.h	2006-10-14 18:32:12 UTC (rev 5027)
@@ -111,6 +111,7 @@
 		Iteration_Index                                     nonLinearMaxIterations;    \
 		Iteration_Index                                     nonLinearIteration_I;      \
 		Bool                                                killNonConvergent;         \
+		Iteration_Index                                     nonLinearMinIterations;    \
 		/* Multi-grid data. */ \
 		Bool                                                mgEnabled;                 \
 		Bool                                                mgUpdate; \

Modified: long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.meta
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.meta	2006-10-14 18:31:26 UTC (rev 5026)
+++ long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.meta	2006-10-14 18:32:12 UTC (rev 5027)
@@ -41,7 +41,20 @@
 		<param name="Default">True</param>
 		<param name="Description">An essential flag, which will kill the simulation if the solver does not appear to be converging after a time step</param>
 	</struct>
+        <struct>
+                <param name="Name">makeConvergenceFile</param>
+                <param name="Type">Bool</param>
+                <param name="Default">False</param>
+                <param name="Description">An optional flag to backup infos on convergence into a Convergence.dat file</param>
+        </struct>
+        <struct>
+                <param name="Name">nonLinearMinIterations</param>
+                <param name="Type">UnsignedInt</param>
+                <param name="Default">1</param>
+                <param name="Description">A minimum number of nonlinear solve iterations that will be performed each time step</param>
+        </struct>
 
+
 </list>
 
 <list name="Dependencies">



More information about the cig-commits mailing list