[cig-commits] r4888 - in long/3D/Gale/trunk/src/StgFEM: .
SLE/SystemSetup/src
walter at geodynamics.org
walter at geodynamics.org
Wed Oct 11 13:49:52 PDT 2006
Author: walter
Date: 2006-10-11 13:49:52 -0700 (Wed, 11 Oct 2006)
New Revision: 4888
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
Log:
r774 at earth: boo | 2006-10-11 13:49:31 -0700
r748 at earth (orig r627): JulianGiordani | 2006-08-22 20:03:31 -0700
Extra information stream created, which prints the convergence information to a seperate file in the output path. This file is called Convergence.dat and contains : [ timeStep | nonLinear_Iteration | Residual | Tolerance ].
To invoke this file add <param name="makeConvergenceFile">true</param> to a SLE class - normally our SLE class is the "StokesFlow" component in your xml.
By default this streaming to the file is off.
Change made by Catherine,Vincent and Julian.
Property changes on: long/3D/Gale/trunk/src/StgFEM
___________________________________________________________________
Name: svk:merge
- 38867592-cf10-0410-9e16-a142ea72ac34:/cig:744
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:626
+ 38867592-cf10-0410-9e16-a142ea72ac34:/cig:774
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:627
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-11 20:48:34 UTC (rev 4887)
+++ long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.c 2006-10-11 20:49:52 UTC (rev 4888)
@@ -134,6 +134,7 @@
void* sle,
SLE_Solver* solver,
FiniteElementContext* context,
+ Bool makeConvergenceFile,
Bool isNonLinear,
double nonLinearTolerance,
Iteration_Index nonLinearMaxIterations,
@@ -142,6 +143,7 @@
MPI_Comm comm )
{
SystemLinearEquations* self = (SystemLinearEquations*)sle;
+ char* filename;
self->isConstructed = True;
self->extensionManager = ExtensionManager_New_OfExistingObject( self->name, self );
@@ -152,6 +154,16 @@
identical timing info printed. May want to fine-tune later so that some info does get
printed on all procs. */
Stream_SetPrintingRank( self->info, 0 );
+
+ self->makeConvergenceFile = makeConvergenceFile;
+ if ( self->makeConvergenceFile ) {
+ self->convergenceStream = Journal_Register( InfoStream_Type, "Convergence Info" );
+ Stg_asprintf( &filename, "Convergence.dat" );
+ Stream_RedirectFile_WithPrependedPath( self->convergenceStream, context->outputPath, filename );
+ Stream_SetPrintingRank( self->convergenceStream, 0 );
+ Memory_Free( filename );
+ Journal_Printf( self->convergenceStream , "Timestep\tIteration\tResidual\tTolerance\n" );
+ }
self->comm = comm;
@@ -219,6 +231,7 @@
sle,
solver,
context,
+ False, //TODO: A hack put in place for setting the convergence stream to 'off' if the SLE class is created from within the code, not via an xml
isNonLinear,
nonLinearTolerance,
nonLinearMaxIterations,
@@ -344,11 +357,13 @@
Iteration_Index nonLinearMaxIterations;
Bool isNonLinear;
Bool killNonConvergent;
+ Bool makeConvergenceFile;
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 );
@@ -363,6 +378,7 @@
self,
solver,
context,
+ makeConvergenceFile,
isNonLinear,
nonLinearTolerance,
nonLinearMaxIterations,
@@ -638,6 +654,7 @@
/* First Solve */
self->nonLinearIteration_I = 0;
Journal_Printf(self->info,"\nNon linear solver - iteration %d\n", self->nonLinearIteration_I);
+
self->linearExecute( self, data );
self->hasExecuted = True;
@@ -659,6 +676,11 @@
Journal_Printf( self->info, "In func %s: Iteration %u of %u - Residual %.5g - Tolerance = %.5g\n",
__func__, self->nonLinearIteration_I, maxIterations, residual, tolerance );
+ if ( self->makeConvergenceFile ) {
+ Journal_Printf( self->convergenceStream, "%d\t\t%d\t\t%.5g\t\t%.5g\n",
+ self->context->timeStep, self->nonLinearIteration_I, residual, tolerance );
+ }
+
/* Check if residual is below tolerance */
converged = (residual < tolerance);
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-11 20:48:34 UTC (rev 4887)
+++ long/3D/Gale/trunk/src/StgFEM/SLE/SystemSetup/src/SystemLinearEquations.h 2006-10-11 20:49:52 UTC (rev 4888)
@@ -88,6 +88,8 @@
/* SystemLinearEquations info */ \
Stream* debug; \
Stream* info; \
+ Stream* convergenceStream; \
+ Bool makeConvergenceFile; \
MPI_Comm comm; \
StiffnessMatrixList* stiffnessMatrices; \
ForceVectorList* forceVectors; \
More information about the cig-commits
mailing list