[cig-commits] r6129 - in long/3D/Gale/trunk/src/StgFEM: . plugins/StandardConditionFunctions

walter at geodynamics.org walter at geodynamics.org
Wed Feb 28 10:21:20 PST 2007


Author: walter
Date: 2007-02-28 10:21:19 -0800 (Wed, 28 Feb 2007)
New Revision: 6129

Modified:
   long/3D/Gale/trunk/src/StgFEM/
   long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c
Log:
 r1017 at earth (orig r754):  LukeHodkinson | 2007-02-26 15:13:40 -0800
 Found a bad memory access when in two dimensions.
 



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

Modified: long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c	2007-02-28 18:21:14 UTC (rev 6128)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c	2007-02-28 18:21:19 UTC (rev 6129)
@@ -550,6 +550,7 @@
 	Dictionary*             dictionary         = context->dictionary;
 	FeVariable*             feVariable = NULL;
 	FeMesh*			feMesh = NULL;
+	unsigned		nDims;
 	double*                 result = (double*) _result;
 	double                  topLayerBC;
 	double                  bottomLayerBC;
@@ -565,6 +566,7 @@
 	feVariable = (FeVariable*)FieldVariable_Register_GetByName( context->fieldVariable_Register, "TemperatureField" );
 	feMesh       = feVariable->feMesh;
 
+	nDims = Mesh_GetDimSize( feMesh );
 	Mesh_GetGlobalCoordRange( feMesh, min, max );
 
 	topLayerBC = Dictionary_GetDouble_WithDefault( dictionary, "SinusoidalTempIC_TopLayerBC", 0.0 );
@@ -578,7 +580,7 @@
 
 	coord = Mesh_GetVertex( feMesh, node_lI );
 	/* make coord relative to box bottom left corner, then scale from 0 to 1 between box min & max */
-	for ( dim_I = 0; dim_I < 3; dim_I++ ) {
+	for( dim_I = 0; dim_I < nDims; dim_I++ ) {
 		relScaledCoord[dim_I] = (coord[dim_I] - min[dim_I]) / (max[dim_I] - min[dim_I]);
 	}
 



More information about the cig-commits mailing list