[cig-commits] r3954 - in long/3D/Gale/trunk/src/StgFEM: . Discretisation/src

walter at geodynamics.org walter at geodynamics.org
Thu Jul 6 02:08:34 PDT 2006


Author: walter
Date: 2006-07-06 02:08:34 -0700 (Thu, 06 Jul 2006)
New Revision: 3954

Modified:
   long/3D/Gale/trunk/src/StgFEM/
   long/3D/Gale/trunk/src/StgFEM/Discretisation/src/AnalyticSolution.c
   long/3D/Gale/trunk/src/StgFEM/Discretisation/src/AnalyticSolution.h
Log:
 r670 at earth:  boo | 2006-07-06 02:04:21 -0700
  r663 at earth (orig r604):  PatrickSunter | 2006-07-05 22:33:08 -0700
  Added a "RelativeErrorMagnitudeField" capability to
  the analytic solution - it creates a new field which
  is the ErrorMagnitude scaled by the Analytic field
  Magnitude.
  
  Doesn't really work so well if you have zeros in your
  analytic field - so use with caution. Will think
  about this more later.
  
 



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

Modified: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/AnalyticSolution.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/AnalyticSolution.c	2006-07-06 09:08:31 UTC (rev 3953)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/AnalyticSolution.c	2006-07-06 09:08:34 UTC (rev 3954)
@@ -118,6 +118,7 @@
 	self->analyticFeVariableList     = Stg_ObjectList_New();
 	self->analyticFeVariableFuncList = Stg_ObjectList_New();
 	self->errorMagnitudeFieldList    = Stg_ObjectList_New();
+	self->relativeErrorMagnitudeFieldList    = Stg_ObjectList_New();
 	self->streamList                 = Stg_ObjectList_New();
 
 	/* Add functions to entry points */
@@ -139,6 +140,7 @@
 	Stg_Class_Delete( self->analyticFeVariableList );
 	Stg_Class_Delete( self->analyticFeVariableFuncList );
 	Stg_Class_Delete( self->errorMagnitudeFieldList );
+	Stg_Class_Delete( self->relativeErrorMagnitudeFieldList );
 	Stg_Class_Delete( self->streamList );
 
 	if ( self->toleranceList )
@@ -186,6 +188,7 @@
 		Stg_Component_Build( Stg_ObjectList_At( self->feVariableList, analyticFeVariable_I ), data, False ) ;
 		Stg_Component_Build( Stg_ObjectList_At( self->analyticFeVariableList, analyticFeVariable_I ), data, False ) ;
 		Stg_Component_Build( Stg_ObjectList_At( self->errorMagnitudeFieldList, analyticFeVariable_I ), data, False ) ;
+		Stg_Component_Build( Stg_ObjectList_At( self->relativeErrorMagnitudeFieldList, analyticFeVariable_I ), data, False ) ;
 	}
 }
 
@@ -201,6 +204,7 @@
 		Stg_Component_Initialise( Stg_ObjectList_At( self->feVariableList, analyticFeVariable_I ), data, False ) ;
 		Stg_Component_Initialise( Stg_ObjectList_At( self->analyticFeVariableList, analyticFeVariable_I ), data, False ) ;
 		Stg_Component_Initialise( Stg_ObjectList_At( self->errorMagnitudeFieldList, analyticFeVariable_I ), data, False ) ;
+		Stg_Component_Initialise( Stg_ObjectList_At( self->relativeErrorMagnitudeFieldList, analyticFeVariable_I ), data, False ) ;
 
 		AnalyticSolution_PutAnalyticSolutionOntoNodes( self, analyticFeVariable_I );
 	}
@@ -335,8 +339,10 @@
 	Variable_Index                               variable_I;
 	Node_DomainIndex                             node_I;
 	Bool                                         scalar             = ( componentsCount == 1 );
+	OperatorFeVariable*                          analyticMagField;
 	OperatorFeVariable*                          errorField;
 	OperatorFeVariable*                          errorMagnitudeField;
