[cig-commits] r3956 - in long/3D/Gale/trunk/src/Underworld: .
InputFiles/BaseApps Rheology/src plugins/EulerDeform
plugins/MovingMesh/tests
walter at geodynamics.org
walter at geodynamics.org
Thu Jul 6 02:10:33 PDT 2006
Author: walter
Date: 2006-07-06 02:10:32 -0700 (Thu, 06 Jul 2006)
New Revision: 3956
Modified:
long/3D/Gale/trunk/src/Underworld/
long/3D/Gale/trunk/src/Underworld/InputFiles/BaseApps/ExtensionBaseApp.xml
long/3D/Gale/trunk/src/Underworld/Rheology/src/Director.c
long/3D/Gale/trunk/src/Underworld/Rheology/src/Director.h
long/3D/Gale/trunk/src/Underworld/Rheology/src/StrainWeakening.c
long/3D/Gale/trunk/src/Underworld/Rheology/src/StrainWeakening.h
long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c
long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.h
long/3D/Gale/trunk/src/Underworld/plugins/MovingMesh/tests/testExtension.xml
Log:
r306 at earth: boo | 2006-07-06 02:07:25 -0700
r291 at earth (orig r234): PatrickSunter | 2006-07-03 21:29:52 -0700
Modifying Underworld to use the new 2nd-order enabled system
for extension:
* Director and StrainWeakening TimeIntegratee sections updated
for the new TimeIntegratee interface.
* EulerDeform plugin updated for the new interface. Does this
plugin still get used, or has it been superseded by Gale?
* ExtensionBaseApp.xml changed to use the normal 2nd order
TimeIntegrator.xml instead of the euler-only Simultaneous
one.
Property changes on: long/3D/Gale/trunk/src/Underworld
___________________________________________________________________
Name: svk:merge
- 9570c393-cf10-0410-b476-9a651db1e55a:/cig:305
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:233
+ 9570c393-cf10-0410-b476-9a651db1e55a:/cig:306
c24a034b-ab11-0410-afe6-cfe714e2959e:/trunk:234
Modified: long/3D/Gale/trunk/src/Underworld/InputFiles/BaseApps/ExtensionBaseApp.xml
===================================================================
--- long/3D/Gale/trunk/src/Underworld/InputFiles/BaseApps/ExtensionBaseApp.xml 2006-07-06 09:10:28 UTC (rev 3955)
+++ long/3D/Gale/trunk/src/Underworld/InputFiles/BaseApps/ExtensionBaseApp.xml 2006-07-06 09:10:32 UTC (rev 3956)
@@ -15,7 +15,7 @@
<include>../StgFEM_Components/VelocityField.xml </include>
<include>../StgFEM_Components/PressureField.xml </include>
<include>../Underworld_Components/GaussSwarm.xml </include>
- <include>../StgFEM_Components/TimeIntegratorSimultaneous.xml </include>
+ <include>../StgFEM_Components/TimeIntegrator.xml </include>
<include>../PIC_Components/MaterialPointSwarm.xml </include>
<include>../Underworld_Components/StokesFlowUzawaCompressible.xml </include>
Modified: long/3D/Gale/trunk/src/Underworld/Rheology/src/Director.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/Rheology/src/Director.c 2006-07-06 09:10:28 UTC (rev 3955)
+++ long/3D/Gale/trunk/src/Underworld/Rheology/src/Director.c 2006-07-06 09:10:32 UTC (rev 3956)
@@ -187,18 +187,12 @@
void _Director_Construct( void* director, Stg_ComponentFactory* cf ){
Director* self = (Director*)director;
- TimeIntegrator* timeIntegrator;
MaterialPointsSwarm* materialPointsSwarm;
FeVariable* velGradField;
/* Construct Parent */
- // TODO: 'KeyFallback' soon to be deprecated/updated
- timeIntegrator = Stg_ComponentFactory_ConstructByNameWithKeyFallback(
- cf, self->name, "timeIntegrator", "TimeIntegrator", TimeIntegrator, True );
- /*timeIntegrator = Stg_ComponentFactory_ConstructByKey(
- cf, self->name, "TimeIntegrator", TimeIntegrator, True ); */
- _TimeIntegratee_Init( self, timeIntegrator, NULL, 0, NULL );
-
+ _TimeIntegratee_Construct( self, cf );
+
/* Construct 'Director' stuff */
// TODO: 'KeyFallback' soon to be deprecated/updated
velGradField = Stg_ComponentFactory_ConstructByNameWithKeyFallback(
@@ -209,7 +203,6 @@
*/
materialPointsSwarm = Stg_ComponentFactory_ConstructByKey(
cf, self->name, "MaterialPointsSwarm", MaterialPointsSwarm, True );
-
_Director_Init(
self,
@@ -273,7 +266,7 @@
}
-void _Director_TimeDerivative( void* director, Index lParticle_I, double* timeDeriv ) {
+Bool _Director_TimeDerivative( void* director, Index lParticle_I, double* timeDeriv ) {
Director* self = (Director*) director;
MaterialPointsSwarm* materialPointsSwarm = self->materialPointsSwarm;
TensorArray velGrad;
@@ -281,6 +274,7 @@
Element_LocalIndex lElement_I;
MaterialPoint* materialPoint = (MaterialPoint*) Swarm_ParticleAt( materialPointsSwarm, lParticle_I );
Director_ParticleExt* particleExt;
+ InterpolationResult result;
/* Get particle extension info - this will contain vector with director */
particleExt = (Director_ParticleExt*) ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr,
@@ -289,15 +283,29 @@
/* Check if this particle should be updated or not */
if ( self->dontUpdate || particleExt->dontUpdate ) {
memset( timeDeriv, 0, sizeof(double) * materialPointsSwarm->dim );
- return;
+ return True;
}
normal = particleExt->director;
lElement_I = materialPoint->owningCell;
- FieldVariable_InterpolateValueAt( self->velGradField, materialPoint->coord, velGrad );
+ result = FieldVariable_InterpolateValueAt( self->velGradField, materialPoint->coord, velGrad );
+ if ( result == OTHER_PROC || result == OUTSIDE_GLOBAL || isinf(velGrad[0]) || isinf(velGrad[1]) ||
+ ( self->materialPointsSwarm->dim == 3 && isinf(velGrad[2]) ) )
+ {
+ #if 0
+ Journal_Printf( Journal_Register( Error_Type, self->type ),
+ "Error in func '%s' for particle with index %u.\n\tPosition (%g, %g, %g)\n\tVelGrad here is (%g, %g, %g)."
+ "\n\tInterpolation result is %s.\n",
+ __func__, array_I, coord[0], coord[1], coord[2],
+ velGrad[0], velGrad[1], ( self->materialPointsSwarm->dim == 3 ? velGrad[2] : 0.0 ),
+ InterpolationResultToStringMap[result] );
+ #endif
+ return False;
+ }
+
if ( materialPointsSwarm->dim == 2 ) {
timeDeriv[0] = -velGrad[MAP_2D_TENSOR(0,0)] * normal[0] - velGrad[MAP_2D_TENSOR(1,0)] * normal[1];
timeDeriv[1] = -velGrad[MAP_2D_TENSOR(0,1)] * normal[0] - velGrad[MAP_2D_TENSOR(1,1)] * normal[1];
@@ -307,6 +315,8 @@
timeDeriv[1] = -velGrad[MAP_3D_TENSOR(0,1)] * normal[0] - velGrad[MAP_3D_TENSOR(1,1)] * normal[1] - velGrad[MAP_3D_TENSOR(2,1)] * normal[2];
timeDeriv[2] = -velGrad[MAP_3D_TENSOR(0,2)] * normal[0] - velGrad[MAP_3D_TENSOR(1,2)] * normal[1] - velGrad[MAP_3D_TENSOR(2,2)] * normal[2] ;
}
+
+ return True;
}
/* This function is called after each of the time integration steps -
Modified: long/3D/Gale/trunk/src/Underworld/Rheology/src/Director.h
===================================================================
--- long/3D/Gale/trunk/src/Underworld/Rheology/src/Director.h 2006-07-06 09:10:28 UTC (rev 3955)
+++ long/3D/Gale/trunk/src/Underworld/Rheology/src/Director.h 2006-07-06 09:10:32 UTC (rev 3956)
@@ -95,7 +95,7 @@
void _Director_Build( void* director, void* data );
void _Director_Initialise( void* director, void* data );
- void _Director_TimeDerivative( void* _director, Index lParticle_I, double* timeDeriv );
+ Bool _Director_TimeDerivative( void* _director, Index lParticle_I, double* timeDeriv );
void _Director_Intermediate( void* director, Index lParticle_I );
void Director_UpdateVariables( void* timeIntegrator, Director* self );
Modified: long/3D/Gale/trunk/src/Underworld/Rheology/src/StrainWeakening.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/Rheology/src/StrainWeakening.c 2006-07-06 09:10:28 UTC (rev 3955)
+++ long/3D/Gale/trunk/src/Underworld/Rheology/src/StrainWeakening.c 2006-07-06 09:10:32 UTC (rev 3956)
@@ -200,7 +200,6 @@
void _StrainWeakening_Construct( void* strainWeakening, Stg_ComponentFactory* cf ){
StrainWeakening* self = (StrainWeakening*) strainWeakening;
- TimeIntegrator* timeIntegrator;
MaterialPointsSwarm* materialPointsSwarm;
double healingRate;
double softeningStrain;
@@ -210,13 +209,7 @@
long int randomSeed;
/* Construct Parent */
- // TODO: KeyFallback soon to be deprecated
- timeIntegrator = Stg_ComponentFactory_ConstructByNameWithKeyFallback(
- cf, self->name, "timeIntegrator", "TimeIntegrator", TimeIntegrator, True );
- /*timeIntegrator = Stg_ComponentFactory_ConstructByKey(
- cf, self->name, "TimeIntegrator", TimeIntegrator, True );*/
- _TimeIntegratee_Init( self, timeIntegrator, NULL, 0, NULL );
-
+ _TimeIntegratee_Construct( self, cf );
materialPointsSwarm = Stg_ComponentFactory_ConstructByKey(
cf, self->name, "MaterialPointsSwarm", MaterialPointsSwarm, True );
@@ -298,11 +291,13 @@
}
}
-void _StrainWeakening_TimeDerivative( void* strainWeakening, Index lParticle_I, double* timeDeriv ) {
+Bool _StrainWeakening_TimeDerivative( void* strainWeakening, Index lParticle_I, double* timeDeriv ) {
StrainWeakening* self = (StrainWeakening*) strainWeakening;
Variable_Update( self->postFailureWeakeningIncrement->variable );
*timeDeriv = Variable_GetValueDouble( self->postFailureWeakeningIncrement->variable, lParticle_I );
+
+ return True;
}
/* This function is called after the time integration steps -
Modified: long/3D/Gale/trunk/src/Underworld/Rheology/src/StrainWeakening.h
===================================================================
--- long/3D/Gale/trunk/src/Underworld/Rheology/src/StrainWeakening.h 2006-07-06 09:10:28 UTC (rev 3955)
+++ long/3D/Gale/trunk/src/Underworld/Rheology/src/StrainWeakening.h 2006-07-06 09:10:32 UTC (rev 3956)
@@ -119,7 +119,7 @@
void _StrainWeakening_Build( void* strainWeakening, void* data ) ;
void _StrainWeakening_Initialise( void* strainWeakening, void* data ) ;
- void _StrainWeakening_TimeDerivative( void* _strainWeakening, Index lParticle_I, double* timeDeriv );
+ Bool _StrainWeakening_TimeDerivative( void* _strainWeakening, Index lParticle_I, double* timeDeriv );
/* Private Functions */
void _StrainWeakening_MakeValuesPositive( void* timeIntegrator, void* strainWeakening ) ;
Modified: long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c 2006-07-06 09:10:28 UTC (rev 3955)
+++ long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.c 2006-07-06 09:10:32 UTC (rev 3956)
@@ -169,7 +169,9 @@
uwCtx->timeIntegrator,
crdVar,
2,
- tiData );
+ tiData,
+ True /* Presume we need to allow fallback on edges of
+ stretching mesh - PatrickSunter, 7 June 2006 */ );
crdAdvector->_calculateTimeDeriv = EulerDeform_TimeDeriv;
/* Add to live component register... */
@@ -205,12 +207,29 @@
}
-void EulerDeform_TimeDeriv( void* crdAdvector, Index arrayInd, double* timeDeriv ) {
+Bool EulerDeform_TimeDeriv( void* crdAdvector, Index arrayInd, double* timeDeriv ) {
TimeIntegratee* self = (TimeIntegratee*)crdAdvector;
- FieldVariable* velField = (FieldVariable*)self->data[0];
+ FieldVariable* velocityField = (FieldVariable*)self->data[0];
Coord* crds = *(Coord**)self->data[1];
+ InterpolationResult result;
- FieldVariable_InterpolateValueAt( velField, crds[arrayInd], timeDeriv );
+ result = FieldVariable_InterpolateValueAt( velocityField, crds[arrayInd], timeDeriv );
+
+ if ( result == OTHER_PROC || result == OUTSIDE_GLOBAL || isinf(timeDeriv[0]) || isinf(timeDeriv[1]) ||
+ ( velocityField->dim == 3 && isinf(timeDeriv[2]) ) )
+ {
+ #if 0
+ Journal_Printf( Journal_Register( Error_Type, self->type ),
+ "Error in func '%s' for particle with index %u.\n\tPosition (%g, %g, %g)\n\tVelocity here is (%g, %g, %g)."
+ "\n\tInterpolation result is %s.\n",
+ __func__, array_I, coord[0], coord[1], coord[2],
+
+ InterpolationResultToStringMap[result] );
+ #endif
+ return False;
+ }
+
+ return True;
}
Modified: long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.h
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.h 2006-07-06 09:10:28 UTC (rev 3955)
+++ long/3D/Gale/trunk/src/Underworld/plugins/EulerDeform/EulerDeform.h 2006-07-06 09:10:32 UTC (rev 3956)
@@ -39,7 +39,7 @@
void _Underworld_EulerDeform_Destroy( void* component, void* data );
- void EulerDeform_TimeDeriv( void* crdAdvector, Index arrayInd, double* timeDeriv );
+ Bool EulerDeform_TimeDeriv( void* crdAdvector, Index arrayInd, double* timeDeriv );
void EulerDeform_Remesh( TimeIntegratee* crdAdvector, EulerDeform_Context* edCtx );
Modified: long/3D/Gale/trunk/src/Underworld/plugins/MovingMesh/tests/testExtension.xml
===================================================================
--- long/3D/Gale/trunk/src/Underworld/plugins/MovingMesh/tests/testExtension.xml 2006-07-06 09:10:28 UTC (rev 3955)
+++ long/3D/Gale/trunk/src/Underworld/plugins/MovingMesh/tests/testExtension.xml 2006-07-06 09:10:32 UTC (rev 3956)
@@ -14,7 +14,7 @@
<include>StgFEM_Components/ElementLayout.xml </include>
<include>StgFEM_Components/LinearMesh.xml </include>
<include>StgFEM_Components/VelocityField.xml </include>
- <include>StgFEM_Components/TimeIntegratorSimultaneous.xml </include>
+ <include>StgFEM_Components/TimeIntegrator.xml </include>
<include>PIC_Components/MaterialPointSwarm.xml </include>
<param name="dt">0.1</param>
More information about the cig-commits
mailing list