[cig-commits] commit: Merge in Gale

Mercurial hg at geodynamics.org
Mon Feb 1 15:31:56 PST 2010


changeset:   382:857843d002b4
parent:      381:84d4b74cf385
parent:      311:2749180508f1
user:        Walter Landry <wlandry at caltech.edu>
date:        Tue Jan 19 14:45:14 2010 -0800
files:       MaterialPoints/src/MaterialPointsSwarm.c MaterialPoints/src/Materials_Register.c MaterialPoints/src/ParticleFeVariable.meta MaterialPoints/src/SwarmVariableField.c PopulationControl/src/EscapedRoutine.c Utils/src/BuoyancyForceTerm.c Utils/src/BuoyancyForceTerm.h Utils/src/BuoyancyForceTerm.meta Utils/src/Init.c Utils/src/Utils.h
description:
Merge in Gale


diff -r 84d4b74cf385 -r 857843d002b4 MaterialPoints/src/ParticleFeVariable.meta
--- a/MaterialPoints/src/ParticleFeVariable.meta	Wed Jan 13 22:24:53 2010 +1100
+++ b/MaterialPoints/src/ParticleFeVariable.meta	Tue Jan 19 14:45:14 2010 -0800
@@ -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 84d4b74cf385 -r 857843d002b4 PopulationControl/src/EscapedRoutine.c
--- a/PopulationControl/src/EscapedRoutine.c	Wed Jan 13 22:24:53 2010 +1100
+++ b/PopulationControl/src/EscapedRoutine.c	Tue Jan 19 14:45:14 2010 -0800
@@ -269,28 +269,7 @@ void EscapedRoutine_RemoveParticles( voi
 	Particle_InCellIndex  lastParticle_IndexWithinCell;
 	SizeT                 particleSize        = swarm->particleExtensionMgr->finalSize;
 
-	#if DEBUG
-	if ( Stream_IsPrintableLevel( self->debug, 2 ) ) {
-		Journal_Printf( self->debug, "Particles to remove:\n{ " );
-		for ( array_I = 0 ; array_I < self->particlesToRemoveCount - 1 ; array_I++ ) {
-			Journal_Printf( self->debug, "%u, ", self->particlesToRemoveList[ array_I ] );
-		}
-		Journal_Printf( self->debug, "%u }\n", self->particlesToRemoveList[ array_I ] );
-	}
-	#endif
-
-
 	EscapedRoutine_SortParticleList( self );
-
-	#if DEBUG
-	if ( Stream_IsPrintableLevel( self->debug, 2 ) ) {
-		Journal_Printf( self->debug, "Particles to remove:\n{ " );
-		for ( array_I = 0 ; array_I < self->particlesToRemoveCount - 1 ; array_I++ ) {
-			Journal_Printf( self->debug, "%u, ", self->particlesToRemoveList[ array_I ] );
-		}
-		Journal_Printf( self->debug, "%u }\n", self->particlesToRemoveList[ array_I ] );
-	}
-	#endif
 
 	for ( array_I = self->particlesToRemoveCount - 1 ; array_I < self->particlesToRemoveCount ; array_I-- ) {
 		particleToRemove_I = self->particlesToRemoveList[ array_I ];
diff -r 84d4b74cf385 -r 857843d002b4 Utils/src/BuoyancyForceTerm.c
--- a/Utils/src/BuoyancyForceTerm.c	Wed Jan 13 22:24:53 2010 +1100
+++ b/Utils/src/BuoyancyForceTerm.c	Tue Jan 19 14:45:14 2010 -0800
@@ -53,6 +53,7 @@
 
 #include "types.h"
 #include "BuoyancyForceTerm.h"
+#include "HydrostaticTerm.h"
 #include "MaterialSwarmVariable.h"
 
 #include <assert.h>
@@ -70,13 +71,15 @@ BuoyancyForceTerm* BuoyancyForceTerm_New
 	FeVariable*					temperatureField,
 	double						gravity,
 	Bool							adjust,
-	Materials_Register*		materials_Register )
+	Materials_Register*		materials_Register,
+        HydrostaticTerm*                                hydrostaticTerm )
 {
 	BuoyancyForceTerm* self = (BuoyancyForceTerm*) _BuoyancyForceTerm_DefaultNew( name );
 
 	self->isConstructed = True;
 	_ForceTerm_Init( self, context, forceVector, integrationSwarm, NULL );
-	_BuoyancyForceTerm_Init( self, temperatureField, gravity, adjust, materials_Register );
+	_BuoyancyForceTerm_Init( self, temperatureField, gravity, adjust, materials_Register,
+                                 hydrostaticTerm );
 
 	return self;
 }