+	OperatorFeVariable*                          relativeErrorMagnitudeField;
 	Stream*                                      stream;
 	Index                                        count;
 
@@ -411,6 +417,11 @@
 	Stg_ObjectList_GlobalPointerAppend( self->analyticFeVariableFuncList, solutionFunction, tmpName );
 	Memory_Free( tmpName );
 
+	/* Create Magnitude Field */
+	tmpName = Stg_Object_AppendSuffix( analyticFeVariable, "Magnitude" );
+	analyticMagField = OperatorFeVariable_NewUnary( tmpName, analyticFeVariable, "Magnitude" );
+	Memory_Free( tmpName );
+
 	/* Create Error field - The the calculated field minus the analytic field */
 	tmpName = Stg_Object_AppendSuffix( feVariable, "ErrorField" );
 	errorField = OperatorFeVariable_NewBinary( 
@@ -423,6 +434,13 @@
 	Memory_Free( tmpName );
 	Stg_ObjectList_Append( self->errorMagnitudeFieldList, errorMagnitudeField ); /* Add it to list */
 
+	/* Create Relative Error magnitude field - The magnitude of relative error */
+	tmpName = Stg_Object_AppendSuffix( feVariable, "RelativeErrorMagnitudeField" );
+	relativeErrorMagnitudeField = OperatorFeVariable_NewBinary(
+			tmpName, errorMagnitudeField, analyticMagField, "ScalarDivision" );
+	Memory_Free( tmpName );
+	Stg_ObjectList_Append( self->relativeErrorMagnitudeFieldList, relativeErrorMagnitudeField ); /* Add it to list */
+
 	/* Create Stream for field to dump error information to */
 	tmpName = Stg_Object_AppendSuffix( feVariable, "ErrorFile" );
 	stream = Journal_Register( Dump_Type, tmpName );
@@ -443,8 +461,10 @@
 	LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) dataVariable );
 	LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) dofLayout );
 	LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) analyticFeVariable );
+	LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) analyticMagField );
 	LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) errorField );
 	LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) errorMagnitudeField );
+	LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) relativeErrorMagnitudeField );
 
 	return analyticFeVariable;
 }
@@ -452,18 +472,9 @@
 FeVariable* AnalyticSolution_CreateAnalyticVectorField( void* analyticSolution, FeVariable* vectorField, AnalyticSolution_FeVariableSolutionFunction* solutionFunction ) {
 	AnalyticSolution*                            self = (AnalyticSolution*) analyticSolution;
 	FeVariable*                                  analyticVectorField;
-	OperatorFeVariable*                          analyticVectorMagField;
-	Name                                         tmpName;
 
 	analyticVectorField = AnalyticSolution_CreateAnalyticField( self, vectorField, solutionFunction );
 
-	/* Create Magnitude Field */
-	tmpName = Stg_Object_AppendSuffix( analyticVectorField, "Magnitude" );
-	analyticVectorMagField = OperatorFeVariable_NewUnary( tmpName, analyticVectorField, "Magnitude" );
-	Memory_Free( tmpName );
-
-	LiveComponentRegister_Add( self->LC_Register, (Stg_Component*) analyticVectorMagField );
-
 	return analyticVectorField;
 }
 

Modified: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/AnalyticSolution.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/AnalyticSolution.h	2006-07-06 09:08:31 UTC (rev 3953)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/AnalyticSolution.h	2006-07-06 09:08:34 UTC (rev 3954)
@@ -65,6 +65,7 @@
 		Stg_ObjectList*        analyticFeVariableList;     \
 		Stg_ObjectList*        analyticFeVariableFuncList; \
 		Stg_ObjectList*        errorMagnitudeFieldList;    \
+		Stg_ObjectList*        relativeErrorMagnitudeFieldList;    \
 		Stg_ObjectList*        streamList;                 \
 		double*                toleranceList;              \
 		Swarm*                 integrationSwarm;           \



More information about the cig-commits mailing list