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

walter at geodynamics.org walter at geodynamics.org
Wed Aug 27 13:43:29 PDT 2008


Author: walter
Date: 2008-08-27 13:43:29 -0700 (Wed, 27 Aug 2008)
New Revision: 12732

Modified:
   long/3D/Gale/trunk/
   long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c
Log:
 r2319 at earth:  boo | 2008-08-26 10:41:35 -0700
 Factor out StaticFriction into an external and internal subroutine, so that we can reuse the internal subroutine for StaticFriction2



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

Modified: long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c	2008-08-27 20:43:26 UTC (rev 12731)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c	2008-08-27 20:43:29 UTC (rev 12732)
@@ -1537,22 +1537,20 @@
 }
 
 
-void StgFEM_StandardConditionFunctions_StaticFriction(Node_LocalIndex node_lI,
-                                                      Variable_Index var_I,
-                                                      void* _context,
-                                                      void* _result ) {
+void StgFEM_StandardConditionFunctions_StaticFriction_Internal
+(Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result,
+ double boundary_v, double coefficient,
+ unsigned normal_dim, unsigned tangent_dim) {
   FiniteElementContext * context = (FiniteElementContext*)_context;
   FeVariable* velocityField = NULL;
   FeVariable* stressField = NULL;
   FeVariable* pressureField = NULL;
   FeVariable* viscosityField = NULL;
   FeMesh* feMesh = NULL;
-  Dictionary* dictionary = context->dictionary;
   double* result = (double*) _result;
   double* coord;
-  unsigned normal_dim, tangent_dim;
   double stress[9], p, v[3], viscosity, normal_stress, yield_stress,
-    tangent_stress, boundary_v, coefficient;
+    tangent_stress;
   
   velocityField = (FeVariable*)FieldVariable_Register_GetByName
     ( context->fieldVariable_Register, "VelocityField" );
@@ -1566,14 +1564,6 @@
   feMesh = velocityField->feMesh;
   coord = Mesh_GetVertex( feMesh, node_lI );
   
-  boundary_v = Dictionary_GetDouble_WithDefault(dictionary,"StaticFrictionV"
-                                                 ,0.0 );
-  coefficient = Dictionary_GetDouble_WithDefault(dictionary,
-                                                 "StaticFrictionCoefficient"
-                                                 ,0.0 );
-  normal_dim = Dictionary_GetUnsignedInt_WithDefault(dictionary,"StaticFrictionNormalDim",0);
-  tangent_dim = Dictionary_GetUnsignedInt_WithDefault(dictionary,"StaticFrictionTangentDim",0);
-
   assert(normal_dim!=tangent_dim);
 
   FeVariable_GetValueAtNode(stressField,node_lI,stress);
@@ -1632,7 +1622,33 @@
     }
 }
 
+void StgFEM_StandardConditionFunctions_StaticFriction(Node_LocalIndex node_lI,
+                                                      Variable_Index var_I,
+                                                      void* _context,
+                                                      void* _result ) {
+  FiniteElementContext * context = (FiniteElementContext*)_context;
+  Dictionary* dictionary = context->dictionary;
+  unsigned normal_dim, tangent_dim;
+  double boundary_v,coefficient;
 
+  boundary_v =
+    Dictionary_GetDouble_WithDefault(dictionary,"StaticFrictionV",0.0 );
+  coefficient =
+    Dictionary_GetDouble_WithDefault(dictionary,
+                                     "StaticFrictionCoefficient",0.0);
+  normal_dim =
+    Dictionary_GetUnsignedInt_WithDefault(dictionary,
+                                          "StaticFrictionNormalDim",0);
+  tangent_dim =
+    Dictionary_GetUnsignedInt_WithDefault(dictionary,
+                                          "StaticFrictionTangentDim",0);
+
+  StgFEM_StandardConditionFunctions_StaticFriction_Internal
+    (node_lI,var_I,_context,_result,boundary_v,coefficient,normal_dim,
+     tangent_dim);
+}
+
+
 Bool StgFEM_StandardConditionFunctions_Init( int* argc, char** argv[] ) {
   Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
   Stg_ComponentRegister_Add(componentsRegister,



More information about the cig-commits mailing list