[cig-commits] commit: Minor rejigging.
Mercurial
hg at geodynamics.org
Mon Feb 1 15:31:16 PST 2010
changeset: 348:e83d20abd905
branch: pcu_rejig
parent: 343:8da41f9da12e
user: JericoRevote
date: Thu Dec 03 10:41:13 2009 +1100
files: MaterialPoints/src/MaterialFeVariable.c MaterialPoints/src/ParticleFeVariable.c
description:
Minor rejigging.
diff -r 8da41f9da12e -r e83d20abd905 MaterialPoints/src/MaterialFeVariable.c
--- a/MaterialPoints/src/MaterialFeVariable.c Wed Dec 02 11:55:14 2009 +1100
+++ b/MaterialPoints/src/MaterialFeVariable.c Thu Dec 03 10:41:13 2009 +1100
@@ -56,14 +56,12 @@
const Type MaterialFeVariable_Type = "MaterialFeVariable";
-MaterialFeVariable* _MaterialFeVariable_New( MATERIALFEVARIABLE_DEFARGS )
-{
- MaterialFeVariable* self;
+MaterialFeVariable* _MaterialFeVariable_New( MATERIALFEVARIABLE_DEFARGS ) {
+ MaterialFeVariable* self;
/* Allocate memory */
assert( _sizeOfSelf >= sizeof(MaterialFeVariable) );
- self = (MaterialFeVariable*)
- _ParticleFeVariable_New( PARTICLEFEVARIABLE_PASSARGS );
+ self = (MaterialFeVariable*) _ParticleFeVariable_New( PARTICLEFEVARIABLE_PASSARGS );
return self;
}
@@ -74,7 +72,7 @@ void _MaterialFeVariable_Init( MaterialF
/* Assign Pointers */
swarm = Stg_CheckType( self->assemblyTerm->integrationSwarm, IntegrationPointsSwarm );
self->picIntegrationPoints = swarm;
- self->material = material;
+ self->material = material;
}
/* --- Virtual Function Implementations --- */
@@ -96,7 +94,6 @@ void _MaterialFeVariable_Print( void* ma
/* MaterialFeVariable info */
Journal_PrintPointer( stream, self->material );
}
-
void* _MaterialFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
MaterialFeVariable* self = (MaterialFeVariable*)feVariable;
@@ -185,27 +182,31 @@ void _MaterialFeVariable_Build( void* ma
_ParticleFeVariable_Build( self, data );
}
+
void _MaterialFeVariable_Initialise( void* materialFeVariable, void* data ) {
MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
_ParticleFeVariable_Initialise( self, data );
}
+
void _MaterialFeVariable_Execute( void* materialFeVariable, void* data ) {
MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
_ParticleFeVariable_Execute( self, data );
}
+
void _MaterialFeVariable_Destroy( void* materialFeVariable, void* data ) {
MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
_ParticleFeVariable_Destroy( self, data );
}
+
void _MaterialFeVariable_ValueAtParticle(
- void* materialFeVariable,
- IntegrationPointsSwarm* swarm,
- Element_LocalIndex lElement_I,
- void* particle,
- double* particleValue )
+ void* materialFeVariable,
+ IntegrationPointsSwarm* swarm,
+ Element_LocalIndex lElement_I,
+ void* particle,
+ double* particleValue )
{
MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
*particleValue = (double) ( self->material->index == IntegrationPointsSwarm_GetMaterialIndexOn( swarm, particle ) );
diff -r 8da41f9da12e -r e83d20abd905 MaterialPoints/src/ParticleFeVariable.c
--- a/MaterialPoints/src/ParticleFeVariable.c Wed Dec 02 11:55:14 2009 +1100
+++ b/MaterialPoints/src/ParticleFeVariable.c Thu Dec 03 10:41:13 2009 +1100
@@ -60,8 +60,7 @@ int ParticleFeVariable_nNames = 0;
int ParticleFeVariable_nNames = 0;
int ParticleFeVariable_curName = 0;
-ParticleFeVariable* _ParticleFeVariable_New( PARTICLEFEVARIABLE_DEFARGS )
-{
+ParticleFeVariable* _ParticleFeVariable_New( PARTICLEFEVARIABLE_DEFARGS ) {
ParticleFeVariable* self;
/* Allocate memory */
@@ -114,9 +113,6 @@ void _ParticleFeVariable_Init( ParticleF
/* --- Virtual Function Implementations --- */
void _ParticleFeVariable_Delete( void* materialFeVariable ) {
ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
-
- Memory_Free( self->assemblyVectorName );
- Memory_Free( self->massMatrixName );
_FeVariable_Delete( self );
}
@@ -217,7 +213,10 @@ void _ParticleFeVariable_Destroy( void*
void _ParticleFeVariable_Destroy( void* materialFeVariable, void* data ) {
ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
+ Memory_Free( self->assemblyVectorName );
+ Memory_Free( self->massMatrixName );
Memory_Free( self->data );
+
Stg_Component_Destroy( self->assemblyVector, data, False );
Stg_Component_Destroy( self->assemblyTerm, data, False );
@@ -227,11 +226,8 @@ void _ParticleFeVariable_Destroy( void*
_FeVariable_Destroy( self, data );
}
-
void ParticleFeVariable_Update( void* materialFeVariable ) {
ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
-
- /* printf( "***\n*** Updating %s\n***\n", self->name ); Why - shouldn't this be done properly ?? */
/* Initialise Vectors */
VecSet( self->assemblyVector->vector, 0.0 );
@@ -245,12 +241,11 @@ void ParticleFeVariable_Update( void* ma
SolutionVector_UpdateSolutionOntoNodes( self->assemblyVector );
}
-void ParticleFeVariable_AssembleElement( void* _forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVector )
-{
+void ParticleFeVariable_AssembleElement( void* _forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVector ) {
ForceTerm* forceTerm = (ForceTerm*) _forceTerm;
ParticleFeVariable* self = Stg_CheckType( forceVector->feVariable, ParticleFeVariable );
IntegrationPointsSwarm* swarm = (IntegrationPointsSwarm*)forceTerm->integrationSwarm;
- FeMesh* mesh = self->feMesh;
+ FeMesh* mesh = self->feMesh;
Element_NodeIndex elementNodeCount = FeMesh_GetElementNodeSize( mesh, lElement_I );
ElementType* elementType = FeMesh_GetElementType( mesh, lElement_I );
Cell_Index cell_I = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
@@ -289,7 +284,7 @@ void ParticleFeVariable_AssembleElementS
ForceTerm* forceTerm = (ForceTerm*) _forceTerm;
ParticleFeVariable* self = Stg_CheckType( forceVector->feVariable, ParticleFeVariable );
Swarm* swarm = forceTerm->integrationSwarm;
- FeMesh* mesh = self->feMesh;
+ FeMesh* mesh = self->feMesh;
Element_NodeIndex elementNodeCount = FeMesh_GetElementNodeSize( mesh, lElement_I );
ElementType* elementType = FeMesh_GetElementType( mesh, lElement_I );
Cell_Index cell_I = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
More information about the CIG-COMMITS
mailing list