[cig-commits] commit: Merge in Underworld 1.4.1
Mercurial
hg at geodynamics.org
Tue Mar 23 10:34:43 PDT 2010
changeset: 412:4e555f7b10ea
tag: tip
parent: 391:57cd3eabc3b6
parent: 411:fec85612375d
user: Walter Landry <wlandry at caltech.edu>
date: Tue Mar 23 08:16:43 2010 -0700
files: MaterialPoints/src/MaterialPointsSwarm.c MaterialPoints/src/ParticleFeVariable.meta MaterialPoints/src/SwarmVariableField.c PopulationControl/tests/EscapedRoutineSuite.c Utils/src/BuoyancyForceTerm.meta Utils/src/DiffusionSMT.c
description:
Merge in Underworld 1.4.1
diff -r 57cd3eabc3b6 -r 4e555f7b10ea .hgtags
--- a/.hgtags Thu Feb 04 15:10:40 2010 -0800
+++ b/.hgtags Tue Mar 23 08:16:43 2010 -0700
@@ -1,1 +1,7 @@ 0096891fa4d4d9beab721bb240384ff50bd1fbf2
0096891fa4d4d9beab721bb240384ff50bd1fbf2 v1.2.0
+d70a4f45390dd1077b9e97c0dca452c4ea8c06cf 1.4.0
+21c55474cd05d9d33213582d0f8b23fb07008a01 1.4.1
+21c55474cd05d9d33213582d0f8b23fb07008a01 1.4.1
+0000000000000000000000000000000000000000 1.4.1
+0000000000000000000000000000000000000000 1.4.1
+f0af717b706213a63342790effa33f8cd6dcd2de 1.4.1
diff -r 57cd3eabc3b6 -r 4e555f7b10ea MaterialPoints/src/MaterialFeVariable.c
--- a/MaterialPoints/src/MaterialFeVariable.c Thu Feb 04 15:10:40 2010 -0800
+++ b/MaterialPoints/src/MaterialFeVariable.c Tue Mar 23 08:16:43 2010 -0700
@@ -163,8 +163,15 @@ void _MaterialFeVariable_Build( void* ma
tmpName = Stg_Object_AppendSuffix( self, (Name)"DataVariable" );
assert( Class_IsSuper( self->feMesh->topo, IGraph ) );
- self->dataVariable = Variable_NewScalar( tmpName, (AbstractContext*)self->context, Variable_DataType_Double, (Index*)&((IGraph*)self->feMesh->topo)->remotes[MT_VERTEX]->nDomains, NULL, (void**)&self->data, variable_Register );
- Memory_Free( tmpName );
+ self->dataVariable = Variable_NewScalar(
+ tmpName,
+ (AbstractContext*)self->context,
+ Variable_DataType_Double,
+ &((IGraph*)self->feMesh->topo)->remotes[MT_VERTEX]->nDomains,
+ NULL,
+ (void**)&self->data,
+ variable_Register );
+ Memory_Free( tmpName );
self->fieldComponentCount = 1;
tmpName = Stg_Object_AppendSuffix( self, (Name)"DofLayout" );
diff -r 57cd3eabc3b6 -r 4e555f7b10ea MaterialPoints/src/ParticleFeVariable.meta
--- a/MaterialPoints/src/ParticleFeVariable.meta Thu Feb 04 15:10:40 2010 -0800
+++ b/MaterialPoints/src/ParticleFeVariable.meta Tue Mar 23 08:16:43 2010 -0700
@@ -13,7 +13,7 @@
<param name="Parent">FeVariable</param>
<param name="Reference"></param>
<param name="Summary"></param>
- <param name="Description"><![CDATA[An abstract class which maps particle variables onto a mesh through the operator $\\hat{\\phi} = \\frac{\\sum_{n}N(\\zeta)\\phi(\\zeta)}{\\sum_{n}N(\\zeta)}$<br/>, where $\\hat{\\phi}$ is the new mesh variable, $N$ are shape functions and $\\phi$ is a particle value. <br/>This class sets up a domain-wide massMatrix (really a vector), forceVector and solutionVector. The massMatrix is the denominator of the equation, while the foceVector is the numerator. <br>This variable is evaluated at the end of the Solve_EP]]></param>
+ <param name="Description"><![CDATA[An abstract class which maps particle variables onto a mesh through the operator $\hat{\phi} = \frac{\sum_{n}N(\zeta)\phi(\zeta)}{\sum_{n}N(\zeta)}$<br/>, where $\hat{\phi}$ is the new mesh variable, $N$ are shape functions and $\phi$ is a particle value. <br/>This class sets up a domain-wide massMatrix (really a vector), forceVector and solutionVector. The massMatrix is the denominator of the equation, while the foceVector is the numerator. <br>This variable is evaluated at the end of the Solve_EP]]></param>
<list name="Params">
</list>
diff -r 57cd3eabc3b6 -r 4e555f7b10ea MaterialPoints/src/SwarmVariableField.c
--- a/MaterialPoints/src/SwarmVariableField.c Thu Feb 04 15:10:40 2010 -0800
+++ b/MaterialPoints/src/SwarmVariableField.c Tue Mar 23 08:16:43 2010 -0700
@@ -156,8 +156,14 @@ void _SwarmVariableField_Build( void* sw
* as other components are not necessarily built yet... dave. 03.10.07 */
assert( Class_IsSuper( self->feMesh->topo, IGraph ) );
tmpName = Stg_Object_AppendSuffix( self, (Name)"DataVariable" );
- self->dataVariable = Variable_NewScalar( tmpName, (AbstractContext*)self->context, Variable_DataType_Double, (Index*)&nDomainVerts, NULL, (void**)&self->data, self->variable_Register );
- Memory_Free( tmpName );
+ self->dataVariable = Variable_NewScalar( tmpName,
+ (AbstractContext*)self->context,
+ Variable_DataType_Double,
+ &nDomainVerts,
+ NULL,
+ (void**)&self->data,
+ self->variable_Register );
+ Memory_Free( tmpName );
self->fieldComponentCount = 1;
tmpName = Stg_Object_AppendSuffix( self, (Name)"DofLayout" );
diff -r 57cd3eabc3b6 -r 4e555f7b10ea MaterialPoints/src/SwarmVariableField.h
--- a/MaterialPoints/src/SwarmVariableField.h Thu Feb 04 15:10:40 2010 -0800
+++ b/MaterialPoints/src/SwarmVariableField.h Tue Mar 23 08:16:43 2010 -0700
@@ -53,7 +53,7 @@
/** SwarmVariableField class contents */
#define __SwarmVariableField \
/* General info */ \
- __ParticleFeVariable; \
+ __ParticleFeVariable \
/* Virtual info */ \
/* SwarmVariableField info */ \
unsigned dofCount; \
diff -r 57cd3eabc3b6 -r 4e555f7b10ea MaterialPoints/tests/MaterialComponentsSuite.c
--- a/MaterialPoints/tests/MaterialComponentsSuite.c Thu Feb 04 15:10:40 2010 -0800
+++ b/MaterialPoints/tests/MaterialComponentsSuite.c Tue Mar 23 08:16:43 2010 -0700
@@ -71,6 +71,7 @@ typedef struct {
Variable_Register* svRegister;
ExtensionManager_Register* eRegister;
Materials_Register* mRegister;
+ LiveComponentRegister* lcRegister;
Dictionary* matDict1;
Dictionary* matDict2;
Stg_Shape* shape1;
@@ -147,6 +148,7 @@ void MaterialComponentsSuite_Setup( Mate
Particle* matPoint;
Particle particle;
+ data->lcRegister = LiveComponentRegister_New();
data->svRegister = Variable_Register_New();
data->eRegister = ExtensionManager_Register_New();
data->mRegister = Materials_Register_New();
@@ -215,6 +217,7 @@ void MaterialComponentsSuite_Teardown( M
_Stg_Component_Delete( data->cellLayout );
_Stg_Component_Delete( data->particleLayout );
_Stg_Component_Delete( data->feMesh );
+ Stg_Class_Delete( data->lcRegister );
Stg_Class_Delete( data->eRegister );
Stg_Class_Delete( data->svRegister );
Stg_Class_Delete( data->mRegister );
diff -r 57cd3eabc3b6 -r 4e555f7b10ea SysTest/RegressionTests/testAll.py
--- a/SysTest/RegressionTests/testAll.py Thu Feb 04 15:10:40 2010 -0800
+++ b/SysTest/RegressionTests/testAll.py Tue Mar 23 08:16:43 2010 -0700
@@ -37,13 +37,20 @@ def runTests():
message += "--------------------------------------------------------\n" + \
"[SYS] PICellerator Normal-Res Integration Tests:\n" + \
"[SYS] Total Passes: (" + str(passed) + "/" + str(len( commands )) + ")\n" \
- "[SYS] Failed Commands:\n"
- for command in failed_commands:
- message += "[SYS] " + command + "\n"
+
+ if( len(failed_commands) > 0 ):
+ message += "[SYS] Failed Commands:\n"
+ for command in failed_commands:
+ message += "[SYS] " + command + "\n"
+
message += "--------------------------------------------------------\n"
FILE.write( message )
print message
FILE.close()
+ if failed > 0:
+ sys.exit(1)
+ else:
+ sys.exit(0)
runTests()
diff -r 57cd3eabc3b6 -r 4e555f7b10ea Utils/src/BuoyancyForceTerm.meta
--- a/Utils/src/BuoyancyForceTerm.meta Thu Feb 04 15:10:40 2010 -0800
+++ b/Utils/src/BuoyancyForceTerm.meta Tue Mar 23 08:16:43 2010 -0700
@@ -13,8 +13,8 @@
<param name="Parent">ForceTerm</param>
<param name="Reference">...</param>
<param name="Summary">...</param>
-<param name="Description">This adds a force term for themo-chemical convection, where the fluid is driven my both the thermal expansivity ($\\alpha$) as well as the density ($\\rho$). Both 'alpha' and 'density' are required as parameters for each material.</param>
-<param name="Equation">$\\rho g \\left( 1 - \\alpha T \\right)$</param>
+ <param name="Description">This adds a force term for themo-chemical convection, where the fluid is driven my both the thermal expansivity ($\alpha$) as well as the density ($\rho$). Both 'alpha' and 'density' are required as parameters for each material.</param>
+ <param name="Equation">$\rho g \left( 1 - \alpha T \right)$</param>
<!--Now the interesting stuff-->
diff -r 57cd3eabc3b6 -r 4e555f7b10ea Utils/src/DiffusionSMT.c
--- a/Utils/src/DiffusionSMT.c Thu Feb 04 15:10:40 2010 -0800
+++ b/Utils/src/DiffusionSMT.c Tue Mar 23 08:16:43 2010 -0700
@@ -133,11 +133,10 @@ void* _DiffusionSMT_DefaultNew( Name nam
void _DiffusionSMT_AssignFromXML( void* matrixTerm, Stg_ComponentFactory* cf, void* data ) {
DiffusionSMT* self = (DiffusionSMT*)matrixTerm;
- PICelleratorContext* context;
+ PICelleratorContext* context = (PICelleratorContext*)self->context;
/* Construct Parent */
_StiffnessMatrixTerm_AssignFromXML( self, cf, data );
- context = (PICelleratorContext*)self->context;
_DiffusionSMT_Init( self );
@@ -160,8 +159,10 @@ void _DiffusionSMT_Build( void* matrixTe
_StiffnessMatrixTerm_Build( self, data );
/* Get Component Factory if we can */
- context = (AbstractContext*)(self->context);
- cf = context->CF;
+ if ( Stg_Class_IsInstance( data, AbstractContext_Type ) ) {
+ context = (AbstractContext*) data;
+ cf = context->CF;
+ }
/* Sort out material extension stuff */
self->materialExtHandle = Materials_Register_AddMaterialExtension(
diff -r 57cd3eabc3b6 -r 4e555f7b10ea Utils/src/PCDVC.c
--- a/Utils/src/PCDVC.c Thu Feb 04 15:10:40 2010 -0800
+++ b/Utils/src/PCDVC.c Tue Mar 23 08:16:43 2010 -0700
@@ -1268,7 +1268,10 @@ void _PCDVC_Calculate2D( void* pcdvc, vo
}
_DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
_DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
-
+/* for(k=0;k<nump;k++){ */
+/* printf("In %s O(%10.7lf %10.7lf) C(%10.7lf %10.7lf) W(%.4lf)\n", __func__, pList[k].x, pList[k].y, pList[k].cx, pList[k].cy, pList[k].w); */
+/* } */
+
/************************************/
/************************************/
/* Start 2D Population Control */
@@ -1560,6 +1563,9 @@ void _PCDVC_Calculate2D( void* pcdvc, vo
particle[i]->weight = pList[i].w;
}
+ /* for(k=0;k<nump;k++){ */
+/* printf("::In %s O(%10.7lf %10.7lf) C(%10.7lf %10.7lf) W(%.4lf)\n", __func__, pList[k].x, pList[k].y, pList[k].cx, pList[k].cy, pList[k].w); */
+/* } */
for(k=0;k<nump;k++){
free(bchain[k].new_claimed_cells);
free(bchain[k].new_bound_cells);
diff -r 57cd3eabc3b6 -r 4e555f7b10ea Utils/tests/PCDVCSuite.c
--- a/Utils/tests/PCDVCSuite.c Thu Feb 04 15:10:40 2010 -0800
+++ b/Utils/tests/PCDVCSuite.c Tue Mar 23 08:16:43 2010 -0700
@@ -135,7 +135,8 @@ void testElementIntegral_CircleInterface
Index loop_I;
Index count = Dictionary_GetUnsignedInt_WithDefault( context->dictionary, "SampleSize", 5000 );
void* data;
-
+ IntegrationPoint* intParticle;
+ MaterialPoint* materialPoint;
/* Create FeVariable */
feVariable = FeVariable_New_Full(
"feVariable",
@@ -164,14 +165,27 @@ void testElementIntegral_CircleInterface
_Swarm_InitialiseParticles( materialSwarm, data );
_IntegrationPointsSwarm_UpdateHook( NULL, integrationSwarm );
+ /* The following function should not be called here as it is already called ultimately via the above function */
+ /* calling this function again causes a first iteration in Lloyd's algorithm for the Voronoi cells which we don't want here */
+ //WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
+ if(loop_I%10 == 0){
+ int i;
+
+ for(i=0;i<integrationSwarm->cellParticleCountTbl[0];i++){
+ intParticle = (IntegrationPoint*)Swarm_ParticleInCellAt( integrationSwarm, 0, i );
+ materialPoint = (MaterialPoint*)Swarm_ParticleInCellAt( materialSwarm, 0, i );
+ //printf("In %s M(%10.7lf %10.7lf) I(%10.7lf %10.7lf) W(%.4lf) particle layout type %s: point %d in cell %d\n",__func__,materialPoint->coord[0], materialPoint->coord[1],
+ // intParticle->xi[0], intParticle->xi[1], intParticle->weight, materialSwarm->particleLayout->type, i, 0);
- WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
+ //printf("%lf %lf\n",intParticle->xi[0],intParticle->xi[1]);
+ }
+ }
/* Evaluate Integral */
integral = FeVariable_IntegrateElement( feVariable, integrationSwarm, lElement_I );
/* Calculate Error */
- error = fabs( integral - analyticValue )/fabs( analyticValue );
+ error = fabs( ( integral - analyticValue )/( analyticValue ) );
errorSum += error;
errorSquaredSum += error*error;
}
@@ -179,7 +193,7 @@ void testElementIntegral_CircleInterface
/* Calculate Mean and Standard Deviation */
*mean = errorSum / (double) count;
*standardDeviation = sqrt( errorSquaredSum / (double) count - *mean * *mean );
-
+ printf("In %s: Mean %lf SD %lf Sol %lf Count = %d\n", __func__, *mean, *standardDeviation, analyticValue, count);
Stg_Component_Destroy( feVariable, NULL, True );
}
@@ -227,8 +241,9 @@ void testElementIntegral_PolynomialFunct
_Swarm_InitialiseParticles( materialSwarm, data );
_IntegrationPointsSwarm_UpdateHook( NULL, integrationSwarm );
-
- WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
+ /* The following function should not be called here as it is already called ultimately via the above function */
+ /* calling this function again causes a first iteration in Lloyd's algorithm for the Voronoi cells which we don't want here */
+ //WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
/* Evaluate Integral */
integral = FeVariable_IntegrateElement( feVariable, integrationSwarm, lElement_I );
@@ -242,7 +257,7 @@ void testElementIntegral_PolynomialFunct
/* Calculate Mean and Standard Deviation */
*mean = errorSum / (double) count;
*standardDeviation = sqrt( errorSquaredSum / (double) count - *mean * *mean );
-
+ printf("In %s: Mean %lf SD %lf Sol %lf\n", __func__, *mean, *standardDeviation, analyticValue);
Stg_Component_Destroy( feVariable, NULL, True );
}
@@ -290,8 +305,9 @@ void testElementIntegral_ExponentialInte
_Swarm_InitialiseParticles( materialSwarm, data );
_IntegrationPointsSwarm_UpdateHook( NULL, integrationSwarm );
-
- WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
+ /* The following function should not be called here as it is already called ultimately via the above function */
+ /* calling this function again causes a first iteration in Lloyd's algorithm for the Voronoi cells which we don't want here */
+ //WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
/* Evaluate Integral */
integral = FeVariable_IntegrateElement( feVariable, integrationSwarm, lElement_I );
@@ -305,7 +321,7 @@ void testElementIntegral_ExponentialInte
/* Calculate Mean and Standard Deviation */
*mean = errorSum / (double) count;
*standardDeviation = sqrt( errorSquaredSum / (double) count - *mean * *mean );
-
+ printf("In %s: Mean %lf SD %lf Sol %lf\n", __func__, *mean, *standardDeviation, analyticValue);
Stg_Component_Destroy( feVariable, NULL, True );
}
diff -r 57cd3eabc3b6 -r 4e555f7b10ea Utils/tests/expected/testPCDVC_CircleInterface.expected
--- a/Utils/tests/expected/testPCDVC_CircleInterface.expected Thu Feb 04 15:10:40 2010 -0800
+++ b/Utils/tests/expected/testPCDVC_CircleInterface.expected Tue Mar 23 08:16:43 2010 -0700
@@ -1,2 +1,2 @@ 0.005000 0.162000
-0.005000 0.162000
-0.001000 0.063000
+0.05 0.104
+0.01 0.06
diff -r 57cd3eabc3b6 -r 4e555f7b10ea Utils/tests/expected/testPCDVC_ExponentialInterface.expected
--- a/Utils/tests/expected/testPCDVC_ExponentialInterface.expected Thu Feb 04 15:10:40 2010 -0800
+++ b/Utils/tests/expected/testPCDVC_ExponentialInterface.expected Tue Mar 23 08:16:43 2010 -0700
@@ -1,2 +1,2 @@ 0.002000 0.070000
-0.002000 0.070000
-0.002000 0.050000
+0.04 0.055
+0.01 0.042
diff -r 57cd3eabc3b6 -r 4e555f7b10ea Utils/tests/expected/testPCDVC_PolynomialFunction.expected
--- a/Utils/tests/expected/testPCDVC_PolynomialFunction.expected Thu Feb 04 15:10:40 2010 -0800
+++ b/Utils/tests/expected/testPCDVC_PolynomialFunction.expected Tue Mar 23 08:16:43 2010 -0700
@@ -1,2 +1,8 @@ 0.001000 0.012000
-0.001000 0.012000
-0.001000 0.002000
+0.001000 0.0092
+0.001000 0.0022
+#the above numbers are
+#first line
+# mean tolerance for the relative mean and the relative mean itself
+#second line
+# mean std dev tolerance and the expected std dev
+
diff -r 57cd3eabc3b6 -r 4e555f7b10ea Utils/tests/input/testPCDVC.xml
--- a/Utils/tests/input/testPCDVC.xml Thu Feb 04 15:10:40 2010 -0800
+++ b/Utils/tests/input/testPCDVC.xml Tue Mar 23 08:16:43 2010 -0700
@@ -16,8 +16,8 @@
<param name="resolutionZ">10</param>
<param name="lowerT">0.6</param>
<param name="upperT">25</param>
- <param name="maxDeletions">3</param>
- <param name="maxSplits">3</param>
+ <param name="maxDeletions">0</param>
+ <param name="maxSplits">0</param>
<param name="MaterialPointsSwarm">materialPoints</param>
</struct>
</struct>
diff -r 57cd3eabc3b6 -r 4e555f7b10ea libPICellerator/src/Init.c
--- a/libPICellerator/src/Init.c Thu Feb 04 15:10:40 2010 -0800
+++ b/libPICellerator/src/Init.c Tue Mar 23 08:16:43 2010 -0700
@@ -83,7 +83,6 @@ Bool PICellerator_Init( int* argc, char*
/* Add the plugin path to the global plugin list */
ModulesManager_AddDirectory( "PICellerator", LIB_DIR );
- ToolboxesManager_SetInitialised( stgToolboxesManager, "PICellerator" );
return True;
}
return False;
More information about the CIG-COMMITS
mailing list