[cig-commits] r14467 - in long/3D/Gale/trunk: . src/StgFEM/plugins/StandardConditionFunctions
walter at geodynamics.org
walter at geodynamics.org
Thu Mar 26 06:52:13 PDT 2009
Author: walter
Date: 2009-03-26 06:52:13 -0700 (Thu, 26 Mar 2009)
New Revision: 14467
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:
r2607 at dante: boo | 2009-03-26 06:52:13 -0700
Remove the broken StaticFriction stuff
Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
- 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:2605
+ 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:2607
Modified: long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c 2009-03-26 11:47:11 UTC (rev 14466)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.c 2009-03-26 13:52:13 UTC (rev 14467)
@@ -144,13 +144,6 @@
condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_ERFC,
"ERFC");
ConditionFunction_Register_Add( context->condFunc_Register, condFunc );
-
- condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_StaticFriction,
- "StaticFriction");
- ConditionFunction_Register_Add( context->condFunc_Register, condFunc );
- condFunc = ConditionFunction_New(StgFEM_StandardConditionFunctions_StaticFriction2,
- "StaticFriction2");
- ConditionFunction_Register_Add( context->condFunc_Register, condFunc );
}
void* _StgFEM_StandardConditionFunctions_DefaultNew( Name name ) {
@@ -1524,322 +1517,6 @@
*result=constant+scale*erfc((coord[dim]+offset)/dilate);
}
-
-void StgFEM_StandardConditionFunctions_StaticFriction_Internal
-(Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result,
- double boundary_v, double boundary_initial_v,
- double boundary_upper_v, double boundary_lower_v,
- Bool set_upper_boundary_v, Bool set_lower_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;
- double* result = (double*) _result;
- double* coord;
- double stress[9], p, v[3], viscosity, normal_stress, yield_stress,
- tangent_stress;
- Grid* grid;
- Node_GlobalIndex node_gI = 0;
- unsigned inds[3];
-
-
- velocityField = (FeVariable*)FieldVariable_Register_GetByName
- ( context->fieldVariable_Register, "VelocityField" );
- stressField = (FeVariable*)FieldVariable_Register_GetByName
- ( context->fieldVariable_Register, "StressField" );
- pressureField = (FeVariable*)FieldVariable_Register_GetByName
- ( context->fieldVariable_Register, "PressureField" );
- viscosityField = (FeVariable*)FieldVariable_Register_GetByName
- ( context->fieldVariable_Register, "ViscosityField" );
-
- feMesh = velocityField->feMesh;
- coord = Mesh_GetVertex( feMesh, node_lI );
-
- assert(normal_dim!=tangent_dim);
-
- FeVariable_GetValueAtNode(stressField,node_lI,stress);
- FeVariable_GetValueAtNode(pressureField,node_lI,&p);
- FeVariable_GetValueAtNode(velocityField,node_lI,v);
- FeVariable_GetValueAtNode(viscosityField,node_lI,&viscosity);
-
- node_gI = Mesh_DomainToGlobal( feMesh, MT_VERTEX, node_lI );
- RegularMeshUtils_Node_1DTo3D( feMesh, node_gI, inds );
-
- /* Assume 2D, boundaries along x or y axis */
- normal_stress=stress[normal_dim];
- if(inds[normal_dim]!=0)
- normal_stress=-normal_stress;
-
- tangent_stress=stress[2];
- yield_stress=(normal_stress+p)*coefficient;
-
- grid = *(Grid**)ExtensionManager_Get( feMesh->info, feMesh,
- ExtensionManager_GetHandle( feMesh->info, "vertexGrid" ) );
-
- if(set_lower_boundary_v==True && inds[tangent_dim]==0)
- {
- *result=boundary_lower_v;
-
- printf("friction %d %d %g fixed\n",tangent_dim,inds[tangent_dim],*result);
- }
- else if(set_upper_boundary_v==True
- && inds[tangent_dim]==(grid->sizes[tangent_dim]-1))
- {
- *result=boundary_upper_v;
-
- printf("friction %d %d %g fixed\n",tangent_dim,inds[tangent_dim],*result);
- }
- else if(context->nonLinearIteration_I==NULL
- || (context->timeStep < 2 && *(context->nonLinearIteration_I)==0)
- || p==0)
- {
- *result=boundary_initial_v;
-
- if(inds[tangent_dim]<8 && tangent_dim==0)
- *result=0;
-
- printf("friction %d %d %g initial\n",tangent_dim,inds[tangent_dim],*result);
- }
- else if(context->nonLinearIteration_I!=NULL
- && (*(context->nonLinearIteration_I)!=0
- || context->timeStep>1)
- && fabs(tangent_stress)<yield_stress
- && v[tangent_dim]==boundary_v)
- {
- *result=boundary_v;
-/* *result=v[tangent_dim]; */
-
- printf("friction %d %d %g %g %g %g %g old\n",
- tangent_dim,inds[tangent_dim],
- *result,v[0],v[1],boundary_v,tangent_stress);
- }
- else
- {
-/* FeVariable* dvField = NULL; */
-/* double dv[9]; */
-/* dvField = (FeVariable*)FieldVariable_Register_GetByName */
-/* ( context->fieldVariable_Register, "VelocityGradientsField" ); */
-/* FeVariable_GetValueAtNode(dvField,node_lI,dv); */
-
-/* printf("friction %d %d %g %g %g %g dv\n",tangent_dim,inds[tangent_dim], */
-/* dv[0],dv[1],dv[2],dv[3]); */
-
-
- /* If we have never yielded before, or if the tangent stress is
- very different from the yield stress, then use the gradient to
- compute a first approximation. */
-
-/* if(v[tangent_dim]==boundary_v */
-/* || fabs((yield_stress-fabs(tangent_stress)) */
-/* /(yield_stress+fabs(tangent_stress)))>0.5 */
-/* || yield_stress<0) */
- {
- Node_LocalIndex temp_node;
- double *temp_coord, delta, v_off[3];
-
- if(inds[normal_dim]==0)
- ++inds[normal_dim];
- else
- --inds[normal_dim];
-
- node_gI=RegularMeshUtils_Node_3DTo1D(feMesh, inds);
- Mesh_GlobalToDomain(feMesh, MT_VERTEX, node_gI, &temp_node);
-
- FeVariable_GetValueAtNode(velocityField,temp_node,v_off);
- temp_coord=Mesh_GetVertex(feMesh, temp_node);
-
- delta=fabs(temp_coord[normal_dim]-coord[normal_dim]);
-
- /* Make sure that we always make the velocity closer to the
- boundary velocity */
- if(v[tangent_dim]>boundary_v)
- *result=v[tangent_dim]
- - delta*(yield_stress-fabs(tangent_stress))/viscosity;
- else
- *result=v[tangent_dim]
- + delta*(yield_stress-fabs(tangent_stress))/viscosity;
-
-/* if(v_off[tangent_dim]>boundary_v) */
-/* *result=v_off[tangent_dim]-delta*yield_stress/viscosity; */
-/* else */
-/* *result=v_off[tangent_dim]+delta*yield_stress/viscosity; */
-
- /* Average the results so that we don't oscillate a lot, looking
- for a solution. */
-/* *result=(*result+v[tangent_dim])/2; */
-
- /* If the yield stress is negative (e.g. the pressure is
- negative), then the boundary moves in lockstep with the
- element above it. */
- if(yield_stress<0)
- {
- *result=v_off[tangent_dim];
-
- printf("friction %d %d %g %g set\n",tangent_dim,inds[tangent_dim],
- *result, v_off[tangent_dim]);
- }
-
- /* If we overshot, make the node stick */
- if((*result-boundary_v)*(v_off[tangent_dim]-boundary_v)<0)
- {
- printf("friction %d %d %g %g %g overshoot\n",
- tangent_dim,inds[tangent_dim],
- *result, boundary_v, v_off[tangent_dim]);
- *result=boundary_v + (v_off[tangent_dim]-boundary_v)*1.0e-5;
-/* *result=boundary_v; */
- }
-
-
- printf("friction %d %d %g %g %g %g %g %g %g %g %g initiate\n",
- tangent_dim, inds[tangent_dim],
- *result,delta,
- yield_stress,normal_stress,p,v_off[tangent_dim],tangent_stress,
- viscosity,v[tangent_dim]);
- }
-/* else */
-/* { */
-/* *result=boundary_v + (v[tangent_dim]-boundary_v) */
-/* *(1+2*(yield_stress-fabs(tangent_stress))/(yield_stress+fabs(tangent_stress))); */
-
-/* /\* If we overshot, make the node stick *\/ */
-/* if((*result-boundary_v)*(v[tangent_dim]-boundary_v)<0) */
-/* { */
-/* printf("friction %d %d %g %g %g overshoot\n", */
-/* tangent_dim,inds[tangent_dim], */
-/* *result, boundary_v, v[tangent_dim]); */
-/* *result=boundary_v; */
-/* } */
-
-/* printf("friction %d %d %g %g %g %g %g %g %g slide\n",tangent_dim, */
-/* inds[tangent_dim],*result, */
-/* yield_stress,tangent_stress,v[tangent_dim],boundary_v, */
-/* (yield_stress-tangent_stress),(yield_stress+tangent_stress) */
-/* ); */
-/* } */
- }
-}
-
-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,boundary_upper_v,boundary_lower_v,coefficient,
- nonsense_number, boundary_initial_v;
- Bool set_upper_boundary_v, set_lower_boundary_v;
- set_upper_boundary_v=True;
- set_lower_boundary_v=True;
-
- nonsense_number=-345.225287;
-
- StG_FEM_StandardConditionFunctions_StepFunctionProduct1(node_lI,var_I,
- _context,&boundary_v);
- boundary_upper_v =
- Dictionary_GetDouble_WithDefault(dictionary,
- "StaticFrictionUpperV",nonsense_number);
- if(boundary_upper_v==nonsense_number)
- {
- boundary_upper_v=boundary_v;
- set_upper_boundary_v=False;
- }
- boundary_lower_v =
- Dictionary_GetDouble_WithDefault(dictionary,
- "StaticFrictionLowerV",nonsense_number);
- if(boundary_lower_v==nonsense_number)
- {
- boundary_lower_v=boundary_v;
- set_lower_boundary_v=False;
- }
- boundary_initial_v =
- Dictionary_GetDouble_WithDefault(dictionary,
- "StaticFrictionInitialV",nonsense_number);
- if(boundary_initial_v==nonsense_number)
- boundary_initial_v=boundary_v;
-
- 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,boundary_initial_v,
- boundary_upper_v,
- boundary_lower_v,set_upper_boundary_v,set_lower_boundary_v,
- coefficient,normal_dim,tangent_dim);
-}
-
-
-void StgFEM_StandardConditionFunctions_StaticFriction2(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,boundary_upper_v,boundary_lower_v,coefficient,
- nonsense_number, boundary_initial_v;
- Bool set_upper_boundary_v, set_lower_boundary_v;
- set_upper_boundary_v=True;
- set_lower_boundary_v=True;
-
- nonsense_number=-345.225287;
-
- StG_FEM_StandardConditionFunctions_StepFunctionProduct2(node_lI,var_I,
- _context,&boundary_v);
-
- /* We have to do this song and dance with nonsense_number, because
- it stores the default and reuses it later, instead of lettting me
- specify a new one each time. */
- boundary_upper_v =
- Dictionary_GetDouble_WithDefault(dictionary,
- "StaticFriction2UpperV",nonsense_number);
- if(boundary_upper_v==nonsense_number)
- {
- boundary_upper_v=boundary_v;
- set_upper_boundary_v=False;
- }
- boundary_lower_v =
- Dictionary_GetDouble_WithDefault(dictionary,
- "StaticFriction2LowerV",nonsense_number);
- if(boundary_lower_v==nonsense_number)
- {
- boundary_lower_v=boundary_v;
- set_lower_boundary_v=False;
- }
- boundary_initial_v =
- Dictionary_GetDouble_WithDefault(dictionary,
- "StaticFriction2InitialV",nonsense_number);
- if(boundary_initial_v==nonsense_number)
- boundary_initial_v=boundary_v;
-
- coefficient =
- Dictionary_GetDouble_WithDefault(dictionary,
- "StaticFriction2Coefficient",0.0);
- normal_dim =
- Dictionary_GetUnsignedInt_WithDefault(dictionary,
- "StaticFriction2NormalDim",0);
- tangent_dim =
- Dictionary_GetUnsignedInt_WithDefault(dictionary,
- "StaticFriction2TangentDim",0);
-
- StgFEM_StandardConditionFunctions_StaticFriction_Internal
- (node_lI,var_I,_context,_result,boundary_v,boundary_initial_v,
- boundary_upper_v,
- boundary_lower_v,set_upper_boundary_v,set_lower_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,
Modified: long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.h
===================================================================
--- long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.h 2009-03-26 11:47:11 UTC (rev 14466)
+++ long/3D/Gale/trunk/src/StgFEM/plugins/StandardConditionFunctions/StandardConditionFunctions.h 2009-03-26 13:52:13 UTC (rev 14467)
@@ -94,7 +94,5 @@
void StgFEM_StandardConditionFunctions_ConstantVelocity( Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result );
void StgFEM_StandardConditionFunctions_ERF( Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result );
void StgFEM_StandardConditionFunctions_ERFC( Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result );
-void StgFEM_StandardConditionFunctions_StaticFriction( Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result );
-void StgFEM_StandardConditionFunctions_StaticFriction2( Node_LocalIndex node_lI, Variable_Index var_I, void* _context, void* _result );
#endif
More information about the CIG-COMMITS
mailing list