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

walter at geodynamics.org walter at geodynamics.org
Wed Jan 24 15:43:23 PST 2007


Author: walter
Date: 2007-01-24 15:43:22 -0800 (Wed, 24 Jan 2007)
New Revision: 5883

Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c
   long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.h
Log:
 r1510 at earth:  boo | 2007-01-24 15:40:04 -0800
 Add the standard condition function TruncatedRotation{XY}



Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
   - 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1508
   + 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:1510

Modified: long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c	2007-01-24 03:18:45 UTC (rev 5882)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c	2007-01-24 23:43:22 UTC (rev 5883)
@@ -115,6 +115,11 @@
 
 	condFunc = ConditionFunction_New( StG_FEM_StandardConditionFunctions_Gaussian, "Gaussian");
 	ConditionFunction_Register_Add( context->condFunc_Register, condFunc );
+
+	condFunc = ConditionFunction_New( StG_FEM_StandardConditionFunctions_TruncatedRotationX, "TruncatedRotationX");
+	ConditionFunction_Register_Add( context->condFunc_Register, condFunc );
+	condFunc = ConditionFunction_New( StG_FEM_StandardConditionFunctions_TruncatedRotationY, "TruncatedRotationY");
+	ConditionFunction_Register_Add( context->condFunc_Register, condFunc );
 }
 
 void* _StgFEM_StandardConditionFunctions_DefaultNew( Name name ) {
@@ -873,7 +878,74 @@
                            /(width*width));
 }
 
+/* The x component of a truncated rotation */
 
+void StG_FEM_StandardConditionFunctions_TruncatedRotationX
+( Node_LocalIndex node_lI, Variable_Index var_I, void* _context,
+  void* _result ) {
+	FiniteElementContext *	context            = (FiniteElementContext*)_context;
+	FeVariable*             feVariable         = NULL;
+	FeMesh*     mesh               = NULL;
+	Dictionary*             dictionary         = context->dictionary;
+	double*                 result             = (double*) _result;
+        double*                 coord;
+	double                  centreX, centreY, radius, magnitude, limit;
+        int dim;
+
+	feVariable = (FeVariable*)FieldVariable_Register_GetByName( context->fieldVariable_Register, "VelocityField" );
+	mesh       = feVariable->feMesh;
+	coord      = Mesh_GetVertex( mesh, node_lI );
+
+        limit = Dictionary_GetDouble_WithDefault
+          ( dictionary, "TruncatedRotationLimit", 1.0 );
+        dim = Dictionary_GetInt_WithDefault( dictionary,
+                                             "TruncatedRotationDim", 0 );
+
+        if(coord[dim]>limit)
+          {
+            *result=0.0;
+          }
+        else
+          {
+            StgFEM_StandardConditionFunctions_PartialRotationX
+              (node_lI, var_I, _context, _result );
+          }
+}
+
+/* The y component of a truncated rotation */
+
+void StG_FEM_StandardConditionFunctions_TruncatedRotationY
+( Node_LocalIndex node_lI, Variable_Index var_I, void* _context,
+  void* _result ) {
+	FiniteElementContext *	context            = (FiniteElementContext*)_context;
+	FeVariable*             feVariable         = NULL;
+	FeMesh*     mesh               = NULL;
+	Dictionary*             dictionary         = context->dictionary;
+	double*                 result             = (double*) _result;
+        double*                 coord;
+	double                  centreX, centreY, radius, magnitude, limit;
+        int dim;
+
+	feVariable = (FeVariable*)FieldVariable_Register_GetByName( context->fieldVariable_Register, "VelocityField" );
+	mesh       = feVariable->feMesh;
+	coord      = Mesh_GetVertex( mesh, node_lI );
+
+        limit = Dictionary_GetDouble_WithDefault
+          ( dictionary, "TruncatedRotationLimit", 1.0 );
+        dim = Dictionary_GetInt_WithDefault( dictionary,
+                                             "TruncatedRotationDim", 0 );
+        if(coord[dim]>limit)
+          {
+            *result=0.0;
+          }
+        else
+          {
+            StgFEM_StandardConditionFunctions_PartialRotationY
+              (node_lI, var_I, _context, _result );
+          }
+}
+
+
 Bool StgFEM_StandardConditionFunctions_Init( int* argc, char** argv[] ) {
   Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
   Stg_ComponentRegister_Add(componentsRegister,

Modified: long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.h	2007-01-24 03:18:45 UTC (rev 5882)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.h	2007-01-24 23:43:22 UTC (rev 5883)
@@ -86,6 +86,9 @@
 void StG_FEM_StandardConditionFunctions_StepFunctionProduct4( Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result ) ;
 void StG_FEM_StandardConditionFunctions_Gaussian( Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result ) ;
 
+void StG_FEM_StandardConditionFunctions_TruncatedRotationX( Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result ) ;
+void StG_FEM_StandardConditionFunctions_TruncatedRotationY( Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result ) ;
 
 
+
 #endif	



More information about the cig-commits mailing list