[cig-commits] commit: Merging the decomp3d branch.

Mercurial hg at geodynamics.org
Mon Nov 24 11:30:12 PST 2008


changeset:   2:c50ba02c415a
user:        LukeHodkinson
date:        Fri Apr 27 06:21:01 2007 +0000
files:       Apps/BuoyancyBenchmark/BuoyancyExample.xml Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c Apps/LidDrivenPIC/LidDrivenPIC.xml Apps/PIC_Components/MaterialPointSwarm-flip1.xml Apps/PIC_Components/MaterialPointSwarm-test1.xml Apps/PIC_Components/MaterialPointSwarm.xml Apps/PIC_Components/MaterialPointSwarmW.xml Apps/PIC_Components/PopulationControl.xml Apps/RayleighTaylor/ParticleDensityVP.xml Apps/RayleighTaylor/ParticleDisplacementVP.xml Apps/RayleighTaylor/RayTay_Example-flip1.xml Apps/RayleighTaylor/RayTay_Example-test1.xml Apps/RayleighTaylor/RayTay_Example.xml Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c Apps/RayleighTaylor/tests/testAnalyticBlock.xml Apps/RayleighTaylor/tests/testAnalyticColumn.xml Apps/ThermoChem/ThermoChem.xml MaterialPoints/makefile MaterialPoints/src/CoincidentMapper.c MaterialPoints/src/Context.c MaterialPoints/src/IntegrationPointsSwarm.c MaterialPoints/src/IntegrationPointsSwarm.h MaterialPoints/src/Material.c MaterialPoints/src/MaterialFeVariable.c MaterialPoints/src/MaterialPointsSwarm.c MaterialPoints/src/MaterialPointsSwarm.h MaterialPoints/src/Materials_Register.c MaterialPoints/src/ParticleFeVariable.c MaterialPoints/src/PeriodicBoundariesManager.c MaterialPoints/src/PeriodicBoundariesManager.h MaterialPoints/src/SwarmAdvector.c MaterialPoints/tests/plugins/testAdvection.c MaterialPoints/tests/testPeriodicBCs.c PopulationControl/src/ReseedSplitting.c Utils/src/BuoyancyForceTerm.c Utils/src/BuoyancyForceTerm.h Utils/src/BuoyancyForceTermThermoChem.c Utils/src/PCDVC.c Utils/src/types.h Voronoi/src/CellularAutomataVoronoi.c Voronoi/src/CellularAutomataVoronoi.h Weights/src/DVCWeights.c Weights/src/DiscreteVoronoiWeights.c Weights/src/VolumeWeights.c Weights/src/VolumeWeights.h Weights/src/WeightsCalculator.c Weights/tests/plugins/testElementIntegral.c plugins/Application/Application.c
description:
Merging the decomp3d branch.


diff -r 31abbeebf74e -r c50ba02c415a Apps/BuoyancyBenchmark/BuoyancyExample.xml
--- a/Apps/BuoyancyBenchmark/BuoyancyExample.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/BuoyancyBenchmark/BuoyancyExample.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -11,7 +11,6 @@
 	<!--param name="extensionReferenceHeight">maxY</param-->
 
 	<!-- Component Stuff -->
-	<include>StgFEM/ElementLayout.xml        </include>
 	<include>StgFEM/ConstantMesh.xml           </include>
 	<include>StgFEM/LinearMesh.xml             </include>
 	<include>StgFEM/VelocityField.xml          </include>