@@ -106,7 +109,8 @@ void _BuoyancyForceTerm_Init(
 	FeVariable*				temperatureField,
 	double					gravity,
 	Bool						adjust,
-	Materials_Register*	materials_Register )
+	Materials_Register*	materials_Register,
+        HydrostaticTerm*                        hydrostaticTerm )
 {
 	BuoyancyForceTerm* self = (BuoyancyForceTerm*)forceTerm;
 
@@ -115,6 +119,7 @@ void _BuoyancyForceTerm_Init(
 	self->gHat		  = NULL;
 	self->adjust              = adjust;
 	self->materials_Register  = materials_Register;
+        self->hydrostaticTerm     = hydrostaticTerm;
 }
 
 void _BuoyancyForceTerm_Delete( void* forceTerm ) {
@@ -169,6 +174,7 @@ void _BuoyancyForceTerm_AssignFromXML( v
 	double*						direc;
 	unsigned						d_i;
 	PICelleratorContext*		context;
+        HydrostaticTerm*                                    hydrostaticTerm;
 
 	/* Construct Parent */
 	_ForceTerm_AssignFromXML( self, cf, data );
@@ -199,14 +205,17 @@ void _BuoyancyForceTerm_AssignFromXML( v
 	}
 	else
 		direc = NULL;
+	self->gHat = direc;
 
 	context = (PICelleratorContext*)self->context;
 	assert( Stg_CheckType( context, PICelleratorContext ) );
 	materials_Register = context->materials_Register;
 	assert( materials_Register );
 
-	_BuoyancyForceTerm_Init( self, temperatureField, gravity, adjust, materials_Register );
-	self->gHat = direc;
+	hydrostaticTerm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "HydrostaticTerm", HydrostaticTerm, False, data ) ;
+
+	_BuoyancyForceTerm_Init( self, temperatureField, gravity, adjust,
+                                 materials_Register, hydrostaticTerm );
 }
 
 void _BuoyancyForceTerm_Build( void* forceTerm, void* data ) {
@@ -338,6 +347,7 @@ void _BuoyancyForceTerm_AssembleElement(
 #endif
 	FeVariable*                      temperatureField   = self->temperatureField;
 	double                           temperature        = 0.0;
+        double                           background_density = 0.0;
 	double*				 gHat;
 	unsigned			d_i;
 
@@ -373,6 +383,7 @@ void _BuoyancyForceTerm_AssembleElement(
 	}
 
 	for( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+          Coord coord;
 		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
 		xi       = particle->xi;
 
@@ -394,10 +405,16 @@ void _BuoyancyForceTerm_AssembleElement(
 		material = IntegrationPointsSwarm_GetMaterialOn( (IntegrationPointsSwarm*) swarm, particle );
 		materialExt = ExtensionManager_Get( material->extensionMgr, material, self->materialExtHandle );
 */
+                if(self->hydrostaticTerm)
+                  {
+                    FeMesh_CoordLocalToGlobal(mesh, cell_I, xi, coord);
+                    background_density=HydrostaticTerm_Density(self->hydrostaticTerm,coord);
+                  }
 
 		/* Calculate Force */
 		gravity = BuoyancyForceTerm_CalcGravity( self, (Swarm*)swarm, lElement_I, particle );
-		force = density * gravity * (1.0 - alpha * temperature);
+                force=gravity*(density*(1.0-alpha*temperature)
+                               - background_density);
 		factor = detJac * particle->weight * adjustFactor * force;
 
 		/* Apply force in the correct direction */
diff -r 84d4b74cf385 -r 857843d002b4 Utils/src/BuoyancyForceTerm.h
--- a/Utils/src/BuoyancyForceTerm.h	Wed Jan 13 22:24:53 2010 +1100
+++ b/Utils/src/BuoyancyForceTerm.h	Tue Jan 19 14:45:14 2010 -0800
@@ -71,7 +71,8 @@
 		ExtensionInfo_Index							materialExtHandle; \
 		MaterialSwarmVariable**						densitySwarmVariables; \
 		MaterialSwarmVariable**						alphaSwarmVariables; \
-		Index												materialSwarmCount;
+		Index												materialSwarmCount;\
+                HydrostaticTerm*                                    hydrostaticTerm;
 
 	struct BuoyancyForceTerm { __BuoyancyForceTerm };
 
@@ -83,7 +84,8 @@
 		FeVariable*					temperatureField,
 		double						gravity,
 		Bool							adjust,
-		Materials_Register*		materials_Register );
+		Materials_Register*		materials_Register,
+                HydrostaticTerm*                                    hydrostaticTerm);
 
 	
 	#ifndef ZERO
diff -r 84d4b74cf385 -r 857843d002b4 Utils/src/BuoyancyForceTerm.meta
--- a/Utils/src/BuoyancyForceTerm.meta	Wed Jan 13 22:24:53 2010 +1100
+++ b/Utils/src/BuoyancyForceTerm.meta	Tue Jan 19 14:45:14 2010 -0800
@@ -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 84d4b74cf385 -r 857843d002b4 Utils/src/HydrostaticTerm.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/HydrostaticTerm.c	Tue Jan 19 14:45:14 2010 -0800
@@ -0,0 +1,438 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  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: /cig/src/PICellerator/Utils/src/HydrostaticTerm.c 2420 2008-12-12T20:12:30.951338Z boo  $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+#include "types.h"
+#include "HydrostaticTerm.h"
+#include "MaterialSwarmVariable.h"
+
+#include <assert.h>
+#include <string.h>
+
+/* Textual name of this class */
+const Type HydrostaticTerm_Type = "HydrostaticTerm";
+
+HydrostaticTerm* HydrostaticTerm_New(Name name,
+                                     double upper_density,
+                                     double upper_alpha,
+                                     double lower_density,
+                                     double lower_alpha,
+                                     double height,
+                                     double material_boundary,
+                                     double T_0,
+                                     double linear_coefficient,
+                                     double exponential_coefficient1,
+                                     double exponential_coefficient2,
+                                     double gravity,
+                                     double v,
+                                     double width,
+                                     AbstractContext *context)
+{
+	HydrostaticTerm* self = (HydrostaticTerm*) _HydrostaticTerm_DefaultNew( name );
+
+	HydrostaticTerm_InitAll(self,
+                                upper_density,
+                                upper_alpha,
+                                lower_density,
+                                lower_alpha,
+                                height,
+                                material_boundary,
+                                T_0,
+                                linear_coefficient,
+                                exponential_coefficient1,
+                                exponential_coefficient2,
+                                gravity,
+                                v,
+                                width,
+                                context);
+	return self;
+}
+
+/* Creation implementation / Virtual constructor */
+HydrostaticTerm* _HydrostaticTerm_New( 
+		SizeT                                               sizeOfSelf,  
+		Type                                                type,
+		Stg_Class_DeleteFunction*                           _delete,
+		Stg_Class_PrintFunction*                            _print,
+		Stg_Class_CopyFunction*                             _copy, 
+		Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+		Stg_Component_ConstructFunction*                    _construct,
+		Stg_Component_BuildFunction*                        _build,
+		Stg_Component_InitialiseFunction*                   _initialise,
+		Stg_Component_ExecuteFunction*                      _execute,
+		Stg_Component_DestroyFunction*                      _destroy,
+                double upper_density,
+                double upper_alpha,
+                double lower_density,
+                double lower_alpha,
+                double height,
+                double material_boundary,
+                double T_0,
+                double linear_coefficient,
+                double exponential_coefficient1,
+                double exponential_coefficient2,
+                double gravity,
+                double v,
+                double width,
+                AbstractContext *context,
+		Name                                                name )
+{
+  HydrostaticTerm* self;
+  
+  /* Allocate memory */
+  assert( sizeOfSelf >= sizeof(HydrostaticTerm) );
+  self = (HydrostaticTerm*)_Stg_Component_New(sizeOfSelf,
+                                              type, 
+                                              _delete,
+                                              _print,
+                                              _copy,
+                                              _defaultConstructor,
+                                              _construct,
+                                              _build,
+                                              _initialise,
+                                              _execute,
+                                              _destroy,
+                                              name,
+                                              NON_GLOBAL );
+
+  /* Virtual info */
+  
+  self->upper_density=upper_density;
+  self->upper_alpha=upper_alpha;
+  self->lower_density=lower_density;
+  self->lower_alpha=lower_alpha;
+  self->height=height;
+  self->material_boundary=material_boundary;
+  self->T_0=T_0;
+  self->linear_coefficient=linear_coefficient;
+  self->exponential_coefficient1=exponential_coefficient1;
+  self->exponential_coefficient2=exponential_coefficient2;
+  self->gravity=gravity;
+  self->v=v;
+  self->width=width;
+  self->context=context;
+  return self;
+}
+
+void _HydrostaticTerm_Init(HydrostaticTerm* self,
+                           double upper_density,
+                           double upper_alpha,
+                           double lower_density,
+                           double lower_alpha,
+                           double height,
+                           double material_boundary,
+                           double T_0,
+                           double linear_coefficient,
+                           double exponential_coefficient1,
+                           double exponential_coefficient2,
+                           double gravity,
+                           double v,
+                           double width,
+                           AbstractContext *context)
+{
+  self->isConstructed    = True;
+
+  self->upper_density=upper_density;
+  self->upper_alpha=upper_alpha;
+  self->lower_density=lower_density;
+  self->lower_alpha=lower_alpha;
+  self->height=height;
+  self->material_boundary=material_boundary;
+  self->T_0=T_0;
+  self->linear_coefficient=linear_coefficient;
+  self->exponential_coefficient1=exponential_coefficient1;
+  self->exponential_coefficient2=exponential_coefficient2;
+  self->gravity=gravity;
+  self->v=v;
+  self->width=width;
+  self->context=context;
+}
+
+void HydrostaticTerm_InitAll(void* forceTerm,
+                             double upper_density,
+                             double upper_alpha,
+                             double lower_density,
+                             double lower_alpha,
+                             double height,
+                             double material_boundary,
+                             double T_0,
+                             double linear_coefficient,
+                             double exponential_coefficient1,
+                             double exponential_coefficient2,
+                             double gravity,
+                             double v,
+                             double width,
+                             AbstractContext *context)
+{
+  HydrostaticTerm* self = (HydrostaticTerm*) forceTerm;
+  _HydrostaticTerm_Init( self,
+                         upper_density,
+                         upper_alpha,
+                         lower_density,
+                         lower_alpha,
+                         height,
+                         material_boundary,
+                         T_0,
+                         linear_coefficient,
+                         exponential_coefficient1,
+                         exponential_coefficient2,
+                         gravity,
+                         v,
+                         width,
+                         context);
+}
+
+void _HydrostaticTerm_Delete( void* forceTerm ) {
+}
+
+void _HydrostaticTerm_Print( void* forceTerm, Stream* stream ) {
+}
+
+void* _HydrostaticTerm_DefaultNew( Name name ) {
+	return (void*)_HydrostaticTerm_New( 
+		sizeof(HydrostaticTerm), 
+		HydrostaticTerm_Type,
+		_HydrostaticTerm_Delete,
+		_HydrostaticTerm_Print,
+		NULL,
+		_HydrostaticTerm_DefaultNew,
+		_HydrostaticTerm_Construct,
+		_HydrostaticTerm_Build,
+		_HydrostaticTerm_Initialise,
+		_HydrostaticTerm_Execute,
+		_HydrostaticTerm_Destroy,
+                0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,
+		name );
+}
+
+void _HydrostaticTerm_Construct( void* forceTerm, Stg_ComponentFactory* cf,
+                                 void* data ) {
+  HydrostaticTerm* self = (HydrostaticTerm*)forceTerm;
+  double upper_density,upper_alpha,lower_density,lower_alpha,height,
+    material_boundary,T_0,linear_coefficient,exponential_coefficient1,
+    exponential_coefficient2,gravity,v,width;
+  AbstractContext *context;
+
+  context = Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data );
+
+  upper_density=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"upperDensity",0.0);
+  upper_alpha=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"upperAlpha",0.0);
+  lower_density=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"lowerDensity",0.0);
+  lower_alpha=Stg_ComponentFactory_GetDouble(cf,self->name,"lowerAlpha",0.0);
+  height=Stg_ComponentFactory_GetDouble(cf,self->name,"height",0.0);
+  material_boundary=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"materialBoundary",0.0);
+  T_0=Stg_ComponentFactory_GetDouble(cf,self->name,"T_0",0.0);
+  linear_coefficient=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"linearCoefficient",0.0);
+  exponential_coefficient1=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"exponentialCoefficient1",0.0);
+  exponential_coefficient2=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"exponentialCoefficient2",0.0);
+  gravity=Stg_ComponentFactory_GetDouble(cf,self->name,"gravity",0.0);
+
+  v=Stg_ComponentFactory_GetDouble(cf,self->name,"expansionVelocity",0.0);
+  width=Stg_ComponentFactory_GetDouble(cf,self->name,"width",0.0);
+
+  _HydrostaticTerm_Init( self, upper_density,
+                         upper_alpha,
+                         lower_density,
+                         lower_alpha,
+                         height,
+                         material_boundary,
+                         T_0,
+                         linear_coefficient,
+                         exponential_coefficient1,
+                         exponential_coefficient2,
+                         gravity,
+                         v,
+                         width,
+                         context);
+}
+
+void _HydrostaticTerm_Build( void* forceTerm, void* data ) {
+}
+
+void _HydrostaticTerm_Initialise( void* forceTerm, void* data ) {
+}
+
+void _HydrostaticTerm_Execute( void* forceTerm, void* data ) {
+}
+
+void _HydrostaticTerm_Destroy( void* forceTerm, void* data ) {
+}
+
+void HydrostaticTerm_Current_Heights(void* forceTerm, double *current_height,
+                                     double *current_boundary)
+{
+  HydrostaticTerm *self=(HydrostaticTerm *)forceTerm;
+  double current_thickness;
+  double t=self->context->currentTime;
+
+  if(self->v!=0)
+    {
+      current_thickness=(self->height - self->material_boundary)
+        *self->width / (self->width + self->v * t);
+      *current_boundary=self->material_boundary
+        + (self->upper_density / self->lower_density)
+        * (self->height - self->material_boundary - current_thickness);
+    }
+  else
+    {
+      current_thickness=self->height - self->material_boundary;
+      *current_boundary=self->material_boundary;
+    }
+  *current_height=current_thickness + *current_boundary;
+}
+
+double HydrostaticTerm_Density( void* forceTerm, Coord coord)
+{
+  HydrostaticTerm *self=(HydrostaticTerm *)forceTerm;
+  double h=self->height-coord[1];
+  double T, density, alpha;
+  double current_height, current_boundary;
+
+  HydrostaticTerm_Current_Heights(self,&current_height,&current_boundary);
+  /* printf("Time %g %g %g\n",current_height,current_boundary,self->context->currentTime); */
+
+  /* First, get the temperature */
+  if(h<0)
+    {
+      T=self->T_0;
+    }
+  else
+    {
+      T=self->T_0 + self->linear_coefficient*h
+        + self->exponential_coefficient1
+        *(1-exp(-self->exponential_coefficient2*h));
+    }
+
+  /* Then, get the density */
+  if(coord[1]>current_height)
+    {
+      density=alpha=0;
+    }
+  else if(coord[1]>current_boundary)
+    {
+      density=self->upper_density;;
+      alpha=self->upper_alpha;
+    }
+  else
+    {
+      density=self->lower_density;
+      alpha=self->lower_alpha;
+    }
+
+  return density*(1-alpha*T);
+}
+
+double HydrostaticTerm_Pressure_Analytic(double density, double gravity,
+                                         double h, double alpha,
+                                         double T_0, double A,
+                                         double B, double C)
+{
+  if(C==0)
+    return density*gravity*h*(1-alpha*(T_0 + A*h/2));
+  else
+    return density*gravity*h*(1-alpha*(T_0 + A*h/2 + B*(1+(exp(-C*h)-1)/(C*h))));
+}
+
+double HydrostaticTerm_Pressure( void* forceTerm, Coord coord)
+{
+  HydrostaticTerm *self=(HydrostaticTerm *)forceTerm;
+  double h=self->height-coord[1];
+  double p;
+
+  if(coord[1]>=self->height)
+    {
+      p=0;
+    }
+  else if(coord[1]>self->material_boundary)
+    {
+      p=HydrostaticTerm_Pressure_Analytic(self->upper_density, self->gravity, h,
+                                          self->upper_alpha,
+                                          self->T_0,
+                                          self->linear_coefficient,
+                                          self->exponential_coefficient1,
+                                          self->exponential_coefficient2);
+    }
+  else
+    {
+      p=HydrostaticTerm_Pressure_Analytic(self->upper_density,
+                                          self->gravity,
+                                          self->height-self->material_boundary,
+                                          self->upper_alpha,
+                                          self->T_0,
+                                          self->linear_coefficient,
+                                          self->exponential_coefficient1,
+                                          self->exponential_coefficient2)
+        - HydrostaticTerm_Pressure_Analytic(self->lower_density, self->gravity,
+                                            self->height-self->material_boundary,
+                                            self->lower_alpha,
+                                            self->T_0,
+                                            self->linear_coefficient,
+                                            self->exponential_coefficient1,
+                                            self->exponential_coefficient2)
+        + HydrostaticTerm_Pressure_Analytic(self->lower_density, self->gravity,
+                                            h,
+                                            self->lower_alpha,
+                                            self->T_0,
+                                            self->linear_coefficient,
+                                            self->exponential_coefficient1,
+                                            self->exponential_coefficient2);
+    }
+  return p;
+}
+
diff -r 84d4b74cf385 -r 857843d002b4 Utils/src/HydrostaticTerm.c~
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/HydrostaticTerm.c~	Tue Jan 19 14:45:14 2010 -0800
@@ -0,0 +1,438 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  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: /cig/src/PICellerator/Utils/src/HydrostaticTerm.c 2420 2008-12-12T20:12:30.951338Z boo  $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+#include "types.h"
+#include "HydrostaticTerm.h"
+#include "MaterialSwarmVariable.h"
+
+#include <assert.h>
+#include <string.h>
+
+/* Textual name of this class */
+const Type HydrostaticTerm_Type = "HydrostaticTerm";
+
+HydrostaticTerm* HydrostaticTerm_New(Name name,
+                                     double upper_density,
+                                     double upper_alpha,
+                                     double lower_density,
+                                     double lower_alpha,
+                                     double height,
+                                     double material_boundary,
+                                     double T_0,
+                                     double linear_coefficient,
+                                     double exponential_coefficient1,
+                                     double exponential_coefficient2,
+                                     double gravity,
+                                     double v,
+                                     double width,
+                                     AbstractContext *context)
+{
+	HydrostaticTerm* self = (HydrostaticTerm*) _HydrostaticTerm_DefaultNew( name );
+
+	HydrostaticTerm_InitAll(self,
+                                upper_density,
+                                upper_alpha,
+                                lower_density,
+                                lower_alpha,
+                                height,
+                                material_boundary,
+                                T_0,
+                                linear_coefficient,
+                                exponential_coefficient1,
+                                exponential_coefficient2,
+                                gravity,
+                                v,
+                                width,
+                                context);
+	return self;
+}
+
+/* Creation implementation / Virtual constructor */
+HydrostaticTerm* _HydrostaticTerm_New( 
+		SizeT                                               sizeOfSelf,  
+		Type                                                type,
+		Stg_Class_DeleteFunction*                           _delete,
+		Stg_Class_PrintFunction*                            _print,
+		Stg_Class_CopyFunction*                             _copy, 
+		Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+		Stg_Component_ConstructFunction*                    _construct,
+		Stg_Component_BuildFunction*                        _build,
+		Stg_Component_InitialiseFunction*                   _initialise,
+		Stg_Component_ExecuteFunction*                      _execute,
+		Stg_Component_DestroyFunction*                      _destroy,
+                double upper_density,
+                double upper_alpha,
+                double lower_density,
+                double lower_alpha,
+                double height,
+                double material_boundary,
+                double T_0,
+                double linear_coefficient,
+                double exponential_coefficient1,
+                double exponential_coefficient2,
+                double gravity,
+                double v,
+                double width,
+                AbstractContext *context,
+		Name                                                name )
+{
+  HydrostaticTerm* self;
+  
+  /* Allocate memory */
+  assert( sizeOfSelf >= sizeof(HydrostaticTerm) );
+  self = (ForceTerm*)_Stg_Component_New(sizeOfSelf,
+                                        type, 
+                                        _delete,
+                                        _print,
+                                        _copy,
+                                        _defaultConstructor,
+                                        _construct,
+                                        _build,
+                                        _initialise,
+                                        _execute,
+                                        _destroy,
+                                        name,
+                                        NON_GLOBAL );
+
+  /* Virtual info */
+  
+  self->upper_density=upper_density;
+  self->upper_alpha=upper_alpha;
+  self->lower_density=lower_density;
+  self->lower_alpha=lower_alpha;
+  self->height=height;
+  self->material_boundary=material_boundary;
+  self->T_0=T_0;
+  self->linear_coefficient=linear_coefficient;
+  self->exponential_coefficient1=exponential_coefficient1;
+  self->exponential_coefficient2=exponential_coefficient2;
+  self->gravity=gravity;
+  self->v=v;
+  self->width=width;
+  self->context=context;
+  return self;
+}
+
+void _HydrostaticTerm_Init(HydrostaticTerm* self,
+                           double upper_density,
+                           double upper_alpha,
+                           double lower_density,
+                           double lower_alpha,
+                           double height,
+                           double material_boundary,
+                           double T_0,
+                           double linear_coefficient,
+                           double exponential_coefficient1,
+                           double exponential_coefficient2,
+                           double gravity,
+                           double v,
+                           double width,
+                           AbstractContext *context)
+{
+  self->isConstructed    = True;
+
+  self->upper_density=upper_density;
+  self->upper_alpha=upper_alpha;
+  self->lower_density=lower_density;
+  self->lower_alpha=lower_alpha;
+  self->height=height;
+  self->material_boundary=material_boundary;
+  self->T_0=T_0;
+  self->linear_coefficient=linear_coefficient;
+  self->exponential_coefficient1=exponential_coefficient1;
+  self->exponential_coefficient2=exponential_coefficient2;
+  self->gravity=gravity;
+  self->v=v;
+  self->width=width;
+  self->context=context;
+}
+
+void HydrostaticTerm_InitAll(void* forceTerm,
+                             double upper_density,
+                             double upper_alpha,
+                             double lower_density,
+                             double lower_alpha,
+                             double height,
+                             double material_boundary,
+                             double T_0,
+                             double linear_coefficient,
+                             double exponential_coefficient1,
+                             double exponential_coefficient2,
+                             double gravity,
+                             double v,
+                             double width,
+                             AbstractContext *context)
+{
+  HydrostaticTerm* self = (HydrostaticTerm*) forceTerm;
+  _HydrostaticTerm_Init( self,
+                         upper_density,
+                         upper_alpha,
+                         lower_density,
+                         lower_alpha,
+                         height,
+                         material_boundary,
+                         T_0,
+                         linear_coefficient,
+                         exponential_coefficient1,
+                         exponential_coefficient2,
+                         gravity,
+                         v,
+                         width,
+                         context);
+}
+
+void _HydrostaticTerm_Delete( void* forceTerm ) {
+}
+
+void _HydrostaticTerm_Print( void* forceTerm, Stream* stream ) {
+}
+
+void* _HydrostaticTerm_DefaultNew( Name name ) {
+	return (void*)_HydrostaticTerm_New( 
+		sizeof(HydrostaticTerm), 
+		HydrostaticTerm_Type,
+		_HydrostaticTerm_Delete,
+		_HydrostaticTerm_Print,
+		NULL,
+		_HydrostaticTerm_DefaultNew,
+		_HydrostaticTerm_Construct,
+		_HydrostaticTerm_Build,
+		_HydrostaticTerm_Initialise,
+		_HydrostaticTerm_Execute,
+		_HydrostaticTerm_Destroy,
+                0,0,0,0,0,0,0,0,0,0,0,0,0,NULL,
+		name );
+}
+
+void _HydrostaticTerm_Construct( void* forceTerm, Stg_ComponentFactory* cf,
+                                 void* data ) {
+  HydrostaticTerm* self = (HydrostaticTerm*)forceTerm;
+  double upper_density,upper_alpha,lower_density,lower_alpha,height,
+    material_boundary,T_0,linear_coefficient,exponential_coefficient1,
+    exponential_coefficient2,gravity,v,width;
+  AbstractContext *context;
+
+  context = Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data );
+
+  upper_density=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"upperDensity",0.0);
+  upper_alpha=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"upperAlpha",0.0);
+  lower_density=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"lowerDensity",0.0);
+  lower_alpha=Stg_ComponentFactory_GetDouble(cf,self->name,"lowerAlpha",0.0);
+  height=Stg_ComponentFactory_GetDouble(cf,self->name,"height",0.0);
+  material_boundary=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"materialBoundary",0.0);
+  T_0=Stg_ComponentFactory_GetDouble(cf,self->name,"T_0",0.0);
+  linear_coefficient=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"linearCoefficient",0.0);
+  exponential_coefficient1=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"exponentialCoefficient1",0.0);
+  exponential_coefficient2=
+    Stg_ComponentFactory_GetDouble(cf,self->name,"exponentialCoefficient2",0.0);
+  gravity=Stg_ComponentFactory_GetDouble(cf,self->name,"gravity",0.0);
+
+  v=Stg_ComponentFactory_GetDouble(cf,self->name,"expansionVelocity",0.0);
+  width=Stg_ComponentFactory_GetDouble(cf,self->name,"width",0.0);
+
+  _HydrostaticTerm_Init( self, upper_density,
+                         upper_alpha,
+                         lower_density,
+                         lower_alpha,
+                         height,
+                         material_boundary,
+                         T_0,
+                         linear_coefficient,
+                         exponential_coefficient1,
+                         exponential_coefficient2,
+                         gravity,
+                         v,
+                         width,
+                         context);
+}
+
+void _HydrostaticTerm_Build( void* forceTerm, void* data ) {
+}
+
+void _HydrostaticTerm_Initialise( void* forceTerm, void* data ) {
+}
+
+void _HydrostaticTerm_Execute( void* forceTerm, void* data ) {
+}
+
+void _HydrostaticTerm_Destroy( void* forceTerm, void* data ) {
+}
+
+void HydrostaticTerm_Current_Heights(void* forceTerm, double *current_height,
+                                     double *current_boundary)
+{
+  HydrostaticTerm *self=(HydrostaticTerm *)forceTerm;
+  double current_thickness;
+  double t=self->context->currentTime;
+
+  if(self->v!=0)
+    {
+      current_thickness=(self->height - self->material_boundary)
+        *self->width / (self->width + self->v * t);
+      *current_boundary=self->material_boundary
+        + (self->upper_density / self->lower_density)
+        * (self->height - self->material_boundary - current_thickness);
+    }
+  else
+    {
+      current_thickness=self->height - self->material_boundary;
+      *current_boundary=self->material_boundary;
+    }
+  *current_height=current_thickness + *current_boundary;
+}
+
+double HydrostaticTerm_Density( void* forceTerm, Coord coord)
+{
+  HydrostaticTerm *self=(HydrostaticTerm *)forceTerm;
+  double h=self->height-coord[1];
+  double T, density, alpha;
+  double current_height, current_boundary;
+
+  HydrostaticTerm_Current_Heights(self,&current_height,&current_boundary);
+  /* printf("Time %g %g %g\n",current_height,current_boundary,self->context->currentTime); */
+
+  /* First, get the temperature */
+  if(h<0)
+    {
+      T=self->T_0;
+    }
+  else
+    {
+      T=self->T_0 + self->linear_coefficient*h
+        + self->exponential_coefficient1
+        *(1-exp(-self->exponential_coefficient2*h));
+    }
+
+  /* Then, get the density */
+  if(coord[1]>current_height)
+    {
+      density=alpha=0;
+    }
+  else if(coord[1]>current_boundary)
+    {
+      density=self->upper_density;;
+      alpha=self->upper_alpha;
+    }
+  else
+    {
+      density=self->lower_density;
+      alpha=self->lower_alpha;
+    }
+
+  return density*(1-alpha*T);
+}
+
+double HydrostaticTerm_Pressure_Analytic(double density, double gravity,
+                                         double h, double alpha,
+                                         double T_0, double A,
+                                         double B, double C)
+{
+  if(C==0)
+    return density*gravity*h*(1-alpha*(T_0 + A*h/2));
+  else
+    return density*gravity*h*(1-alpha*(T_0 + A*h/2 + B*(1+(exp(-C*h)-1)/(C*h))));
+}
+
+double HydrostaticTerm_Pressure( void* forceTerm, Coord coord)
+{
+  HydrostaticTerm *self=(HydrostaticTerm *)forceTerm;
+  double h=self->height-coord[1];
+  double p;
+
+  if(coord[1]>=self->height)
+    {
+      p=0;
+    }
+  else if(coord[1]>self->material_boundary)
+    {
+      p=HydrostaticTerm_Pressure_Analytic(self->upper_density, self->gravity, h,
+                                          self->upper_alpha,
+                                          self->T_0,
+                                          self->linear_coefficient,
+                                          self->exponential_coefficient1,
+                                          self->exponential_coefficient2);
+    }
+  else
+    {
+      p=HydrostaticTerm_Pressure_Analytic(self->upper_density,
+                                          self->gravity,
+                                          self->height-self->material_boundary,
+                                          self->upper_alpha,
+                                          self->T_0,
+                                          self->linear_coefficient,
+                                          self->exponential_coefficient1,
+                                          self->exponential_coefficient2)
+        - HydrostaticTerm_Pressure_Analytic(self->lower_density, self->gravity,
+                                            self->height-self->material_boundary,
+                                            self->lower_alpha,
+                                            self->T_0,
+                                            self->linear_coefficient,
+                                            self->exponential_coefficient1,
+                                            self->exponential_coefficient2)
+        + HydrostaticTerm_Pressure_Analytic(self->lower_density, self->gravity,
+                                            h,
+                                            self->lower_alpha,
+                                            self->T_0,
+                                            self->linear_coefficient,
+                                            self->exponential_coefficient1,
+                                            self->exponential_coefficient2);
+    }
+  return p;
+}
+
diff -r 84d4b74cf385 -r 857843d002b4 Utils/src/HydrostaticTerm.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/HydrostaticTerm.h	Tue Jan 19 14:45:14 2010 -0800
@@ -0,0 +1,150 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+
+
+#ifndef __PICellerator_Utils_HydrostaticTerm_h__
+#define __PICellerator_Utils_HydrostaticTerm_h__
+
+	/** Textual name of this class */
+	extern const Type HydrostaticTerm_Type;
+
+	/** HydrostaticTerm class contents */
+	#define __HydrostaticTerm \
+		/* General info */ \
+		__Stg_Component \
+		\
+		/* Virtual info */ \
+                double upper_density; \
+                double upper_alpha; \
+                double lower_density; \
+                double lower_alpha; \
+                double height; \
+                double material_boundary; \
+                double T_0; \
+                double linear_coefficient; \
+                double exponential_coefficient1; \
+                double exponential_coefficient2; \
+                double gravity; \
+                double v; \
+                double width; \
+                AbstractContext *context; \
+
+
+
+	struct HydrostaticTerm { __HydrostaticTerm };
+
+	HydrostaticTerm* HydrostaticTerm_New( 
+		Name                                                name,
+                double upper_density,
+                double upper_alpha,
+                double lower_density,
+                double lower_alpha,
+                double height,
+                double material_boundary,
+                double T_0,
+                double linear_coefficient,
+                double exponential_coefficient1,
+                double exponential_coefficient2,
+                double gravity,
+                double v,
+                double width,
+                AbstractContext *context);
+
+	HydrostaticTerm* _HydrostaticTerm_New( 
+		SizeT                                               sizeOfSelf,  
+		Type                                                type,
+		Stg_Class_DeleteFunction*                           _delete,
+		Stg_Class_PrintFunction*                            _print,
+		Stg_Class_CopyFunction*                             _copy, 
+		Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+		Stg_Component_ConstructFunction*                    _construct,
+		Stg_Component_BuildFunction*                        _build,
+		Stg_Component_InitialiseFunction*                   _initialise,
+		Stg_Component_ExecuteFunction*                      _execute,
+		Stg_Component_DestroyFunction*                      _destroy,
+                double upper_density,
+                double upper_alpha,
+                double lower_density,
+                double lower_alpha,
+                double height,
+                double material_boundary,
+                double T_0,
+                double linear_coefficient,
+                double exponential_coefficient1,
+                double exponential_coefficient2,
+                double gravity,
+                double v,
+                double width,
+                AbstractContext *context,
+		Name                                                name );
+	
+        void HydrostaticTerm_InitAll(void* forceTerm,
+                                     double upper_density,
+                                     double upper_alpha,
+                                     double lower_density,
+                                     double lower_alpha,
+                                     double height,
+                                     double material_boundary,
+                                     double T_0,
+                                     double linear_coefficient,
+                                     double exponential_coefficient1,
+                                     double exponential_coefficient2,
+                                     double gravity,
+                                     double v,
+                                     double width,
+                                     AbstractContext *context);
+
+	void _HydrostaticTerm_Delete( void* forceTerm );
+	void _HydrostaticTerm_Print( void* forceTerm, Stream* stream );
+
+	void* _HydrostaticTerm_DefaultNew( Name name ) ;
+        void _HydrostaticTerm_Construct( void* forceTerm,
+                                         Stg_ComponentFactory* cf,
+                                         void* data ) ;
+	void _HydrostaticTerm_Build( void* forceTerm, void* data ) ;
+	void _HydrostaticTerm_Initialise( void* forceTerm, void* data ) ;
+	void _HydrostaticTerm_Execute( void* forceTerm, void* data ) ;
+	void _HydrostaticTerm_Destroy( void* forceTerm, void* data ) ;
+        double HydrostaticTerm_Density( void* forceTerm, Coord coord);
+        double HydrostaticTerm_Pressure( void* forceTerm, Coord coord);
+
+#endif
diff -r 84d4b74cf385 -r 857843d002b4 Utils/src/HydrostaticTerm.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/HydrostaticTerm.meta	Tue Jan 19 14:45:14 2010 -0800
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">HydrostaticTerm</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Utils/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">ForceTerm</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description"></param>
+<param name="Equation"></param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">
+</param>
+
+</StGermainData>
diff -r 84d4b74cf385 -r 857843d002b4 Utils/src/Init.c
--- a/Utils/src/Init.c	Wed Jan 13 22:24:53 2010 +1100
+++ b/Utils/src/Init.c	Tue Jan 19 14:45:14 2010 -0800
@@ -62,12 +62,14 @@ Bool PICellerator_Utils_Init( int* argc,
 	Stg_ComponentRegister_Add( componentsRegister, BuoyancyForceTerm_Type, (Name)"0", _BuoyancyForceTerm_DefaultNew  );
 	Stg_ComponentRegister_Add( componentsRegister, BuoyancyForceTermThermoChem_Type, (Name)"0", _BuoyancyForceTermThermoChem_DefaultNew  );
 	Stg_ComponentRegister_Add( componentsRegister, DiffusionSMT_Type, (Name)"0", _DiffusionSMT_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, HydrostaticTerm_Type, (Name)"0", _HydrostaticTerm_DefaultNew );
 
 	RegisterParent( BuoyancyForceTerm_Type,     ForceTerm_Type );
 	RegisterParent( BuoyancyForceTermThermoChem_Type,     ForceTerm_Type );
 	RegisterParent( DiffusionSMT_Type,     StiffnessMatrixTerm_Type );
 	RegisterParent( MaterialSwarmVariable_Type, SwarmVariable_Type );
 	RegisterParent( PCDVC_Type,                 DVCWeights_Type );
+	RegisterParent( HydrostaticTerm_Type,       Stg_Component_Type );
 	return True;
 }
 
