[cig-commits] commit: Modifying the BuoyancyForceTerm to use new interfaces
Mercurial
hg at geodynamics.org
Mon Feb 1 15:31:12 PST 2010
changeset: 345:99a525cc04cc
user: LukeHodkinson at localhost.localdomain
date: Thu Dec 03 09:58:54 2009 +1100
files: Utils/src/BuoyancyForceTerm.c
description:
Modifying the BuoyancyForceTerm to use new interfaces
to the materials.
diff -r c9d486818565 -r 99a525cc04cc Utils/src/BuoyancyForceTerm.c
--- a/Utils/src/BuoyancyForceTerm.c Thu Dec 03 09:58:14 2009 +1100
+++ b/Utils/src/BuoyancyForceTerm.c Thu Dec 03 09:58:54 2009 +1100
@@ -373,6 +373,8 @@ void _BuoyancyForceTerm_AssembleElement(
double totalWeight = 0.0;
double adjustFactor = 0.0;
+ double density;
+ double alpha;
elementType = FeMesh_GetElementType( mesh, lElement_I );
elementNodeCount = elementType->nodeCount;
@@ -410,13 +412,22 @@ void _BuoyancyForceTerm_AssembleElement(
/* Get parameters */
if ( temperatureField )
FeVariable_InterpolateFromMeshLocalCoord( temperatureField, mesh, lElement_I, xi, &temperature );
-
+
+ density = IntegrationPointMapper_GetDoubleFromMaterial(
+ swarm->mapper, particle, self->materialExtHandle,
+ offsetof(BuoyancyForceTerm_MaterialExt, density));
+ alpha = IntegrationPointMapper_GetDoubleFromMaterial(
+ swarm->mapper, particle, self->materialExtHandle,
+ offsetof(BuoyancyForceTerm_MaterialExt, alpha));
+
+/*
material = IntegrationPointsSwarm_GetMaterialOn( (IntegrationPointsSwarm*) swarm, particle );
materialExt = ExtensionManager_Get( material->extensionMgr, material, self->materialExtHandle );
+*/
/* Calculate Force */
gravity = BuoyancyForceTerm_CalcGravity( self, (Swarm*)swarm, lElement_I, particle );
- force = materialExt->density * gravity * (1.0 - materialExt->alpha * temperature);
+ force = density * gravity * (1.0 - alpha * temperature);
factor = detJac * particle->weight * adjustFactor * force;
/* Apply force in the correct direction */
More information about the CIG-COMMITS
mailing list