diff -r 31abbeebf74e -r c50ba02c415a Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c
--- a/Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c	Fri Apr 27 06:21:01 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: AnalyticPressure.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: AnalyticPressure.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -53,6 +53,7 @@ const Type AnalyticPressure_Type = "Anal
 
 typedef struct {
 	__AnalyticSolution
+	FeVariable*		pressureField;
 	double                  density;
 	double                  gravity;
 	double                  maxY;
@@ -74,19 +75,28 @@ void _AnalyticPressure_PressureFunction(
 	
 void _AnalyticPressure_Construct( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
 	AnalyticPressure*        self           = (AnalyticPressure*)analyticSolution;
-	FeVariable*              pressureField;
 
 	/* Construct Parent */
 	_AnalyticSolution_Construct( self, cf, data );
 
 	/* Create Analytic Fields */
-	pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
-	AnalyticSolution_CreateAnalyticField( self, pressureField, _AnalyticPressure_PressureFunction );
+	self->pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
 	
 	self->density  = Stg_ComponentFactory_GetDouble( cf, "layer", "density", 0.0 );
 	self->gravity  = Stg_ComponentFactory_GetRootDictDouble( cf, "gravity", 0 );
 	self->maxY     = Stg_ComponentFactory_GetRootDictDouble( cf, "maxY", 0 );
 	self->minY     = Stg_ComponentFactory_GetRootDictDouble( cf, "minY", 0 );
+}
+
+void _AnalyticPressure_Build( void* analyticSolution, void* data ) {
+	AnalyticPressure*	self = (AnalyticPressure*)analyticSolution;
+
+	assert( self && Stg_CheckType( self, AnalyticPressure ) );
+
+	Build( self->pressureField, data, False );
+	AnalyticSolution_CreateAnalyticField( self, self->pressureField, _AnalyticPressure_PressureFunction );
+
+	_AnalyticSolution_Build( self, data );
 }
 
 void* _AnalyticPressure_DefaultNew( Name name ) {
@@ -98,7 +108,7 @@ void* _AnalyticPressure_DefaultNew( Name
 			_AnalyticSolution_Copy,
 			_AnalyticPressure_DefaultNew,
 			_AnalyticPressure_Construct,
-			_AnalyticSolution_Build,
+			_AnalyticPressure_Build,
 			_AnalyticSolution_Initialise,
 			_AnalyticSolution_Execute,
 			_AnalyticSolution_Destroy,
diff -r 31abbeebf74e -r c50ba02c415a Apps/LidDrivenPIC/LidDrivenPIC.xml
--- a/Apps/LidDrivenPIC/LidDrivenPIC.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/LidDrivenPIC/LidDrivenPIC.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -3,7 +3,6 @@
 <!-- DTD to validate against -->
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 
-	<include>StgFEM/ElementLayout.xml          </include>
 	<include>StgFEM/ConstantMesh.xml           </include>
 	<include>StgFEM/LinearMesh.xml             </include>
 	<include>StgFEM/VelocityField.xml          </include>
diff -r 31abbeebf74e -r c50ba02c415a Apps/PIC_Components/MaterialPointSwarm-flip1.xml
--- a/Apps/PIC_Components/MaterialPointSwarm-flip1.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/PIC_Components/MaterialPointSwarm-flip1.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -30,7 +30,7 @@
 			<param name="Type">IntegrationPointsSwarm</param>
 			<param name="CellLayout">elementCellLayout</param>
 			<param name="ParticleLayout">localLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">mesh-linear</param>
 			<param name="WeightsCalculator">weights</param>
 			<param name="TimeIntegrator">timeIntegrator</param>
 			<param name="IntegrationPointMapper">mapper</param>
@@ -49,7 +49,7 @@
 			<param name="Type">MaterialPointsSwarm</param>
 			<param name="CellLayout">elementCellLayout</param>
 			<param name="ParticleLayout">picIntegrationPointsParticleLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">mesh-linear</param>
 
 			<!-- These guys may or may not be created -->
 			<param name="SwarmAdvector">materialSwarmAdvector</param>
@@ -67,7 +67,7 @@
 			<param name="Type">IntegrationPointsSwarm</param>
 			<param name="CellLayout">cellLayout</param>
 			<param name="ParticleLayout">particleLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">mesh-linear</param>
 			<param name="TimeIntegrator">timeIntegrator</param>
 			<param name="IntegrationPointMapper">backgroundMapper</param>
 		</struct>
@@ -83,7 +83,7 @@
 			<param name="Type">MaterialPointsSwarm</param>
 			<param name="CellLayout">cellLayout</param>
 			<param name="ParticleLayout">backgroundLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">mesh-linear</param>
 			<param name="Material">denseMaterial</param>
 		</struct>
 
diff -r 31abbeebf74e -r c50ba02c415a Apps/PIC_Components/MaterialPointSwarm-test1.xml
--- a/Apps/PIC_Components/MaterialPointSwarm-test1.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/PIC_Components/MaterialPointSwarm-test1.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -30,7 +30,7 @@
 			<param name="Type">IntegrationPointsSwarm</param>
 			<param name="CellLayout">elementCellLayout</param>
 			<param name="ParticleLayout">localLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">mesh-linear</param>
 			<param name="WeightsCalculator">weights</param>
 			<param name="TimeIntegrator">timeIntegrator</param>
 			<param name="IntegrationPointMapper">mapper</param>
@@ -50,7 +50,7 @@
 			<param name="Type">MaterialPointsSwarm</param>
 			<param name="CellLayout">elementCellLayout</param>
 			<param name="ParticleLayout">picIntegrationPointsParticleLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">mesh-linear</param>
 
 			<!-- These guys may or may not be created -->
 			<param name="SwarmAdvector">materialSwarmAdvector</param>
@@ -68,7 +68,7 @@
 			<param name="Type">IntegrationPointsSwarm</param>
 			<param name="CellLayout">cellLayout</param>
 			<param name="ParticleLayout">particleLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">mesh-linear</param>
 			<param name="TimeIntegrator">timeIntegrator</param>
 			<param name="IntegrationPointMapper">backgroundMapper</param>
 		</struct>
@@ -84,7 +84,7 @@
 			<param name="Type">MaterialPointsSwarm</param>
 			<param name="CellLayout">cellLayout</param>
 			<param name="ParticleLayout">backgroundLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">mesh-linear</param>
 			<param name="Material">lightMaterial</param>
 		</struct>
 
diff -r 31abbeebf74e -r c50ba02c415a Apps/PIC_Components/MaterialPointSwarm.xml
--- a/Apps/PIC_Components/MaterialPointSwarm.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/PIC_Components/MaterialPointSwarm.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -7,7 +7,7 @@
 	<struct name="components" mergeType="merge">
 		<struct name="elementCellLayout">
 			<param name="Type">ElementCellLayout</param>
-			<param name="Mesh">mesh-linear</param>
+			<param name="Mesh">elementMesh</param>
 		</struct>
 		<!--struct name="discreteVoronoi">
 			<param name="Type">CellularAutomataVoronoi</param>
@@ -29,14 +29,16 @@
 			<param name="Type">ConstantWeights</param>
 		</struct>	
 		-->
-		
+
+<!--
 		<struct name="weights">
   			<param name="Type">DVCWeights</param>
  			 <param name="resolution">10</param>
 		</struct>
+-->
 		
-		<!-- struct name="weights">
-  			<param name="Type">PCDVC</param>
+		<struct name="weights">
+		   <param name="Type">PCDVC</param>
 		   <param name="resolutionX">10</param>
 		   <param name="resolutionY">10</param>
 		   <param name="resolutionZ">10</param>
@@ -45,7 +47,7 @@
 		   <param name="maxDeletions">3</param>
 		   <param name="maxSplits">3</param>
 		   <param name="MaterialPointsSwarm">materialSwarm</param>
-		</struct-->
+		</struct>
 		
 		<struct name="localLayout">
 			<param name="Type">MappedParticleLayout</param>
@@ -54,7 +56,7 @@
 			<param name="Type">IntegrationPointsSwarm</param>
 			<param name="CellLayout">elementCellLayout</param>
 			<param name="ParticleLayout">localLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">elementMesh</param>
 			<param name="WeightsCalculator">weights</param>
 			<param name="TimeIntegrator">timeIntegrator</param>
 			<param name="IntegrationPointMapper">mapper</param>
@@ -72,7 +74,7 @@
 			<param name="Type">MaterialPointsSwarm</param>
 			<param name="CellLayout">elementCellLayout</param>
 			<param name="ParticleLayout">materialSwarmParticleLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">elementMesh</param>
 
 			<!-- These guys may or may not be created -->
 			<param name="SplittingRoutine">splittingRoutine</param>
diff -r 31abbeebf74e -r c50ba02c415a Apps/PIC_Components/MaterialPointSwarmW.xml
--- a/Apps/PIC_Components/MaterialPointSwarmW.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/PIC_Components/MaterialPointSwarmW.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -7,7 +7,7 @@
 	<struct name="components" mergeType="merge">
 		<struct name="elementCellLayout">
 			<param name="Type">ElementCellLayout</param>
-			<param name="Mesh">mesh-linear</param>
+			<param name="Mesh">elementMesh</param>
 		</struct>
 		<struct name="discreteVoronoi">
 			<param name="Type">CellularAutomataVoronoi</param>
@@ -35,7 +35,7 @@
 			<param name="Type">IntegrationPointsSwarm</param>
 			<param name="CellLayout">elementCellLayout</param>
 			<param name="ParticleLayout">localLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">elementMesh</param>
 			<param name="WeightsCalculator">weights</param>
 			<param name="TimeIntegrator">timeIntegrator</param>
 			<param name="IntegrationPointMapper">mapper</param>
@@ -53,7 +53,7 @@
 			<param name="Type">MaterialPointsSwarm</param>
 			<param name="CellLayout">elementCellLayout</param>
 			<param name="ParticleLayout">materialSwarmParticleLayout</param>
-			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="FeMesh">elementMesh</param>
 
 			<!-- These guys may or may not be created -->
 			<param name="SplittingRoutine">splittingRoutine</param>
diff -r 31abbeebf74e -r c50ba02c415a Apps/PIC_Components/PopulationControl.xml
--- a/Apps/PIC_Components/PopulationControl.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/PIC_Components/PopulationControl.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -14,7 +14,7 @@
 			<param name="Type">ReseedSplitting</param>
 			<param name="idealParticleCount">particlesPerCell</param> 
 			<param name="DiscreteVoronoi">discreteVoronoi</param> 
-		</struct>	
+		</struct>
 	</struct>
 
 </StGermainData>
diff -r 31abbeebf74e -r c50ba02c415a Apps/RayleighTaylor/ParticleDensityVP.xml
--- a/Apps/RayleighTaylor/ParticleDensityVP.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/RayleighTaylor/ParticleDensityVP.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -19,13 +19,9 @@
 			<param name="Type">lucTitle</param>
 			<param name="string">Particle dots - light is red, heavy blue</param>
 		</struct>
-		<struct name="meshView">
-			<param name="Type">lucMeshViewer</param>
-			<param name="Mesh">mesh-linear</param>
-		</struct>
 		<struct name="velocityArrows">
 			<param name="Type">lucVectorArrows</param>
-			<param name="Mesh">mesh-linear</param>
+			<param name="Mesh">linearMesh</param>
 			<param name="VectorVariable">VelocityField</param>
 			<param name="Colour">black</param>
 			<param name="arrowHeadSize">0.15</param>	
@@ -46,7 +42,6 @@
 				<param>title</param>
 				<param>velocityArrows</param>
 				<param>particleDots</param>
-				<param>meshView</param>
 			</list>
 		</struct>
 	</struct>
diff -r 31abbeebf74e -r c50ba02c415a Apps/RayleighTaylor/ParticleDisplacementVP.xml
--- a/Apps/RayleighTaylor/ParticleDisplacementVP.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/RayleighTaylor/ParticleDisplacementVP.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -37,10 +37,6 @@
 			<param name="Type">lucTitle</param>
 			<param name="string">Particle displacement</param>
 		</struct>
-		<struct name="meshView" mergeType="replace">
-			<param name="Type">lucMeshViewer</param>
-			<param name="Mesh">mesh-linear</param>
-		</struct>
 		<struct name="displacementArrows">
 			<param name="Type">lucSwarmVectors</param>
 			<param name="Swarm">materialSwarm</param>
@@ -68,7 +64,6 @@
 				-->
 				<param>displacementParticleDots</param>
 				<param>displacementColourBar</param>
-				<param>meshView</param>
 			</list>
 		</struct>
 	</struct>
diff -r 31abbeebf74e -r c50ba02c415a Apps/RayleighTaylor/RayTay_Example-flip1.xml
--- a/Apps/RayleighTaylor/RayTay_Example-flip1.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/RayleighTaylor/RayTay_Example-flip1.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -3,7 +3,6 @@
 <!-- DTD to validate against -->
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 
-	<include>StgFEM/ElementLayout.xml          </include>
 	<include>StgFEM/ConstantMesh.xml           </include>
 	<include>StgFEM/LinearMesh.xml             </include>
 	<include>StgFEM/VelocityField.xml          </include>
diff -r 31abbeebf74e -r c50ba02c415a Apps/RayleighTaylor/RayTay_Example-test1.xml
--- a/Apps/RayleighTaylor/RayTay_Example-test1.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/RayleighTaylor/RayTay_Example-test1.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -3,7 +3,6 @@
 <!-- DTD to validate against -->
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 
-	<include>StgFEM/ElementLayout.xml          </include>
 	<include>StgFEM/ConstantMesh.xml           </include>
 	<include>StgFEM/LinearMesh.xml             </include>
 	<include>StgFEM/VelocityField.xml          </include>
diff -r 31abbeebf74e -r c50ba02c415a Apps/RayleighTaylor/RayTay_Example.xml
--- a/Apps/RayleighTaylor/RayTay_Example.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/RayleighTaylor/RayTay_Example.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -3,7 +3,6 @@
 <!-- DTD to validate against -->
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 
-	<include>StgFEM/ElementLayout.xml          </include>
 	<include>StgFEM/ConstantMesh.xml           </include>
 	<include>StgFEM/LinearMesh.xml             </include>
 	<include>StgFEM/VelocityField.xml          </include>
@@ -62,6 +61,9 @@
 	<param name="outputPath"> ./output </param>
 
 	<!-- general decomposition parameters -->
+	<param name="velocityMesh"> linearMesh </param>
+	<param name="pressureMesh"> constantMesh </param>
+	<param name="elementMesh"> linearMesh </param>
 	<param name="dim"> 2 </param>
 	<!-- mesh parameters -->
 	<param name="elementResI"> 10 </param>
diff -r 31abbeebf74e -r c50ba02c415a Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c
--- a/Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c	Fri Apr 27 06:21:01 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: AnalyticBlock.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: AnalyticBlock.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -55,6 +55,8 @@ const Type AnalyticBlock_Type = "Analyti
 
 typedef struct {
 	__AnalyticSolution
+	FeVariable* velocityField;
+	FeVariable* pressureField;
 	double startBlockX;
 	double endBlockX;
 	double startBlockY;
@@ -1719,24 +1721,31 @@ void _AnalyticBlock_PressureFunction( vo
 
 void _AnalyticBlock_Construct( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
 	AnalyticBlock*           self           = (AnalyticBlock*)analyticSolution;
-	FeVariable*              velocityField;
-	FeVariable*              pressureField;
 
 	/* Construct Parent */
 	_AnalyticSolution_Construct( self, cf, data );
 
 	/* Create Analytic Fields */
-	velocityField = Stg_ComponentFactory_ConstructByName( cf, "VelocityField", FeVariable, True, data ); 
-	AnalyticSolution_CreateAnalyticField( self, velocityField, _AnalyticBlock_VelocityFunction );
-
-	pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
-	AnalyticSolution_CreateAnalyticField( self, pressureField, _AnalyticBlock_PressureFunction );
+	self->velocityField = Stg_ComponentFactory_ConstructByName( cf, "VelocityField", FeVariable, True, data ); 
+	self->pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
 
 	self->startBlockX = Stg_ComponentFactory_GetRootDictDouble( cf, "startBlockX", 0.0 );
 	self->endBlockX = Stg_ComponentFactory_GetRootDictDouble( cf, "endBlockX", 0.0 );
 	self->startBlockY = Stg_ComponentFactory_GetRootDictDouble( cf, "startBlockY", 0.0 );
 }
 
+void _AnalyticBlock_Build( void* analyticSolution, void* data ) {
+	AnalyticBlock*	self = (AnalyticBlock*)analyticSolution;
+
+	assert( self && Stg_CheckType( self, AnalyticBlock ) );
+
+	Build( self->velocityField, data, False );
+	Build( self->pressureField, data, False );
+	AnalyticSolution_CreateAnalyticField( self, self->velocityField, _AnalyticBlock_VelocityFunction );
+	AnalyticSolution_CreateAnalyticField( self, self->pressureField, _AnalyticBlock_PressureFunction );
+
+	_AnalyticSolution_Build( self, data );
+}
 
 void* _AnalyticBlock_DefaultNew( Name name ) {
 	return _AnalyticSolution_New(
@@ -1747,7 +1756,7 @@ void* _AnalyticBlock_DefaultNew( Name na
 			_AnalyticSolution_Copy,
 			_AnalyticBlock_DefaultNew,
 			_AnalyticBlock_Construct,
-			_AnalyticSolution_Build,
+			_AnalyticBlock_Build,
 			_AnalyticSolution_Initialise,
 			_AnalyticSolution_Execute,
 			_AnalyticSolution_Destroy,
diff -r 31abbeebf74e -r c50ba02c415a Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c
--- a/Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c	Fri Apr 27 06:21:01 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: AnalyticColumn.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: AnalyticColumn.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -55,6 +55,8 @@ const Type AnalyticColumn_Type = "Analyt
 
 typedef struct {
 	__AnalyticSolution
+	FeVariable*		velocityField;
+	FeVariable*		pressureField;
 	Dimension_Index         dim;
 	double                  sigma;
 	double                  viscosity;
@@ -293,18 +295,13 @@ void _AnalyticColumn_PressureFunction( v
 	
 void _AnalyticColumn_Construct( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
 	AnalyticColumn*          self           = (AnalyticColumn*)analyticSolution;
-	FeVariable*              velocityField;
-	FeVariable*              pressureField;
 
 	/* Construct Parent */
 	_AnalyticSolution_Construct( self, cf, data );
 
 	/* Create Analytic Fields */
-	velocityField = Stg_ComponentFactory_ConstructByName( cf, "VelocityField", FeVariable, True, data ); 
-	AnalyticSolution_CreateAnalyticField( self, velocityField, _AnalyticColumn_VelocityFunction );
-
-	pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
-	AnalyticSolution_CreateAnalyticField( self, pressureField, _AnalyticColumn_PressureFunction );
+	self->velocityField = Stg_ComponentFactory_ConstructByName( cf, "VelocityField", FeVariable, True, data ); 
+	self->pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
 
 	self->dim          = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
 	self->startColumnX = Stg_ComponentFactory_GetRootDictDouble( cf, "startColumnX", 0.0 );
@@ -313,6 +310,19 @@ void _AnalyticColumn_Construct( void* an
 	self->endColumnZ   = Stg_ComponentFactory_GetRootDictDouble( cf, "endColumnZ", 0.0 );
 	self->viscosity    = Stg_ComponentFactory_GetRootDictDouble( cf, "viscosity", 1.0 );
 	self->sigma        = Stg_ComponentFactory_GetRootDictDouble( cf, "sigma", 1.0 );
+}
+
+void _AnalyticColumn_Build( void* analyticSolution, void* data ) {
+	AnalyticColumn*	self = (AnalyticColumn*)analyticSolution;
+
+	assert( self && Stg_CheckType( self, AnalyticColumn ) );
+
+	Build( self->velocityField, data, False );
+	Build( self->pressureField, data, False );
+	AnalyticSolution_CreateAnalyticField( self, self->velocityField, _AnalyticColumn_VelocityFunction );
+	AnalyticSolution_CreateAnalyticField( self, self->pressureField, _AnalyticColumn_PressureFunction );
+
+	_AnalyticSolution_Build( self, data );
 }
 
 void* _AnalyticColumn_DefaultNew( Name name ) {
@@ -324,7 +334,7 @@ void* _AnalyticColumn_DefaultNew( Name n
 			_AnalyticSolution_Copy,
 			_AnalyticColumn_DefaultNew,
 			_AnalyticColumn_Construct,
-			_AnalyticSolution_Build,
+			_AnalyticColumn_Build,
 			_AnalyticSolution_Initialise,
 			_AnalyticSolution_Execute,
 			_AnalyticSolution_Destroy,
diff -r 31abbeebf74e -r c50ba02c415a Apps/RayleighTaylor/tests/testAnalyticBlock.xml
--- a/Apps/RayleighTaylor/tests/testAnalyticBlock.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/RayleighTaylor/tests/testAnalyticBlock.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -3,7 +3,6 @@
 <!-- DTD to validate against -->
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 
-	<include>StgFEM/ElementLayout.xml          </include>
 	<include>StgFEM/ConstantMesh.xml           </include>
 	<include>StgFEM/LinearMesh.xml             </include>
 	<include>StgFEM/VelocityField.xml          </include>
diff -r 31abbeebf74e -r c50ba02c415a Apps/RayleighTaylor/tests/testAnalyticColumn.xml
--- a/Apps/RayleighTaylor/tests/testAnalyticColumn.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/RayleighTaylor/tests/testAnalyticColumn.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -3,7 +3,6 @@
 <!-- DTD to validate against -->
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 
-	<include>StgFEM/ElementLayout.xml          </include>
 	<include>StgFEM/ConstantMesh.xml           </include>
 	<include>StgFEM/LinearMesh.xml             </include>
 	<include>StgFEM/VelocityField.xml          </include>
diff -r 31abbeebf74e -r c50ba02c415a Apps/ThermoChem/ThermoChem.xml
--- a/Apps/ThermoChem/ThermoChem.xml	Mon Mar 26 09:24:36 2007 +0000
+++ b/Apps/ThermoChem/ThermoChem.xml	Fri Apr 27 06:21:01 2007 +0000
@@ -4,7 +4,6 @@
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
  
 	<!-- Component Stuff -->
-	<include>StgFEM/ElementLayout.xml          </include>
 	<include>StgFEM/ConstantMesh.xml           </include>
 	<include>StgFEM/LinearMesh.xml             </include>
 	<include>StgFEM/VelocityField.xml          </include>
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/makefile
--- a/MaterialPoints/makefile	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/makefile	Fri Apr 27 06:21:01 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+## $Id: makefile 456 2007-04-27 06:21:01Z LukeHodkinson $
 ##
 ##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -48,6 +48,6 @@ include ${PROJ_ROOT}/Makefile.system
 include ${PROJ_ROOT}/Makefile.system
 
 # Subdirectories
-subdirs := src tests
+subdirs := src
 
 include ${PROJ_ROOT}/Makefile.vmake
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/CoincidentMapper.c
--- a/MaterialPoints/src/CoincidentMapper.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/CoincidentMapper.c	Fri Apr 27 06:21:01 2007 +0000
@@ -217,8 +217,7 @@ void _CoincidentMapper_Map( void* mapper
 	MaterialPoint*          materialPoint;
 	MaterialPointRef*       ref;
 
-	FiniteElement_Mesh*     mesh                   = materialSwarm->mesh;
-	ElementLayout*          layout                 = mesh->layout->elementLayout;
+	FeMesh*     mesh                   = materialSwarm->mesh;
 
 	Particle_Index          particle_lI;
 	Cell_Index              cell_dI;
@@ -273,9 +272,9 @@ void _CoincidentMapper_Map( void* mapper
 
 		/* Convert global to local coordinates */
 		ElementType_ConvertGlobalCoordToElLocal(
-				FiniteElement_Mesh_ElementTypeAt( mesh, cell_dI ),
-				layout,
-				(const Coord**)materialSwarm->cellPointTbl[cell_dI],
+				FeMesh_GetElementType( mesh, cell_dI ),
+				mesh, 
+				cell_dI, 
 				materialPoint->coord,
 				integrationPoint->xi );
 
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/Context.c
--- a/MaterialPoints/src/Context.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/Context.c	Fri Apr 27 06:21:01 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: Context.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: Context.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -170,9 +170,9 @@ void _PICelleratorContext_Init( void* co
 
 	ContextEP_Prepend( self, AbstractContext_EP_ConstructExtensions, PICelleratorContext_CreateDefaultMaterial );
 
-	// TODO want to append an EP to the end of the time integration that makes sure that after all integration 
-	// swarms have been updated, each element has at least one integration point from one swarm in it, or else
-	// we will fail the next timestep
+/* 	 TODO want to append an EP to the end of the time integration that makes sure that after all integration  */
+/* 	 swarms have been updated, each element has at least one integration point from one swarm in it, or else */
+/* 	 we will fail the next timestep */
 }
 
 
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/IntegrationPointsSwarm.c
--- a/MaterialPoints/src/IntegrationPointsSwarm.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/IntegrationPointsSwarm.c	Fri Apr 27 06:21:01 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: IntegrationPointsSwarm.c 436 2007-03-05 06:11:35Z KathleenHumble $
+** $Id: IntegrationPointsSwarm.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -69,7 +69,7 @@ IntegrationPointsSwarm* IntegrationPoint
 		SizeT                                 particleSize,
 		Particle_InCellIndex                  cellParticleTblDelta,
 		double                                extraParticlesFactor,
-		FiniteElement_Mesh*                   mesh,
+		FeMesh*                   	      mesh,
 		TimeIntegrator*                       timeIntegrator,
 		WeightsCalculator*                    weights,
 		IntegrationPointMapper*               mapper,
@@ -167,7 +167,7 @@ IntegrationPointsSwarm* _IntegrationPoin
 		SizeT                                           particleSize,
 		Particle_InCellIndex                            cellParticleTblDelta,
 		double                                          extraParticlesFactor,
-		FiniteElement_Mesh*                             mesh, 
+		FeMesh*     		                        mesh, 
 		TimeIntegrator*                                 timeIntegrator,
 		WeightsCalculator*                              weights,
 		IntegrationPointMapper*                         mapper,
@@ -222,7 +222,7 @@ IntegrationPointsSwarm* _IntegrationPoin
 
 void _IntegrationPointsSwarm_Construct( void* integrationPoints, Stg_ComponentFactory* cf, void* data ) {
 	IntegrationPointsSwarm*	        self          = (IntegrationPointsSwarm*) integrationPoints;
-	FiniteElement_Mesh*             mesh;
+	FeMesh*             		mesh;
 	TimeIntegrator*                 timeIntegrator;
 	WeightsCalculator*              weights;
 	IntegrationPointMapper*         mapper;
@@ -232,7 +232,7 @@ void _IntegrationPointsSwarm_Construct( 
 	/* This will also call _Swarm_Init */
 	_Swarm_Construct( self, cf, data );
 
-	mesh           = Stg_ComponentFactory_ConstructByKey( cf, self->name, "FiniteElement_Mesh", FiniteElement_Mesh, True, data );
+	mesh           = Stg_ComponentFactory_ConstructByKey( cf, self->name, "FeMesh", FeMesh, True, data );
 	timeIntegrator = Stg_ComponentFactory_ConstructByKey( cf, self->name, "TimeIntegrator", TimeIntegrator, True, data );
 	weights        = Stg_ComponentFactory_ConstructByKey( cf, self->name, "WeightsCalculator", WeightsCalculator, False, data );
 	mapper         = Stg_ComponentFactory_ConstructByKey( cf, self->name, "IntegrationPointMapper", IntegrationPointMapper, True, data );
@@ -258,7 +258,7 @@ void _IntegrationPointsSwarm_Construct( 
 
 void _IntegrationPointsSwarm_Init( 
 		void*                                 swarm,
-		FiniteElement_Mesh*                   mesh, 
+		FeMesh*                   mesh, 
 		TimeIntegrator*                       timeIntegrator,
 		WeightsCalculator*                    weights,
 		IntegrationPointMapper*               mapper,
@@ -342,7 +342,7 @@ void* _IntegrationPointsSwarm_Copy( void
 	
 	newIntegrationPointsSwarm = (IntegrationPointsSwarm*)_Swarm_Copy( self, dest, deep, nameExt, ptrMap );
 
-	newIntegrationPointsSwarm->mesh = (FiniteElement_Mesh*)Stg_Class_Copy(
+	newIntegrationPointsSwarm->mesh = (FeMesh*)Stg_Class_Copy(
 				self->mesh,
 				NULL,
 				deep,
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/IntegrationPointsSwarm.h
--- a/MaterialPoints/src/IntegrationPointsSwarm.h	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/IntegrationPointsSwarm.h	Fri Apr 27 06:21:01 2007 +0000
@@ -49,7 +49,7 @@
 **
 ** Comments:
 **
-** $Id: IntegrationPointsSwarm.h 435 2007-03-04 10:42:10Z PatrickSunter $
+** $Id: IntegrationPointsSwarm.h 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -63,7 +63,7 @@
 	#define __IntegrationPointsSwarm \
 		__Swarm \
 		\
-		FiniteElement_Mesh*                   mesh;                 \
+		FeMesh*                   mesh;                 \
 		TimeIntegrator*                       timeIntegrator;       \
 		WeightsCalculator*                    weights;              \
 		IntegrationPointMapper*               mapper;               \
@@ -88,7 +88,7 @@
 		SizeT                                 particleSize,
 		Particle_InCellIndex                  cellParticleTblDelta,
 		double                                extraParticlesFactor,
-		FiniteElement_Mesh*                   mesh,
+		FeMesh*				      mesh, 
 		TimeIntegrator*                       timeIntegrator,
 		WeightsCalculator*                    weights,
 		IntegrationPointMapper*               mapper,
@@ -121,7 +121,7 @@
 		SizeT                                           particleSize, 
 		Particle_InCellIndex                            cellParticleTblDelta, 
 		double                                          extraParticlesFactor,
-		FiniteElement_Mesh*                             mesh, 
+		FeMesh*         		                mesh, 
 		TimeIntegrator*                                 timeIntegrator,
 		WeightsCalculator*                              weights,
 		IntegrationPointMapper*                         mapper,
@@ -136,7 +136,7 @@
 
 	void _IntegrationPointsSwarm_Init(
 		void*                                           swarm,
-		FiniteElement_Mesh*                             mesh, 
+		FeMesh*                             mesh, 
 		TimeIntegrator*                                 timeIntegrator,
 		WeightsCalculator*                              weights,
 		IntegrationPointMapper*                         mapper,
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/Material.c
--- a/MaterialPoints/src/Material.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/Material.c	Fri Apr 27 06:21:01 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: Material.c 435 2007-03-04 10:42:10Z PatrickSunter $
+** $Id: Material.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -241,7 +241,7 @@ void Material_Layout( void* material, Ma
 
 double Material_Volume( void* material, IntegrationPointsSwarm* swarm, Coord centroid ) {
 	Material*            self               = (Material*)material;
-	FiniteElement_Mesh*  feMesh             = swarm->mesh;
+	FeMesh*  feMesh             = swarm->mesh;
 	ElementType*         elementType;
 	IntegrationPoint*    particle;
 	Coord                globalCoord;
@@ -262,7 +262,7 @@ double Material_Volume( void* material, 
 
 	/* Loop over all cells in domain */
 	for ( lCell_I = 0 ; lCell_I < cellLocalCount ; lCell_I++ ) {
-		elementType = FeMesh_ElementTypeAt( feMesh, lCell_I );
+		elementType = FeMesh_GetElementType( feMesh, lCell_I );
 		for( cParticle_I = 0 ; cParticle_I < swarm->cellParticleCountTbl[lCell_I] ; cParticle_I++ ) {
 			lParticle_I = swarm->cellParticleTbl[lCell_I][cParticle_I];
 			particle = (IntegrationPoint*)Swarm_ParticleAt( swarm, lParticle_I );
@@ -278,7 +278,7 @@ double Material_Volume( void* material, 
 			/* Sum Volume */
 			volume += detJac * particle->weight;
 
-			FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( feMesh, dim, lCell_I, particle->xi, globalCoord );
+			FeMesh_CoordLocalToGlobal( feMesh, lCell_I, particle->xi, globalCoord );
 				
 			/* Sum centroid */
 			localCentroid[ I_AXIS ] += detJac * particle->weight * globalCoord[ I_AXIS ];
@@ -312,7 +312,7 @@ void Material_IntegrateField(
 		double*                 result ) 
 {
 	Material*            self               = (Material*)material;
-	FiniteElement_Mesh*  feMesh             = swarm->mesh;
+	FeMesh*  feMesh             = swarm->mesh;
 	ElementType*         elementType;
 	IntegrationPoint*    particle;
 	Cell_Index           lCell_I;
@@ -337,7 +337,7 @@ void Material_IntegrateField(
 
 	/* Loop over all cells in domain */
 	for ( lCell_I = 0 ; lCell_I < cellLocalCount ; lCell_I++ ) {
-		elementType = FeMesh_ElementTypeAt( feMesh, lCell_I );
+		elementType = FeMesh_GetElementType( feMesh, lCell_I );
 		for( cParticle_I = 0 ; cParticle_I < swarm->cellParticleCountTbl[lCell_I] ; cParticle_I++ ) {
 			lParticle_I = swarm->cellParticleTbl[lCell_I][cParticle_I];
 			particle = (IntegrationPoint*) Swarm_ParticleAt( swarm, lParticle_I );
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/MaterialFeVariable.c
--- a/MaterialPoints/src/MaterialFeVariable.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/MaterialFeVariable.c	Fri Apr 27 06:21:01 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: MaterialFeVariable.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: MaterialFeVariable.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -110,33 +110,11 @@ MaterialFeVariable* _MaterialFeVariable_
 
 void _MaterialFeVariable_Init( MaterialFeVariable* self, Material* material ) {
 	IntegrationPointsSwarm* swarm;
-	Name tmpName;
-	Variable_Register* variable_Register = NULL;
 
 	/* Assign Pointers */
 	swarm = Stg_CheckType( self->assemblyTerm->integrationSwarm, IntegrationPointsSwarm );
 	self->picIntegrationPoints = swarm;
 	self->material       = material;
-
-	/* Create Dof Layout */
-	if ( swarm->swarmVariable_Register )
-		variable_Register = swarm->swarmVariable_Register->variable_Register;
-
-	tmpName = Stg_Object_AppendSuffix( self, "DataVariable" );
-	self->dataVariable = Variable_NewScalar( 	
-			tmpName,
-			Variable_DataType_Double, 
-			&self->feMesh->nodeDomainCount, 
-			(void**)&self->data, 
-			variable_Register );
-	Memory_Free( tmpName );
-	self->fieldComponentCount = 1;
-	
-	tmpName = Stg_Object_AppendSuffix( self, "DofLayout" );
-	self->dofLayout = DofLayout_New( tmpName, variable_Register, self->feMesh->layout->decomp->nodeDomainCount );
-	DofLayout_AddAllFromVariableArray( self->dofLayout, 1, &self->dataVariable );
-	Memory_Free( tmpName );
-	self->eqNum->dofLayout = self->dofLayout;
 }
 
 /* --- Virtual Function Implementations --- */
@@ -211,6 +189,32 @@ void _MaterialFeVariable_Construct( void
 
 void _MaterialFeVariable_Build( void* materialFeVariable, void* data ) {
 	MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
+	IntegrationPointsSwarm* swarm;
+	Name tmpName;
+	Variable_Register* variable_Register = NULL;
+
+	Build( self->feMesh, data, False );
+
+	/* Create Dof Layout */
+	swarm = self->picIntegrationPoints;
+	if ( swarm->swarmVariable_Register )
+		variable_Register = swarm->swarmVariable_Register->variable_Register;
+
+	tmpName = Stg_Object_AppendSuffix( self, "DataVariable" );
+	self->dataVariable = Variable_NewScalar( 
+			tmpName,
+			Variable_DataType_Double, 
+			&self->feMesh->topo->domains[MT_VERTEX]->nDomains, 
+			(void**)&self->data, 
+			variable_Register );
+	Memory_Free( tmpName );
+	self->fieldComponentCount = 1;
+	
+	tmpName = Stg_Object_AppendSuffix( self, "DofLayout" );
+	self->dofLayout = DofLayout_New( tmpName, variable_Register, self->feMesh->topo->domains[MT_VERTEX]->nDomains, NULL );
+	DofLayout_AddAllFromVariableArray( self->dofLayout, 1, &self->dataVariable );
+	Memory_Free( tmpName );
+	self->eqNum->dofLayout = self->dofLayout;
 	
 	_ParticleFeVariable_Build( self, data );
 }
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/MaterialPointsSwarm.c
--- a/MaterialPoints/src/MaterialPointsSwarm.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/MaterialPointsSwarm.c	Fri Apr 27 06:21:01 2007 +0000
@@ -68,7 +68,7 @@ MaterialPointsSwarm* MaterialPointsSwarm
 		SizeT                                 particleSize,
 		Particle_InCellIndex                  cellParticleTblDelta,
 		double                                extraParticlesFactor,
-		FiniteElement_Mesh*                   mesh,
+		FeMesh*                   mesh,
 		RemovalRoutine*                       removalRoutine,
 		SplittingRoutine*                     splittingRoutine,
 		EscapedRoutine*                       escapedRoutine, 
@@ -161,7 +161,7 @@ MaterialPointsSwarm* _MaterialPointsSwar
 
 void _MaterialPointsSwarm_Init( 
 		void*                                 swarm,
-		FiniteElement_Mesh*                   mesh,
+		FeMesh*                   mesh,
 		RemovalRoutine*                       removalRoutine,
 		SplittingRoutine*                     splittingRoutine,
 		EscapedRoutine*                       escapedRoutine, 
@@ -265,7 +265,7 @@ void* _MaterialPointsSwarm_DefaultNew( N
 
 void _MaterialPointsSwarm_Construct( void* swarm, Stg_ComponentFactory* cf, void* data ) {
 	MaterialPointsSwarm*	        self          = (MaterialPointsSwarm*) swarm;
-	FiniteElement_Mesh*             mesh;
+	FeMesh*             mesh;
 	RemovalRoutine*                 removalRoutine;
 	SplittingRoutine*               splittingRoutine;
 	EscapedRoutine*                 escapedRoutine;
@@ -274,7 +274,7 @@ void _MaterialPointsSwarm_Construct( voi
 
 	_Swarm_Construct( self, cf, data );
 
-	mesh             = Stg_ComponentFactory_ConstructByKey( cf, self->name, "FiniteElement_Mesh", FiniteElement_Mesh, True, data );
+	mesh             = Stg_ComponentFactory_ConstructByKey( cf, self->name, "FeMesh", FeMesh, True, data );
 	removalRoutine   = Stg_ComponentFactory_ConstructByKey( cf, self->name, "RemovalRoutine",     RemovalRoutine,     False, data );
 	splittingRoutine = Stg_ComponentFactory_ConstructByKey( cf, self->name, "SplittingRoutine",   SplittingRoutine,   False, data );
 	escapedRoutine   = Stg_ComponentFactory_ConstructByKey( cf, self->name, "EscapedRoutine",     EscapedRoutine,     False, data );
@@ -343,7 +343,7 @@ void _MaterialPointsSwarm_Destroy( void*
 
 void _MaterialPointsSwarm_UpdateHook( void* timeIntegrator, void* swarm ) {
 	MaterialPointsSwarm* self               = (MaterialPointsSwarm*)swarm;
-	FiniteElement_Mesh*  mesh               = self->mesh;
+	FeMesh*  mesh               = self->mesh;
 	Index                cell;
 	Index                point_I;
 	MaterialPoint*       materialPoint;
@@ -367,7 +367,7 @@ void _MaterialPointsSwarm_UpdateHook( vo
 			materialPoint = (MaterialPoint*)Swarm_ParticleAt( self, point_I );
 			cell = materialPoint->owningCell;
 			Journal_Firewall(
-				cell < mesh->elementLocalCount,
+					 cell < FeMesh_GetElementLocalSize( mesh ), 
 				Journal_MyStream( Error_Type, self ),
 				"In func %s: MaterialPoint '%d' outside element. Coord = {%g, %g, %g}\n",
 				__func__,
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/MaterialPointsSwarm.h
--- a/MaterialPoints/src/MaterialPointsSwarm.h	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/MaterialPointsSwarm.h	Fri Apr 27 06:21:01 2007 +0000
@@ -62,7 +62,7 @@
 	#define __MaterialPointsSwarm \
 		__Swarm \
 		\
-		FiniteElement_Mesh*                   mesh;                 \
+		FeMesh*                   mesh;                 \
 		SwarmAdvector*                        swarmAdvector;        \
 		RemovalRoutine*                       removalRoutine;       \
 		SplittingRoutine*                     splittingRoutine;     \
@@ -87,7 +87,7 @@
 		SizeT                                 particleSize,
 		Particle_InCellIndex                  cellParticleTblDelta,
 		double                                extraParticlesFactor,
-		FiniteElement_Mesh*                   mesh,
+		FeMesh*                   	      mesh,
 		RemovalRoutine*                       removalRoutine,
 		SplittingRoutine*                     splittingRoutine,
 		EscapedRoutine*                       escapedRoutine, 
@@ -139,7 +139,7 @@ void _MaterialPointsSwarm_Construct( voi
 
 void _MaterialPointsSwarm_Init( 
 		void*                                 swarm,
-		FiniteElement_Mesh*                   mesh,
+		FeMesh*                   mesh,
 		RemovalRoutine*                       removalRoutine,
 		SplittingRoutine*                     splittingRoutine,
 		EscapedRoutine*                       escapedRoutine, 
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/Materials_Register.c
--- a/MaterialPoints/src/Materials_Register.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/Materials_Register.c	Fri Apr 27 06:21:01 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: Materials_Register.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: Materials_Register.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -99,7 +99,7 @@ void Materials_Register_SetupSwarm( void
 	assert( swarm != NULL );
 
 	_Materials_Register_LayoutGeometry( self, swarm );
-	//Materials_Register_SetupParticleToMaterialMappings( self, swarm );
+/* 	Materials_Register_SetupParticleToMaterialMappings( self, swarm ); */
 	Materials_Register_AssignParticleProperties( self, swarm, swarm->swarmVariable_Register->variable_Register );
 }
 
@@ -189,8 +189,8 @@ void Materials_Register_AssignParticlePr
 
 		
 		if ( /*(swarm->myRank == 0) && */ ((lParticle_I+1) >= nextCompletedParticleCountToPrint ) ) {
-			// TODO: parallelise : non-master CPUs send a non-blocking update to the master to report
-			// status. Master does blocking receive on all updates before printing
+/* 			 TODO: parallelise : non-master CPUs send a non-blocking update to the master to report */
+/* 			 status. Master does blocking receive on all updates before printing */
 
 			/* Special case for really small swarms, or really small increments - may cross more than one
 				at once */
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/ParticleFeVariable.c
--- a/MaterialPoints/src/ParticleFeVariable.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/ParticleFeVariable.c	Fri Apr 27 06:21:01 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: ParticleFeVariable.c 381 2006-11-23 01:41:37Z EinatLev $
+** $Id: ParticleFeVariable.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -194,11 +194,11 @@ void _ParticleFeVariable_Construct( void
 	ParticleFeVariable*     self            = (ParticleFeVariable*) materialFeVariable;
 	IntegrationPointsSwarm* swarm;
 	FiniteElementContext*   context;
-	FiniteElement_Mesh*     mesh;
+	FeMesh*     mesh;
 
 	swarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Swarm", IntegrationPointsSwarm, True, data );
 	context = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Context", FiniteElementContext, True, data );
-	mesh = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Mesh", FiniteElement_Mesh, True, data );
+	mesh = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Mesh", FeMesh, True, data );
 
 	/* Construct Parent */
 	_FieldVariable_Construct( self, cf, data );
@@ -211,7 +211,7 @@ void _ParticleFeVariable_Build( void* ma
 	ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
 	
 	Stg_Component_Build( self->feMesh, data, False );
-	self->data = Memory_Alloc_Array( double, self->feMesh->nodeDomainCount * self->fieldComponentCount, "data" );
+	self->data = Memory_Alloc_Array( double, FeMesh_GetNodeDomainSize( self->feMesh ) * self->fieldComponentCount, "data" );
 
 	/* Do a Variable_Update() first as well as last, since if we are loading from checkpoint we need
 	to make sure the variable exists to put ICs onto - and we only just allocated it */
@@ -269,7 +269,7 @@ void ParticleFeVariable_Update( void* ma
 	ForceVector_Assemble( self->assemblyVector );
 	ForceVector_Assemble( self->massMatrix );
 
-	Vector_PointwiseDivide( self->assemblyVector->vector, self->massMatrix->vector, self->assemblyVector->vector );
+	Vector_PointwiseDivide( self->assemblyVector->vector, self->assemblyVector->vector, self->massMatrix->vector );
 
 	SolutionVector_UpdateSolutionOntoNodes( self->assemblyVector );
 }
@@ -279,9 +279,9 @@ void ParticleFeVariable_AssembleElement(
 	ForceTerm*                 forceTerm         = (ForceTerm*) _forceTerm;
 	ParticleFeVariable*        self              = Stg_CheckType( forceVector->feVariable, ParticleFeVariable );
 	IntegrationPointsSwarm*    swarm             = (IntegrationPointsSwarm*)forceTerm->integrationSwarm;
-	FiniteElement_Mesh*        mesh              = self->feMesh;
-	Element_NodeIndex          elementNodeCount  = mesh->elementNodeCountTbl[ lElement_I ];
-	ElementType*               elementType       = FeMesh_ElementTypeAt( mesh, lElement_I );
+	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 );
 	Particle_InCellIndex       cellParticleCount;
 	Particle_InCellIndex       cParticle_I;
@@ -315,9 +315,9 @@ void ParticleFeVariable_AssembleElementS
 	ForceTerm*                 forceTerm         = (ForceTerm*) _forceTerm;
 	ParticleFeVariable*        self              = Stg_CheckType( forceVector->feVariable, ParticleFeVariable );
 	Swarm*                     swarm             = forceTerm->integrationSwarm;
-	FiniteElement_Mesh*        mesh              = self->feMesh;
-	Element_NodeIndex          elementNodeCount  = mesh->elementNodeCountTbl[ lElement_I ];
-	ElementType*               elementType       = FeMesh_ElementTypeAt( mesh, lElement_I );
+	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 );
 	Particle_InCellIndex       cellParticleCount;
 	Particle_InCellIndex       cParticle_I;
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/PeriodicBoundariesManager.c
--- a/MaterialPoints/src/PeriodicBoundariesManager.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/PeriodicBoundariesManager.c	Fri Apr 27 06:21:01 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: PeriodicBoundariesManager.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: PeriodicBoundariesManager.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -82,7 +82,7 @@ void* _PeriodicBoundariesManager_Default
 
 PeriodicBoundariesManager* PeriodicBoundariesManager_New( 
 		Name                        name,
-		BlockGeometry*              geometry,
+		Mesh*			    mesh, 
 		Swarm*                      swarm,
 		Dictionary*                 dictionary )
 {
@@ -100,7 +100,7 @@ PeriodicBoundariesManager* PeriodicBound
 		_PeriodicBoundariesManager_Destroy,
 		name,
 		True,
-		geometry,
+		mesh, 
 		swarm,
 		dictionary );
 }	
@@ -120,7 +120,7 @@ PeriodicBoundariesManager* _PeriodicBoun
 		Stg_Component_DestroyFunction*         _destroy,
 		Name                                   name,
 		Bool                                   initFlag,
-		BlockGeometry*                         geometry,
+		Mesh*				       mesh, 
 		Swarm*                                 swarm,
 		Dictionary*                            dictionary )		
 {
@@ -147,7 +147,7 @@ PeriodicBoundariesManager* _PeriodicBoun
 	/* Virtual info */
 	
 	if( initFlag ){
-		_PeriodicBoundariesManager_Init( self, geometry, swarm, dictionary );
+		_PeriodicBoundariesManager_Init( self, mesh, swarm, dictionary );
 	}
 	
 	return self;
@@ -156,7 +156,7 @@ PeriodicBoundariesManager* _PeriodicBoun
 
 void _PeriodicBoundariesManager_Init(
 		void*             periodicBCsManager,
-		BlockGeometry*    geometry,
+		Mesh*		  mesh, 
 		Swarm*            swarm,
 		Dictionary*       dictionary )
 {
@@ -164,7 +164,7 @@ void _PeriodicBoundariesManager_Init(
 
 	self->isConstructed = True;
 	self->dictionary = dictionary;
-	self->geometry = geometry;
+	self->mesh = mesh;
 	self->swarm = swarm;
 	self->count = 0;
 	self->delta = 0;
@@ -177,14 +177,14 @@ void _PeriodicBoundariesManager_Construc
 void _PeriodicBoundariesManager_Construct( void* periodicBCsManager, Stg_ComponentFactory* cf, void* data ) {
 	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)periodicBCsManager;
 	Dictionary*			dictionary = NULL;
-	BlockGeometry*                  geometry = NULL;
+	Mesh*				mesh = NULL;
 	Swarm*                          swarm = NULL;
 
 	dictionary = Dictionary_GetDictionary( cf->componentDict, self->name );
-	geometry =  Stg_ComponentFactory_ConstructByKey(  cf,  self->name,  "Geometry", BlockGeometry,  True, data  ) ;
+	mesh =  Stg_ComponentFactory_ConstructByKey(  cf,  self->name,  "mesh", Mesh,  True, data  ) ;
 	swarm =  Stg_ComponentFactory_ConstructByKey(  cf,  self->name,  "Swarm", Swarm,  True, data  ) ;
 
-	_PeriodicBoundariesManager_Init( self, geometry, swarm, dictionary );
+	_PeriodicBoundariesManager_Init( self, mesh, swarm, dictionary );
 }
 
 
@@ -240,7 +240,7 @@ void* _PeriodicBoundariesManager_Copy( v
 
 	if ( deep ) {
 		newPeriodicBCsManager->dictionary = (Dictionary*)Stg_Class_Copy( self->dictionary, NULL, deep, nameExt, map );
-		newPeriodicBCsManager->geometry = (BlockGeometry*)Stg_Class_Copy( self->geometry, NULL, deep, nameExt, map );
+		newPeriodicBCsManager->mesh = (Mesh*)Stg_Class_Copy( self->mesh, NULL, deep, nameExt, map );
 		newPeriodicBCsManager->swarm = (Swarm*)Stg_Class_Copy( self->swarm, NULL, deep, nameExt, map );
 		newPeriodicBCsManager->debug = self->debug;
 		newPeriodicBCsManager->boundaries = Memory_Alloc_Array( PeriodicBoundary, self->size,
@@ -249,7 +249,7 @@ void* _PeriodicBoundariesManager_Copy( v
 	}
 	else {
 		newPeriodicBCsManager->dictionary = self->dictionary;
-		newPeriodicBCsManager->geometry = self->geometry;
+		newPeriodicBCsManager->mesh = self->mesh;
 		newPeriodicBCsManager->swarm = self->swarm;
 		newPeriodicBCsManager->boundaries = self->boundaries;
 		newPeriodicBCsManager->debug = self->debug;
@@ -318,6 +318,9 @@ void PeriodicBoundariesManager_AddPeriod
 void PeriodicBoundariesManager_AddPeriodicBoundary( void* periodicBCsManager, Axis axis ) {
 	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)periodicBCsManager;	
 	PeriodicBoundary*		newPeriodicBoundary;
+	double				min[3], max[3];
+
+	Mesh_GetGlobalCoordRange( self->mesh, min, max );
 	
 	if ( self->count == self->size ) {
 		self->size += self->delta;
@@ -325,8 +328,8 @@ void PeriodicBoundariesManager_AddPeriod
 	}
 	newPeriodicBoundary = &self->boundaries[self->count];
 	newPeriodicBoundary->axis = axis;
-	newPeriodicBoundary->minWall = self->geometry->min[axis];
-	newPeriodicBoundary->maxWall = self->geometry->max[axis];
+	newPeriodicBoundary->minWall = min[axis];
+	newPeriodicBoundary->maxWall = max[axis];
 	newPeriodicBoundary->particlesUpdatedMinEndCount = 0;	
 	newPeriodicBoundary->particlesUpdatedMaxEndCount = 0;	
 	self->count++;
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/PeriodicBoundariesManager.h
--- a/MaterialPoints/src/PeriodicBoundariesManager.h	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/PeriodicBoundariesManager.h	Fri Apr 27 06:21:01 2007 +0000
@@ -47,7 +47,7 @@
 **
 ** Comments:
 **
-** $Id: PeriodicBoundariesManager.h 374 2006-10-12 08:59:41Z SteveQuenette $
+** $Id: PeriodicBoundariesManager.h 456 2007-04-27 06:21:01Z LukeHodkinson $
 *
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -69,7 +69,7 @@
 		__Stg_Component \
 		\
 		Dictionary*		dictionary; \
-		BlockGeometry*          geometry; \
+		Mesh*			mesh; \
 		Index			count; \
 		Index			size; \
 		Index			delta; \
@@ -83,7 +83,7 @@
 
 	PeriodicBoundariesManager* PeriodicBoundariesManager_New( 
 		Name                    			name,
-		BlockGeometry*                                  geometry,
+		Mesh*						mesh, 
 		Swarm*                                          swarm,
 		Dictionary*					dictionary );
 
@@ -101,13 +101,13 @@
 		Stg_Component_DestroyFunction*         _destroy,
 		Name                                   name,
 		Bool                                   initFlag,
-		BlockGeometry*                         geometry,
+		Mesh*				       mesh, 
 		Swarm*                                 swarm,
 		Dictionary*                            dictionary );
 
 	void _PeriodicBoundariesManager_Init(
 		void*             periodicBCsManager,
-		BlockGeometry*    geometry,
+		Mesh*		  mesh, 
 		Swarm*            swarm,
 		Dictionary*       dictionary );
 		
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/src/SwarmAdvector.c
--- a/MaterialPoints/src/SwarmAdvector.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/src/SwarmAdvector.c	Fri Apr 27 06:21:01 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: SwarmAdvector.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: SwarmAdvector.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -133,7 +133,7 @@ void _SwarmAdvector_Init(
 		MaterialPointsSwarm*                       swarm,
 		PeriodicBoundariesManager*                 periodicBCsManager )
 {
-	// TODO - commented out by Pat Sunter 20060428 since we need to use gauss layout initially for testing sometimes
+/* 	 TODO - commented out by Pat Sunter 20060428 since we need to use gauss layout initially for testing sometimes */
 	/*
 	Journal_Firewall(
 		swarm->particleLayout->coordSystem == GlobalCoordSystem,
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/tests/plugins/testAdvection.c
--- a/MaterialPoints/tests/plugins/testAdvection.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/tests/plugins/testAdvection.c	Fri Apr 27 06:21:01 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: testAdvection.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: testAdvection.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -117,8 +117,8 @@ void check( PICelleratorContext* context
 		currentRadius  = StGermain_VectorMagnitude( coord, 2 );
 		originalRadius = StGermain_VectorMagnitude( originalCoord, 2 );
 		
-		//if ( originalRadius >= 1.0 || currentRadius >= 1.0 )
-		//	continue;
+		/* if ( originalRadius >= 1.0 || currentRadius >= 1.0 ) */
+		/* 	continue; */
 
 		originalTheta = acos( originalCoord[ I_AXIS ]/originalRadius );
 		if ( originalCoord[ J_AXIS ] < 0.0 )
diff -r 31abbeebf74e -r c50ba02c415a MaterialPoints/tests/testPeriodicBCs.c
--- a/MaterialPoints/tests/testPeriodicBCs.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/MaterialPoints/tests/testPeriodicBCs.c	Fri Apr 27 06:21:01 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: testPeriodicBCs.c 427 2007-02-23 02:37:11Z KathleenHumble $
+** $Id: testPeriodicBCs.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -161,10 +161,10 @@ int main( int argc, char* argv[] ) {
 	Dictionary_Add( dictionary, "particlesPerCell", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
 	Dictionary_Add( dictionary, "seed", Dictionary_Entry_Value_FromUnsignedInt( 13 ) );
 	Dictionary_Add( dictionary, "shadowDepth", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
-	// TODO: a 2nd test with the periodic shadowing enabled. Its handy to keep the orig one
-	//	without it though.
-	//Dictionary_Add( dictionary, "isPeriodicI", Dictionary_Entry_Value_FromBool( True ) );
-	//Dictionary_Add( dictionary, "isPeriodicJ", Dictionary_Entry_Value_FromBool( True ) );
+	/*  TODO: a 2nd test with the periodic shadowing enabled. Its handy to keep the orig one */
+	/* 	without it though. */
+	/* Dictionary_Add( dictionary, "isPeriodicI", Dictionary_Entry_Value_FromBool( True ) ); */
+	/* Dictionary_Add( dictionary, "isPeriodicJ", Dictionary_Entry_Value_FromBool( True ) ); */
 	decompDims = 1;
 
 	/* Run the mesher */
diff -r 31abbeebf74e -r c50ba02c415a PopulationControl/src/ReseedSplitting.c
--- a/PopulationControl/src/ReseedSplitting.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/PopulationControl/src/ReseedSplitting.c	Fri Apr 27 06:21:01 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: ReseedSplitting.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: ReseedSplitting.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -172,8 +172,7 @@ void _ReseedSplitting_SplitParticlesInCe
 	Dimension_Index         dim_I;
 	Dimension_Index         dim               = self->dim;
 	double                  regionLength;
-	FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)swarm->cellLayout)->mesh;
-	ElementLayout*          elementLayout     = mesh->layout->elementLayout;
+	FeMesh*     mesh              = (FeMesh*)((ElementCellLayout*)swarm->cellLayout)->mesh;
 
 	/* Initialise all Bools to false */
 	memset( self->regionContainsParticleTbl, 0, self->regionCount * sizeof(Bool) );
@@ -188,9 +187,9 @@ void _ReseedSplitting_SplitParticlesInCe
 		
 		/* Calculate local coordinates */
 		ElementType_ConvertGlobalCoordToElLocal(
-				FiniteElement_Mesh_ElementTypeAt( mesh, lCell_I ),
-				elementLayout,
-				(const Coord**) swarm->cellPointTbl[lCell_I],
+				FeMesh_GetElementType( mesh, lCell_I ),
+				mesh, 
+				lCell_I, 
 				particle->coord,
 				xi );
 
@@ -216,7 +215,7 @@ void _ReseedSplitting_SplitParticlesInCe
 		}
 
 		/* Convert Local Coordinate to Global Coordinate */
-		FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, dim, lCell_I, xi, newCoord );
+		FeMesh_CoordLocalToGlobal( mesh, lCell_I, xi, newCoord );
 			
 		/* Work out particle to split by finding closest particle in this cell */
 		cParticle_I = Swarm_FindClosestParticleInCell( swarm, lCell_I, dim, newCoord, NULL );
diff -r 31abbeebf74e -r c50ba02c415a Utils/src/BuoyancyForceTerm.c
--- a/Utils/src/BuoyancyForceTerm.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Utils/src/BuoyancyForceTerm.c	Fri Apr 27 06:21:01 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 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: BuoyancyForceTerm.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -135,9 +135,9 @@ void _BuoyancyForceTerm_Init(
 {
 	self->temperatureField    = temperatureField;
 	self->gravity             = gravity;
+	self->gHat		  = NULL;
 	self->adjust              = adjust;
 	self->materials_Register  = materials_Register;
-
 }
 
 void BuoyancyForceTerm_InitAll( 
@@ -159,6 +159,7 @@ void _BuoyancyForceTerm_Delete( void* fo
 	BuoyancyForceTerm* self = (BuoyancyForceTerm*)forceTerm;
 	Index i;
 
+	FreeArray( self->gHat );
 	for ( i = 0; i < self->materialSwarmCount; ++i ) {
 		Stg_Class_Delete( self->densitySwarmVariables[i] );
 		Stg_Class_Delete( self->alphaSwarmVariables[i] );
@@ -199,22 +200,50 @@ void* _BuoyancyForceTerm_DefaultNew( Nam
 
 void _BuoyancyForceTerm_Construct( void* forceTerm, Stg_ComponentFactory* cf, void* data ) {
 	BuoyancyForceTerm*          self             = (BuoyancyForceTerm*)forceTerm;
+	Dictionary*		dict;
+	Dictionary_Entry_Value*	tmp;
+	char*			rootKey;
 	FeVariable*                 temperatureField;
 	double                      gravity;
 	Bool                        adjust;
 	Materials_Register*         materials_Register;
+	unsigned		    nDims;
+	Dictionary_Entry_Value*	    direcList;
+	double*			    direc;
+	unsigned		d_i;
 
 	/* Construct Parent */
 	_ForceTerm_Construct( self, cf, data );
 
+	dict = Dictionary_Entry_Value_AsDictionary( Dictionary_Get( cf->componentDict, self->name ) );
 	temperatureField = Stg_ComponentFactory_ConstructByKey( cf, self->name, "TemperatureField", FeVariable, False, data ) ;
 	gravity          = Stg_ComponentFactory_GetDouble( cf, self->name, "gravity", 0.0 );
 	adjust           = Stg_ComponentFactory_GetBool( cf, self->name, "adjust", False );
 
+	direcList = Dictionary_Get( dict, "gravityDirection" );
+	if( direcList ) {
+		nDims = Dictionary_Entry_Value_GetCount( direcList );
+		direc = AllocArray( double, nDims );
+		for( d_i = 0; d_i < nDims; d_i++ ) {
+			tmp = Dictionary_Entry_Value_GetElement( direcList, d_i );
+			rootKey = Dictionary_Entry_Value_AsString( tmp );
+			if( !Stg_StringIsNumeric( rootKey ) )
+				tmp = Dictionary_Get( cf->rootDict, rootKey );
+			direc[d_i] = Dictionary_Entry_Value_AsDouble( tmp );
+		}
+		if( nDims == 2 )
+			Vec_Norm2D( direc, direc );
+		else
+			Vec_Norm3D( direc, direc );
+	}
+	else
+		direc = NULL;
+
 	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
 	assert( materials_Register );
 
 	_BuoyancyForceTerm_Init( self, temperatureField, gravity, adjust, materials_Register );
+	self->gHat = direc;
 }
 
 void _BuoyancyForceTerm_Build( void* forceTerm, void* data ) {
@@ -276,8 +305,6 @@ void _BuoyancyForceTerm_Build( void* for
 		Stg_Component_Build( self->densitySwarmVariables[materialSwarm_I], data, False );
 		Stg_Component_Build( self->alphaSwarmVariables[materialSwarm_I],   data, False );
 	}
-
-
 }
 
 void _BuoyancyForceTerm_Initialise( void* forceTerm, void* data ) {
@@ -313,7 +340,7 @@ void _BuoyancyForceTerm_AssembleElement(
 	Element_NodeIndex                elementNodeCount;
 	Dimension_Index                  dim                = forceVector->dim;
 	IntegrationPointsSwarm*          swarm              = (IntegrationPointsSwarm*)self->integrationSwarm;
-	FiniteElement_Mesh*              mesh               = forceVector->feVariable->feMesh;
+	FeMesh*              mesh               = forceVector->feVariable->feMesh;
 	Node_ElementLocalIndex           eNode_I;
 	Cell_Index                       cell_I;
 	ElementType*                     elementType;
@@ -327,15 +354,18 @@ void _BuoyancyForceTerm_AssembleElement(
 	Material*                        material;
 	FeVariable*                      temperatureField   = self->temperatureField;
 	double                           temperature        = 0.0;
+	double*				 gHat;
+	unsigned			d_i;
 
 	double totalWeight = 0.0;
 	double adjustFactor = 0.0;
 
-	elementType       = FeMesh_ElementTypeAt( mesh, lElement_I );
+	elementType       = FeMesh_GetElementType( mesh, lElement_I );
 	elementNodeCount  = elementType->nodeCount;
 	nodeDofCount      = dim;
 	cell_I            = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
 	cellParticleCount = swarm->cellParticleCountTbl[cell_I];
+	gHat		  = self->gHat;
 
 	/* adjust & adjustFactor -- 20060411 Alan
 	 *
@@ -355,7 +385,7 @@ void _BuoyancyForceTerm_AssembleElement(
 	else {
 		adjustFactor = 1.0;
 	}
-			
+
 	for( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
 		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
 		xi       = particle->xi;
@@ -375,8 +405,14 @@ void _BuoyancyForceTerm_AssembleElement(
 		factor = detJac * particle->weight * adjustFactor * force;
 
 		/* Apply force in verticle direction */
-		for( eNode_I = 0 ; eNode_I < elementNodeCount; eNode_I++ ) { 		
-			elForceVec[ eNode_I * nodeDofCount + J_AXIS ] += factor * Ni[ eNode_I ] ;
+		for( eNode_I = 0 ; eNode_I < elementNodeCount; eNode_I++ ) {
+			if( gHat ) {
+				for( d_i = 0; d_i < dim; d_i++ )
+					elForceVec[ eNode_I * nodeDofCount + d_i ] += gHat[d_i] * factor * Ni[ eNode_I ] ;
+			}
+			else {
+				elForceVec[ eNode_I * nodeDofCount + J_AXIS ] += factor * Ni[ eNode_I ] ;
+			}
 		}
 	}
 	
diff -r 31abbeebf74e -r c50ba02c415a Utils/src/BuoyancyForceTerm.h
--- a/Utils/src/BuoyancyForceTerm.h	Mon Mar 26 09:24:36 2007 +0000
+++ b/Utils/src/BuoyancyForceTerm.h	Fri Apr 27 06:21:01 2007 +0000
@@ -69,6 +69,7 @@
 		/* BuoyancyForceTerm info */ \
 		FeVariable*                                         temperatureField;                  \
 		double                                              gravity;                           \
+		double*						    gHat;			       \
 		Bool                                                adjust;                            \
 		Materials_Register*                                 materials_Register;                \
 		ExtensionInfo_Index                                 materialExtHandle;                 \
diff -r 31abbeebf74e -r c50ba02c415a Utils/src/BuoyancyForceTermThermoChem.c
--- a/Utils/src/BuoyancyForceTermThermoChem.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Utils/src/BuoyancyForceTermThermoChem.c	Fri Apr 27 06:21:01 2007 +0000
@@ -308,7 +308,7 @@ void _BuoyancyForceTermThermoChem_Assemb
 	Element_NodeIndex                elementNodeCount;
 	Dimension_Index                  dim                = forceVector->dim;
 	IntegrationPointsSwarm*          swarm              = (IntegrationPointsSwarm*)self->integrationSwarm;
-	FiniteElement_Mesh*              mesh               = forceVector->feVariable->feMesh;
+	FeMesh*		                 mesh               = forceVector->feVariable->feMesh;
 	Node_ElementLocalIndex           eNode_I;
 	Cell_Index                       cell_I;
 	ElementType*                     elementType;
@@ -327,7 +327,7 @@ void _BuoyancyForceTermThermoChem_Assemb
 	double totalWeight = 0.0;
 	double adjustFactor = 0.0;
 
-	elementType       = FeMesh_ElementTypeAt( mesh, lElement_I );
+	elementType       = FeMesh_GetElementType( mesh, lElement_I );
 	elementNodeCount  = elementType->nodeCount;
 	nodeDofCount      = dim;
 	cell_I            = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
diff -r 31abbeebf74e -r c50ba02c415a Utils/src/PCDVC.c
--- a/Utils/src/PCDVC.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Utils/src/PCDVC.c	Fri Apr 27 06:21:01 2007 +0000
@@ -219,6 +219,7 @@ void _PCDVC_Construct( void* pcdvc, Stg_
 	Stream*  stream = Journal_Register( Info_Type, materialPointsSwarm->type );
 	
 
+	stream = Journal_Register( Info_Type, materialPointsSwarm->type );
 	upT = Stg_ComponentFactory_GetDouble( cf, self->name, "upperT", 25 );
 	lowT = Stg_ComponentFactory_GetDouble( cf, self->name, "lowerT", 0.6 );
 	maxD = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "maxDeletions", 2);
@@ -511,7 +512,7 @@ void splitIntParticleByIndexWithinCell( 
       Coord                   newCoord;
 //      Coord                   xi;
 
-      FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
+      FeMesh*     mesh              = (FeMesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
 
 	      
       //intParticleToSplit_IndexWithinCell = maxI;
@@ -541,7 +542,7 @@ void splitIntParticleByIndexWithinCell( 
       memcpy( intNewParticle->xi, xi, sizeof(Coord) );
 	      
       /* Get new Global Coordinates from the Local Coordinates */
-      FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, matSwarm->dim, lCell_I, xi, newCoord );
+      FeMesh_CoordLocalToGlobal( mesh, lCell_I, xi, newCoord );
 
       /* Copy new global position to coord on new mat particle */
       memcpy( matNewParticle->coord, newCoord, sizeof(Coord) );
@@ -577,7 +578,7 @@ void splitIntParticleByIndexOnCPU( Integ
 
       Cell_LocalIndex lCell_I;
 
-      FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
+      FeMesh*     mesh              = (FeMesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
 
 	      
       //intParticleToSplit_IndexWithinCell = maxI;
@@ -616,7 +617,7 @@ void splitIntParticleByIndexOnCPU( Integ
       memcpy( intNewParticle->xi, xi, sizeof(Coord) );
 	      
       /* Get new Global Coordinates from the Local Coordinates */
-      FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, matSwarm->dim, lCell_I, xi, newCoord );
+      FeMesh_CoordLocalToGlobal( mesh, lCell_I, xi, newCoord );
 
       /* Copy new global position to coord on new mat particle */
       memcpy( matNewParticle->coord, newCoord, sizeof(Coord) );
diff -r 31abbeebf74e -r c50ba02c415a Utils/src/types.h
--- a/Utils/src/types.h	Mon Mar 26 09:24:36 2007 +0000
+++ b/Utils/src/types.h	Fri Apr 27 06:21:01 2007 +0000
@@ -47,7 +47,7 @@
 **
 ** Comments:
 **
-** $Id: types.h 420 2007-02-09 05:09:54Z RobertTurnbull $
+** $Id: types.h 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -57,6 +57,6 @@
 	typedef struct MaterialSwarmVariable            MaterialSwarmVariable;
 	typedef struct BuoyancyForceTerm                BuoyancyForceTerm;
 	typedef struct BuoyancyForceTermThermoChem      BuoyancyForceTermThermoChem;
-        typedef struct PCDVC                        PCDVC;
+        typedef struct PCDVC                        	PCDVC;
 
 #endif 
diff -r 31abbeebf74e -r c50ba02c415a Voronoi/src/CellularAutomataVoronoi.c
--- a/Voronoi/src/CellularAutomataVoronoi.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Voronoi/src/CellularAutomataVoronoi.c	Fri Apr 27 06:21:01 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: CellularAutomataVoronoi.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: CellularAutomataVoronoi.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -430,7 +430,7 @@ Particle_InCellIndex CellularAutomataVor
 	Cell_LocalIndex           lCell_I;
 	Particle_InCellIndex*     battlePair;
 
-	FiniteElement_Mesh*       mesh;
+	FeMesh*       mesh;
 
 	/* Check if battle has already been fought */
 	for ( battle_I = 0 ; battle_I < battleCount ; battle_I++ ) {
@@ -445,7 +445,7 @@ Particle_InCellIndex CellularAutomataVor
 	cellCentroid        = cell->centroid;
 	champion            = Swarm_ParticleInCellAt( swarm, lCell_I, champion_I );
 	contender           = Swarm_ParticleInCellAt( swarm, lCell_I, contender_I );
-	mesh                = (FiniteElement_Mesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh); /* Assume ElementCellLayout */
+	mesh                = (FeMesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh); /* Assume ElementCellLayout */
 	
 	if ( swarm->particleLayout->coordSystem == GlobalCoordSystem ) {
 		memcpy( championCoord, ((GlobalParticle*)champion)->coord, sizeof(Coord) );
@@ -453,18 +453,8 @@ Particle_InCellIndex CellularAutomataVor
 	}
 	else {
 		/* LocalCoordSystem need to convert to global */
-		FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord(
-			mesh,
-			swarm->dim,
-			lCell_I,
-			((LocalParticle*)champion)->xi,
-			championCoord );
-		FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord(
-			mesh,
-			swarm->dim,
-			lCell_I,
-			((LocalParticle*)contender)->xi,
-			contenderCoord );
+		FeMesh_CoordLocalToGlobal( mesh, lCell_I, ((LocalParticle*)champion)->xi, championCoord );
+		FeMesh_CoordLocalToGlobal( mesh, lCell_I, ((LocalParticle*)contender)->xi, contenderCoord );
 	}
 						
 
@@ -576,10 +566,10 @@ void CellularAutomataVoronoi_Seed( void*
 	Dimension_Index                      dim               = self->dim;
 	Dimension_Index                      dim_I;
 	Index*                               resolution        = self->resolution;
-	FiniteElement_Mesh*                  mesh;
+	FeMesh*                  mesh;
 	Coord                                localCoord;
 
-	mesh                = (FiniteElement_Mesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh); /* Assume ElementCellLayout */
+	mesh                = (FeMesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh); /* Assume ElementCellLayout */
 
 	/* Loop over all the particles in the cell - assigning it to the a voronoi cell it is in */
 	for ( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
@@ -587,10 +577,7 @@ void CellularAutomataVoronoi_Seed( void*
 
 		if ( swarm->particleLayout->coordSystem == GlobalCoordSystem ) {
 			/* Must convert global to local. */
-			FiniteElement_Mesh_CalcLocalCoordFromGlobalCoord( mesh, 
-									  lCell_I, 
-									  ((GlobalParticle*)particle)->coord, 
-									  localCoord );
+			FeMesh_CoordGlobalToLocal( mesh, lCell_I, ((GlobalParticle*)particle)->coord, localCoord );
 		}
 		else {
 			/* Now we need to coordinate in locals. */
@@ -713,7 +700,7 @@ void CellularAutomataVoronoi_CalcSubCell
 }
 
 void CellularAutomataVoronoi_CalcSubCells2D( CellularAutomataVoronoi* self, Swarm* swarm, unsigned cellInd ) {
-	FiniteElement_Mesh*	mesh;
+	FeMesh*	mesh;
 	unsigned		nSubCells;
 	unsigned*		res;
 	double**		gCrds;
@@ -727,7 +714,7 @@ void CellularAutomataVoronoi_CalcSubCell
 	/* Shortcuts. */
 	nSubCells = self->claimedCellCount;
 	res = self->resolution;
-	mesh = (FiniteElement_Mesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh);
+	mesh = (FeMesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh);
 
 	/* NOTE: It is assumed in an earlier function that the cell layout is based on the
 	   mesh's elements; I continue that assumption here. */
@@ -753,13 +740,8 @@ void CellularAutomataVoronoi_CalcSubCell
 			lCrds[3][0] = (double)(d_i + 1) * self->dx[0] - 1.0;
 
 			/* Map the local coordinates back to globals. */
-			for( c_i = 0; c_i < 4; c_i++ ) {
-				FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, 
-										  self->dim, 
-										  cellInd, 
-										  lCrds[c_i], 
-										  gCrds[c_i] );
-			}
+			for( c_i = 0; c_i < 4; c_i++ )
+				FeMesh_CoordLocalToGlobal( mesh, cellInd, lCrds[c_i], gCrds[c_i] );
 
 			/* Calculate the volume. */
 			self->cellVolumes[subCellInd] = CellularAutomataVoronoi_QuadArea( self, gCrds );
@@ -779,12 +761,11 @@ void CellularAutomataVoronoi_CalcSubCell
 	const double		sign[3][8] = {{-1, 1, -1, 1, -1, 1, -1, 1}, 
 					      {-1, -1, 1, 1, -1, -1, 1, 1}, 
 					      {-1, -1, -1, -1, 1, 1, 1, 1}};
-	FiniteElement_Mesh*	mesh;
+	FeMesh*	mesh;
 	unsigned		nSubCells;
 	unsigned*		res;
 	double**		gCrds;
 	double**		lCrds;
-	Coord*			gCrdPtrs[8];
 	ElementType*		elType;
 	unsigned		d_i, d_j, d_k;
 
@@ -795,8 +776,8 @@ void CellularAutomataVoronoi_CalcSubCell
 	/* Shortcuts. */
 	nSubCells = self->claimedCellCount;
 	res = self->resolution;
-	mesh = (FiniteElement_Mesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh);
-	elType = FiniteElement_Mesh_ElementTypeAt( mesh, cellInd );
+	mesh = (FeMesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh);
+	elType = FeMesh_GetElementType( mesh, cellInd );
 
 	/* NOTE: It is assumed in an earlier function that the cell layout is based on the
 	   mesh's elements; I continue that assumption here. */
@@ -844,15 +825,8 @@ void CellularAutomataVoronoi_CalcSubCell
 
 				/* Map the local coordinates back to globals. */
 				for( c_i = 0; c_i < 8; c_i++ ) {
-					/* Build a list of global coordinate pointers. */
-					gCrdPtrs[c_i] = (Coord*)(gCrds + c_i);
-
 					/* Convert to local coordinates. */
-					FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, 
-											  self->dim, 
-											  cellInd, 
-											  lCrds[c_i], 
-											  gCrds[c_i] );
+					FeMesh_CoordLocalToGlobal( mesh, cellInd, lCrds[c_i], gCrds[c_i] );
 
 					/* Calculate the jacobian. */
 					jac[0][0] += 0.125 * sign[0][c_i] * gCrds[c_i][0];
@@ -907,7 +881,7 @@ double CellularAutomataVoronoi_QuadArea(
 	return area;
 }
 
-void CellularAutomataVoronoi_QuadCentroid( CellularAutomataVoronoi* self, double** gCrds, Coord centroid ) {
+void CellularAutomataVoronoi_QuadCentroid( CellularAutomataVoronoi* self, double** gCrds, double* centroid ) {
 	unsigned	c_i;
 
 	/* Sanity check. */
@@ -925,7 +899,7 @@ void CellularAutomataVoronoi_QuadCentroi
 	centroid[1] *= 0.25;
 }
 
-void CellularAutomataVoronoi_HexCentroid( CellularAutomataVoronoi* self, double** gCrds, Coord centroid ) {
+void CellularAutomataVoronoi_HexCentroid( CellularAutomataVoronoi* self, double** gCrds, double* centroid ) {
 	unsigned	c_i;
 
 	/* Sanity check. */
diff -r 31abbeebf74e -r c50ba02c415a Voronoi/src/CellularAutomataVoronoi.h
--- a/Voronoi/src/CellularAutomataVoronoi.h	Mon Mar 26 09:24:36 2007 +0000
+++ b/Voronoi/src/CellularAutomataVoronoi.h	Fri Apr 27 06:21:01 2007 +0000
@@ -46,7 +46,7 @@
 **
 ** Comments:
 **
-** $Id: CellularAutomataVoronoi.h 374 2006-10-12 08:59:41Z SteveQuenette $
+** $Id: CellularAutomataVoronoi.h 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -168,7 +168,7 @@ void _CellularAutomataVoronoi_Construct(
 	void CellularAutomataVoronoi_CalcSubCells2D( CellularAutomataVoronoi* self, Swarm* swarm, unsigned cellInd );
 	void CellularAutomataVoronoi_CalcSubCells3D( CellularAutomataVoronoi* self, Swarm* swarm, unsigned cellInd );
 	double CellularAutomataVoronoi_QuadArea( CellularAutomataVoronoi* self, double** gCrds );
-	void CellularAutomataVoronoi_QuadCentroid( CellularAutomataVoronoi* self, double** gCrds, Coord centroid );
-	void CellularAutomataVoronoi_HexCentroid( CellularAutomataVoronoi* self, double** gCrds, Coord centroid );
+	void CellularAutomataVoronoi_QuadCentroid( CellularAutomataVoronoi* self, double** gCrds, double* centroid );
+	void CellularAutomataVoronoi_HexCentroid( CellularAutomataVoronoi* self, double** gCrds, double* centroid );
 	
 #endif 
diff -r 31abbeebf74e -r c50ba02c415a Weights/src/DVCWeights.c
--- a/Weights/src/DVCWeights.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Weights/src/DVCWeights.c	Fri Apr 27 06:21:01 2007 +0000
@@ -625,8 +625,8 @@ double _DVCWeights_DistanceSquared(doubl
 double _DVCWeights_DistanceSquared(double x0, double y0, double z0, double x1, double y1, double z1){
 	double  position0[3], position1[3], vectorDistance[3];
 	double  dist;
-	Vector_SetScalar( position0, x0, y0, z0 );	
-	Vector_SetScalar( position1, x1, y1, z1 );
+	Vec_SetScalar3D( position0, x0, y0, z0 );	
+	Vec_SetScalar3D( position1, x1, y1, z1 );
 	StGermain_VectorSubtraction( vectorDistance, position0, position1, 3 ) ;
 	dist = StGermain_VectorDotProduct(vectorDistance, vectorDistance, 3);
 	return dist;
@@ -636,8 +636,8 @@ double _DVCWeights_DistanceSquared2D(dou
 double _DVCWeights_DistanceSquared2D(double x0, double y0,double x1, double y1){
 	double  position0[2], position1[2], vectorDistance[2];
 	double dist;
-	Vector_SetScalar2D( position0, x0, y0);	
-	Vector_SetScalar2D( position1, x1, y1);
+	Vec_SetScalar2D( position0, x0, y0);	
+	Vec_SetScalar2D( position1, x1, y1);
 	StGermain_VectorSubtraction( vectorDistance, position0, position1, 2 ) ;
 	dist = StGermain_VectorDotProduct(vectorDistance, vectorDistance, 2);
 	return dist;
diff -r 31abbeebf74e -r c50ba02c415a Weights/src/DiscreteVoronoiWeights.c
--- a/Weights/src/DiscreteVoronoiWeights.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Weights/src/DiscreteVoronoiWeights.c	Fri Apr 27 06:21:01 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: DiscreteVoronoiWeights.c 376 2006-10-18 06:58:41Z SteveQuenette $
+** $Id: DiscreteVoronoiWeights.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -165,7 +165,7 @@ void _DiscreteVoronoiWeights_Calculate( 
 void _DiscreteVoronoiWeights_Calculate( void* discreteVoronoiWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
 	DiscreteVoronoiWeights*     self            = (DiscreteVoronoiWeights*)  discreteVoronoiWeights;
 	Swarm*                      swarm           = (Swarm*) _swarm;
-	FiniteElement_Mesh*         feMesh          = (FiniteElement_Mesh*)((ElementCellLayout*)swarm->cellLayout)->mesh;
+	FeMesh*         feMesh          = (FeMesh*)((ElementCellLayout*)swarm->cellLayout)->mesh;
 	Voronoi_CellIndex           claimedVoronoiCellsCount;
 	Voronoi_CellIndex           voronoiCell_I;
 	ElementType*                elementType;
@@ -184,7 +184,7 @@ void _DiscreteVoronoiWeights_Calculate( 
 	}
 
 	WeightsCalculator_ZeroWeightsInCell( self, swarm, lCell_I );
-	elementType    = FeMesh_ElementTypeAt( feMesh, lCell_I );
+	elementType    = FeMesh_GetElementType( feMesh, lCell_I );
 
 	/* Do Discrete Voronoi for this Cell */
 	DiscreteVoronoi_CalculateForCell( self->discreteVoronoi, swarm, lCell_I );
diff -r 31abbeebf74e -r c50ba02c415a Weights/src/VolumeWeights.c
--- a/Weights/src/VolumeWeights.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Weights/src/VolumeWeights.c	Fri Apr 27 06:21:01 2007 +0000
@@ -41,7 +41,7 @@ const Type VolumeWeights_Type = "VolumeW
 /*----------------------------------------------------------------------------------------------------------------------------------
 ** Constructors
 */
-VolumeWeights* VolumeWeights_New( Name name, Dimension_Index dim, Stg_Shape* shape, FiniteElement_Mesh* mesh ) {
+VolumeWeights* VolumeWeights_New( Name name, Dimension_Index dim, Stg_Shape* shape, FeMesh* mesh ) {
 	VolumeWeights* self = (VolumeWeights*) _VolumeWeights_DefaultNew( name );
 
 	VolumeWeights_InitAll( self, dim, shape, mesh );
@@ -91,7 +91,7 @@ VolumeWeights* _VolumeWeights_New(
 	return self;
 }
 
-void _VolumeWeights_Init( void* weights, Stg_Shape* shape, FiniteElement_Mesh* mesh ) {
+void _VolumeWeights_Init( void* weights, Stg_Shape* shape, FeMesh* mesh ) {
 	VolumeWeights* self = (VolumeWeights*)weights;
 	
 	self->isConstructed = True;
@@ -100,7 +100,7 @@ void _VolumeWeights_Init( void* weights,
 	self->mesh  = mesh;
 
 }
-void VolumeWeights_InitAll( void* weights, Dimension_Index dim, Stg_Shape* shape, FiniteElement_Mesh* mesh ) {
+void VolumeWeights_InitAll( void* weights, Dimension_Index dim, Stg_Shape* shape, FeMesh* mesh ) {
 	VolumeWeights* self = (VolumeWeights*)weights;
 
 	WeightsCalculator_InitAll( self, dim );
@@ -158,12 +158,12 @@ void _VolumeWeights_Construct( void* wei
 void _VolumeWeights_Construct( void* weights, Stg_ComponentFactory* cf, void* data ) {
 	VolumeWeights*	     self          = (VolumeWeights*) weights;
 	Stg_Shape*           shape;
-	FiniteElement_Mesh*  mesh;
+	FeMesh*  mesh;
 
 	_WeightsCalculator_Construct( self, cf, data );
 
 	shape = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Shape", Stg_Shape, True, data );
-	mesh  = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Mesh", FiniteElement_Mesh, True, data );
+	mesh  = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Mesh", FeMesh, True, data );
 /*
 	Journal_Firewall(
 			Stg_Class_IsInstance( shape, Sphere_Type ),
@@ -208,7 +208,7 @@ void _VolumeWeights_Calculate( void* wei
 	double                       dy;
 	double                       dz;
 	double                       weight;
-	IJK                          size; /* mesh resolution */
+	Grid*				vertGrid;
 	
 	MPI_Allreduce( 
 		&(swarm->particleLocalCount),
@@ -220,12 +220,16 @@ void _VolumeWeights_Calculate( void* wei
 
 	volume = Stg_Shape_CalculateVolume( shape );
 
-	memcpy(&size, &(((IJKTopology*)self->mesh->layout->nodeLayout->topology)->size), sizeof(IJK) );
-	
-	dx = 1.0 / (double)(size[0] - 1); /* size of an element */
-	dy = 1.0 / (double)(size[1] - 1);
+	/*
+	** NOTE: Big assumption that the mesh is regular.
+	*/
+	vertGrid = *(Grid**)ExtensionManager_Get( self->mesh->info, self->mesh, 
+						  ExtensionManager_GetHandle( self->mesh->info, "vertexGrid" ) );
+	
+	dx = 1.0 / (double)(vertGrid->sizes[0] - 1); /* size of an element */
+	dy = 1.0 / (double)(vertGrid->sizes[1] - 1);
 	if ( self->dim > 2 ) {
-		dz = 1.0 / (double)(size[2] - 1);
+		dz = 1.0 / (double)(vertGrid->sizes[2] - 1);
 	}
 	else {
 		dz = 1.0;
diff -r 31abbeebf74e -r c50ba02c415a Weights/src/VolumeWeights.h
--- a/Weights/src/VolumeWeights.h	Mon Mar 26 09:24:36 2007 +0000
+++ b/Weights/src/VolumeWeights.h	Fri Apr 27 06:21:01 2007 +0000
@@ -39,7 +39,7 @@
 	#define __VolumeWeights \
 		__WeightsCalculator \
 		Stg_Shape*              shape; \
-		FiniteElement_Mesh*     mesh; 
+		FeMesh*     mesh; 
 
 	struct VolumeWeights { __VolumeWeights };
 	
@@ -47,7 +47,7 @@
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Constructors
 	*/
-	VolumeWeights* VolumeWeights_New( Name name, Dimension_Index dim, Stg_Shape* shape, FiniteElement_Mesh* mesh );
+	VolumeWeights* VolumeWeights_New( Name name, Dimension_Index dim, Stg_Shape* shape, FeMesh* mesh );
 	VolumeWeights* _VolumeWeights_New(
 		SizeT                                 _sizeOfSelf, 
 		Type                                  type,
@@ -63,8 +63,8 @@
 		WeightsCalculator_CalculateFunction*  _calculate,
 		Name                                  name );
 
-	void _VolumeWeights_Init( void* weights, Stg_Shape* shape, FiniteElement_Mesh* mesh ) ;
-	void VolumeWeights_InitAll( void* weights, Dimension_Index dim, Stg_Shape* shape, FiniteElement_Mesh* mesh ) ;
+	void _VolumeWeights_Init( void* weights, Stg_Shape* shape, FeMesh* mesh ) ;
+	void VolumeWeights_InitAll( void* weights, Dimension_Index dim, Stg_Shape* shape, FeMesh* mesh ) ;
 
 
 	/* Stg_Class_Delete VolumeWeights implementation */
diff -r 31abbeebf74e -r c50ba02c415a Weights/src/WeightsCalculator.c
--- a/Weights/src/WeightsCalculator.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Weights/src/WeightsCalculator.c	Fri Apr 27 06:21:01 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: WeightsCalculator.c 374 2006-10-12 08:59:41Z SteveQuenette $
+** $Id: WeightsCalculator.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -160,19 +160,19 @@ void _WeightsCalculator_Construct( void*
 }
 
 void _WeightsCalculator_Build( void* weightsCalculator, void* data ) {
-	//WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+/* 	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator; */
 
 }
 void _WeightsCalculator_Initialise( void* weightsCalculator, void* data ) {
-	//WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+/* 	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator; */
 	
 }
 void _WeightsCalculator_Execute( void* weightsCalculator, void* data ) {
-//	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+/* 	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator; */
 	
 }
 void _WeightsCalculator_Destroy( void* weightsCalculator, void* data ) {
-	//WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+/* 	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator; */
 	
 }
 
@@ -223,7 +223,7 @@ void WeightsCalculator_CalculateAll( voi
 	for ( lCell_I = 0 ; lCell_I < cellLocalCount ; lCell_I++ ) {
 /*		WeightsCalculator_CheckEmptyCell( self, swarm, lCell_I );*/
 		WeightsCalculator_CalculateCell( self, swarm, lCell_I );
-		// TODO: parallelise
+/* 		 TODO: parallelise */
 
 		if ( (lCell_I+1) >= nextCompletedCellCountToPrint ) {
 			nextPlusOneCompletedCellCountToPrint = ceil(( cellLocalCount
diff -r 31abbeebf74e -r c50ba02c415a Weights/tests/plugins/testElementIntegral.c
--- a/Weights/tests/plugins/testElementIntegral.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/Weights/tests/plugins/testElementIntegral.c	Fri Apr 27 06:21:01 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: testElementIntegral.c 445 2007-03-22 01:04:29Z KathleenHumble $
+** $Id: testElementIntegral.c 456 2007-04-27 06:21:01Z LukeHodkinson $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -148,7 +148,7 @@ void PICellerator_testElementIntegral( D
 void PICellerator_testElementIntegral( DiscretisationContext* context ) {
 	Swarm*              integrationSwarm = (Swarm*)LiveComponentRegister_Get( context->CF->LCRegister, "swarm" );
 	Swarm*              materialSwarm    = (Swarm*)LiveComponentRegister_Get( context->CF->LCRegister, "picIntegrationPoints" );
-	FiniteElement_Mesh* mesh             = (FiniteElement_Mesh*) LiveComponentRegister_Get( context->CF->LCRegister, "mesh-linear" );
+	FeMesh* mesh             = (FeMesh*) LiveComponentRegister_Get( context->CF->LCRegister, "mesh-linear" );
 	WeightsCalculator*  weights          = (WeightsCalculator*) LiveComponentRegister_Get( context->CF->LCRegister, "weights" );
 	FeVariable*         feVariable;
 	Element_LocalIndex  lElement_I       = 0;
diff -r 31abbeebf74e -r c50ba02c415a plugins/Application/Application.c
--- a/plugins/Application/Application.c	Mon Mar 26 09:24:36 2007 +0000
+++ b/plugins/Application/Application.c	Fri Apr 27 06:21:01 2007 +0000
@@ -44,19 +44,19 @@
 #endif
 
 #include <mpi.h>
-//EP_APPLICATIONS_FINALISE defined in StGermain.h
+/* EP_APPLICATIONS_FINALISE defined in StGermain.h */
 #include <StGermain/StGermain.h>
-//Must include StgFEM library, but WON'T call Stg_FEM_Init in this plugin.
+/* Must include StgFEM library, but WON'T call Stg_FEM_Init in this plugin. */
 #include <StgFEM/StgFEM.h>
 #include <PICellerator/PICellerator.h>
 #include "Application.h"
 
 #include <stdio.h>
-//for strcmp
+/* for strcmp */
 #include <string.h>
 
-//All StGermain Application Plugins should use this finalise.
-//char EP_APPLICATIONS_FINALISE[] = "StGermain_EP_ApplicationsFinalise";
+/* All StGermain Application Plugins should use this finalise. */
+/* char EP_APPLICATIONS_FINALISE[] = "StGermain_EP_ApplicationsFinalise"; */
 const Type PICellerator_Application_Type = "PICellerator_Application";
 
 void _PICellerator_Application_Construct( void* component, Stg_ComponentFactory* cf, void* data ) 
@@ -68,8 +68,8 @@ void _PICellerator_Application_Construct
         AbstractContext* prevContext;
         EntryPoint* applicationsFinalise_EP;
 
-	//Get the existing abstract context, as defined by StGermain.
-	//Get it up here, so the communicator can be used for messages.
+/* 	Get the existing abstract context, as defined by StGermain. */
+/* 	Get it up here, so the communicator can be used for messages. */
 	prevContext = (AbstractContext*)Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data ); 
 
 	/* Ensures copyright info always come first in output */
@@ -89,48 +89,48 @@ void _PICellerator_Application_Construct
 	/* Ensures copyright info always come first in output */
         MPI_Barrier( prevContext->communicator ); 
 
-	//Only need to initialise a new context, and copy all relevant registers over IF this is the first application
-	//plugin to be constructed.
-	//The first application plugin to be constructed is Guaranteed to have the 'largest' context.
-	//			(ie is an inherited child of ALL other application plugins about to be loaded)
+/* 	Only need to initialise a new context, and copy all relevant registers over IF this is the first application */
+/* 	plugin to be constructed. */
+/* 	The first application plugin to be constructed is Guaranteed to have the 'largest' context. */
+/* 				(ie is an inherited child of ALL other application plugins about to be loaded) */
 	if( prevContext->type == AbstractContext_Type )
 	{
-		//Set the existing abstract context.
+/* 		Set the existing abstract context. */
 		currAbstractContext = prevContext;
-		//Create a new, empty PICelleratorContext.
+/* 		Create a new, empty PICelleratorContext. */
 		context = PICelleratorContext_New( "context", 0, 0, currAbstractContext->communicator, cf->rootDict );
 	
 		context->dictionary = cf->rootDict;
 	
-		//Initialise Abstract parts of PICelleratorContext
+/* 		Initialise Abstract parts of PICelleratorContext */
 		_AbstractContext_Init((AbstractContext*)context, 0, 0, MPI_COMM_WORLD );
-		//Initialise Discretisation parts of PICelleratorContext
+/* 		Initialise Discretisation parts of PICelleratorContext */
 		_DiscretisationContext_Init((DiscretisationContext*)context );
-		//Initialise FiniteElement parts of PICelleratorContext
+/* 		Initialise FiniteElement parts of PICelleratorContext */
 		_FiniteElementContext_Init( (FiniteElementContext*)context );
-		//Initialise PIcellerator parts of PICelleratorContext
+/* 		Initialise PIcellerator parts of PICelleratorContext */
 		_PICelleratorContext_Init( context );
 	
-	       	//Need to get the old CF from currAbstractContext, and use that in my new context.
-	        //Now I CANNOT delete this currAbstractContext or I'll lose the CF. :(
+/* 	       	Need to get the old CF from currAbstractContext, and use that in my new context. */
+/* 	        Now I CANNOT delete this currAbstractContext or I'll lose the CF. :( */
 	        context->CF = currAbstractContext->CF;
 
-	        //Need to get the LCRegister componentList, and replace the existing (abstract) context 
-		//with the newly created (PICellerator) context!!!
+/* 	        Need to get the LCRegister componentList, and replace the existing (abstract) context  */
+/* 		with the newly created (PICellerator) context!!! */
 	        Stg_ObjectList_Replace( context->CF->LCRegister->componentList,
                                 	((Stg_Component*) currAbstractContext)->name, 
 					KEEP, 
 					(Stg_Component*) context);
 	
-		//Recreate the registerRegister link in CF.
+/* 		Recreate the registerRegister link in CF. */
 		context->CF->registerRegister = context->register_Register;
 
-		//Create the EntryPoint for all application plugins' finalise functions to hook into.
+/* 		Create the EntryPoint for all application plugins' finalise functions to hook into. */
 	        applicationsFinalise_EP = EntryPoint_New( EP_APPLICATIONS_FINALISE, EntryPoint_VoidPtr_CastType );
 	        EntryPoint_Register_Add(context->entryPoint_Register, (void*)applicationsFinalise_EP);
 
-	} //close of if(context->type == AbstractContext_Type)
-	else //prevContext was NOT an abstract context -> that is does NOT need to be replaced
+	} /* close of if(context->type == AbstractContext_Type) */
+	else /* prevContext was NOT an abstract context -> that is does NOT need to be replaced */
 		context = (PICelleratorContext*) prevContext;
 
 
@@ -164,7 +164,7 @@ void* _PICellerator_Application_DefaultN
 
 Index PICellerator_Application_Register( PluginsManager* pluginsManager ) 
 {
-	//Initialise the PICellerator context.
+/* 	Initialise the PICellerator context. */
         PICellerator_Init( NULL, NULL);
 	#ifdef HAVE_PYTHON
 	Py_Initialize();



More information about the CIG-COMMITS mailing list