[cig-commits] r4166 - in long/3D/Gale/trunk/src/StgFEM: .
Discretisation/src
walter at geodynamics.org
walter at geodynamics.org
Tue Aug 1 01:55:04 PDT 2006
Author: walter
Date: 2006-08-01 01:55:03 -0700 (Tue, 01 Aug 2006)
New Revision: 4166
Modified:
long/3D/Gale/trunk/src/StgFEM/
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Mesh.c
long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Mesh.h
Log:
r730 at earth: boo | 2006-08-01 01:52:57 -0700
r720 at earth (orig r624): LukeHodkinson | 2006-07-26 20:37:16 -0700
Added a routine to register only the local nodes'
coordinates as variables. In Gale it's preferable to
only advect local coordinates, shadow coordinates
have a problem interpolating velocities.
Property changes on: long/3D/Gale/trunk/src/StgFEM
___________________________________________________________________
Name: svk:merge
- 38867592-cf10-0410-9e16-a142ea72ac34:/cig:729
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:623
+ 38867592-cf10-0410-9e16-a142ea72ac34:/cig:730
db209038-57f2-0310-97fa-b160e0ae9d04:/trunk:624
Modified: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Mesh.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Mesh.c 2006-08-01 08:54:59 UTC (rev 4165)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Mesh.c 2006-08-01 08:55:03 UTC (rev 4166)
@@ -476,6 +476,55 @@
return variable;
}
+Variable* FiniteElement_Mesh_RegisterLocalNodeCoordsAsVariables( void* feMesh, void* _variable_Register, Variable** variableList ) {
+ FiniteElement_Mesh* self = (FiniteElement_Mesh*)feMesh;
+ Variable_Register* variable_Register = (Variable_Register*) _variable_Register;
+ Variable* variable;
+ Name variableName;
+ Name variableNameX;
+ Name variableNameY;
+ Name variableNameZ;
+
+ /* Append Extension onto names */
+ variableName = Memory_Alloc_Array( char, strlen( self->name ) + strlen( "NodeCoords" ) + 1, "variableName" );
+ sprintf( variableName , "%sNodeCoords", self->name );
+
+ variableNameX = Memory_Alloc_Array( char, strlen( self->name ) + strlen( "NodeCoordX" ) + 1, "variableNameX" );
+ sprintf( variableNameX, "%sNodeCoordX", self->name );
+
+ variableNameY = Memory_Alloc_Array( char, strlen( self->name ) + strlen( "NodeCoordY" ) + 1, "variableNameY" );
+ sprintf( variableNameY, "%sNodeCoordY", self->name );
+
+ variableNameZ = Memory_Alloc_Array( char, strlen( self->name ) + strlen( "NodeCoordZ" ) + 1, "variableNameZ" );
+ sprintf( variableNameZ, "%sNodeCoordZ", self->name );
+
+ /* Construct */
+ variable = Variable_NewVector(
+ variableName,
+ Variable_DataType_Double,
+ 3,
+ &self->nodeLocalCount,
+ (void**)&self->nodeCoord,
+ variable_Register,
+ variableNameX,
+ variableNameY,
+ variableNameZ );
+
+ if ( variableList != NULL ) {
+ variableList[ I_AXIS ] = Variable_Register_GetByName( variable_Register, variableNameX );
+ variableList[ J_AXIS ] = Variable_Register_GetByName( variable_Register, variableNameY );
+ variableList[ K_AXIS ] = Variable_Register_GetByName( variable_Register, variableNameZ );
+ }
+
+ /* Clean Up */
+ Memory_Free( variableNameZ );
+ Memory_Free( variableNameY );
+ Memory_Free( variableNameX );
+ Memory_Free( variableName );
+
+ return variable;
+}
+
void FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( void* feMesh, Dimension_Index dim, Element_LocalIndex lElement_I, Coord xi, Coord globalCoord ) {
FiniteElement_Mesh* self = (FiniteElement_Mesh*) feMesh;
ElementType* elementType = FeMesh_ElementTypeAt( self, lElement_I );
Modified: long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Mesh.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Mesh.h 2006-08-01 08:54:59 UTC (rev 4165)
+++ long/3D/Gale/trunk/src/StgFEM/Discretisation/src/Mesh.h 2006-08-01 08:55:03 UTC (rev 4166)
@@ -197,6 +197,7 @@
/* --- Public Functions --- */
Variable* FiniteElement_Mesh_RegisterNodeCoordsAsVariables( void* feMesh, void* _variable_Register, Variable** variableList ) ;
+ Variable* FiniteElement_Mesh_RegisterLocalNodeCoordsAsVariables( void* feMesh, void* _variable_Register, Variable** variableList );
void FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( void* feMesh, Dimension_Index dim, Element_LocalIndex lElement_I, Coord xi, Coord globalCoord ) ;
/** This is a higher-level function to the actual one on the elementType that does the work.
More information about the cig-commits
mailing list