[cig-commits] commit: changing the interpolation function to make Buoyancy force term work with dual mesh
Mercurial
hg at geodynamics.org
Mon Nov 24 11:30:34 PST 2008
changeset: 40:b6731688555b
user: RobertTurnbull
date: Fri Sep 14 05:20:39 2007 +0000
files: Utils/src/BuoyancyForceTerm.c Utils/src/BuoyancyForceTermThermoChem.c
description:
changing the interpolation function to make Buoyancy force term work with dual mesh
diff -r d7ab407f7264 -r b6731688555b Utils/src/BuoyancyForceTerm.c
--- a/Utils/src/BuoyancyForceTerm.c Thu Aug 16 03:47:04 2007 +0000
+++ b/Utils/src/BuoyancyForceTerm.c Fri Sep 14 05:20:39 2007 +0000
@@ -38,7 +38,7 @@
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
**
-** $Id: BuoyancyForceTerm.c 475 2007-06-27 00:31:44Z DavidLee $
+** $Id: BuoyancyForceTerm.c 508 2007-09-14 05:20:39Z RobertTurnbull $
**
**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -256,6 +256,14 @@ void _BuoyancyForceTerm_Build( void* for
MaterialPointsSwarm** materialSwarms;
Index materialSwarm_I;
Name name;
+ AbstractContext* context;
+ Stg_ComponentFactory* cf;
+
+ /* Get Component Factory if we can */
+ if ( Stg_Class_IsInstance( data, AbstractContext_Type ) ) {
+ context = (AbstractContext*) data;
+ cf = context->CF;
+ }
_ForceTerm_Build( self, data );
@@ -271,8 +279,14 @@ void _BuoyancyForceTerm_Build( void* for
material = Materials_Register_GetByIndex( materials_Register, material_I );
materialExt = ExtensionManager_GetFunc( material->extensionMgr, material, self->materialExtHandle );
- materialExt->density = Dictionary_GetDouble_WithDefault( material->dictionary, "density", 0.0 );
- materialExt->alpha = Dictionary_GetDouble_WithDefault( material->dictionary, "alpha", 0.0 );
+ if ( cf ) {
+ materialExt->density = Stg_ComponentFactory_GetDouble( cf, material->name, "density", 0.0 );
+ materialExt->alpha = Stg_ComponentFactory_GetDouble( cf, material->name, "alpha", 0.0 );
+ }
+ else {
+ materialExt->density = Dictionary_GetDouble_WithDefault( material->dictionary, "density", 0.0 );
+ materialExt->alpha = Dictionary_GetDouble_WithDefault( material->dictionary, "alpha", 0.0 );
+ }
}
/* Create Swarm Variables of each material swarm this ip swarm is mapped against */
@@ -394,8 +408,9 @@ void _BuoyancyForceTerm_AssembleElement(
ElementType_EvaluateShapeFunctionsAt( elementType, xi, Ni );
/* Get parameters */
- if ( temperatureField )
- FeVariable_InterpolateWithinElement( temperatureField, lElement_I, xi, &temperature );
+ if ( temperatureField )
+ FeVariable_InterpolateFromMeshLocalCoord( temperatureField, mesh, lElement_I, xi, &temperature );
+
material = IntegrationPointsSwarm_GetMaterialOn( (IntegrationPointsSwarm*) swarm, particle );
materialExt = ExtensionManager_Get( material->extensionMgr, material, self->materialExtHandle );
diff -r d7ab407f7264 -r b6731688555b Utils/src/BuoyancyForceTermThermoChem.c
--- a/Utils/src/BuoyancyForceTermThermoChem.c Thu Aug 16 03:47:04 2007 +0000
+++ b/Utils/src/BuoyancyForceTermThermoChem.c Fri Sep 14 05:20:39 2007 +0000
@@ -361,7 +361,8 @@ void _BuoyancyForceTermThermoChem_Assemb
/* Get parameters */
if ( temperatureField )
- FeVariable_InterpolateWithinElement( temperatureField, lElement_I, xi, &temperature );
+ FeVariable_InterpolateFromMeshLocalCoord( temperatureField, mesh, lElement_I, xi, &temperature );
+
material = IntegrationPointsSwarm_GetMaterialOn( (IntegrationPointsSwarm*) swarm, particle );
materialExt = ExtensionManager_Get( material->extensionMgr, material, self->materialExtHandle );
More information about the CIG-COMMITS
mailing list