diff -r 84d4b74cf385 -r 857843d002b4 Utils/src/Utils.h
--- a/Utils/src/Utils.h	Wed Jan 13 22:24:53 2010 +1100
+++ b/Utils/src/Utils.h	Tue Jan 19 14:45:14 2010 -0800
@@ -49,6 +49,7 @@
 	#include "BuoyancyForceTermThermoChem.h"
         #include "DiffusionSMT.h"
 	#include "MaterialSwarmVariable.h"
+	#include "HydrostaticTerm.h"
 
 	#include "Init.h"
 	#include "Finalise.h"
diff -r 84d4b74cf385 -r 857843d002b4 Utils/src/types.h
--- a/Utils/src/types.h	Wed Jan 13 22:24:53 2010 +1100
+++ b/Utils/src/types.h	Tue Jan 19 14:45:14 2010 -0800
@@ -58,6 +58,7 @@
 	typedef struct BuoyancyForceTerm                BuoyancyForceTerm;
 	typedef struct BuoyancyForceTermThermoChem      BuoyancyForceTermThermoChem;
         typedef struct DiffusionSMT DiffusionSMT;
+        typedef struct HydrostaticTerm      HydrostaticTerm;
         typedef struct PCDVC                        	PCDVC;
 
 #endif 



More information about the CIG-COMMITS mailing list