[cig-commits] commit: Backed out changeset 4ca4356447d8

Mercurial hg at geodynamics.org
Tue Mar 23 10:34:34 PDT 2010


changeset:   399:42d3a58b6ff9
branch:      1.4.x
user:        JulianGiordani
date:        Tue Feb 02 16:55:08 2010 +1100
files:       Apps/BuoyancyBenchmark/BuoyancyExample.xml Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c Apps/BuoyancyBenchmark/tests/expected/testBuoyancy.0of1.PressureField-ErrorFile.expected Apps/BuoyancyBenchmark/tests/testBuoyancy.0of1.sh Apps/BuoyancyBenchmark/velocityBCs.freeslip.xml Apps/PIC_Components/velocityBCs.freeslip.xml Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c MaterialPoints/src/BackgroundParticleLayout.c MaterialPoints/src/BackgroundParticleLayout.h MaterialPoints/src/CoincidentMapper.c MaterialPoints/src/CoincidentMapper.h MaterialPoints/src/Context.c MaterialPoints/src/Context.h MaterialPoints/src/Context.meta MaterialPoints/src/Finalise.c MaterialPoints/src/GaussCoincidentMapper.c MaterialPoints/src/GaussCoincidentMapper.h MaterialPoints/src/GaussMapper.c MaterialPoints/src/GaussMapper.h MaterialPoints/src/Init.c MaterialPoints/src/IntegrationPointMapper.c MaterialPoints/src/IntegrationPointMapper.h MaterialPoints/src/IntegrationPointsSwarm.c MaterialPoints/src/IntegrationPointsSwarm.h MaterialPoints/src/ManyToOneMapper.c MaterialPoints/src/ManyToOneMapper.h MaterialPoints/src/MappedParticleLayout.c MaterialPoints/src/MappedParticleLayout.h MaterialPoints/src/Material.c MaterialPoints/src/Material.h MaterialPoints/src/MaterialFeVariable.c MaterialPoints/src/MaterialFeVariable.h MaterialPoints/src/MaterialPoint.c MaterialPoints/src/MaterialPoints.h MaterialPoints/src/MaterialPointsSwarm.c MaterialPoints/src/MaterialPointsSwarm.h MaterialPoints/src/Materials_Register.c MaterialPoints/src/Materials_Register.h MaterialPoints/src/OneToManyMapper.c MaterialPoints/src/OneToManyMapper.h MaterialPoints/src/OneToManyMapper.meta MaterialPoints/src/OneToOneMapper.c MaterialPoints/src/OneToOneMapper.h MaterialPoints/src/PICelleratorContext.c MaterialPoints/src/PICelleratorContext.h MaterialPoints/src/PICelleratorContext.meta MaterialPoints/src/ParticleFeVariable.c MaterialPoints/src/ParticleFeVariable.h MaterialPoints/src/ParticleFeVariable.meta MaterialPoints/src/PeriodicBoundariesManager.c MaterialPoints/src/PeriodicBoundariesManager.h MaterialPoints/src/SwarmAdvectionInAPlane.c MaterialPoints/src/SwarmAdvectionInAPlane.h MaterialPoints/src/SwarmAdvectionInAPlane.meta MaterialPoints/src/SwarmAdvector.c MaterialPoints/src/SwarmAdvector.h MaterialPoints/src/SwarmAdvector.meta MaterialPoints/src/SwarmVariableField.c MaterialPoints/src/SwarmVariableField.h MaterialPoints/src/SwarmVariableField.meta MaterialPoints/src/types.h MaterialPoints/tests/AdvectionSuite.c MaterialPoints/tests/AdvectionSuite.h MaterialPoints/tests/MaterialComponentsSuite.c MaterialPoints/tests/MaterialComponentsSuite.c.disabled MaterialPoints/tests/MaterialComponentsSuite.h MaterialPoints/tests/MaterialComponentsSuite.h.disabled MaterialPoints/tests/MaterialFeVariableSuite.c MaterialPoints/tests/MaterialFeVariableSuite.c.disabled MaterialPoints/tests/MaterialFeVariableSuite.h MaterialPoints/tests/MaterialFeVariableSuite.h.disabled MaterialPoints/tests/PeriodicBoundariesManagerSuite.c MaterialPoints/tests/PeriodicBoundariesManagerSuite.c.disabled MaterialPoints/tests/PeriodicBoundariesManagerSuite.h MaterialPoints/tests/PeriodicBoundariesManagerSuite.h.disabled MaterialPoints/tests/Viewport.xml MaterialPoints/tests/expected/testEuler.0of1.output.dat.expected MaterialPoints/tests/expected/testEuler.0of2.output.dat.expected MaterialPoints/tests/expected/testEuler.0of3.output.dat.expected MaterialPoints/tests/expected/testMaterialFeVariable.0of1.output.dat.expected MaterialPoints/tests/expected/testMaterialFeVariable.0of2.output.dat.expected MaterialPoints/tests/expected/testPeriodicBCs.0of1.expected MaterialPoints/tests/expected/testPeriodicBCs.0of2.expected MaterialPoints/tests/expected/testPeriodicBCs.1of2.expected MaterialPoints/tests/expected/testRK2.0of1.output.dat.expected MaterialPoints/tests/expected/testRK2.0of2.output.dat.expected MaterialPoints/tests/expected/testRK4.0of1.output.dat.expected MaterialPoints/tests/expected/testRK4.0of2.output.dat.expected MaterialPoints/tests/input/testAdvection.xml MaterialPoints/tests/input/testEuler.xml MaterialPoints/tests/input/testMaterialFeVariable.xml MaterialPoints/tests/input/testPeriodicBoundariesManager.xml MaterialPoints/tests/input/testRK2.xml MaterialPoints/tests/input/testRK4.xml MaterialPoints/tests/plugins/testAdvection.c MaterialPoints/tests/testAdvection.xml MaterialPoints/tests/testEuler.0of1.sh MaterialPoints/tests/testEuler.0of2.sh MaterialPoints/tests/testEuler.0of3.sh MaterialPoints/tests/testEuler.xml MaterialPoints/tests/testRK2.0of1.sh MaterialPoints/tests/testRK2.0of2.sh MaterialPoints/tests/testRK2.xml MaterialPoints/tests/testRK4.0of1.sh MaterialPoints/tests/testRK4.0of2.sh MaterialPoints/tests/testRK4.xml PopulationControl/src/EscapedRoutine.c PopulationControl/src/EscapedRoutine.h PopulationControl/src/Finalise.c PopulationControl/src/Init.c PopulationControl/src/PopulationControl.h PopulationControl/tests/EscapedRoutineSuite.c PopulationControl/tests/input/EscapedRoutineSuite.xml SConscript SysTest/AnalyticPlugins/AnalyticPressure/AnalyticPressure.c SysTest/AnalyticPlugins/AnalyticPressure/AnalyticPressure.h SysTest/PerformanceTests/BuoyancyExample.xml SysTest/PerformanceTests/generate-convergence-rates.pl SysTest/PerformanceTests/runAndTestConvergence.pl SysTest/RegressionTests/AnalyticShearXZ.xml SysTest/RegressionTests/LidDrivenPIC2D.xml SysTest/RegressionTests/OFile.dat SysTest/RegressionTests/analyticTest.pl SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/FrequentOutput.dat SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/Mesh.00010.h5 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/PressureField.00010.h5 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/VelocityField.00010.h5 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/materialSwarm.00010.h5 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/timeInfo.00010.h5 SysTest/RegressionTests/lidDrivenAnalytic.xml SysTest/RegressionTests/lidDrivenVelocityBCs.xml SysTest/RegressionTests/np-1.dat SysTest/RegressionTests/np-2.dat SysTest/RegressionTests/np-4.dat SysTest/RegressionTests/np-8.dat SysTest/RegressionTests/testAll.py Utils/src/BuoyancyForceTerm.c Utils/src/BuoyancyForceTerm.h Utils/src/BuoyancyForceTerm.meta Utils/src/BuoyancyForceTermThermoChem.c Utils/src/BuoyancyForceTermThermoChem.h Utils/src/DiffusionSMT.c Utils/src/DiffusionSMT.h Utils/src/DiffusionSMT.meta Utils/src/Finalise.c Utils/src/Init.c Utils/src/MaterialSwarmVariable.c Utils/src/MaterialSwarmVariable.h Utils/src/PCDVC.c Utils/src/PCDVC.h Utils/src/Utils.h Utils/tests/PCDVCSuite.c Utils/tests/PCDVCSuite.h Utils/tests/expected/testPCDVC_Circle.0of1.output.dat.expected Utils/tests/expected/testPCDVC_CircleInterface.expected Utils/tests/expected/testPCDVC_ExpIface.0of1.output.dat.expected Utils/tests/expected/testPCDVC_ExponentialInterface.expected Utils/tests/expected/testPCDVC_Poly.0of1.output.dat.expected Utils/tests/expected/testPCDVC_PolynomialFunction.expected Utils/tests/input/testElementIntegral.xml Utils/tests/input/testPCDVC.xml Utils/tests/testElementIntegral.xml Utils/tests/testPCDVC.xml Utils/tests/testPCDVC_Circle.0of1.sh Utils/tests/testPCDVC_ExpIface.0of1.sh Utils/tests/testPCDVC_Poly.0of1.sh Weights/src/ConstantWeights.c Weights/src/ConstantWeights.h Weights/src/DVCWeights.c Weights/src/DVCWeights.h Weights/src/Finalise.c Weights/src/Init.c Weights/src/IterativeWeights.c Weights/src/IterativeWeights.h Weights/src/MomentBalanceWeights.c Weights/src/MomentBalanceWeights.h Weights/src/VolumeWeights.c Weights/src/VolumeWeights.h Weights/src/Weights.h Weights/src/WeightsCalculator.c Weights/src/WeightsCalculator.h Weights/tests/ConstantWeightsSuite.c Weights/tests/ConstantWeightsSuite.c. Weights/tests/ConstantWeightsSuite.c.disabled Weights/tests/ConstantWeightsSuite.h Weights/tests/ConstantWeightsSuite.h.disabled Weights/tests/DVCWeightsSuite.c Weights/tests/DVCWeightsSuite.c.disabled Weights/tests/DVCWeightsSuite.h Weights/tests/DVCWeightsSuite.h.disabled Weights/tests/DVCWeightsXMLSuite.c.disabled Weights/tests/IterativeWeightsSuite.c Weights/tests/IterativeWeightsSuite.c.disabled Weights/tests/IterativeWeightsSuite.h Weights/tests/IterativeWeightsSuite.h.disabled Weights/tests/MomentBalanceWeightsSuite.c Weights/tests/MomentBalanceWeightsSuite.c.disabled Weights/tests/MomentBalanceWeightsSuite.h Weights/tests/MomentBalanceWeightsSuite.h.disabled Weights/tests/expected/DVCWeightsSuite_testConstructGrid.txt Weights/tests/expected/DVCWeightsSuite_testConstructGrid2D.txt Weights/tests/expected/DVCWeightsSuite_testGetCentroids.txt Weights/tests/expected/DVCWeightsSuite_testGetCentroids2D.txt Weights/tests/input/testConstantWeights.xml Weights/tests/input/testDVCWeights.xml Weights/tests/input/testElementIntegral.xml Weights/tests/input/testIterativeWeights.xml Weights/tests/input/testMomentBalanceWeights.xml libPICellerator/Toolbox/Toolbox.c libPICellerator/src/Finalise.c libPICellerator/src/Init.c libPICellerator/tests/LibPICelleratorSuite.c libPICellerator/tests/LibPICelleratorSuite.h libPICellerator/tests/expected/testLibPICellerator.0of1.expected libPICellerator/tests/testLibPICellerator.0of1.sh libPICellerator/tests/testLibPICellerator.c plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.c plugins/Output/MaterialCentroid/MaterialCentroid.c
description:
Backed out changeset 4ca4356447d8


diff -r 4ca4356447d8 -r 42d3a58b6ff9 Apps/BuoyancyBenchmark/BuoyancyExample.xml
--- a/Apps/BuoyancyBenchmark/BuoyancyExample.xml	Tue Feb 02 16:36:14 2010 +1100
+++ b/Apps/BuoyancyBenchmark/BuoyancyExample.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -8,18 +8,9 @@
 	</list>
 
 	<list name="plugins" mergeType="Replace">
-		<struct>
-			<param name="Type">StgFEM_FrequentOutput</param>
-			<param name="Context">context</param>
-		</struct>
-		<struct>
-			<param name="Type">StgFEM_CPUTime</param>
-			<param name="Context">context</param>
-		</struct>
-    <struct>
-			<param name="Type">PICellerator_AnalyticPressure</param>
-			<param name="Context">context</param>
-		</struct>
+		<!--param>Underworld_MovingMesh</param-->
+		<param>StgFEM_StandardConditionFunctions</param>	
+		<!--param>Experimental_PressureCalibration</param-->	
 	</list>
 
 	<!--param name="extensionReferenceHeight">maxY</param-->
@@ -35,26 +26,15 @@
 	<include>PICellerator/StokesFlowUzawa.xml </include>
 	<!--include>Underworld/StokesFlowUzawaCompressible.xml </include-->
 
-  <param name="gravity">9.81</param>
-
-  <struct name="pluginData">
-		<list name="NumericFields">
-			<param>PressureField</param> <param>0</param>
-		</list> 
-		<param name="IntegrationSwarm">gaussSwarm</param>
-		<param name="ConstantMesh">constantMesh</param>
-		<param name="ElementMesh">linearMesh</param>
-		<param name="normaliseByAnalyticSolution">true</param>
-		<param name="useReferenceSolutionFromFile">false</param>
-		<param name="appendToAnalysisFile">false</param>
-		<param name="Context">context</param>
-	</struct>
+	<list name="plugins" mergeType="merge">
+		<!-- Output Plugins -->
+		<param>StgFEM_FrequentOutput</param>	
+		<param>StgFEM_CPUTime</param>
+	</list>
+        <param name="gravity">9.81</param>
 
 	<!-- Rheology Components -->
 	<struct name="components" mergeType="merge">
-    <struct name="context">
-			<param name="Type">PICelleratorContext</param>
-		</struct>
 		<struct name="buoyancyForceTerm">
 			<param name="Type">BuoyancyForceTerm</param>
 			<param name="ForceVector">mom_force</param>
@@ -100,9 +80,9 @@
 			<param name="density">1.36</param>
 		</struct>
 
-  <struct name="materialSwarmParticleLayout" mergeType="replace">
-    <param name="Type">GaussParticleLayout</param>
-  </struct>
+                <struct name="materialSwarmParticleLayout" mergeType="replace">
+		         <param name="Type">GaussParticleLayout</param>
+		</struct>
 										
 	</struct>
 
@@ -129,7 +109,7 @@
 	<param name="elementResJ"> 50 </param>
 	<param name="elementResK"> 1 </param>
 	<param name="shadowDepth"> 1 </param>
-  <param name="minX"> 0.0 </param>
+   	<param name="minX"> 0.0 </param>
 	<param name="minY"> 0.0 </param>
 	<param name="minZ"> 0.0 </param>
 	<param name="maxX"> 1.0 </param>
@@ -138,7 +118,7 @@
 	<param name="allowUnbalancing"> True </param>
 
 	<!-- Set up BCs and ICs -->
-  <include>PICellerator/velocityBCs.freeslip.xml</include>
+        <include>velocityBCs.freeslip.xml</include>
 	
 </StGermainData>
 
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,120 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: AnalyticPressure.c 518 2007-10-11 08:07:50Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PICellerator.h>
+
+#include <assert.h>
+
+const Type AnalyticPressure_Type = "AnalyticPressure";
+
+typedef struct {
+	__AnalyticSolution
+	FeVariable*		pressureField;
+	double                  density;
+	double                  gravity;
+	double                  maxY;
+	double                  minY;
+} AnalyticPressure;
+
+void _AnalyticPressure_PressureFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* pressure ) {
+	AnalyticPressure*  self    = (AnalyticPressure*)analyticSolution;
+	double             density = self->density;
+	double             gravity = self->gravity;
+        double             y;
+
+	/* Find coordinate of node */
+	y = -coord[ J_AXIS ] + (self->minY+self->maxY)/2.0;
+
+	*pressure = y * density * gravity;
+}
+
+	
+void _AnalyticPressure_Construct( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
+	AnalyticPressure*        self           = (AnalyticPressure*)analyticSolution;
+
+	/* Construct Parent */
+	_AnalyticSolution_Construct( self, cf, data );
+
+	/* Create Analytic Fields */
+	self->pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
+	AnalyticSolution_RegisterFeVariableWithAnalyticFunction( self, self->pressureField, _AnalyticPressure_PressureFunction );
+	
+	
+	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 ) );
+
+	_AnalyticSolution_Build( self, data );
+}
+
+void* _AnalyticPressure_DefaultNew( Name name ) {
+	return _AnalyticSolution_New(
+			sizeof(AnalyticPressure),
+			AnalyticPressure_Type,
+			_AnalyticSolution_Delete,
+			_AnalyticSolution_Print,
+			_AnalyticSolution_Copy,
+			_AnalyticPressure_DefaultNew,
+			_AnalyticPressure_Construct,
+			_AnalyticPressure_Build,
+			_AnalyticSolution_Initialise,
+			_AnalyticSolution_Execute,
+			_AnalyticSolution_Destroy,
+			name );
+}
+
+Index _PICellerator_AnalyticPressure_Register( PluginsManager* pluginsManager ) {
+	return PluginsManager_Submit( pluginsManager, AnalyticPressure_Type, "0", _AnalyticPressure_DefaultNew );
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Apps/BuoyancyBenchmark/tests/expected/testBuoyancy.0of1.PressureField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/expected/testBuoyancy.0of1.PressureField-ErrorFile.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'PressureField-ErrorMagnitudeField' is outside a tolerance 1.5e-06.
+Timestep 1: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 1.5e-06.
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Apps/BuoyancyBenchmark/tests/testBuoyancy.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/testBuoyancy.0of1.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testBuoyancy.0of1.sh 504 2007-08-05 09:48:58Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain ./testBuoyancy.xml" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Apps/BuoyancyBenchmark/velocityBCs.freeslip.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/velocityBCs.freeslip.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<!-- A StGermain input file -->
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<!-- Velocity BCs -->
+	<struct name="velocityBCs">
+		<param name="type">CompositeVC</param>
+		<list name="vcList">
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> bottom </param>
+				<list name="variables">
+					<struct>
+						<param name="name">vy</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> left </param>
+				<list name="variables">
+					<struct>
+						<param name="name">vx</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> right </param>
+				<list name="variables">
+					<struct>
+						<param name="name">vx</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> front </param>
+				<list name="variables">
+					<struct>
+						<param name="name">vz</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> back </param>
+				<list name="variables">
+					<struct>
+						<param name="name">vz</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> top </param>
+				<list name="variables">
+					<struct>
+						<param name="name">vy</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>
+		</list>
+	</struct>
+</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Apps/PIC_Components/velocityBCs.freeslip.xml
--- a/Apps/PIC_Components/velocityBCs.freeslip.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-<!-- A StGermain input file -->
-<!-- DTD to validate against -->
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-
-	<!-- Velocity BCs -->
-	<struct name="velocityBCs">
-		<param name="type">CompositeVC</param>
-		<list name="vcList">
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> bottom </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vy</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> left </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> right </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> front </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vz</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> back </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vz</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> top </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vy</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-		</list>
-	</struct>
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c
--- a/Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c	Tue Feb 02 16:55:08 2010 +1100
@@ -1720,19 +1720,19 @@ void _AnalyticBlock_PressureFunction( vo
 
 }
 
-void _AnalyticBlock_AssignFromXML( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
+void _AnalyticBlock_Construct( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
 	AnalyticBlock*           self           = (AnalyticBlock*)analyticSolution;
 
 	/* Construct Parent */
-	_AnalyticSolution_AssignFromXML( self, cf, data );
+	_AnalyticSolution_Construct( self, cf, data );
 
 	/* Create Analytic Fields */
-	self->velocityField = Stg_ComponentFactory_ConstructByName( cf, (Name)"VelocityField", FeVariable, True, data  ); 
-	self->pressureField = Stg_ComponentFactory_ConstructByName( cf, (Name)"PressureField", FeVariable, True, data  ); 
+	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, (Dictionary_Entry_Key)"startBlockX", 0.0  );
-	self->endBlockX = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"endBlockX", 0.0  );
-	self->startBlockY = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"startBlockY", 0.0  );
+	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 ) {
@@ -1749,27 +1749,21 @@ void _AnalyticBlock_Build( void* analyti
 }
 
 void* _AnalyticBlock_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(AnalyticBlock);
-	Type                                                      type = AnalyticBlock_Type;
-	Stg_Class_DeleteFunction*                              _delete = _AnalyticSolution_Delete;
-	Stg_Class_PrintFunction*                                _print = _AnalyticSolution_Print;
-	Stg_Class_CopyFunction*                                  _copy = _AnalyticSolution_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _AnalyticBlock_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _AnalyticBlock_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _AnalyticBlock_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _AnalyticSolution_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _AnalyticSolution_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _AnalyticSolution_Destroy;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return _AnalyticSolution_New(  ANALYTICSOLUTION_PASSARGS  );
+	return _AnalyticSolution_New(
+			sizeof(AnalyticBlock),
+			AnalyticBlock_Type,
+			_AnalyticSolution_Delete,
+			_AnalyticSolution_Print,
+			_AnalyticSolution_Copy,
+			_AnalyticBlock_DefaultNew,
+			_AnalyticBlock_Construct,
+			_AnalyticBlock_Build,
+			_AnalyticSolution_Initialise,
+			_AnalyticSolution_Execute,
+			_AnalyticSolution_Destroy,
+			name );
 }
 
 Index _PICellerator_AnalyticBlock_Register( PluginsManager* pluginsManager ) {
-	return PluginsManager_Submit( pluginsManager, AnalyticBlock_Type, (Name)"0", _AnalyticBlock_DefaultNew  );
+	return PluginsManager_Submit( pluginsManager, AnalyticBlock_Type, "0", _AnalyticBlock_DefaultNew );
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c
--- a/Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c	Tue Feb 02 16:55:08 2010 +1100
@@ -294,23 +294,23 @@ void _AnalyticColumn_PressureFunction( v
 }
 
 	
-void _AnalyticColumn_AssignFromXML( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
+void _AnalyticColumn_Construct( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
 	AnalyticColumn*          self           = (AnalyticColumn*)analyticSolution;
 
 	/* Construct Parent */
-	_AnalyticSolution_AssignFromXML( self, cf, data );
+	_AnalyticSolution_Construct( self, cf, data );
 
 	/* Create Analytic Fields */
-	self->velocityField = Stg_ComponentFactory_ConstructByName( cf, (Name)"VelocityField", FeVariable, True, data  ); 
-	self->pressureField = Stg_ComponentFactory_ConstructByName( cf, (Name)"PressureField", FeVariable, True, data  ); 
+	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, (Dictionary_Entry_Key)"dim", 0  );
-	self->startColumnX = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"startColumnX", 0.0  );
-	self->endColumnX   = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"endColumnX", 0.0  );
-	self->startColumnZ = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"startColumnZ", 0.0  );
-	self->endColumnZ   = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"endColumnZ", 0.0  );
-	self->viscosity    = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"viscosity", 1.0  );
-	self->sigma        = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"sigma", 1.0  );
+	self->dim          = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+	self->startColumnX = Stg_ComponentFactory_GetRootDictDouble( cf, "startColumnX", 0.0 );
+	self->endColumnX   = Stg_ComponentFactory_GetRootDictDouble( cf, "endColumnX", 0.0 );
+	self->startColumnZ = Stg_ComponentFactory_GetRootDictDouble( cf, "startColumnZ", 0.0 );
+	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 ) {
@@ -327,27 +327,21 @@ void _AnalyticColumn_Build( void* analyt
 }
 
 void* _AnalyticColumn_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(AnalyticColumn);
-	Type                                                      type = AnalyticColumn_Type;
-	Stg_Class_DeleteFunction*                              _delete = _AnalyticSolution_Delete;
-	Stg_Class_PrintFunction*                                _print = _AnalyticSolution_Print;
-	Stg_Class_CopyFunction*                                  _copy = _AnalyticSolution_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _AnalyticColumn_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _AnalyticColumn_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _AnalyticColumn_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _AnalyticSolution_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _AnalyticSolution_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _AnalyticSolution_Destroy;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return _AnalyticSolution_New(  ANALYTICSOLUTION_PASSARGS  );
+	return _AnalyticSolution_New(
+			sizeof(AnalyticColumn),
+			AnalyticColumn_Type,
+			_AnalyticSolution_Delete,
+			_AnalyticSolution_Print,
+			_AnalyticSolution_Copy,
+			_AnalyticColumn_DefaultNew,
+			_AnalyticColumn_Construct,
+			_AnalyticColumn_Build,
+			_AnalyticSolution_Initialise,
+			_AnalyticSolution_Execute,
+			_AnalyticSolution_Destroy,
+			name );
 }
 
 Index _PICellerator_AnalyticColumn_Register( PluginsManager* pluginsManager ) {
-	return PluginsManager_Submit( pluginsManager, AnalyticColumn_Type, (Name)"0", _AnalyticColumn_DefaultNew  );
+	return PluginsManager_Submit( pluginsManager, AnalyticColumn_Type, "0", _AnalyticColumn_DefaultNew );
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/BackgroundParticleLayout.c
--- a/MaterialPoints/src/BackgroundParticleLayout.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/BackgroundParticleLayout.c	Tue Feb 02 16:55:08 2010 +1100
@@ -21,14 +21,14 @@
 **
 */
 /** \file
- **  Role:
- **	A particle layout which creates only 1 particle, for use in creating backgroud layers where materials are "everywhere"
- **
- ** Assumptions:
- **
- ** Comments:
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**	A particle layout which creates only 1 particle, for use in creating backgroud layers where materials are "everywhere"
+**
+** Assumptions:
+**
+** Comments:
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 
 #include <mpi.h>
@@ -47,139 +47,162 @@
 
 const Type BackgroundParticleLayout_Type = "BackgroundParticleLayout";
 
-BackgroundParticleLayout* BackgroundParticleLayout_New( Name name,
-   AbstractContext* context, 
-   CoordSystem      coordSystem, 
-   Bool             weightsInitialisedAtStartup ) {
-
-   BackgroundParticleLayout* self = _BackgroundParticleLayout_DefaultNew( name );
-
-   _ParticleLayout_Init( self, context, coordSystem, weightsInitialisedAtStartup );
-   _BackgroundParticleLayout_Init( self );
-   self->isConstructed = True;
-   return self;
+BackgroundParticleLayout* _BackgroundParticleLayout_New( 
+                SizeT                                                       _sizeOfSelf,
+                Type                                                        type,
+                Stg_Class_DeleteFunction*                                   _delete,
+                Stg_Class_PrintFunction*                                    _print,
+                Stg_Class_CopyFunction*                                     _copy,
+                Stg_Component_DefaultConstructorFunction*                   _defaultConstructor,
+                Stg_Component_ConstructFunction*                            _construct,
+                Stg_Component_BuildFunction*                                _build,
+                Stg_Component_InitialiseFunction*                           _initialise,
+                Stg_Component_ExecuteFunction*                              _execute,
+                Stg_Component_DestroyFunction*                              _destroy,
+                ParticleLayout_SetInitialCountsFunction*                    _setInitialCounts,
+                ParticleLayout_InitialiseParticlesFunction*                 _initialiseParticles,
+                Name                                                        name,
+                Bool                                                        initFlag,
+		CoordSystem                                                 coordSystem,
+                Bool                                                        weightsInitialisedAtStartup )
+{
+	BackgroundParticleLayout*		self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(BackgroundParticleLayout) );
+	self = (BackgroundParticleLayout*)_ParticleLayout_New( 
+			_sizeOfSelf, 
+			type, 
+			_delete, 
+			_print, 
+			_copy, 
+			_defaultConstructor,
+			_construct, 
+			_build, 
+			_initialise, 
+			_execute, 
+			_destroy, 
+			_setInitialCounts, 
+			_initialiseParticles, 
+			name, 
+			initFlag,
+			coordSystem,
+			weightsInitialisedAtStartup );
+	
+	if( initFlag ){
+		_BackgroundParticleLayout_Init( self, coordSystem, weightsInitialisedAtStartup );
+	}
+	
+	return self;
 }
 
-BackgroundParticleLayout* _BackgroundParticleLayout_New(  BACKGROUNDPARTICLELAYOUT_DEFARGS  ) {
-    BackgroundParticleLayout* self;
+
+void _BackgroundParticleLayout_Init(
+		void*                  particleLayout,
+		CoordSystem            coordSystem,
+		Bool                   weightsInitialisedAtStartup )
+{
+	BackgroundParticleLayout* self = (BackgroundParticleLayout*)particleLayout;
 	
-    /* Allocate memory */
-    assert( _sizeOfSelf >= sizeof(BackgroundParticleLayout) );
-    self = (BackgroundParticleLayout*)_ParticleLayout_New(  PARTICLELAYOUT_PASSARGS  );
-	
-    return self;
-}
+	self->isConstructed = True;
 
-
-void _BackgroundParticleLayout_Init( void* particleLayout ) {
-	BackgroundParticleLayout* self;
-
-	self = (BackgroundParticleLayout*)particleLayout;
+	_ParticleLayout_Init( particleLayout, coordSystem, weightsInitialisedAtStartup );
 }
 
 void _BackgroundParticleLayout_Delete( void* particleLayout ) {
-    BackgroundParticleLayout* self = (BackgroundParticleLayout*)particleLayout;
+	BackgroundParticleLayout* self = (BackgroundParticleLayout*)particleLayout;
 	
-    _ParticleLayout_Delete( self );
+	_ParticleLayout_Delete( self );
 }
 
 void _BackgroundParticleLayout_Print( void* particleLayout, Stream* stream ) {
-    BackgroundParticleLayout* self = (BackgroundParticleLayout*)particleLayout;
+	BackgroundParticleLayout* self = (BackgroundParticleLayout*)particleLayout;
 	
-    Journal_Printf( stream, "BackgroundParticleLayout (ptr): %p\n", self );
+	Journal_Printf( stream, "BackgroundParticleLayout (ptr): %p\n", self );
 	
-    /* Parent class info */
-    _ParticleLayout_Print( self, stream );
+	/* Parent class info */
+	_ParticleLayout_Print( self, stream );
 	
 }
 
+
 void* _BackgroundParticleLayout_Copy( void* particleLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    BackgroundParticleLayout*		self = (BackgroundParticleLayout*)particleLayout;
-    BackgroundParticleLayout*		newBackgroundParticleLayout;
+	BackgroundParticleLayout*		self = (BackgroundParticleLayout*)particleLayout;
+	BackgroundParticleLayout*		newBackgroundParticleLayout;
 	
-    newBackgroundParticleLayout = (BackgroundParticleLayout*)_ParticleLayout_Copy( self, dest, deep, nameExt, ptrMap );
+	newBackgroundParticleLayout = (BackgroundParticleLayout*)_ParticleLayout_Copy( self, dest, deep, nameExt, ptrMap );
 
-    return (void*)newBackgroundParticleLayout;
+	return (void*)newBackgroundParticleLayout;
 }
 
 void* _BackgroundParticleLayout_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                        _sizeOfSelf = sizeof(BackgroundParticleLayout);
-	Type                                                                type = BackgroundParticleLayout_Type;
-	Stg_Class_DeleteFunction*                                        _delete = _BackgroundParticleLayout_Delete;
-	Stg_Class_PrintFunction*                                          _print = _BackgroundParticleLayout_Print;
-	Stg_Class_CopyFunction*                                            _copy = _BackgroundParticleLayout_Copy;
-	Stg_Component_DefaultConstructorFunction*            _defaultConstructor = _BackgroundParticleLayout_DefaultNew;
-	Stg_Component_ConstructFunction*                              _construct = _BackgroundParticleLayout_AssignFromXML;
-	Stg_Component_BuildFunction*                                      _build = _BackgroundParticleLayout_Build;
-	Stg_Component_InitialiseFunction*                            _initialise = _BackgroundParticleLayout_Initialise;
-	Stg_Component_ExecuteFunction*                                  _execute = _BackgroundParticleLayout_Execute;
-	Stg_Component_DestroyFunction*                                  _destroy = _BackgroundParticleLayout_Destroy;
-	AllocationType                                        nameAllocationType = NON_GLOBAL;
-	ParticleLayout_SetInitialCountsFunction*               _setInitialCounts = _BackgroundParticleLayout_SetInitialCounts;
-	ParticleLayout_InitialiseParticlesFunction*         _initialiseParticles = _BackgroundParticleLayout_InitialiseParticles;
-	CoordSystem                                                  coordSystem = GlobalCoordSystem;
-	Bool                                         weightsInitialisedAtStartup = False;
-
-    return _BackgroundParticleLayout_New(  BACKGROUNDPARTICLELAYOUT_PASSARGS  );
+	return _BackgroundParticleLayout_New(
+			sizeof(BackgroundParticleLayout),
+			BackgroundParticleLayout_Type,
+			_BackgroundParticleLayout_Delete,
+			_BackgroundParticleLayout_Print,
+			_BackgroundParticleLayout_Copy,
+			_BackgroundParticleLayout_DefaultNew,
+			_BackgroundParticleLayout_Construct,
+			_BackgroundParticleLayout_Build,
+			_BackgroundParticleLayout_Initialise,
+			_BackgroundParticleLayout_Execute,
+			_BackgroundParticleLayout_Destroy,
+			_BackgroundParticleLayout_SetInitialCounts,
+			_BackgroundParticleLayout_InitialiseParticles,
+			name,
+			False,
+			GlobalCoordSystem,
+			False );
 }
-void  _BackgroundParticleLayout_AssignFromXML( void* component, Stg_ComponentFactory* cf, void* data )  {
-   BackgroundParticleLayout*	self = (BackgroundParticleLayout*)component;
-
-   _ParticleLayout_AssignFromXML( self, cf, data );
-
-   _BackgroundParticleLayout_Init( self );
+void  _BackgroundParticleLayout_Construct( void* component, Stg_ComponentFactory* cf, void* data )  {
+	_BackgroundParticleLayout_Init( component, GlobalCoordSystem, False );
 }
 
 void  _BackgroundParticleLayout_Build( void* component, void* data ) {}
 void  _BackgroundParticleLayout_Initialise( void* component, void* data ) {}
 void  _BackgroundParticleLayout_Execute( void* component, void* data ) {}
-void  _BackgroundParticleLayout_Destroy( void* component, void* data ) {
-   BackgroundParticleLayout*	self = (BackgroundParticleLayout*)component;
-   _ParticleLayout_Destroy( self, data );
-}
+void  _BackgroundParticleLayout_Destroy( void* component, void* data ) {}
 
 
 void _BackgroundParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm )
 {
-    Swarm*			  swarm         = (Swarm*)_swarm;
-    Cell_DomainIndex	  cell_I        = 0;
-    char			  tempStr[100];
+	Swarm*			  swarm         = (Swarm*)_swarm;
+	Cell_DomainIndex	  cell_I        = 0;
+	char			  tempStr[100];
 
-    swarm->particleLocalCount = 1;
+	swarm->particleLocalCount = 1;
 
-    for( cell_I = 0; cell_I < swarm->cellLocalCount; cell_I++ ) {
-        /* Set initial counts to empty, till we add the particles */
-        swarm->cellParticleCountTbl[cell_I] = 0; 
-        swarm->cellParticleSizeTbl[cell_I] = 1; /* Just to create array */
+	for( cell_I = 0; cell_I < swarm->cellLocalCount; cell_I++ ) {
+		/* Set initial counts to empty, till we add the particles */
+		swarm->cellParticleCountTbl[cell_I] = 0; 
+		swarm->cellParticleSizeTbl[cell_I] = 1; /* Just to create array */
 
-        sprintf( tempStr, "Swarm->cellParticleTbl[%d]", cell_I );
-        swarm->cellParticleTbl[cell_I] = Memory_Alloc_Array( Particle_Index, swarm->cellParticleSizeTbl[cell_I], tempStr );
+		sprintf( tempStr, "Swarm->cellParticleTbl[%d]", cell_I );
+		swarm->cellParticleTbl[cell_I] = Memory_Alloc_Array( Particle_Index, swarm->cellParticleSizeTbl[cell_I], tempStr );
 										
-    }
+	}
 
-    /* Now initialise the shadow cell particle counts */
-    for (; cell_I < swarm->cellDomainCount; cell_I++ ) {
-        swarm->cellParticleCountTbl[cell_I] = 0;
-        swarm->cellParticleSizeTbl[cell_I] = 0;
-        swarm->cellParticleTbl[cell_I] = NULL;
-    }
+	/* Now initialise the shadow cell particle counts */
+	for (; cell_I < swarm->cellDomainCount; cell_I++ ) {
+		swarm->cellParticleCountTbl[cell_I] = 0;
+		swarm->cellParticleSizeTbl[cell_I] = 0;
+		swarm->cellParticleTbl[cell_I] = NULL;
+	}
 }
 
 void _BackgroundParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm )
 {
-    Swarm*                    swarm         = (Swarm*)_swarm;
-    GlobalParticle*           particle;
+	Swarm*                    swarm         = (Swarm*)_swarm;
+	GlobalParticle*           particle;
 
-    particle = (GlobalParticle*)Swarm_ParticleAt( swarm, 0 );
+	particle = (GlobalParticle*)Swarm_ParticleAt( swarm, 0 );
 
-    particle->owningCell = 0;
-    particle->coord[0] = 0.5; /* just some value, doesn't matter where */
-    particle->coord[1] = 0.5;
-    particle->coord[2] = 0.5;
+	particle->owningCell = 0;
+	particle->coord[0] = 0.5; /* just some value, doesn't matter where */
+	particle->coord[1] = 0.5;
+	particle->coord[2] = 0.5;
 
-    Swarm_AddParticleToCell( swarm, 0, 0 );
+	Swarm_AddParticleToCell( swarm, 0, 0 );
 }
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/BackgroundParticleLayout.h
--- a/MaterialPoints/src/BackgroundParticleLayout.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/BackgroundParticleLayout.h	Tue Feb 02 16:55:08 2010 +1100
@@ -1,57 +1,58 @@
 #ifndef __PICellerator_MaterialPoints_BackgroundParticleLayout_h__
 #define __PICellerator_MaterialPoints_BackgroundParticleLayout_h__
 	
-/* Textual name of this class */
-extern const Type BackgroundParticleLayout_Type;
+	/* Textual name of this class */
+	extern const Type BackgroundParticleLayout_Type;
 	
-/* ParticleLayout information */
-#define __BackgroundParticleLayout                              \
-    /* General info */                                          \
-    __ParticleLayout                                            \
+	/* ParticleLayout information */
+	#define __BackgroundParticleLayout \
+		/* General info */ \
+		__ParticleLayout \
 
-struct BackgroundParticleLayout { __BackgroundParticleLayout };
+	struct BackgroundParticleLayout { __BackgroundParticleLayout };
 	
-/** public constructor */
-BackgroundParticleLayout* BackgroundParticleLayout_New( Name name,
-   AbstractContext* context, 
-   CoordSystem      coordSystem, 
-   Bool             weightsInitialisedAtStartup );
+	BackgroundParticleLayout* _BackgroundParticleLayout_New( 
+		SizeT                                                        _sizeOfSelf,
+		Type                                                         type,
+		Stg_Class_DeleteFunction*                                    _delete,
+		Stg_Class_PrintFunction*                                     _print,
+		Stg_Class_CopyFunction*                                      _copy,
+		Stg_Component_DefaultConstructorFunction*                    _defaultConstructor,
+		Stg_Component_ConstructFunction*                             _construct,
+		Stg_Component_BuildFunction*                                 _build,
+		Stg_Component_InitialiseFunction*                            _initialise,
+		Stg_Component_ExecuteFunction*                               _execute,
+		Stg_Component_DestroyFunction*                               _destroy,
+		ParticleLayout_SetInitialCountsFunction*                     _setInitialCounts,
+		ParticleLayout_InitialiseParticlesFunction*                  _initialiseParticles,
+		Name                                                         name,
+		Bool                                                         initFlag,
+		CoordSystem                                                  coordSystem,
+		Bool                                                         weightsInitialisedAtStartup );
+	
+	/* Initialise implementation */
+	void _BackgroundParticleLayout_Init( 
+			void*                  particleLayout, 
+			CoordSystem            coordSystem, 
+			Bool                   weightsInitialisedAtStartup );
+	
+	void _BackgroundParticleLayout_Delete( void* particleLayout );
+	void _BackgroundParticleLayout_Print( void* particleLayout, Stream* stream );
+	#define BackgroundParticleLayout_Copy( self ) \
+		(BackgroundParticleLayout*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define BackgroundParticleLayout_DeepCopy( self ) \
+		(BackgroundParticleLayout*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _BackgroundParticleLayout_Copy( void* particleLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
+	void* _BackgroundParticleLayout_DefaultNew( Name name );
+	void  _BackgroundParticleLayout_Construct( void* component, Stg_ComponentFactory* cf, void* data );
+	void  _BackgroundParticleLayout_Build( void* component, void* data );
+	void  _BackgroundParticleLayout_Initialise( void* component, void* data );
+	void  _BackgroundParticleLayout_Execute( void* component, void* data );
+	void  _BackgroundParticleLayout_Destroy( void* component, void* data );
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define BACKGROUNDPARTICLELAYOUT_DEFARGS \
-                PARTICLELAYOUT_DEFARGS
-
-	#define BACKGROUNDPARTICLELAYOUT_PASSARGS \
-                PARTICLELAYOUT_PASSARGS
-
-BackgroundParticleLayout* _BackgroundParticleLayout_New(  BACKGROUNDPARTICLELAYOUT_DEFARGS  );
-	
-/* Initialise implementation */
-void _BackgroundParticleLayout_Init( 
-    void*                  particleLayout );
-	
-void _BackgroundParticleLayout_Delete( void* particleLayout );
-void _BackgroundParticleLayout_Print( void* particleLayout, Stream* stream );
-#define BackgroundParticleLayout_Copy( self )                           \
-    (BackgroundParticleLayout*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define BackgroundParticleLayout_DeepCopy( self )                       \
-    (BackgroundParticleLayout*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _BackgroundParticleLayout_Copy( void* particleLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-
-void* _BackgroundParticleLayout_DefaultNew( Name name );
-void  _BackgroundParticleLayout_AssignFromXML( void* component, Stg_ComponentFactory* cf, void* data );
-void  _BackgroundParticleLayout_Build( void* component, void* data );
-void  _BackgroundParticleLayout_Initialise( void* component, void* data );
-void  _BackgroundParticleLayout_Execute( void* component, void* data );
-void  _BackgroundParticleLayout_Destroy( void* component, void* data );
-	
-void _BackgroundParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm );
-void _BackgroundParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm );
+	void _BackgroundParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm );
+	void _BackgroundParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm );
 
 	
 #endif /* __PICellerator_MaterialPoints_BackgroundParticleLayout_h__ */
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/CoincidentMapper.c
--- a/MaterialPoints/src/CoincidentMapper.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/CoincidentMapper.c	Tue Feb 02 16:55:08 2010 +1100
@@ -66,131 +66,185 @@ const Type CoincidentMapper_Type = "Coin
 const Type CoincidentMapper_Type = "CoincidentMapper";
 
 CoincidentMapper* CoincidentMapper_New(
-	Name							name,
-	PICelleratorContext*		context,
-	IntegrationPointsSwarm*	integrationSwarm,
-	MaterialPointsSwarm*		materialSwarm )
+	Name                       name,
+	IntegrationPointsSwarm*    integrationSwarm,
+	MaterialPointsSwarm*       materialSwarm
+	)
 {
-	CoincidentMapper* self = _CoincidentMapper_DefaultNew( name );
-
-	self->isConstructed = True;
-	_IntegrationPointMapper_Init( self, context, integrationSwarm );
-	_OneToOneMapper_Init( self, materialSwarm );
-	_CoincidentMapper_Init( self );
+	CoincidentMapper* self = (CoincidentMapper*) _CoincidentMapper_New(
+		sizeof(CoincidentMapper),
+		CoincidentMapper_Type,
+		_CoincidentMapper_Delete,
+		_CoincidentMapper_Print,
+		_CoincidentMapper_Copy,
+		_CoincidentMapper_DefaultNew,
+		_CoincidentMapper_Construct,
+		_CoincidentMapper_Build,
+		_CoincidentMapper_Initialise,
+		_CoincidentMapper_Execute,
+		_CoincidentMapper_Destroy,
+		_CoincidentMapper_Map,
+		_OneToOneMapper_GetMaterialPointsSwarms,
+		_OneToOneMapper_GetMaterialIndexOn,
+		_OneToOneMapper_GetExtensionOn,
+		name,
+		True, /* initFlag */
+		integrationSwarm,
+		materialSwarm
+		);
 
 	return self;
 }
 
+
 void* _CoincidentMapper_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                                 _sizeOfSelf = sizeof(CoincidentMapper);
-	Type                                                                         type = CoincidentMapper_Type;
-	Stg_Class_DeleteFunction*                                                 _delete = _CoincidentMapper_Delete;
-	Stg_Class_PrintFunction*                                                   _print = _CoincidentMapper_Print;
-	Stg_Class_CopyFunction*                                                     _copy = _CoincidentMapper_Copy;
-	Stg_Component_DefaultConstructorFunction*                     _defaultConstructor = _CoincidentMapper_DefaultNew;
-	Stg_Component_ConstructFunction*                                       _construct = _CoincidentMapper_AssignFromXML;
-	Stg_Component_BuildFunction*                                               _build = _CoincidentMapper_Build;
-	Stg_Component_InitialiseFunction*                                     _initialise = _CoincidentMapper_Initialise;
-	Stg_Component_ExecuteFunction*                                           _execute = _CoincidentMapper_Execute;
-	Stg_Component_DestroyFunction*                                           _destroy = _CoincidentMapper_Destroy;
-	AllocationType                                                 nameAllocationType = NON_GLOBAL;
-	IntegrationPointMapper_MapFunction*                                          _map = _CoincidentMapper_Map;
-	IntegrationPointMapper_GetMaterialPointsSwarmsFunction*  _getMaterialPointsSwarms = _OneToOneMapper_GetMaterialPointsSwarms;
-	IntegrationPointMapper_GetMaterialIndexOnFunction*            _getMaterialIndexOn = _OneToOneMapper_GetMaterialIndexOn;
-	IntegrationPointMapper_GetExtensionOnFunction*                    _getExtensionOn = _OneToOneMapper_GetExtensionOn;
-    IntegrationPointMapper_GetDoubleFromExtension*                  _getDoubleFromExtension = _OneToOneMapper_GetDoubleFromExtension;
-	IntegrationPointMapper_GetDoubleFromExtension*                  _getDoubleFromMaterial = _OneToOneMapper_GetDoubleFromMaterial;
-
-	return _CoincidentMapper_New(  COINCIDENTMAPPER_PASSARGS  );
+	return _CoincidentMapper_New(
+			sizeof(CoincidentMapper),
+			CoincidentMapper_Type,
+			_CoincidentMapper_Delete,
+			_CoincidentMapper_Print,
+			_CoincidentMapper_Copy,
+			_CoincidentMapper_DefaultNew,
+			_CoincidentMapper_Construct,
+			_CoincidentMapper_Build,
+			_CoincidentMapper_Initialise,
+			_CoincidentMapper_Execute,
+			_CoincidentMapper_Destroy,
+			_CoincidentMapper_Map,
+			_OneToOneMapper_GetMaterialPointsSwarms,
+			_OneToOneMapper_GetMaterialIndexOn,
+			_OneToOneMapper_GetExtensionOn,
+			name,
+			False,
+			NULL,
+			NULL );
 }
 
-CoincidentMapper* _CoincidentMapper_New(  COINCIDENTMAPPER_DEFARGS  ) {
+
+CoincidentMapper* _CoincidentMapper_New(
+		SizeT                                                           _sizeOfSelf,
+		Type                                                            type,
+		Stg_Class_DeleteFunction*                                       _delete,
+		Stg_Class_PrintFunction*                                        _print,
+		Stg_Class_CopyFunction*                                         _copy,
+		Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+		Stg_Component_ConstructFunction*                                _construct,
+		Stg_Component_BuildFunction*                                    _build,
+		Stg_Component_InitialiseFunction*                               _initialise,
+		Stg_Component_ExecuteFunction*                                  _execute,
+		Stg_Component_DestroyFunction*                                  _destroy,
+		IntegrationPointMapper_MapFunction*                             _map,
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+		IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+		IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+		Name                                                            name,
+		Bool                                                            initFlag,
+		IntegrationPointsSwarm*                                         integrationSwarm,
+		MaterialPointsSwarm*                                            materialSwarm )
+{
 	CoincidentMapper* result;
 
-	result = (CoincidentMapper*)_OneToOneMapper_New(  ONETOONEMAPPER_PASSARGS  );
-
+	result = (CoincidentMapper*)_OneToOneMapper_New(
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_map,
+			_getMaterialPointsSwarms,
+			_getMaterialIndexOn,
+			_getExtensionOn,
+			name,
+			initFlag,
+			integrationSwarm,
+			materialSwarm );
+	if (initFlag) {
+		_CoincidentMapper_Init( result, integrationSwarm, materialSwarm );
+	}
+		
 	return result;
 }
 
-void _CoincidentMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-	_OneToOneMapper_AssignFromXML( mapper, cf, data );
+void _CoincidentMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+	_OneToOneMapper_Construct( mapper, cf, data );
 }
 
-void _CoincidentMapper_Init( void* mapper ) {
+void _CoincidentMapper_Init(
+		void*                   mapper,
+		IntegrationPointsSwarm* integrationSwarm,
+		MaterialPointsSwarm*    materialSwarm ) 
+{
+	_OneToOneMapper_Init( mapper, integrationSwarm, materialSwarm );
 }
 
 void _CoincidentMapper_Delete( void* mapper ) {
-	CoincidentMapper* self = (CoincidentMapper*)mapper;
-
-	_OneToOneMapper_Delete( self );
+	_IntegrationPointMapper_Delete( mapper );
 }
-
 void _CoincidentMapper_Print( void* mapper, Stream* stream ) {
 	_IntegrationPointMapper_Print( mapper, stream );
 }
-
 void* _CoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	return _IntegrationPointMapper_Copy( mapper, dest, deep, nameExt, ptrMap );
 }
 
 void _CoincidentMapper_Build( void* mapper, void* cf ) {
-	CoincidentMapper* self = (CoincidentMapper*)mapper;
-
-	_OneToOneMapper_Build( self, cf );
+	_OneToOneMapper_Build( mapper, cf );
 }
 
 void _CoincidentMapper_Initialise( void* mapper, void* cf ) {
-	CoincidentMapper* self = (CoincidentMapper*)mapper;
-
-	_OneToOneMapper_Initialise( self, cf );
+	_OneToOneMapper_Initialise( mapper, cf );
 }
 
 void _CoincidentMapper_Execute( void* mapper, void* data ) {
 }
 
 void _CoincidentMapper_Destroy( void* mapper, void* data ) {
-	CoincidentMapper* self = (CoincidentMapper*)mapper;
-
-	_OneToOneMapper_Destroy( self, data );
 }
 
 void _CoincidentMapper_Map( void* mapper ) {
-	CoincidentMapper*			self = (CoincidentMapper*)mapper;
-	IntegrationPointsSwarm*	integrationSwarm = self->integrationSwarm;
-	MaterialPointsSwarm*		materialSwarm = self->materialSwarm;
-	IntegrationPoint*			integrationPoint;
-	MaterialPoint*				materialPoint;
-	MaterialPointRef*			ref;
-	FeMesh*						mesh = materialSwarm->mesh;
-	Particle_Index				particle_lI;
-	Cell_Index					cell_dI;
+	CoincidentMapper*       self                   = (CoincidentMapper*)mapper;
 
-#ifdef CAUTIOUS
-	Index							dim_I;
-	Stream*						errorStream = Journal_Register( Error_Type, (Name)self->type  );
-#endif
-	Stream*						debugStream = Swarm_Debug;
+	IntegrationPointsSwarm* integrationSwarm       = self->integrationSwarm;
+	MaterialPointsSwarm*    materialSwarm          = self->materialSwarm;
+
+	IntegrationPoint*       integrationPoint;
+	MaterialPoint*          materialPoint;
+	MaterialPointRef*       ref;
+
+	FeMesh*     mesh                   = materialSwarm->mesh;
+
+	Particle_Index          particle_lI;
+	Cell_Index              cell_dI;
+
+	#ifdef CAUTIOUS
+	Index			dim_I;
+	Stream*                 errorStream = Journal_Register( Error_Type, self->type );
+	#endif
+	Stream*                 debugStream = Swarm_Debug;
 	
+
 	Journal_DPrintfL( debugStream, 1, "In %s(): Re-creating a new set of integration points, exactly\n" 
-		"\tmapping to the current material points & their positions.\n", __func__ );
-
+		"\tmapping to the current material points & their positions.\n",
+		__func__ ) ;
 	Stream_IndentBranch( debugStream );
 
 	Journal_DPrintfL( debugStream, 2, "Reallocating the integration points array from size of %u points "
 		"to the \n\tcurrent material swarm particle count of %u\n", integrationSwarm->particleLocalCount,
 		materialSwarm->particleLocalCount );
-
 	integrationSwarm->particleLocalCount = materialSwarm->particleLocalCount;
 	Swarm_Realloc( integrationSwarm );
 
 	Journal_DPrintfL( debugStream, 2, "Clearing all the cell->particle ownership tables, "
 		"ready to add new cell->particle\n\trelationships as new integration points are set up.\n" );
-
 	for( cell_dI = 0; cell_dI < integrationSwarm->cellDomainCount; cell_dI++ ) {
 		integrationSwarm->cellParticleCountTbl[cell_dI] = 0;
 		integrationSwarm->cellParticleSizeTbl[cell_dI] = 0;
-
 		if ( integrationSwarm->cellParticleTbl[cell_dI] ) {
 			Memory_Free( integrationSwarm->cellParticleTbl[cell_dI] );
 		}
@@ -198,37 +252,37 @@ void _CoincidentMapper_Map( void* mapper
 	}
 
 	Journal_DPrintfL( debugStream, 2, "For each material particle, setting up a corresponding integration "
-                      "point, and\n\tcalculating its element-local coord based on the material's global coord:\n" );
+		"point, and\n\tcalculating its element-local coord based on the material's global coord:\n" );
 	Stream_IndentBranch( debugStream );	
-
 	/* Map each point */
 	for ( particle_lI = 0; particle_lI < materialSwarm->particleLocalCount; particle_lI++ ) {
 		integrationPoint = (IntegrationPoint*)Swarm_ParticleAt( integrationSwarm, particle_lI );
-		materialPoint = (MaterialPoint*)Swarm_ParticleAt( materialSwarm, particle_lI );
+		materialPoint    = (MaterialPoint*)   Swarm_ParticleAt( materialSwarm, particle_lI );
 
 		cell_dI = materialPoint->owningCell;
 
-		Journal_DPrintfL( debugStream, 3, "Referring to local material point %u, from material swarm cell %u:\n", particle_lI, cell_dI );
+		Journal_DPrintfL( debugStream, 3, "Referring to local material point %u, from material swarm cell %u:\n",
+			particle_lI, cell_dI );
 		Stream_IndentBranch( debugStream );	
 
-		Journal_DPrintfL( debugStream, 3, "Adding new integration point %u to integration swarm cell %u\n", particle_lI, cell_dI );
+		Journal_DPrintfL( debugStream, 3, "Adding new integration point %u to integration swarm cell %u\n",
+			particle_lI, cell_dI );
 
 		Swarm_AddParticleToCell( integrationSwarm, cell_dI, particle_lI );
 
 		/* Convert global to local coordinates */
 		ElementType_ConvertGlobalCoordToElLocal(
-			FeMesh_GetElementType( mesh, cell_dI ),
-			mesh, 
-			cell_dI, 
-			materialPoint->coord,
-			integrationPoint->xi );
+				FeMesh_GetElementType( mesh, cell_dI ),
+				mesh, 
+				cell_dI, 
+				materialPoint->coord,
+				integrationPoint->xi );
 
 		Journal_DPrintfL( debugStream, 3, "Based on material point's coord of (%.2f,%.2f,%.2f):\n"
 			"calculated and set new integration point's local coord as (%.2f,%.2f,%.2f)\n",
 			materialPoint->coord[0], materialPoint->coord[1], materialPoint->coord[2],
 			integrationPoint->xi[0], integrationPoint->xi[1], integrationPoint->xi[2] );
-
-#ifdef CAUTIOUS
+		#ifdef CAUTIOUS
 		/* Check the result is between -1 to 1 in all dimensions : if not, something is stuffed */		
 		for ( dim_I= 0; dim_I < materialSwarm->dim; dim_I++ ) {
 			Journal_Firewall(
@@ -242,7 +296,7 @@ void _CoincidentMapper_Map( void* mapper
 				materialSwarm->particleLayout->type, integrationPoint->xi[0],
 				integrationPoint->xi[1], integrationPoint->xi[2] );
 		}
-#endif
+		#endif
 
 		ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
 		ref->swarm_I = materialSwarm->swarmReg_I;
@@ -258,5 +312,3 @@ void _CoincidentMapper_Map( void* mapper
 	Stream_UnIndentBranch( debugStream );
 	Journal_DPrintfL( debugStream, 1, "...%s(): Done.\n", __func__ );
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/CoincidentMapper.h
--- a/MaterialPoints/src/CoincidentMapper.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/CoincidentMapper.h	Tue Feb 02 16:55:08 2010 +1100
@@ -40,17 +40,17 @@
 **
 */
 /** \file
- **  Role:
- **	A OneToOne mapping between MaterialPointsSwarm and IntegrationPointsSwarm where the translation a direct
- **      global to local coordinates 
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: CoincidentMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**	A OneToOne mapping between MaterialPointsSwarm and IntegrationPointsSwarm where the translation a direct
+**      global to local coordinates 
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: CoincidentMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_MaterialPoints_CoincidentMapper_h__
 #define __PICellerator_MaterialPoints_CoincidentMapper_h__
@@ -63,53 +63,55 @@
 
 	struct CoincidentMapper { __CoincidentMapper };
 
+	CoincidentMapper* CoincidentMapper_New(
+			Name                       name,
+			IntegrationPointsSwarm*    integrationSwarm,
+			MaterialPointsSwarm*       materialSwarm);	
+	
+	CoincidentMapper* _CoincidentMapper_New(
+			SizeT                                                           _sizeOfSelf,
+			Type                                                            type,
+			Stg_Class_DeleteFunction*                                       _delete,
+			Stg_Class_PrintFunction*                                        _print,
+			Stg_Class_CopyFunction*                                         _copy,
+			Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+			Stg_Component_ConstructFunction*                                _construct,
+			Stg_Component_BuildFunction*                                    _build,
+			Stg_Component_InitialiseFunction*                               _initialise,
+			Stg_Component_ExecuteFunction*                                  _execute,
+			Stg_Component_DestroyFunction*                                  _destroy,
+			IntegrationPointMapper_MapFunction*                             _map,
+			IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+			IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+			IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+			Name                                                            name,
+			Bool                                                            initFlag,
 
+			IntegrationPointsSwarm*                                         integrationSwarm,
+			MaterialPointsSwarm*                                            materialSwarm );
 
-	CoincidentMapper* CoincidentMapper_New(
-		Name							name,
-		PICelleratorContext*		context,
-		IntegrationPointsSwarm*	integrationSwarm,
-		MaterialPointsSwarm*		materialSwarm);	
-	
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
+	void _CoincidentMapper_Init(
+			void*                   mapper,
+			IntegrationPointsSwarm* integrationSwarm,
+			MaterialPointsSwarm*    materialSwarm );
 
-	#define COINCIDENTMAPPER_DEFARGS \
-                ONETOONEMAPPER_DEFARGS
-
-	#define COINCIDENTMAPPER_PASSARGS \
-                ONETOONEMAPPER_PASSARGS
-
-	CoincidentMapper* _CoincidentMapper_New(  COINCIDENTMAPPER_DEFARGS  );
-
-	void _CoincidentMapper_Init( void* mapper );
 
 	void _CoincidentMapper_Delete( void* mapper );
-
 	void _CoincidentMapper_Print( void* mapper, Stream* stream );
-
 	#define CoincidentMapper_Copy( self ) \
 		(CoincidentMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define CoincidentMapper_DeepCopy( self ) \
 		(CoincidentMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
 	void* _CoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	void* _CoincidentMapper_DefaultNew( Name name );
-
-	void _CoincidentMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
-
-	void _CoincidentMapper_Build( void* mapper, void* data );
-
-	void _CoincidentMapper_Initialise( void* mapper, void* data );
-
+void _CoincidentMapper_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _CoincidentMapper_Build( void* mapper, void* data ) ;
+	void _CoincidentMapper_Initialise( void* mapper, void* data ) ;
 	void _CoincidentMapper_Execute( void* mapper, void* data );
-
-	void _CoincidentMapper_Destroy( void* mapper, void* data );
+	void _CoincidentMapper_Destroy( void* mapper, void* data ) ;
+	
 
 	void _CoincidentMapper_Map( void* mapper );
 	
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/Context.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Context.c	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,233 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Context.c 518 2007-10-11 08:07:50Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "types.h"
+#include "Materials_Register.h"
+#include "Material.h"
+#include "Context.h"
+
+/* Textual name of this class */
+const Type PICelleratorContext_Type = "PICelleratorContext";
+
+/* Constructors ------------------------------------------------------------------------------------------------*/
+void* _PICelleratorContext_DefaultNew( Name name ) {
+	return (void*) _PICelleratorContext_New(
+		sizeof(PICelleratorContext),
+		PICelleratorContext_Type,
+		_PICelleratorContext_Delete,
+		_PICelleratorContext_Print,
+		NULL, 
+		_PICelleratorContext_DefaultNew,
+		_AbstractContext_Construct,
+		_AbstractContext_Build,
+		_AbstractContext_Initialise,
+		_AbstractContext_Execute,
+		_AbstractContext_Destroy,
+		_PICelleratorContext_SetDt,
+		name,
+		False,
+		0,
+		0,
+		0,
+		NULL );
+}
+
+PICelleratorContext* PICelleratorContext_New( 
+		Name                                            name,
+		double                                          start,
+		double                                          stop,
+		MPI_Comm                                        communicator,
+		Dictionary*                                     dictionary )
+{
+	return _PICelleratorContext_New(
+		sizeof(PICelleratorContext),
+		PICelleratorContext_Type,
+		_PICelleratorContext_Delete,
+		_PICelleratorContext_Print,
+		NULL, 
+		_PICelleratorContext_DefaultNew,
+		_AbstractContext_Construct,
+		_AbstractContext_Build,
+		_AbstractContext_Initialise,
+		_AbstractContext_Execute,
+		_AbstractContext_Destroy,
+		_PICelleratorContext_SetDt,
+		name,
+		True,
+		start,
+		stop,
+		communicator,
+		dictionary );
+}	
+
+
+PICelleratorContext* _PICelleratorContext_New( 
+		SizeT                                           sizeOfSelf,
+		Type                                            type,
+		Stg_Class_DeleteFunction*                       _delete,
+		Stg_Class_PrintFunction*                        _print,
+		Stg_Class_CopyFunction*                         _copy,
+		Stg_Component_DefaultConstructorFunction*       _defaultConstructor,
+		Stg_Component_ConstructFunction*                _construct,
+		Stg_Component_BuildFunction*                    _build,
+		Stg_Component_InitialiseFunction*               _initialise,
+		Stg_Component_ExecuteFunction*                  _execute,
+		Stg_Component_DestroyFunction*                  _destroy,
+		AbstractContext_SetDt*                          _setDt,
+		Name                                            name,
+		Bool                                            initFlag,
+		double                                          start,
+		double                                          stop,
+		MPI_Comm                                        communicator,
+		Dictionary*                                     dictionary )
+{
+	PICelleratorContext* self;
+	
+	/* Allocate memory */
+	self = (PICelleratorContext*)_FiniteElementContext_New( 
+		sizeOfSelf, 
+		type, 
+		_delete, 
+		_print, 
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,
+		name,
+		initFlag,
+		_setDt, 
+		start, 
+		stop, 
+		communicator, 
+		dictionary );
+	
+	/* General info */
+	
+	/* Virtual info */
+	
+	if( initFlag ){
+		_PICelleratorContext_Init( self );
+	}
+	
+	return self;
+}
+
+
+void _PICelleratorContext_Init( void* context ) {
+	PICelleratorContext* self = (PICelleratorContext*)context;
+	self->isConstructed = True;
+
+	self->materials_Register = Materials_Register_New();
+	Stg_ObjectList_ClassAppend( self->register_Register, (void*)self->materials_Register, "Materials_Register" );
+
+	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 */
+}
+
+
+/* Virtual Functions -------------------------------------------------------------------------------------------------------------*/
+
+void _PICelleratorContext_Delete( void* context ) {
+	PICelleratorContext* self = (PICelleratorContext*)context;
+	
+	Journal_DPrintf( self->debug, "In: %s()\n", __func__ );
+
+	Stg_Class_Delete( self->materials_Register );
+
+	/* Stg_Class_Delete parent */
+	_FiniteElementContext_Delete( self );
+}
+
+
+void _PICelleratorContext_Print( void* context, Stream* stream ) {
+	PICelleratorContext* self = (PICelleratorContext*)context;
+	
+	/* General info */
+	Journal_Printf( (void*) stream, "PICelleratorContext (ptr): %p\n", self );
+	
+	/* Print parent */
+	_FiniteElementContext_Print( self, stream );
+
+	Journal_PrintPointer( stream, self->materials_Register );
+
+}
+
+void _PICelleratorContext_SetDt( void* context, double dt ) {
+	PICelleratorContext* self = (PICelleratorContext*)context;
+	
+	self->dt = dt;
+}
+
+
+/* Public Functions ----------------------------------------------------------------------------------------------------*/
+
+
+
+/* EntryPoint Hooks ----------------------------------------------------------------------------------------------------*/
+void PICelleratorContext_CreateDefaultMaterial( void* context ) {
+	PICelleratorContext*      self         = (PICelleratorContext*) context;
+	
+	if ( Materials_Register_GetCount( self->materials_Register ) == 0 ) {
+		Stg_Shape* everywhereShape = (Stg_Shape*) Everywhere_New( "defaultShape", self->dim );
+
+		Material_New( "backgroundMaterial", everywhereShape, self->dictionary, self->materials_Register );
+	}
+}
+
+void _PICelleratorContext_Construct( void* context, Stg_ComponentFactory *cf, void* data ){
+	PICelleratorContext* self = (PICelleratorContext*) context;
+	
+	_PICelleratorContext_Init( self );	
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/Context.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Context.h	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,127 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	Class allowing the user to construct and solve a hybrid FEM/PIC problem
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Context.h 374 2006-10-12 08:59:41Z SteveQuenette $
+*
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_Context_h__
+#define __PICellerator_MaterialPoints_Context_h__
+	
+	/* Textual name of this class */
+	extern const Type PICelleratorContext_Type;
+	
+	#define __PICelleratorContext \
+		/* General info */ \
+		__FiniteElementContext \
+		\
+		/* Virtual info */ \
+		\
+		/* PICelleratorContext info */ \
+		Materials_Register*                        materials_Register;
+
+
+		
+	struct PICelleratorContext { __PICelleratorContext };
+	
+	/* Constructors ----------------------------------------------------------------------------------------------------*/
+	
+	/** Constructor */
+	void* _PICelleratorContext_DefaultNew( Name name );
+	
+	PICelleratorContext* PICelleratorContext_New( 
+		Name                                            name,
+		double                                          start,
+		double                                          stop,
+		MPI_Comm                                        communicator,
+		Dictionary*                                     dictionary );
+
+	
+	/** Creation implementation / Virtual constructor */
+	PICelleratorContext* _PICelleratorContext_New( 
+		SizeT                                           sizeOfSelf,
+		Type                                            type,
+		Stg_Class_DeleteFunction*                       _delete,
+		Stg_Class_PrintFunction*                        _print,
+		Stg_Class_CopyFunction*                         _copy, 
+		Stg_Component_DefaultConstructorFunction*       _defaultConstructor,
+		Stg_Component_ConstructFunction*                _construct,
+		Stg_Component_BuildFunction*                    _build,
+		Stg_Component_InitialiseFunction*               _initialise,
+		Stg_Component_ExecuteFunction*                  _execute,
+		Stg_Component_DestroyFunction*                  _destroy,
+		AbstractContext_SetDt*                          _setDt,
+		Name                                            name,
+		Bool                                            initFlag,
+		double                                          start,
+		double                                          stop,
+		MPI_Comm                                        communicator,
+		Dictionary*                                     dictionary );
+	
+	/** Initialisation implementation */
+	void _PICelleratorContext_Init( void* context );
+
+	/* Virtual Functions -----------------------------------------------------------------------------------------------*/
+	
+	/* Stg_Class_Delete implementation */
+	void _PICelleratorContext_Delete( void* context );
+	
+	/* Print implementation */
+	void _PICelleratorContext_Print( void* context, Stream* stream );
+	
+	/* Set the dt */
+	void _PICelleratorContext_SetDt( void* context, double dt );
+
+	void _PICelleratorContext_Construct( void* context, Stg_ComponentFactory* cf, void* data );
+	
+	/* Public functions -----------------------------------------------------------------------------------------------*/
+	void PICelleratorContext_CreateDefaultMaterial( void* context ) ;
+	
+	/* Private functions -----------------------------------------------------------------------------------------------*/
+#endif /* __PICelleratorContext_h__ */
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/Context.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Context.meta	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">PICelleratorContext</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/MaterialPoints/src/</param>
+<param name="Project Web">http://www.stgermainproject.org/PICellerator.html</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">FiniteElementContext</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/Finalise.c
--- a/MaterialPoints/src/Finalise.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/Finalise.c	Tue Feb 02 16:55:08 2010 +1100
@@ -53,9 +53,7 @@
 #include <stdio.h>
 
 Bool PICellerator_MaterialPoints_Finalise( void ) {
-	Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
 	
 	return True;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/GaussCoincidentMapper.c
--- a/MaterialPoints/src/GaussCoincidentMapper.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/GaussCoincidentMapper.c	Tue Feb 02 16:55:08 2010 +1100
@@ -66,121 +66,172 @@ const Type GaussCoincidentMapper_Type = 
 const Type GaussCoincidentMapper_Type = "GaussCoincidentMapper";
 
 GaussCoincidentMapper* GaussCoincidentMapper_New(
-	Name								name,
-	PICelleratorContext*			context,
-	IntegrationPointsSwarm*		integrationSwarm,
-	MaterialPointsSwarm*			materialSwarm )
+	Name                       name,
+	IntegrationPointsSwarm*    integrationSwarm,
+	MaterialPointsSwarm*       materialSwarm
+	)
 {
-	GaussCoincidentMapper* self = _GaussCoincidentMapper_DefaultNew( name );
-
-	self->isConstructed = True;
-	_IntegrationPointMapper_Init( self, context, integrationSwarm );
-   _OneToOneMapper_Init( self, materialSwarm );
-	_GaussCoincidentMapper_Init( self );
+	GaussCoincidentMapper* self = (GaussCoincidentMapper*) _GaussCoincidentMapper_New(
+		sizeof(GaussCoincidentMapper),
+		GaussCoincidentMapper_Type,
+		_GaussCoincidentMapper_Delete,
+		_GaussCoincidentMapper_Print,
+		_GaussCoincidentMapper_Copy,
+		_GaussCoincidentMapper_DefaultNew,
+		_GaussCoincidentMapper_Construct,
+		_GaussCoincidentMapper_Build,
+		_GaussCoincidentMapper_Initialise,
+		_GaussCoincidentMapper_Execute,
+		_GaussCoincidentMapper_Destroy,
+		_GaussCoincidentMapper_Map,
+		_OneToOneMapper_GetMaterialPointsSwarms,
+		_OneToOneMapper_GetMaterialIndexOn,
+		_OneToOneMapper_GetExtensionOn,
+		name,
+		True, /* initFlag */
+		integrationSwarm,
+		materialSwarm
+		);
 
 	return self;
 }
 
+
 void* _GaussCoincidentMapper_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                                 _sizeOfSelf = sizeof(GaussCoincidentMapper);
-	Type                                                                         type = GaussCoincidentMapper_Type;
-	Stg_Class_DeleteFunction*                                                 _delete = _GaussCoincidentMapper_Delete;
-	Stg_Class_PrintFunction*                                                   _print = _GaussCoincidentMapper_Print;
-	Stg_Class_CopyFunction*                                                     _copy = _GaussCoincidentMapper_Copy;
-	Stg_Component_DefaultConstructorFunction*                     _defaultConstructor = _GaussCoincidentMapper_DefaultNew;
-	Stg_Component_ConstructFunction*                                       _construct = _GaussCoincidentMapper_AssignFromXML;
-	Stg_Component_BuildFunction*                                               _build = _GaussCoincidentMapper_Build;
-	Stg_Component_InitialiseFunction*                                     _initialise = _GaussCoincidentMapper_Initialise;
-	Stg_Component_ExecuteFunction*                                           _execute = _GaussCoincidentMapper_Execute;
-	Stg_Component_DestroyFunction*                                           _destroy = _GaussCoincidentMapper_Destroy;
-	AllocationType                                                 nameAllocationType = NON_GLOBAL;
-	IntegrationPointMapper_MapFunction*                                          _map = _GaussCoincidentMapper_Map;
-	IntegrationPointMapper_GetMaterialPointsSwarmsFunction*  _getMaterialPointsSwarms = _OneToOneMapper_GetMaterialPointsSwarms;
-	IntegrationPointMapper_GetMaterialIndexOnFunction*            _getMaterialIndexOn = _OneToOneMapper_GetMaterialIndexOn;
-	IntegrationPointMapper_GetExtensionOnFunction*                    _getExtensionOn = _OneToOneMapper_GetExtensionOn;
-        IntegrationPointMapper_GetDoubleFromExtension*                  _getDoubleFromExtension = _OneToOneMapper_GetDoubleFromExtension;
-    IntegrationPointMapper_GetDoubleFromMaterial*                  _getDoubleFromMaterial = _OneToOneMapper_GetDoubleFromMaterial;
-
-	return _GaussCoincidentMapper_New(  GAUSSCOINCIDENTMAPPER_PASSARGS  );
+	return _GaussCoincidentMapper_New(
+			sizeof(GaussCoincidentMapper),
+			GaussCoincidentMapper_Type,
+			_GaussCoincidentMapper_Delete,
+			_GaussCoincidentMapper_Print,
+			_GaussCoincidentMapper_Copy,
+			_GaussCoincidentMapper_DefaultNew,
+			_GaussCoincidentMapper_Construct,
+			_GaussCoincidentMapper_Build,
+			_GaussCoincidentMapper_Initialise,
+			_GaussCoincidentMapper_Execute,
+			_GaussCoincidentMapper_Destroy,
+			_GaussCoincidentMapper_Map,
+			_OneToOneMapper_GetMaterialPointsSwarms,
+			_OneToOneMapper_GetMaterialIndexOn,
+			_OneToOneMapper_GetExtensionOn,
+			name,
+			False,
+			NULL,
+			NULL );
 }
 
-GaussCoincidentMapper* _GaussCoincidentMapper_New(  GAUSSCOINCIDENTMAPPER_DEFARGS  ) {
+
+GaussCoincidentMapper* _GaussCoincidentMapper_New(
+		SizeT                                                           _sizeOfSelf,
+		Type                                                            type,
+		Stg_Class_DeleteFunction*                                       _delete,
+		Stg_Class_PrintFunction*                                        _print,
+		Stg_Class_CopyFunction*                                         _copy,
+		Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+		Stg_Component_ConstructFunction*                                _construct,
+		Stg_Component_BuildFunction*                                    _build,
+		Stg_Component_InitialiseFunction*                               _initialise,
+		Stg_Component_ExecuteFunction*                                  _execute,
+		Stg_Component_DestroyFunction*                                  _destroy,
+		IntegrationPointMapper_MapFunction*                             _map,
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+		IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+		IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+		Name                                                            name,
+		Bool                                                            initFlag,
+		IntegrationPointsSwarm*                                         integrationSwarm,
+		MaterialPointsSwarm*                                            materialSwarm )
+{
 	GaussCoincidentMapper* result;
 
-	result = (GaussCoincidentMapper*)_OneToOneMapper_New(  ONETOONEMAPPER_PASSARGS  );
-
+	result = (GaussCoincidentMapper*)_OneToOneMapper_New(
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_map,
+			_getMaterialPointsSwarms,
+			_getMaterialIndexOn,
+			_getExtensionOn,
+			name,
+			initFlag,
+			integrationSwarm,
+			materialSwarm );
+	if (initFlag) {
+		_GaussCoincidentMapper_Init( result, integrationSwarm, materialSwarm );
+	}
+		
 	return result;
 }
 
-void _GaussCoincidentMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
-
-	_OneToOneMapper_AssignFromXML( self, cf, data );
+void _GaussCoincidentMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+	_OneToOneMapper_Construct( mapper, cf, data );
 }
 
-void _GaussCoincidentMapper_Init( void* mapper ) {
+void _GaussCoincidentMapper_Init(
+		void*                   mapper,
+		IntegrationPointsSwarm* integrationSwarm,
+		MaterialPointsSwarm*    materialSwarm ) 
+{
+	_OneToOneMapper_Init( mapper, integrationSwarm, materialSwarm );
 }
 
 void _GaussCoincidentMapper_Delete( void* mapper ) {
-	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
-
-	_OneToOneMapper_Delete( self );
+	_IntegrationPointMapper_Delete( mapper );
 }
-
 void _GaussCoincidentMapper_Print( void* mapper, Stream* stream ) {
-	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
-
-	_IntegrationPointMapper_Print( self, stream );
+	_IntegrationPointMapper_Print( mapper, stream );
 }
-
 void* _GaussCoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	return _IntegrationPointMapper_Copy( mapper, dest, deep, nameExt, ptrMap );
 }
 
 void _GaussCoincidentMapper_Build( void* mapper, void* cf ) {
-	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
-
-	_OneToOneMapper_Build( self, cf );
+	_OneToOneMapper_Build( mapper, cf );
 }
 
 void _GaussCoincidentMapper_Initialise( void* mapper, void* cf ) {
-	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
-
-	_OneToOneMapper_Initialise( self, cf );
+	_OneToOneMapper_Initialise( mapper, cf );
 }
 
 void _GaussCoincidentMapper_Execute( void* mapper, void* data ) {
 }
 
 void _GaussCoincidentMapper_Destroy( void* mapper, void* data ) {
-	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
-
-	_OneToOneMapper_Destroy( self, data );
 }
 
 void _GaussCoincidentMapper_Map( void* mapper ) {
-	GaussCoincidentMapper*	self = (GaussCoincidentMapper*)mapper;
-	IntegrationPointsSwarm*	integrationSwarm = self->integrationSwarm;
-	MaterialPointsSwarm*    materialSwarm = self->materialSwarm;
-	IntegrationPoint*			integrationPoint;
-	MaterialPoint*				materialPoint;
-	MaterialPointRef*			ref;
-	Particle_Index				particle_lI;
-#if 0
-	FeMesh*						mesh = materialSwarm->mesh;
-	Cell_Index					cell_dI;
-#endif
+	GaussCoincidentMapper*       self                   = (GaussCoincidentMapper*)mapper;
 
-#ifdef CAUTIOUS
-    Index						dim_I;
-    Stream*						errorStream = Journal_Register( Error_Type, (Name)self->type  );
-#endif
-    Stream*						debugStream = Swarm_Debug;
+	IntegrationPointsSwarm* integrationSwarm       = self->integrationSwarm;
+	MaterialPointsSwarm*    materialSwarm          = self->materialSwarm;
+
+	IntegrationPoint*       integrationPoint;
+	MaterialPoint*          materialPoint;
+	MaterialPointRef*       ref;
+
+	FeMesh*     mesh                   = materialSwarm->mesh;
+
+	Particle_Index          particle_lI;
+	Cell_Index              cell_dI;
+
+	#ifdef CAUTIOUS
+	Index			dim_I;
+	Stream*                 errorStream = Journal_Register( Error_Type, self->type );
+	#endif
+	Stream*                 debugStream = Swarm_Debug;
 	
 #if 0
 	Journal_DPrintfL( debugStream, 1, "In %s(): Re-creating a new set of integration points, exactly\n" 
-		"\tmapping to the current material points & their positions.\n", __func__ ) ;
+		"\tmapping to the current material points & their positions.\n",
+		__func__ ) ;
 	Stream_IndentBranch( debugStream );
 
 	Journal_DPrintfL( debugStream, 2, "Reallocating the integration points array from size of %u points "
@@ -191,34 +242,34 @@ void _GaussCoincidentMapper_Map( void* m
 
 	Journal_DPrintfL( debugStream, 2, "Clearing all the cell->particle ownership tables, "
 		"ready to add new cell->particle\n\trelationships as new integration points are set up.\n" );
-
 	for( cell_dI = 0; cell_dI < materialSwarm->cellDomainCount; cell_dI++ ) {
-		materialSwarm->cellParticleCountTbl[cell_dI] = 0;
-		materialSwarm->cellParticleSizeTbl[cell_dI] = 0;
-
-		if ( materialSwarm->cellParticleTbl[cell_dI] ) {
-			Memory_Free( materialSwarm->cellParticleTbl[cell_dI] );
-		}
-		materialSwarm->cellParticleTbl[cell_dI] = NULL;
+	    materialSwarm->cellParticleCountTbl[cell_dI] = 0;
+	    materialSwarm->cellParticleSizeTbl[cell_dI] = 0;
+	    if ( materialSwarm->cellParticleTbl[cell_dI] ) {
+		Memory_Free( materialSwarm->cellParticleTbl[cell_dI] );
+	    }
+	    materialSwarm->cellParticleTbl[cell_dI] = NULL;
 	}
 
 	Journal_DPrintfL( debugStream, 2, "For each material particle, setting up a corresponding integration "
 		"point, and\n\tcalculating its element-local coord based on the material's global coord:\n" );
-		Stream_IndentBranch( debugStream );
+	Stream_IndentBranch( debugStream );
 #endif
 
 	/* Map each point */
 	for ( particle_lI = 0; particle_lI < integrationSwarm->particleLocalCount; particle_lI++ ) {
 		integrationPoint = (IntegrationPoint*)Swarm_ParticleAt( integrationSwarm, particle_lI );
-		materialPoint = (MaterialPoint*)Swarm_ParticleAt( materialSwarm, particle_lI );
+		materialPoint    = (MaterialPoint*)   Swarm_ParticleAt( materialSwarm, particle_lI );
 
 #if 0
 		cell_dI = integrationPoint->owningCell;
 
-		Journal_DPrintfL( debugStream, 3, "Referring to local material point %u, from material swarm cell %u:\n", particle_lI, cell_dI );
+		Journal_DPrintfL( debugStream, 3, "Referring to local material point %u, from material swarm cell %u:\n",
+			particle_lI, cell_dI );
 		Stream_IndentBranch( debugStream );
 
-		Journal_DPrintfL( debugStream, 3, "Adding new integration point %u to integration swarm cell %u\n", particle_lI, cell_dI );
+		Journal_DPrintfL( debugStream, 3, "Adding new integration point %u to integration swarm cell %u\n",
+			particle_lI, cell_dI );
 
 		Swarm_AddParticleToCell( materialSwarm, cell_dI, particle_lI );
 
@@ -246,7 +297,4 @@ void _GaussCoincidentMapper_Map( void* m
 	Stream_UnIndentBranch( debugStream );
 	Journal_DPrintfL( debugStream, 1, "...%s(): Done.\n", __func__ );
 #endif
-
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/GaussCoincidentMapper.h
--- a/MaterialPoints/src/GaussCoincidentMapper.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/GaussCoincidentMapper.h	Tue Feb 02 16:55:08 2010 +1100
@@ -40,17 +40,17 @@
 **
 */
 /** \file
- **  Role:
- **	A OneToOne mapping between MaterialPointsSwarm and IntegrationPointsSwarm where the translation a direct
- **      global to local coordinates 
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: GaussCoincidentMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**	A OneToOne mapping between MaterialPointsSwarm and IntegrationPointsSwarm where the translation a direct
+**      global to local coordinates 
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: GaussCoincidentMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_MaterialPoints_GaussCoincidentMapper_h__
 #define __PICellerator_MaterialPoints_GaussCoincidentMapper_h__
@@ -63,53 +63,55 @@
 
 	struct GaussCoincidentMapper { __GaussCoincidentMapper };
 
+	GaussCoincidentMapper* GaussCoincidentMapper_New(
+			Name                       name,
+			IntegrationPointsSwarm*    integrationSwarm,
+			MaterialPointsSwarm*       materialSwarm);	
+	
+	GaussCoincidentMapper* _GaussCoincidentMapper_New(
+			SizeT                                                           _sizeOfSelf,
+			Type                                                            type,
+			Stg_Class_DeleteFunction*                                       _delete,
+			Stg_Class_PrintFunction*                                        _print,
+			Stg_Class_CopyFunction*                                         _copy,
+			Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+			Stg_Component_ConstructFunction*                                _construct,
+			Stg_Component_BuildFunction*                                    _build,
+			Stg_Component_InitialiseFunction*                               _initialise,
+			Stg_Component_ExecuteFunction*                                  _execute,
+			Stg_Component_DestroyFunction*                                  _destroy,
+			IntegrationPointMapper_MapFunction*                             _map,
+			IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+			IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+			IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+			Name                                                            name,
+			Bool                                                            initFlag,
 
+			IntegrationPointsSwarm*                                         integrationSwarm,
+			MaterialPointsSwarm*                                            materialSwarm );
 
-	GaussCoincidentMapper* GaussCoincidentMapper_New(
-		Name							name,
-		PICelleratorContext*		context,
-		IntegrationPointsSwarm*	integrationSwarm,
-		MaterialPointsSwarm*		materialSwarm);	
-	
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
+	void _GaussCoincidentMapper_Init(
+			void*                   mapper,
+			IntegrationPointsSwarm* integrationSwarm,
+			MaterialPointsSwarm*    materialSwarm );
 
-	#define GAUSSCOINCIDENTMAPPER_DEFARGS \
-                ONETOONEMAPPER_DEFARGS
-
-	#define GAUSSCOINCIDENTMAPPER_PASSARGS \
-                ONETOONEMAPPER_PASSARGS
-
-	GaussCoincidentMapper* _GaussCoincidentMapper_New(  GAUSSCOINCIDENTMAPPER_DEFARGS  );
-
-	void _GaussCoincidentMapper_Init( void* mapper );
 
 	void _GaussCoincidentMapper_Delete( void* mapper );
-
 	void _GaussCoincidentMapper_Print( void* mapper, Stream* stream );
-
 	#define GaussCoincidentMapper_Copy( self ) \
 		(GaussCoincidentMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define GaussCoincidentMapper_DeepCopy( self ) \
 		(GaussCoincidentMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
 	void* _GaussCoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	void* _GaussCoincidentMapper_DefaultNew( Name name );
+void _GaussCoincidentMapper_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _GaussCoincidentMapper_Build( void* mapper, void* data ) ;
+	void _GaussCoincidentMapper_Initialise( void* mapper, void* data ) ;
+	void _GaussCoincidentMapper_Execute( void* mapper, void* data );
+	void _GaussCoincidentMapper_Destroy( void* mapper, void* data ) ;
+	
 
-	void _GaussCoincidentMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
-
-	void _GaussCoincidentMapper_Build( void* mapper, void* data );
-
-	void _GaussCoincidentMapper_Initialise( void* mapper, void* data );
-
-	void _GaussCoincidentMapper_Execute( void* mapper, void* data );
-
-	void _GaussCoincidentMapper_Destroy( void* mapper, void* data );
-		
 	void _GaussCoincidentMapper_Map( void* mapper );
 	
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/GaussMapper.c
--- a/MaterialPoints/src/GaussMapper.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/GaussMapper.c	Tue Feb 02 16:55:08 2010 +1100
@@ -44,115 +44,144 @@
 
 const Type GaussMapper_Type = "GaussMapper";
 
-GaussMapper* _GaussMapper_New(  GAUSSMAPPER_DEFARGS  ) {
+GaussMapper* _GaussMapper_New(
+		SizeT                                                           _sizeOfSelf,
+		Type                                                            type,
+		Stg_Class_DeleteFunction*                                       _delete,
+		Stg_Class_PrintFunction*                                        _print,
+		Stg_Class_CopyFunction*                                         _copy,
+		Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+		Stg_Component_ConstructFunction*                                _construct,
+		Stg_Component_BuildFunction*                                    _build,
+		Stg_Component_InitialiseFunction*                               _initialise,
+		Stg_Component_ExecuteFunction*                                  _execute,
+		Stg_Component_DestroyFunction*                                  _destroy,
+		IntegrationPointMapper_MapFunction*                             _map,
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+		IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+		IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+		Name                                                            name,
+		Bool                                                            initFlag,
+
+		IntegrationPointsSwarm*                                         integrationSwarm,
+		MaterialPointsSwarm*                                            materialSwarm )
+{
 	GaussMapper* result;
 
-	result = (GaussMapper*)_OneToOneMapper_New(  ONETOONEMAPPER_PASSARGS  );
+	result = (GaussMapper*)_OneToOneMapper_New(
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_map,
+			_getMaterialPointsSwarms,
+			_getMaterialIndexOn,
+			_getExtensionOn,
+			name,
+			initFlag,
+			integrationSwarm,
+			materialSwarm );
 
+	if (initFlag) {
+		_GaussMapper_Init( result, integrationSwarm, materialSwarm );
+	}
 	return result;
 }
 
-void* _GaussMapper_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                                 _sizeOfSelf = sizeof(GaussMapper);
-	Type                                                                         type = GaussMapper_Type;
-	Stg_Class_DeleteFunction*                                                 _delete = _GaussMapper_Delete;
-	Stg_Class_PrintFunction*                                                   _print = _GaussMapper_Print;
-	Stg_Class_CopyFunction*                                                     _copy = _GaussMapper_Copy;
-	Stg_Component_DefaultConstructorFunction*                     _defaultConstructor = _GaussMapper_DefaultNew;
-	Stg_Component_ConstructFunction*                                       _construct = _GaussMapper_AssignFromXML;
-	Stg_Component_BuildFunction*                                               _build = _GaussMapper_Build;
-	Stg_Component_InitialiseFunction*                                     _initialise = _GaussMapper_Initialise;
-	Stg_Component_ExecuteFunction*                                           _execute = _GaussMapper_Execute;
-	Stg_Component_DestroyFunction*                                           _destroy = _GaussMapper_Destroy;
-	AllocationType                                                 nameAllocationType = NON_GLOBAL;
-	IntegrationPointMapper_MapFunction*                                          _map = _GaussMapper_Map;
-	IntegrationPointMapper_GetMaterialPointsSwarmsFunction*  _getMaterialPointsSwarms = _OneToOneMapper_GetMaterialPointsSwarms;
-	IntegrationPointMapper_GetMaterialIndexOnFunction*            _getMaterialIndexOn = _OneToOneMapper_GetMaterialIndexOn;
-	IntegrationPointMapper_GetExtensionOnFunction*                    _getExtensionOn = _OneToOneMapper_GetExtensionOn;
-    IntegrationPointMapper_GetDoubleFromExtension*                  _getDoubleFromExtension = _OneToOneMapper_GetDoubleFromExtension;
-	IntegrationPointMapper_GetDoubleFromMaterial*                  _getDoubleFromMaterial = _OneToOneMapper_GetDoubleFromMaterial;
-
-	return _GaussMapper_New(  GAUSSMAPPER_PASSARGS  );
-}
-
-void _GaussMapper_Init( void* mapper ) {
-	GaussMapper* self;
-
-	self = (GaussMapper*)mapper;
+void _GaussMapper_Init(
+		void*                   mapper,
+		IntegrationPointsSwarm* integrationSwarm,
+		MaterialPointsSwarm*    materialSwarm ) 
+{
+	_OneToOneMapper_Init( mapper, integrationSwarm, materialSwarm );
 }
 
 void _GaussMapper_Delete( void* mapper ) {
-	GaussMapper* self = (GaussMapper*)mapper;
-
-	_OneToOneMapper_Delete( self );
+	_IntegrationPointMapper_Delete( mapper );
 }
-
 void _GaussMapper_Print( void* mapper, Stream* stream ) {
-	GaussMapper* self = (GaussMapper*)mapper;
-
-	_OneToOneMapper_Print( self, stream );
+	_IntegrationPointMapper_Print( mapper, stream );
 }
-
 void* _GaussMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	return _IntegrationPointMapper_Copy( mapper, dest, deep, nameExt, ptrMap );
 }
 
-void _GaussMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+void* _GaussMapper_DefaultNew( Name name ) {
+	return _GaussMapper_New(
+			sizeof(GaussMapper),
+			GaussMapper_Type,
+			_GaussMapper_Delete,
+			_GaussMapper_Print,
+			_GaussMapper_Copy,
+			_GaussMapper_DefaultNew,
+			_GaussMapper_Construct,
+			_GaussMapper_Build,
+			_GaussMapper_Initialise,
+			_GaussMapper_Execute,
+			_GaussMapper_Destroy,
+			_GaussMapper_Map,
+			_OneToOneMapper_GetMaterialPointsSwarms,
+			_OneToOneMapper_GetMaterialIndexOn,
+			_OneToOneMapper_GetExtensionOn,
+			name,
+			False,
+			NULL,
+			NULL );
+}
+
+void _GaussMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
 	GaussMapper* self = (GaussMapper*)mapper;
 	
-	_OneToOneMapper_AssignFromXML( mapper, cf, data );
+	_OneToOneMapper_Construct( mapper, cf, data );
 
 	/* Validate assumptions on the layouts the swarms use */
+	
 	Journal_Firewall(
-		Stg_Class_IsInstance( self->integrationSwarm->particleLayout, GaussParticleLayout_Type ) ||
-		Stg_Class_IsInstance( self->integrationSwarm->particleLayout, TriGaussParticleLayout_Type ),
-		Journal_MyStream( Error_Type, self ),
-		"In func %s, To use Gauss mapper, the integration point swarm %s must use a %s\n",
-		__func__,
-		self->integrationSwarm->name,
-		GaussParticleLayout_Type );
-
+			Stg_Class_IsInstance( self->integrationSwarm->particleLayout, GaussParticleLayout_Type ) ||
+			Stg_Class_IsInstance( self->integrationSwarm->particleLayout, TriGaussParticleLayout_Type ),
+			Journal_MyStream( Error_Type, self ),
+			"In func %s, To use Gauss mapper, the integration point swarm %s must use a %s\n",
+			__func__,
+			self->integrationSwarm->name,
+			GaussParticleLayout_Type );
 	Journal_Firewall(
-		Stg_Class_IsInstance( self->materialSwarm->particleLayout, BackgroundParticleLayout_Type ),
-		Journal_MyStream( Error_Type, self ),
-		"In func %s, To use Gauss mapper, the material point swarm %s must use a %s\n",
-		__func__,
-		self->materialSwarm->particleLayout,
-		BackgroundParticleLayout_Type );
-
-	_GaussMapper_Init( self );
+			Stg_Class_IsInstance( self->materialSwarm->particleLayout, BackgroundParticleLayout_Type ),
+			Journal_MyStream( Error_Type, self ),
+			"In func %s, To use Gauss mapper, the material point swarm %s must use a %s\n",
+			__func__,
+			self->materialSwarm->particleLayout,
+			BackgroundParticleLayout_Type );
 }
 
 void _GaussMapper_Build( void* mapper, void* cf ) {
-	GaussMapper* self = (GaussMapper*)mapper;
-
-	_OneToOneMapper_Build( self, cf );
+	_OneToOneMapper_Build( mapper, cf );
 }
-
 void _GaussMapper_Initialise( void* mapper, void* cf ) {
-	GaussMapper* self = (GaussMapper*)mapper;
-
-	_OneToOneMapper_Initialise( self, cf );
+	_OneToOneMapper_Initialise( mapper, cf );
 }
-
 void _GaussMapper_Execute( void* mapper, void* data ) {
 }
-
 void _GaussMapper_Destroy( void* mapper, void* data ) {
-	GaussMapper* self = (GaussMapper*)mapper;
-
-	_OneToOneMapper_Destroy( self, data );
 }
 
 void _GaussMapper_Map( void* mapper ) {
-	GaussMapper*				self = (GaussMapper*)mapper;
-	IntegrationPointsSwarm*	integrationSwarm = self->integrationSwarm;
-	MaterialPointsSwarm*		materialSwarm = self->materialSwarm;
-	IntegrationPoint*			integrationPoint;
-	MaterialPoint*				materialPoint;
-	MaterialPointRef*			ref;
-	Particle_Index				point_I;
+	GaussMapper*            self                   = (GaussMapper*)mapper;
+
+	IntegrationPointsSwarm* integrationSwarm       = self->integrationSwarm;
+	MaterialPointsSwarm*    materialSwarm          = self->materialSwarm;
+
+	IntegrationPoint*       integrationPoint;
+	MaterialPoint*          materialPoint;
+	MaterialPointRef*       ref;
+
+	Particle_Index          point_I;
 
 	materialPoint = (MaterialPoint*)Swarm_ParticleAt( materialSwarm, 0 ); /* Get the first and only point */
 	
@@ -165,5 +194,3 @@ void _GaussMapper_Map( void* mapper ) {
 		ref->particle_I = 0;
 	}
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/GaussMapper.h
--- a/MaterialPoints/src/GaussMapper.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/GaussMapper.h	Tue Feb 02 16:55:08 2010 +1100
@@ -19,17 +19,17 @@
 **
 */
 /** \file
- **  Role:
- **	A OneToOne mapping between MaterialPointsSwarm and IntegrationPointsSwarm where the integration swarm uses a gauss
- **	layout so xi and weight calculation isn't needed. The materialPointsSwarm is assumed to use a BackgroundParticleLayout.
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: GaussMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**	A OneToOne mapping between MaterialPointsSwarm and IntegrationPointsSwarm where the integration swarm uses a gauss
+**	layout so xi and weight calculation isn't needed. The materialPointsSwarm is assumed to use a BackgroundParticleLayout.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: GaussMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_MaterialPoints_GaussMapper_h__
 #define __PICellerator_MaterialPoints_GaussMapper_h__
@@ -41,48 +41,50 @@
 		__OneToOneMapper 
 
 	struct GaussMapper { __GaussMapper };
+		
+	GaussMapper* _GaussMapper_New(
+			SizeT                                                           _sizeOfSelf,
+			Type                                                            type,
+			Stg_Class_DeleteFunction*                                       _delete,
+			Stg_Class_PrintFunction*                                        _print,
+			Stg_Class_CopyFunction*                                         _copy,
+			Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+			Stg_Component_ConstructFunction*                                _construct,
+			Stg_Component_BuildFunction*                                    _build,
+			Stg_Component_InitialiseFunction*                               _initialise,
+			Stg_Component_ExecuteFunction*                                  _execute,
+			Stg_Component_DestroyFunction*                                  _destroy,
+			IntegrationPointMapper_MapFunction*                             _map,
+			IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+			IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+			IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+			Name                                                            name,
+			Bool                                                            initFlag,
+			IntegrationPointsSwarm*                                         integrationSwarm,
+			MaterialPointsSwarm*                                            materialSwarm );
 
-		
+	void _GaussMapper_Init(
+			void*                   mapper,
+			IntegrationPointsSwarm* integrationSwarm,
+			MaterialPointsSwarm*    materialSwarm );
 
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define GAUSSMAPPER_DEFARGS \
-                ONETOONEMAPPER_DEFARGS
-
-	#define GAUSSMAPPER_PASSARGS \
-                ONETOONEMAPPER_PASSARGS
-
-	GaussMapper* _GaussMapper_New(  GAUSSMAPPER_DEFARGS  );
-
-	void _GaussMapper_Init( void* mapper );
 
 	void _GaussMapper_Delete( void* mapper );
-
 	void _GaussMapper_Print( void* mapper, Stream* stream );
-
 	#define GaussMapper_Copy( self ) \
 		(GaussMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define GaussMapper_DeepCopy( self ) \
 		(GaussMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
 	void* _GaussMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	void* _GaussMapper_DefaultNew( Name name );
+void _GaussMapper_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _GaussMapper_Build( void* mapper, void* data ) ;
+	void _GaussMapper_Initialise( void* mapper, void* data ) ;
+	void _GaussMapper_Execute( void* mapper, void* data );
+	void _GaussMapper_Destroy( void* mapper, void* data ) ;
+	
 
-	void _GaussMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
-
-	void _GaussMapper_Build( void* mapper, void* data );
-
-	void _GaussMapper_Initialise( void* mapper, void* data );
-
-	void _GaussMapper_Execute( void* mapper, void* data );
-
-	void _GaussMapper_Destroy( void* mapper, void* data );
-	
 	void _GaussMapper_Map( void* mapper );
 	
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/Init.c
--- a/MaterialPoints/src/Init.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/Init.c	Tue Feb 02 16:55:08 2010 +1100
@@ -56,29 +56,30 @@ Bool PICellerator_MaterialPoints_Init( i
 Bool PICellerator_MaterialPoints_Init( int* argc, char** argv[] ) {
 	Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
 
-	Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
 
-	Stg_ComponentRegister_Add( componentsRegister, PICelleratorContext_Type, (Name)"0", _PICelleratorContext_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, PICelleratorContext_Type,      "0", _PICelleratorContext_DefaultNew );
 
-	Stg_ComponentRegister_Add( componentsRegister, BackgroundParticleLayout_Type, (Name)"0", _BackgroundParticleLayout_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, BackgroundParticleLayout_Type, "0", _BackgroundParticleLayout_DefaultNew );
 	
-	Stg_ComponentRegister_Add( componentsRegister, MappedParticleLayout_Type, (Name)"0", _MappedParticleLayout_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, IntegrationPointsSwarm_Type, (Name)"0", _IntegrationPointsSwarm_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, MaterialPointsSwarm_Type, (Name)"0", _MaterialPointsSwarm_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, MappedParticleLayout_Type,     "0", _MappedParticleLayout_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, IntegrationPointsSwarm_Type,   "0", _IntegrationPointsSwarm_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, MaterialPointsSwarm_Type,      "0", _MaterialPointsSwarm_DefaultNew );
 	
-	Stg_ComponentRegister_Add( componentsRegister, MaterialFeVariable_Type, (Name)"0", _MaterialFeVariable_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, Material_Type, (Name)"0", _Material_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, MaterialFeVariable_Type,       "0", _MaterialFeVariable_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, Material_Type,                 "0", _Material_DefaultNew );
 	
-	Stg_ComponentRegister_Add( componentsRegister, CoincidentMapper_Type, (Name)"0", _CoincidentMapper_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, GaussCoincidentMapper_Type, (Name)"0", _GaussCoincidentMapper_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, GaussMapper_Type, (Name)"0", _GaussMapper_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, CoincidentMapper_Type,         "0", _CoincidentMapper_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, GaussCoincidentMapper_Type,    "0", _GaussCoincidentMapper_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, GaussMapper_Type,              "0", _GaussMapper_DefaultNew );
 	
-	Stg_ComponentRegister_Add( componentsRegister, SwarmAdvector_Type, (Name)"0", _SwarmAdvector_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, SwarmAdvectionInAPlane_Type, (Name)"0", _SwarmAdvectionInAPlane_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, SwarmAdvector_Type,            "0", _SwarmAdvector_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, SwarmAdvectionInAPlane_Type,            "0", _SwarmAdvectionInAPlane_DefaultNew );
 
-	Stg_ComponentRegister_Add( componentsRegister, PeriodicBoundariesManager_Type, (Name)"0", _PeriodicBoundariesManager_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, PeriodicBoundariesManager_Type,"0", _PeriodicBoundariesManager_DefaultNew );
 	
-	Stg_ComponentRegister_Add( componentsRegister, SwarmVariableField_Type, (Name)"0", _SwarmVariableField_DefaultNew  );
+	/* dave, 18.09.07 */
+	Stg_ComponentRegister_Add( componentsRegister, SwarmVariableField_Type,"0", _SwarmVariableField_DefaultNew );
 
 	/* Doing this in alphabetical order to match ls output */
 	RegisterParent( BackgroundParticleLayout_Type,  ParticleLayout_Type );
@@ -95,10 +96,9 @@ Bool PICellerator_MaterialPoints_Init( i
 	RegisterParent( Materials_Register_Type,        NamedObject_Register_Type );
 	RegisterParent( MaterialPointsSwarm_Type,       Swarm_Type );
 	RegisterParent( OneToOneMapper_Type,            IntegrationPointMapper_Type );
-	RegisterParent(OneToManyMapper_Type, IntegrationPointMapper_Type);
 	RegisterParent( ParticleFeVariable_Type,        FeVariable_Type );
 	RegisterParent( PeriodicBoundariesManager_Type, Stg_Component_Type );
-	RegisterParent( SwarmAdvector_Type,             TimeIntegrand_Type );
+	RegisterParent( SwarmAdvector_Type,             TimeIntegratee_Type );
 	RegisterParent( SwarmAdvectionInAPlane_Type,            SwarmAdvector_Type );
 	
 	/* dave, 18.09.07 */
@@ -107,5 +107,3 @@ Bool PICellerator_MaterialPoints_Init( i
 
 	return True;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/IntegrationPointMapper.c
--- a/MaterialPoints/src/IntegrationPointMapper.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/IntegrationPointMapper.c	Tue Feb 02 16:55:08 2010 +1100
@@ -58,34 +58,68 @@
 
 const Type IntegrationPointMapper_Type = "IntegrationPointMapper";
 
-IntegrationPointMapper* _IntegrationPointMapper_New(  INTEGRATIONPOINTMAPPER_DEFARGS  ) {
+IntegrationPointMapper* _IntegrationPointMapper_New(
+		SizeT                                                           _sizeOfSelf,
+		Type                                                            type,
+		Stg_Class_DeleteFunction*                                       _delete,
+		Stg_Class_PrintFunction*                                        _print,
+		Stg_Class_CopyFunction*                                         _copy,
+		Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+		Stg_Component_ConstructFunction*                                _construct,
+		Stg_Component_BuildFunction*                                    _build,
+		Stg_Component_InitialiseFunction*                               _initialise,
+		Stg_Component_ExecuteFunction*                                  _execute,
+		Stg_Component_DestroyFunction*                                  _destroy,
+		IntegrationPointMapper_MapFunction*                             _map,
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+		IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+		IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+		Name                                                            name,
+		Bool                                            initFlag,
+		IntegrationPointsSwarm*                                         integrationSwarm )
+{
 	IntegrationPointMapper* self;
 
-	self = (IntegrationPointMapper*)_Stg_Component_New(  STG_COMPONENT_PASSARGS  );
+	self = (IntegrationPointMapper*)_Stg_Component_New(
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			name,
+			NON_GLOBAL );
 
-	self->_map = _map;
-	self->_getMaterialPointsSwarms = _getMaterialPointsSwarms;
-	self->_getMaterialIndexOn = _getMaterialIndexOn;
-	self->_getExtensionOn = _getExtensionOn;
-    self->_getDoubleFromExtension        = _getDoubleFromExtension;
-	self->_getDoubleFromMaterial         = _getDoubleFromMaterial;
+	self->_map                           = _map;
+	self->_getMaterialPointsSwarms       = _getMaterialPointsSwarms;
+	self->_getMaterialIndexOn            = _getMaterialIndexOn;
+	self->_getExtensionOn                = _getExtensionOn;
+
+	if (initFlag) {
+		_IntegrationPointMapper_Init( self, integrationSwarm );
+	}
 
 	return self;
 }
 
-void _IntegrationPointMapper_Init( void* mapper, PICelleratorContext* context, IntegrationPointsSwarm* integrationSwarm ) {
+void _IntegrationPointMapper_Init( void* mapper, IntegrationPointsSwarm* integrationSwarm ) {
 	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
-	self->context = context;
 	self->integrationSwarm = integrationSwarm;
 }
 
 void _IntegrationPointMapper_Delete( void* mapper ) {
 	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
+	Stg_Class_Delete( self->integrationSwarm );
+
 	_Stg_Component_Delete( self );
 }
-
 void _IntegrationPointMapper_Print( void* mapper, Stream* stream ) {
 	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 	
@@ -98,7 +132,6 @@ void _IntegrationPointMapper_Print( void
 
 	Stream_UnIndent( stream );
 }
-
 void* _IntegrationPointMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 	IntegrationPointMapper* newCopy = (IntegrationPointMapper*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
@@ -108,39 +141,28 @@ void* _IntegrationPointMapper_Copy( void
 	return newCopy;
 }
 
-void _IntegrationPointMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-	IntegrationPointMapper*	self = (IntegrationPointMapper*)mapper;
-	IntegrationPointsSwarm*	integrationSwarm;
-	PICelleratorContext*		context;
+void _IntegrationPointMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
-	context = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Context", PICelleratorContext, False, data );
-	if( !context  ) 
-		context = Stg_ComponentFactory_ConstructByName( cf, (Name)"context", PICelleratorContext, True, data  );
+	IntegrationPointsSwarm* integrationSwarm;
 
-	integrationSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)IntegrationPointsSwarm_Type, IntegrationPointsSwarm, True, data  );
+	integrationSwarm = Stg_ComponentFactory_ConstructByKey( 
+				cf, 
+				self->name, 
+				IntegrationPointsSwarm_Type, 
+				IntegrationPointsSwarm,
+				True,
+				data  );
 	
-	_IntegrationPointMapper_Init( self, context, integrationSwarm );
+	_IntegrationPointMapper_Init( self, integrationSwarm );
 }
-
 void _IntegrationPointMapper_Build( void* mapper, void* data ) {
-	IntegrationPointMapper*	self;
-
-	self = (IntegrationPointMapper*)mapper;
 }
-
 void _IntegrationPointMapper_Initialise( void* mapper, void* data ) {
-	IntegrationPointMapper*	self;
-
-	self = (IntegrationPointMapper*)mapper;
 }
-
 void _IntegrationPointMapper_Execute( void* mapper, void* data ) {
 }
-
 void _IntegrationPointMapper_Destroy( void* mapper, void* data ) {
-	IntegrationPointMapper* self;
-	
-	self = (IntegrationPointMapper*)mapper;
 }
 
 void IntegrationPointMapper_Map( void* mapper ) {
@@ -160,18 +182,21 @@ Material_Index IntegrationPointMapper_Ge
 
 	return self->_getMaterialIndexOn( mapper, point );
 }
-
 void* IntegrationPointMapper_GetExtensionOnFunc( void* mapper, void* point, ExtensionInfo_Index extHandle ) {
 	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
 	return self->_getExtensionOn( mapper, point, extHandle );
 }
-
 Material_Index IntegrationPointMapper_GetMaterialIndexAtFunc( void* mapper, Index point_I ) {
 	IntegrationPointMapper* self  = (IntegrationPointMapper*)mapper;
 	void*                   point = Swarm_ParticleAt( self->integrationSwarm, point_I );
 
-	Journal_Firewall( point != NULL, Journal_MyStream( Error_Type, self ), "In func %s, no point in swarm of index %d\n", __func__, point_I );
+	Journal_Firewall(
+			point != NULL,
+			Journal_MyStream( Error_Type, self ),
+			"In func %s, no point in swarm of index %d\n",
+			__func__,
+			point_I );
 
 	return IntegrationPointMapper_GetMaterialIndexOn( mapper, point );
 }
@@ -179,9 +204,12 @@ void* IntegrationPointMapper_GetExtensio
 	IntegrationPointMapper* self  = (IntegrationPointMapper*)mapper;
 	void*                   point = Swarm_ParticleAt( self->integrationSwarm, point_I );
 
-	Journal_Firewall( point != NULL, Journal_MyStream( Error_Type, self ), "In func %s, no point in swarm of index %d\n", __func__, point_I );
+	Journal_Firewall(
+			point != NULL,
+			Journal_MyStream( Error_Type, self ),
+			"In func %s, no point in swarm of index %d\n",
+			__func__,
+			point_I );
 	
 	return IntegrationPointMapper_GetExtensionOn( mapper, point, extHandle );
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/IntegrationPointMapper.h
--- a/MaterialPoints/src/IntegrationPointMapper.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/IntegrationPointMapper.h	Tue Feb 02 16:55:08 2010 +1100
@@ -40,21 +40,21 @@
 **
 */
 /** \file
- **  Role:
- **     Abstract way to map integration points to a material properties.
- **     Under this scheme, IntegrationPointsSwarms are essentailly 'virtual' swarms that are generated/mapped 
- **     (and then reused/updated) at everytime time from the information obtained from MaterialPointsSwarm(s). 
- **     MaterialPointsSwarm can undergo advection which makes it very dynamic.
- **
- **     This provides an abstract interface to access integration and material point properties.
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: IntegrationPointMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**     Abstract way to map integration points to a material properties.
+**     Under this scheme, IntegrationPointsSwarms are essentailly 'virtual' swarms that are generated/mapped 
+**     (and then reused/updated) at everytime time from the information obtained from MaterialPointsSwarm(s). 
+**     MaterialPointsSwarm can undergo advection which makes it very dynamic.
+**
+**     This provides an abstract interface to access integration and material point properties.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: IntegrationPointMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_MaterialPoints_IntegrationPointMapper_h__
 #define __PICellerator_MaterialPoints_IntegrationPointMapper_h__
@@ -72,152 +72,118 @@
 	typedef Material_Index (IntegrationPointMapper_GetMaterialIndexOnFunction) ( void* mapper, void* point );
 
 	/** @see IntegrationPointMapper_GetExtensionOn */
-	typedef void* (IntegrationPointMapper_GetExtensionOnFunction) ( void* mapper, void* points, ExtensionInfo_Index extHandle );
-
-    typedef double (IntegrationPointMapper_GetDoubleFromExtension)(
-	    void*                   mapper,
-	    void*                   intPoint,
-	    ExtensionInfo_Index     extHandle,
-	    int                     offs );
-
-    typedef double (IntegrationPointMapper_GetDoubleFromMaterial)(
-	    void*                   mapper,
-	    void*                   intPoint,
-	    ExtensionInfo_Index     extHandle,
-	    int                     offs );
+	typedef void* (IntegrationPointMapper_GetExtensionOnFunction) ( 
+				void*                   mapper, 
+				void*                   points, 
+				ExtensionInfo_Index     extHandle );
 	
 	/* IntegrationPointMapper information */
 	#define __IntegrationPointMapper \
 		__Stg_Component \
 		\
-		PICelleratorContext*													context; \
 		/* Virtual functions */ \
-		IntegrationPointMapper_MapFunction*								_map; \
-		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*	_getMaterialPointsSwarms; \
-		IntegrationPointMapper_GetMaterialIndexOnFunction*			_getMaterialIndexOn; \
-		IntegrationPointMapper_GetExtensionOnFunction*				_getExtensionOn; \
-        IntegrationPointMapper_GetDoubleFromExtension*                  _getDoubleFromExtension; \
-        IntegrationPointMapper_GetDoubleFromExtension*                  _getDoubleFromMaterial; \
+		IntegrationPointMapper_MapFunction*                             _map; \
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms; \
+		IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn; \
+		IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn; \
 		\
 		/* General info */ \
-		IntegrationPointsSwarm*												integrationSwarm;
+		IntegrationPointsSwarm*                                     integrationSwarm;
 
 	struct IntegrationPointMapper { __IntegrationPointMapper };
-
-
+	
 	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Constructors
 	*/
+	IntegrationPointMapper* _IntegrationPointMapper_New(
+		SizeT                                                           _sizeOfSelf, 
+		Type                                                            type,
+		Stg_Class_DeleteFunction*                                       _delete,
+		Stg_Class_PrintFunction*                                        _print,
+		Stg_Class_CopyFunction*                                         _copy, 
+		Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+		Stg_Component_ConstructFunction*                                _construct,
+		Stg_Component_BuildFunction*                                    _build,
+		Stg_Component_InitialiseFunction*                               _initialise,
+		Stg_Component_ExecuteFunction*                                  _execute,
+		Stg_Component_DestroyFunction*                                  _destroy,
+		IntegrationPointMapper_MapFunction*                             _map, 
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+		IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn, 
+		IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn, 
+		Name                                                            name,
+		Bool                                                            initFlag,
+		IntegrationPointsSwarm*                                         integrationSwarm );
 
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define INTEGRATIONPOINTMAPPER_DEFARGS \
-                STG_COMPONENT_DEFARGS, \
-                IntegrationPointMapper_MapFunction*                                          _map, \
-                IntegrationPointMapper_GetMaterialPointsSwarmsFunction*  _getMaterialPointsSwarms, \
-                IntegrationPointMapper_GetMaterialIndexOnFunction*            _getMaterialIndexOn, \
-                IntegrationPointMapper_GetExtensionOnFunction*                    _getExtensionOn, \
-                IntegrationPointMapper_GetDoubleFromExtension*                  _getDoubleFromExtension, \
-                IntegrationPointMapper_GetDoubleFromExtension*                  _getDoubleFromMaterial
-
-	#define INTEGRATIONPOINTMAPPER_PASSARGS \
-                STG_COMPONENT_PASSARGS, \
-	        _map,                     \
-	        _getMaterialPointsSwarms, \
-	        _getMaterialIndexOn,      \
-	        _getExtensionOn, \
-            _getDoubleFromExtension, \
-            _getDoubleFromMaterial
-
-	IntegrationPointMapper* _IntegrationPointMapper_New(  INTEGRATIONPOINTMAPPER_DEFARGS  );
-
-	void _IntegrationPointMapper_Init( void* mapper, PICelleratorContext* context, IntegrationPointsSwarm* integrationSwarm );
+	void _IntegrationPointMapper_Init( void* mapper, IntegrationPointsSwarm* integrationSwarm );
 
 	void _IntegrationPointMapper_Delete( void* mapper );
-
 	void _IntegrationPointMapper_Print( void* mapper, Stream* stream );
-
 	#define IntegrationPointMapper_Copy( self ) \
 		(IntegrationPointMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define IntegrationPointMapper_DeepCopy( self ) \
 		(IntegrationPointMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
 	void* _IntegrationPointMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-	void _IntegrationPointMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data );
-
-	void _IntegrationPointMapper_Build( void* mapper, void* data );
-
-	void _IntegrationPointMapper_Initialise( void* mapper, void* data );
-
+void _IntegrationPointMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) ;
+	void _IntegrationPointMapper_Build( void* mapper, void* data ) ;
+	void _IntegrationPointMapper_Initialise( void* mapper, void* data ) ;
 	void _IntegrationPointMapper_Execute( void* mapper, void* data );
-
-	void _IntegrationPointMapper_Destroy( void* mapper, void* data );
+	void _IntegrationPointMapper_Destroy( void* mapper, void* data ) ;
 	
 	/** Performs a mapping between the MaterialPointSwarms and IntegrationPointsSwarm */
 	void IntegrationPointMapper_Map( void* mapper );
 
 	/** Returns the MaterialPointsSwarm(s) involved in this mapping. Allocates memory so the result must be deleted.
-	 *		@param count Output parameter which stores the number of swarms returned */
+	 *     @param count Output parameter which stores the number of swarms returned */
 	MaterialPointsSwarm** IntegrationPointMapper_GetMaterialPointsSwarms( void* mapper, Index* count );
 	
 	/** Returns the material index associated with this integration point by mapping to physical material swarm(s) */
 	#ifdef MACRO_AS_FUNC
-	#define IntegrationPointMapper_GetMaterialIndexOn IntegrationPointMapper_GetMaterialIndexOnFunc
+		#define IntegrationPointMapper_GetMaterialIndexOn IntegrationPointMapper_GetMaterialIndexOnFunc
 	#else
-	#define IntegrationPointMapper_GetMaterialIndexOn IntegrationPointMapper_GetMaterialIndexOnMacro
+		#define IntegrationPointMapper_GetMaterialIndexOn IntegrationPointMapper_GetMaterialIndexOnMacro
 	#endif
 	#define IntegrationPointMapper_GetMaterialIndexOnMacro( mapper, point ) \
-		( (IntegrationPointMapper*)(mapper) )->_getMaterialIndexOn( (mapper), (point) ) 
+			( (IntegrationPointMapper*)(mapper) )->_getMaterialIndexOn( (mapper), (point) ) 
 	Material_Index IntegrationPointMapper_GetMaterialIndexOnFunc( void* mapper, void* point );
 
 	
 	/** Returns an extension associated with this integration point by mapping to physical material swarm(s) */
 	#ifdef MACRO_AS_FUNC
-	#define IntegrationPointMapper_GetExtensionOn IntegrationPointMapper_GetExtensionOnFunc
+		#define IntegrationPointMapper_GetExtensionOn IntegrationPointMapper_GetExtensionOnFunc
 	#else
-	#define IntegrationPointMapper_GetExtensionOn IntegrationPointMapper_GetExtensionOnMacro
+		#define IntegrationPointMapper_GetExtensionOn IntegrationPointMapper_GetExtensionOnMacro
 	#endif
 	#define IntegrationPointMapper_GetExtensionOnMacro( mapper, point, extHandle ) \
-		( (IntegrationPointMapper*)(mapper) )->_getExtensionOn( (mapper), (point), (extHandle) )
+			( (IntegrationPointMapper*)(mapper) )->_getExtensionOn( (mapper), (point), (extHandle) )
 	void* IntegrationPointMapper_GetExtensionOnFunc( void* mapper, void* point, ExtensionInfo_Index extHandle );
 
 
 	/** Returns the material index associated with this integration point index by mapping to physical material swarm(s) */
 	#ifdef MACRO_AS_FUNC
-	#define IntegrationPointMapper_GetMaterialIndexAt IntegrationPointMapper_GetMaterialIndexAtFunc
+		#define IntegrationPointMapper_GetMaterialIndexAt IntegrationPointMapper_GetMaterialIndexAtFunc
 	#else
-	#define IntegrationPointMapper_GetMaterialIndexAt IntegrationPointMapper_GetMaterialIndexAtMacro
+		#define IntegrationPointMapper_GetMaterialIndexAt IntegrationPointMapper_GetMaterialIndexAtMacro
 	#endif
 	#define IntegrationPointMapper_GetMaterialIndexAtMacro( mapper, point_I ) \
-		IntegrationPointMapper_GetMaterialIndexOn( \
-        (mapper), \
-        Swarm_ParticleAt( ((IntegrationPointMapper*)mapper)->integrationSwarm, point_I ) )
+			IntegrationPointMapper_GetMaterialIndexOn( \
+					(mapper), \
+					Swarm_ParticleAt( ((IntegrationPointMapper*)mapper)->integrationSwarm, point_I ) )
 	Material_Index IntegrationPointMapper_GetMaterialIndexAtFunc( void* mapper, Index point_I );
 	
 	/** Returns an extension associated with this integration point index by mapping to physical material swarm(s) */
 	#ifdef MACRO_AS_FUNC
-	#define IntegrationPointMapper_GetExtensionAt
+		#define IntegrationPointMapper_GetExtensionAt
 	#else
-	#define IntegrationPointMapper_GetExtensionAt
+		#define IntegrationPointMapper_GetExtensionAt
 	#endif
 	#define IntegrationPointMapper_GetExtensionAtMacro( mapper, point_I, extHandle ) \
-		IntegrationPointMapper_GetExtensionOn( \
-			(mapper), \
-			Swarm_ParticleAt( ((IntegrationPointMapper*)mapper)->integrationSwarm, point_I ), \
-			extHandle )
+			IntegrationPointMapper_GetExtensionOn( \
+					(mapper), \
+					Swarm_ParticleAt( ((IntegrationPointMapper*)mapper)->integrationSwarm, point_I ), \
+					extHandle )
 	void* IntegrationPointMapper_GetExtensionAtFunc( void* mapper, Index point_I, ExtensionInfo_Index extHandle );
 
-
-#define IntegrationPointMapper_GetDoubleFromExtension(mapper, intPoint, extHandle, offs) \
-    ((IntegrationPointMapper*)mapper)->_getDoubleFromExtension(mapper, intPoint, extHandle, offs);
-
-#define IntegrationPointMapper_GetDoubleFromMaterial(mapper, intPoint, extHandle, offs) \
-    ((IntegrationPointMapper*)mapper)->_getDoubleFromMaterial(mapper, intPoint, extHandle, offs);
-
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/IntegrationPointsSwarm.c
--- a/MaterialPoints/src/IntegrationPointsSwarm.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/IntegrationPointsSwarm.c	Tue Feb 02 16:55:08 2010 +1100
@@ -52,7 +52,6 @@
 
 #include "MaterialPoints.h"
 #include "Material.h"
-#include "PICelleratorContext.h"
 
 #include <assert.h>
 #include <string.h>
@@ -64,7 +63,6 @@ const Type IntegrationPointsSwarm_Type =
 
 IntegrationPointsSwarm* IntegrationPointsSwarm_New(
 		Name                                  name,
-      AbstractContext*                      context,
 		void*                                 cellLayout,
 		void*                                 particleLayout,
 		Dimension_Index                       dim,
@@ -79,94 +77,151 @@ IntegrationPointsSwarm* IntegrationPoint
 		ExtensionManager_Register*            extensionMgr_Register,
 		Variable_Register*                    swarmVariable_Register,
 		Materials_Register*                   materials_Register,
-		MPI_Comm                              comm,
-      void*                                 ics_dummy)
+		MPI_Comm                              comm)
 {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(IntegrationPointsSwarm);
-	Type                                                      type = IntegrationPointsSwarm_Type;
-	Stg_Class_DeleteFunction*                              _delete = _IntegrationPointsSwarm_Delete;
-	Stg_Class_PrintFunction*                                _print = _IntegrationPointsSwarm_Print;
-	Stg_Class_CopyFunction*                                  _copy = _IntegrationPointsSwarm_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _IntegrationPointsSwarm_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _IntegrationPointsSwarm_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _IntegrationPointsSwarm_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _IntegrationPointsSwarm_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _IntegrationPointsSwarm_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _IntegrationPointsSwarm_Destroy;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-	void*                          ics = ZERO;
-
-    IntegrationPointsSwarm* self = _IntegrationPointsSwarm_New(  INTEGRATIONPOINTSSWARM_PASSARGS  );
-
-    _Swarm_Init( 
-         (Swarm*)self, context,
-         cellLayout,
-         particleLayout,
-         dim,
-         particleSize,
-         cellParticleTblDelta,
-         extraParticlesFactor,
-         extensionMgr_Register,
-         swarmVariable_Register,
-         comm, 
-         ics_dummy );
-
-   _IntegrationPointsSwarm_Init( 
-      self,
-      mesh, 
-      timeIntegrator,
-      weights,
-      mapper,
-      materials_Register,
-      recalculateWeights );
-
+	IntegrationPointsSwarm* self = _IntegrationPointsSwarm_New(
+			sizeof(IntegrationPointsSwarm),
+			IntegrationPointsSwarm_Type,
+			_IntegrationPointsSwarm_Delete,
+			_IntegrationPointsSwarm_Print,
+			_IntegrationPointsSwarm_Copy,
+			_IntegrationPointsSwarm_DefaultNew,
+			_IntegrationPointsSwarm_Construct,
+			_IntegrationPointsSwarm_Build,
+			_IntegrationPointsSwarm_Initialise,
+			_IntegrationPointsSwarm_Execute,
+			_IntegrationPointsSwarm_Destroy,
+			name,
+			True,
+			cellLayout,
+			particleLayout,
+			dim,
+			particleSize,
+			cellParticleTblDelta,
+			extraParticlesFactor,
+			mesh,
+			timeIntegrator,
+			weights,
+			mapper,
+			recalculateWeights,
+			extensionMgr_Register,
+			swarmVariable_Register,
+			materials_Register,
+			comm
+			);
 	return self;
 }
 
+
 void* _IntegrationPointsSwarm_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                 _sizeOfSelf = sizeof(IntegrationPointsSwarm);
-	Type                                                         type = IntegrationPointsSwarm_Type;
-	Stg_Class_DeleteFunction*                                 _delete = _IntegrationPointsSwarm_Delete;
-	Stg_Class_PrintFunction*                                   _print = _IntegrationPointsSwarm_Print;
-	Stg_Class_CopyFunction*                                     _copy = _IntegrationPointsSwarm_Copy;
-	Stg_Component_DefaultConstructorFunction*     _defaultConstructor = _IntegrationPointsSwarm_DefaultNew;
-	Stg_Component_ConstructFunction*                       _construct = _IntegrationPointsSwarm_AssignFromXML;
-	Stg_Component_BuildFunction*                               _build = _IntegrationPointsSwarm_Build;
-	Stg_Component_InitialiseFunction*                     _initialise = _IntegrationPointsSwarm_Initialise;
-	Stg_Component_ExecuteFunction*                           _execute = _IntegrationPointsSwarm_Execute;
-	Stg_Component_DestroyFunction*                           _destroy = _IntegrationPointsSwarm_Destroy;
-	SizeT                                                particleSize = sizeof(IntegrationPoint);
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-	void*                          ics = ZERO;
-
-	return (void*) _IntegrationPointsSwarm_New(  INTEGRATIONPOINTSSWARM_PASSARGS  );
+	return (void*) _IntegrationPointsSwarm_New(
+			sizeof(IntegrationPointsSwarm),
+			IntegrationPointsSwarm_Type,
+			_IntegrationPointsSwarm_Delete,
+			_IntegrationPointsSwarm_Print,
+			_IntegrationPointsSwarm_Copy,
+			_IntegrationPointsSwarm_DefaultNew,
+			_IntegrationPointsSwarm_Construct,
+			_IntegrationPointsSwarm_Build,
+			_IntegrationPointsSwarm_Initialise,
+			_IntegrationPointsSwarm_Execute,
+			_IntegrationPointsSwarm_Destroy,
+			name,
+			False,
+			NULL,                           /* cellLayout */
+			NULL,                           /* particleLayout */
+			0,                              /* dim */
+			sizeof(IntegrationPoint),       /* particleSize */
+			0,                              /* cellParticleTblDelta */
+			0.0,                            /* extraParticlesFactor */
+			NULL,                           /* mesh */
+			NULL,                           /* timeIntegrator */
+			NULL,                           /* weights */
+			NULL,                           /* mapper */
+			False,                          /* recalculateWeights */
+			NULL,                           /* extensionMgr_Register */
+			NULL,                           /* swarmVariable_Register */
+			NULL,                           /* materials_Register */
+			MPI_COMM_WORLD                 /* MPI_Comm */
+			);
 }
 
 
-IntegrationPointsSwarm* _IntegrationPointsSwarm_New(  INTEGRATIONPOINTSSWARM_DEFARGS  )
+IntegrationPointsSwarm* _IntegrationPointsSwarm_New(
+		SizeT                                           _sizeOfSelf,
+		Type                                            type,
+		Stg_Class_DeleteFunction*                       _delete,
+		Stg_Class_PrintFunction*                        _print,
+		Stg_Class_CopyFunction*                         _copy,
+		Stg_Component_DefaultConstructorFunction*       _defaultConstructor,
+		Stg_Component_ConstructFunction*                _construct,
+		Stg_Component_BuildFunction*                    _build,
+		Stg_Component_InitialiseFunction*               _initialise,
+		Stg_Component_ExecuteFunction*                  _execute,
+		Stg_Component_DestroyFunction*                  _destroy,
+		Name                                            name,
+		Bool                                            initFlag,
+		CellLayout*                                     cellLayout,
+		ParticleLayout*                                 particleLayout,
+		Dimension_Index                                 dim,
+		SizeT                                           particleSize,
+		Particle_InCellIndex                            cellParticleTblDelta,
+		double                                          extraParticlesFactor,
+		FeMesh*     		                        mesh, 
+		TimeIntegrator*                                 timeIntegrator,
+		WeightsCalculator*                              weights,
+		IntegrationPointMapper*                         mapper,
+		Bool                                            recalculateWeights,
+		ExtensionManager_Register*                      extensionMgr_Register,
+		Variable_Register*                              swarmVariable_Register,
+		Materials_Register*                             materials_Register,
+		MPI_Comm                                        comm)
 {
 	IntegrationPointsSwarm* self;
 	
 	/* Allocate memory */
 	assert( _sizeOfSelf >= sizeof(IntegrationPointsSwarm) );
-	/* The following terms are parameters that have been passed into this function but are being set before being passed onto the parent */
-	/* This means that any values of these parameters that are passed into this function are not passed onto the parent function
-	   and so should be set to ZERO in any children of this class. */
-	ics = NULL;
+	self = (IntegrationPointsSwarm*)_Swarm_New( 
+		_sizeOfSelf,
+		type,
+		_delete,
+		_print,
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,		
+		name,
+		initFlag,
+		cellLayout,
+		particleLayout,
+		dim,
+		particleSize,
+		cellParticleTblDelta,
+		extraParticlesFactor,
+		extensionMgr_Register,
+		swarmVariable_Register,
+		comm,
+	        NULL	);
 
-	self = (IntegrationPointsSwarm*)_Swarm_New(  SWARM_PASSARGS  );
-
+	if (initFlag) {
+		_IntegrationPointsSwarm_Init( 
+			self,
+			mesh, 
+			timeIntegrator,
+			weights,
+			mapper,
+			materials_Register,
+			recalculateWeights );
+	}
+		
 	return self;
 }
 
 
-void _IntegrationPointsSwarm_AssignFromXML( void* integrationPoints, Stg_ComponentFactory* cf, void* data ) {
+void _IntegrationPointsSwarm_Construct( void* integrationPoints, Stg_ComponentFactory* cf, void* data ) {
 	IntegrationPointsSwarm*	        self          = (IntegrationPointsSwarm*) integrationPoints;
 	FeMesh*             		mesh;
 	TimeIntegrator*                 timeIntegrator;
@@ -174,16 +229,15 @@ void _IntegrationPointsSwarm_AssignFromX
 	IntegrationPointMapper*         mapper;
 	Materials_Register*             materials_Register;
 	Bool                            recalculateWeights;
-	PICelleratorContext*		context;
 
 	/* This will also call _Swarm_Init */
-	_Swarm_AssignFromXML( self, cf, data );
+	_Swarm_Construct( self, cf, data );
 
-	mesh           = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"FeMesh", FeMesh, True, data  );
-	timeIntegrator = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"TimeIntegrator", TimeIntegrator, True, data  );
-	weights        = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"WeightsCalculator", WeightsCalculator, False, data  );
-	mapper         = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"IntegrationPointMapper", IntegrationPointMapper, True, data  );
-	recalculateWeights = Stg_ComponentFactory_GetBool( cf, self->name, (Dictionary_Entry_Key)"recalculateWeights", True  );
+	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 );
+	recalculateWeights = Stg_ComponentFactory_GetBool( cf, self->name, "recalculateWeights", True );
 
 	Journal_Firewall (
 			weights != NULL ||
@@ -198,9 +252,7 @@ void _IntegrationPointsSwarm_AssignFromX
 			WeightsCalculator_Type,
 			GaussMapper_Type );
 	
-	context = (PICelleratorContext*)self->context;
-	assert( Stg_CheckType( context, PICelleratorContext ) );
-	materials_Register = context->materials_Register;
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
 	assert( materials_Register );
 
 	_IntegrationPointsSwarm_Init( self, mesh, timeIntegrator, weights, mapper, materials_Register, recalculateWeights );
@@ -234,23 +286,24 @@ void _IntegrationPointsSwarm_Init(
 	-- PatrickSunter 12 June 2006 */
 	self->isSwarmTypeToCheckPointAndReload = False;
 
-	self->weightVariable = Swarm_NewScalarVariable( self, (Name)"Weight", GetOffsetOfMember( particle , weight  ), 
+	self->weightVariable = Swarm_NewScalarVariable( 
+			self,
+			"Weight",
+			GetOffsetOfMember( particle , weight ), 
 			Variable_DataType_Double );
 
-   LiveComponentRegister_Add( LiveComponentRegister_GetLiveComponentRegister(), (Stg_Component*)self->weightVariable );
-   LiveComponentRegister_Add( LiveComponentRegister_GetLiveComponentRegister(), (Stg_Component*)self->weightVariable->variable );
-
-	self->localCoordVariable = Swarm_NewVectorVariable( self, (Name)"LocalElCoord", GetOffsetOfMember( localParticle , xi ),
+	self->localCoordVariable = Swarm_NewVectorVariable(
+		self,
+		"LocalElCoord",
+		GetOffsetOfMember( localParticle , xi ),
 		Variable_DataType_Double,
 		self->dim,
 		"Xi",
 		"Eta",
 		"Zeta" );
-   LiveComponentRegister_Add( LiveComponentRegister_GetLiveComponentRegister(), (Stg_Component*)self->localCoordVariable );
-   LiveComponentRegister_Add( LiveComponentRegister_GetLiveComponentRegister(), (Stg_Component*)self->localCoordVariable->variable );
 
 	if ( timeIntegrator ) {
-		/* Assuming this is called from _IntegrationPointsSwarm_AssignFromXML, it would have always called construct
+		/* Assuming this is called from _IntegrationPointsSwarm_Construct, it would have always called construct
 		 * on the mapper which in turn would have constructed any MaterialPointsSwarms with it.
 		 * The MaterialPointsSwarms would have already appended their update routines to the EP, and hence this
 		 * ensures that the _IntegrationPointsSwarm_UpdateHook will always be called last */
@@ -332,12 +385,6 @@ void _IntegrationPointsSwarm_Build( void
 	Stg_Component_Build( self->localCoordVariable, data, False );
 	Stg_Component_Build( self->weightVariable, data, False );
 	Stg_Component_Build( self->mapper, data, False );
-   Stg_Component_Build( self->mesh, data, False );
-   Stg_Component_Build( self->timeIntegrator, data, False );
-   if ( self->weights != NULL ) {
-		Stg_Component_Build( self->weights, data, False );
-	}
-   
 }
 void _IntegrationPointsSwarm_Initialise( void* integrationPoints, void* data ) {
 	IntegrationPointsSwarm*	self = (IntegrationPointsSwarm*) integrationPoints;
@@ -351,8 +398,6 @@ void _IntegrationPointsSwarm_Initialise(
 	Stg_Component_Initialise( self->localCoordVariable, data, False );
 	Stg_Component_Initialise( self->weightVariable, data, False );
 	Stg_Component_Initialise( self->mapper, data, False );
-   Stg_Component_Initialise( self->mesh, data, False );
-   Stg_Component_Initialise( self->timeIntegrator, data, False );
 
 	if ( self->weights != NULL ) {
 		Stg_Component_Initialise( self->weights, data, False );
@@ -373,15 +418,6 @@ void _IntegrationPointsSwarm_Execute( vo
 }
 void _IntegrationPointsSwarm_Destroy( void* integrationPoints, void* data ) {
 	IntegrationPointsSwarm*	self = (IntegrationPointsSwarm*)integrationPoints;
-
-	Stg_Component_Destroy( self->localCoordVariable, data, False );
-	Stg_Component_Destroy( self->weightVariable, data, False );
-	Stg_Component_Destroy( self->mapper, data, False );
-   Stg_Component_Destroy( self->mesh, data, False );
-   Stg_Component_Destroy( self->timeIntegrator, data, False );
-   if ( self->weights != NULL ) {
-		Stg_Component_Destroy( self->weights, data, False );
-	}
 	
 	_Swarm_Destroy( self, data );
 }
@@ -427,7 +463,7 @@ void IntegrationPointsSwarm_RemapIntegra
 		Journal_DPrintf( self->debug, "...weights updating finished - took %g secs.\n", weightsUpdateTime );
 	}	
 	else {
-		Stream* errorStream = Journal_Register( Error_Type, (Name)self->type  );
+		Stream* errorStream = Journal_Register( Error_Type, self->type );
 		Journal_Firewall( Stg_Class_IsInstance( self->mapper, GaussMapper_Type ) ||
 				  Stg_Class_IsInstance( self->mapper, GaussCoincidentMapper_Type ) ||
 				  !strcmp(self->mapper->type, "PCDVCGaussMapper"), errorStream,
@@ -454,5 +490,3 @@ Material* IntegrationPointsSwarm_GetMate
 		swarm->materials_Register, 
 		IntegrationPointsSwarm_GetMaterialIndexOn( swarm, point ) );
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/IntegrationPointsSwarm.h
--- a/MaterialPoints/src/IntegrationPointsSwarm.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/IntegrationPointsSwarm.h	Tue Feb 02 16:55:08 2010 +1100
@@ -53,8 +53,8 @@
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
-#ifndef __PICellerator_MaterialPoints_IntegrationPointsSwarm_h__
-#define __PICellerator_MaterialPoints_IntegrationPointsSwarm_h__
+#ifndef __PICellerator_IntegrationPointsSwarm_IntegrationPointsSwarm_h__
+#define __PICellerator_IntegrationPointsSwarm_IntegrationPointsSwarm_h__
 
 	/* Textual name of this class */
 	extern const Type IntegrationPointsSwarm_Type;
@@ -80,16 +80,15 @@
 	*/
 
 	/** Classic C++-style constructor */
-   IntegrationPointsSwarm* IntegrationPointsSwarm_New(
+	IntegrationPointsSwarm* IntegrationPointsSwarm_New(
 		Name                                  name,
-      AbstractContext*                      context,
 		void*                                 cellLayout,
 		void*                                 particleLayout,
 		Dimension_Index                       dim,
 		SizeT                                 particleSize,
 		Particle_InCellIndex                  cellParticleTblDelta,
 		double                                extraParticlesFactor,
-		FeMesh*                   	           mesh,
+		FeMesh*				      mesh, 
 		TimeIntegrator*                       timeIntegrator,
 		WeightsCalculator*                    weights,
 		IntegrationPointMapper*               mapper,
@@ -97,26 +96,43 @@
 		ExtensionManager_Register*            extensionMgr_Register,
 		Variable_Register*                    swarmVariable_Register,
 		Materials_Register*                   materials_Register,
-		MPI_Comm                              comm,
-      void*                                 ics);
+		MPI_Comm                              comm);
 	
 	void* _IntegrationPointsSwarm_DefaultNew( Name name ) ;
 
 	/** Private New */
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
+	IntegrationPointsSwarm* _IntegrationPointsSwarm_New(
+		SizeT                                           _sizeOfSelf, 
+		Type                                            type,
+		Stg_Class_DeleteFunction*                       _delete,
+		Stg_Class_PrintFunction*                        _print,
+		Stg_Class_CopyFunction*                         _copy, 
+		Stg_Component_DefaultConstructorFunction*       _defaultConstructor,
+		Stg_Component_ConstructFunction*                _construct,
+		Stg_Component_BuildFunction*                    _build,
+		Stg_Component_InitialiseFunction*               _initialise,
+		Stg_Component_ExecuteFunction*                  _execute,
+		Stg_Component_DestroyFunction*                  _destroy,
+		Name                                            name,
+		Bool                                            initFlag,
+		CellLayout*                                     cellLayout,
+		ParticleLayout*                                 particleLayout,
+		Dimension_Index                                 dim,
+		SizeT                                           particleSize, 
+		Particle_InCellIndex                            cellParticleTblDelta, 
+		double                                          extraParticlesFactor,
+		FeMesh*         		                mesh, 
+		TimeIntegrator*                                 timeIntegrator,
+		WeightsCalculator*                              weights,
+		IntegrationPointMapper*                         mapper,
+		Bool                                            recalculateWeights,
+		ExtensionManager_Register*                      extensionMgr_Register,
+		Variable_Register*                              swarmVariable_Register,
+		Materials_Register*                             materials_Register,
+		MPI_Comm                                        comm
+		);
 
-	#define INTEGRATIONPOINTSSWARM_DEFARGS \
-                SWARM_DEFARGS
-
-	#define INTEGRATIONPOINTSSWARM_PASSARGS \
-                SWARM_PASSARGS
-
-	IntegrationPointsSwarm* _IntegrationPointsSwarm_New(  INTEGRATIONPOINTSSWARM_DEFARGS  );
-
-	void _IntegrationPointsSwarm_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _IntegrationPointsSwarm_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
 
 	void _IntegrationPointsSwarm_Init(
 		void*                                           swarm,
@@ -177,4 +193,3 @@
 		IntegrationPointMapper_GetExtensionAt( ((IntegrationPointsSwarm*)(swarm))->mapper, (point_I), (extHandle) )
 
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/ManyToOneMapper.c
--- a/MaterialPoints/src/ManyToOneMapper.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/ManyToOneMapper.c	Tue Feb 02 16:55:08 2010 +1100
@@ -58,38 +58,88 @@
 
 const Type ManyToOneMapper_Type = "ManyToOneMapper";
 
-ManyToOneMapper* _ManyToOneMapper_New(  MANYTOONEMAPPER_DEFARGS  ) {
+ManyToOneMapper* _ManyToOneMapper_New(
+		SizeT                                                           _sizeOfSelf,
+		Type                                                            type,
+		Stg_Class_DeleteFunction*                                       _delete,
+		Stg_Class_PrintFunction*                                        _print,
+		Stg_Class_CopyFunction*                                         _copy,
+		Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+		Stg_Component_ConstructFunction*                                _construct,
+		Stg_Component_BuildFunction*                                    _build,
+		Stg_Component_InitialiseFunction*                               _initialise,
+		Stg_Component_ExecuteFunction*                                  _execute,
+		Stg_Component_DestroyFunction*                                  _destroy,
+		IntegrationPointMapper_MapFunction*                             _map,
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+		IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+		IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+		Name                                                            name,
+		Bool                                            initFlag,
+		IntegrationPointsSwarm*                                         integrationSwarm,
+		MaterialPointsSwarm**                                           materialSwarms,
+		Index                                                           materialSwarmCount ) 
+{
 	ManyToOneMapper* result;
 
-	result = (ManyToOneMapper*)_IntegrationPointMapper_New(  INTEGRATIONPOINTMAPPER_PASSARGS  );
+	result = (ManyToOneMapper*)_IntegrationPointMapper_New(
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,
+			_map,
+			_getMaterialPointsSwarms,
+			_getMaterialIndexOn,
+			_getExtensionOn,
+			name,
+			initFlag,	
+			integrationSwarm );
+
+	if (initFlag) {
+		_ManyToOneMapper_Init( result, integrationSwarm, materialSwarms, materialSwarmCount );
+	}
 
 	return result;
 }
 
-void _ManyToOneMapper_Init( void* mapper, MaterialPointsSwarm** materialSwarms, Index materialSwarmCount ) {
-	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
-	int					i;
+void _ManyToOneMapper_Init( 
+		void*                   mapper,
+		IntegrationPointsSwarm* integrationSwarm,
+		MaterialPointsSwarm**   materialSwarms,
+		Index                   materialSwarmCount )
+{
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
 
 	self->materialSwarms = materialSwarms;
 	self->materialSwarmCount = materialSwarmCount;
 
-	/* Each integration point will have a reference to a material particle (one for each swarm) */
-	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, False );
-	for ( i = 0; i < self->materialSwarmCount; ++i ) {
-		ExtensionManager_Add( self->integrationSwarm->particleExtensionMgr, (Name)materialSwarms[i]->name, sizeof(MaterialPointRef)  );
-	}
-	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, True );
+	_IntegrationPointMapper_Init( self, integrationSwarm );
 }
 
 void _ManyToOneMapper_Delete( void* mapper ) {
-	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
 
+	int i;
+
+	if ( self->materialSwarms != NULL ) {
+		for ( i = 0; i < self->materialSwarmCount; ++i )  {
+			Stg_Class_Delete( self->materialSwarms[i] );
+		}
+		Memory_Free( self->materialSwarms );
+	}
+	
 	_IntegrationPointMapper_Delete( self );
 }
-
 void _ManyToOneMapper_Print( void* mapper, Stream* stream ) {
-	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
-	int					i;
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+	int i;
 
 	_IntegrationPointMapper_Print( self, stream );
 	if ( self->materialSwarms != NULL ) {
@@ -100,7 +150,6 @@ void _ManyToOneMapper_Print( void* mappe
 		Stream_UnIndent( stream );
 	}
 }
-
 void* _ManyToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
 	ManyToOneMapper* newCopy;
@@ -109,7 +158,6 @@ void* _ManyToOneMapper_Copy( void* mappe
 
 	if ( self->materialSwarms != NULL ) {
 		newCopy->materialSwarms = PtrMap_Find( ptrMap, self->materialSwarms );
-
 		if ( newCopy->materialSwarms == NULL ) {
 			newCopy->materialSwarms = Memory_Alloc_Array( MaterialPointsSwarm*, self->materialSwarmCount, "componentList" );
 			PtrMap_Append( ptrMap, self->materialSwarms, newCopy->materialSwarms );
@@ -120,66 +168,76 @@ void* _ManyToOneMapper_Copy( void* mappe
 		newCopy->materialSwarms = NULL;
 		newCopy->materialSwarmCount = 0;
 	}
+
 	return newCopy;
 }
 
-void _ManyToOneMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-	ManyToOneMapper*			self = (ManyToOneMapper*)mapper;
-	MaterialPointsSwarm**	materialSwarms;
+void _ManyToOneMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+
+	MaterialPointsSwarm** materialSwarms;
+	int i;
 	
-	_IntegrationPointMapper_AssignFromXML( self, cf, data );
+	_IntegrationPointMapper_Construct( self, cf, data );
 
-	materialSwarms = (MaterialPointsSwarm**)Stg_ComponentFactory_ConstructByList( cf, self->name, (Dictionary_Entry_Key)IntegrationPointsSwarm_Type, Stg_ComponentFactory_Unlimited, IntegrationPointsSwarm, True, &(self->materialSwarmCount), data  );
+	materialSwarms = (MaterialPointsSwarm**)Stg_ComponentFactory_ConstructByList( 
+					cf, 
+					self->name, 
+					IntegrationPointsSwarm_Type, 
+					Stg_ComponentFactory_Unlimited, 
+					IntegrationPointsSwarm,
+					True,
+					&(self->materialSwarmCount), data );
 
 	Journal_Firewall( 
 		self->materialSwarmCount < 1,
-		Journal_Register( Error_Type, (Name)self->type  ),
+		Journal_Register( Error_Type, self->type ),
 		"In func %s, there must be at least one swarm in the material swarm list!\n", __func__ );
 
-	_ManyToOneMapper_Init( self, materialSwarms, self->materialSwarmCount );
+	_ManyToOneMapper_Init( self, self->integrationSwarm, materialSwarms, self->materialSwarmCount );
+
+	/* Each integration point will have a reference to a material particle (one for each swarm) */
+	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, False );
+	for ( i = 0; i < self->materialSwarmCount; ++i ) {
+		ExtensionManager_Add( 
+			self->integrationSwarm->particleExtensionMgr,
+			materialSwarms[i]->name, 
+			sizeof(MaterialPointRef) );
+	}
+	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, True );
 }
 
 void _ManyToOneMapper_Build( void* mapper, void* data ) {
-	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
-	int					i;
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+	int i;
 
 	_IntegrationPointMapper_Build( mapper, data );
 	
 	for ( i = 0 ; i < self->materialSwarmCount; ++i ) {
 		Stg_Component_Build( self->materialSwarms[i], data, False );
 	}
+	
 }
-
 void _ManyToOneMapper_Initialise( void* mapper, void* data ) {
-	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
-	int					i;
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+	int i;
 
 	_IntegrationPointMapper_Initialise( mapper, data );
-
 	for ( i = 0; i < self->materialSwarmCount; ++i ) {
 		Stg_Component_Initialise( self->materialSwarms[i], data, False );
 	}
 }
+void _ManyToOneMapper_Execute( void* mapper, void* data ) {
 
-void _ManyToOneMapper_Execute( void* mapper, void* data ) {
 }
+void _ManyToOneMapper_Destroy( void* mapper, void* data ) {
 
-void _ManyToOneMapper_Destroy( void* mapper, void* data ) {
-	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
-	int					i;
-
-	for ( i = 0; i < self->materialSwarmCount; ++i ) {
-		Stg_Component_Destroy( self->materialSwarms[i], data, False );
-	}
-
-	_IntegrationPointMapper_Destroy( self, data );
-   
 }
 
 MaterialPointsSwarm** ManyToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count ) {
-	ManyToOneMapper*			self = (ManyToOneMapper*)mapper;
-	MaterialPointsSwarm**	result = Memory_Alloc_Array( MaterialPointsSwarm*, self->materialSwarmCount, "Swarms" );
-	Index							i;
+	ManyToOneMapper*       self   = (ManyToOneMapper*)mapper;
+	MaterialPointsSwarm** result = Memory_Alloc_Array( MaterialPointsSwarm*, self->materialSwarmCount, "Swarms" );
+	Index                  i;
 	
 	*count = self->materialSwarmCount;
 
@@ -189,5 +247,3 @@ MaterialPointsSwarm** ManyToOneMapper_Ge
 
 	return result;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/ManyToOneMapper.h
--- a/MaterialPoints/src/ManyToOneMapper.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/ManyToOneMapper.h	Tue Feb 02 16:55:08 2010 +1100
@@ -40,16 +40,16 @@
 **
 */
 /** \file
- **  Role:
- **     An IntegrationPointMapper which maps many MaterialPointsSwarms to one IntegrationPointsSwarm
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: ManyToOneMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**     An IntegrationPointMapper which maps many MaterialPointsSwarms to one IntegrationPointsSwarm
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: ManyToOneMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_MaterialPoints_ManyToOneMapper_h__
 #define __PICellerator_MaterialPoints_ManyToOneMapper_h__
@@ -61,55 +61,57 @@
 	#define __ManyToOneMapper \
 		__IntegrationPointMapper \
 		\
-		MaterialPointsSwarm**	materialSwarms; \
-		Index							materialSwarmCount;
+		MaterialPointsSwarm**   materialSwarms; \
+		Index                   materialSwarmCount;
 
 	struct ManyToOneMapper { __ManyToOneMapper };
 	
-
-
+	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Constructors
 	*/
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
+	ManyToOneMapper* _ManyToOneMapper_New(
+			SizeT                                                           _sizeOfSelf,
+			Type                                                            type,
+			Stg_Class_DeleteFunction*                                       _delete,
+			Stg_Class_PrintFunction*                                        _print,
+			Stg_Class_CopyFunction*                                         _copy,
+			Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+			Stg_Component_ConstructFunction*                                _construct,
+			Stg_Component_BuildFunction*                                    _build,
+			Stg_Component_InitialiseFunction*                               _initialise,
+			Stg_Component_ExecuteFunction*                                  _execute,
+			Stg_Component_DestroyFunction*                                  _destroy,
+			IntegrationPointMapper_MapFunction*                             _map,
+			IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+			IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+			IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+			Name                                                            name,
+			Bool                                                            initFlag,
+			IntegrationPointsSwarm*                                         integrationSwarm,
+			MaterialPointsSwarm**                                           materialSwarms,
+			Index                                                           materialSwarmCount );
 
-	#define MANYTOONEMAPPER_DEFARGS \
-                INTEGRATIONPOINTMAPPER_DEFARGS
-
-	#define MANYTOONEMAPPER_PASSARGS \
-                INTEGRATIONPOINTMAPPER_PASSARGS
-
-	ManyToOneMapper* _ManyToOneMapper_New(  MANYTOONEMAPPER_DEFARGS  );
-
-	void _ManyToOneMapper_Init( void* mapper, MaterialPointsSwarm** materialSwarms, Index materialSwarmCount );
+	void _ManyToOneMapper_Init( 
+			void*                   mapper, 
+			IntegrationPointsSwarm* integrationSwarm,
+			MaterialPointsSwarm**   materialSwarms, 
+			Index                   materialSwarmCount );
 
 	void _ManyToOneMapper_Delete( void* mapper );
-
 	void _ManyToOneMapper_Print( void* mapper, Stream* stream );
-
 	#define ManyToOneMapper_Copy( self ) \
 		(ManyToOneMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define ManyToOneMapper_DeepCopy( self ) \
 		(ManyToOneMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
 	void* _ManyToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	void* _ManyToOneMapper_DefaultNew( Name name );
-
-	void _ManyToOneMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
-
-	void _ManyToOneMapper_Build( void* mapper, void* data );
-
-	void _ManyToOneMapper_Initialise( void* mapper, void* data );
-
+void _ManyToOneMapper_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _ManyToOneMapper_Build( void* mapper, void* data ) ;
+	void _ManyToOneMapper_Initialise( void* mapper, void* data ) ;
 	void _ManyToOneMapper_Execute( void* mapper, void* data );
-
-	void _ManyToOneMapper_Destroy( void* mapper, void* data );
+	void _ManyToOneMapper_Destroy( void* mapper, void* data ) ;
 
 	MaterialPointsSwarm** ManyToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count );
-
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/MappedParticleLayout.c
--- a/MaterialPoints/src/MappedParticleLayout.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/MappedParticleLayout.c	Tue Feb 02 16:55:08 2010 +1100
@@ -21,16 +21,16 @@
 **
 */
 /** \file
- **  Role:
- **      A particle layout designed for IntegrationPointsSwarms where particle positions and weights are mapped by
- **	another matieral points swarm and a weights calculator. Hence this particle layout does nothing except for
- **	creating the swarm's cell table arrays
- **
- ** Assumptions:
- **
- ** Comments:
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**      A particle layout designed for IntegrationPointsSwarms where particle positions and weights are mapped by
+**	another matieral points swarm and a weights calculator. Hence this particle layout does nothing except for
+**	creating the swarm's cell table arrays
+**
+** Assumptions:
+**
+** Comments:
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 
 #include <mpi.h>
@@ -48,127 +48,146 @@
 
 const Type MappedParticleLayout_Type = "MappedParticleLayout";
 
-MappedParticleLayout* MappedParticleLayout_New( 
-	Name					name, 
-	AbstractContext*	context,
-	CoordSystem			coordSystem,
-	Bool					weightsInitialisedAtStartup )
+MappedParticleLayout* _MappedParticleLayout_New( 
+                SizeT                                                       _sizeOfSelf,
+                Type                                                        type,
+                Stg_Class_DeleteFunction*                                   _delete,
+                Stg_Class_PrintFunction*                                    _print,
+                Stg_Class_CopyFunction*                                     _copy,
+                Stg_Component_DefaultConstructorFunction*                   _defaultConstructor,
+                Stg_Component_ConstructFunction*                            _construct,
+                Stg_Component_BuildFunction*                                _build,
+                Stg_Component_InitialiseFunction*                           _initialise,
+                Stg_Component_ExecuteFunction*                              _execute,
+                Stg_Component_DestroyFunction*                              _destroy,
+                ParticleLayout_SetInitialCountsFunction*                    _setInitialCounts,
+                ParticleLayout_InitialiseParticlesFunction*                 _initialiseParticles,
+                Name                                                        name,
+                Bool                                                        initFlag,
+		CoordSystem                                                 coordSystem,
+                Bool                                                        weightsInitialisedAtStartup )
 {
-
-   MappedParticleLayout* self = _MappedParticleLayout_DefaultNew( name ); 
-
-   _ParticleLayout_Init( self, context, coordSystem, weightsInitialisedAtStartup );
-   _MappedParticleLayout_Init( self );
-
+	MappedParticleLayout*		self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(MappedParticleLayout) );
+	self = (MappedParticleLayout*)_ParticleLayout_New( 
+			_sizeOfSelf, 
+			type, 
+			_delete, 
+			_print, 
+			_copy, 
+			_defaultConstructor,
+			_construct, 
+			_build, 
+			_initialise, 
+			_execute, 
+			_destroy, 
+			_setInitialCounts, 
+			_initialiseParticles, 
+			name, 
+			initFlag,
+			coordSystem,
+			weightsInitialisedAtStartup );
+	
+	if( initFlag ){
+		_MappedParticleLayout_Init( self, coordSystem, weightsInitialisedAtStartup );
+	}
+	
 	return self;
 }
-MappedParticleLayout* _MappedParticleLayout_New(  MAPPEDPARTICLELAYOUT_DEFARGS  )
+
+
+void _MappedParticleLayout_Init(
+		void*                  particleLayout,
+		CoordSystem            coordSystem,
+		Bool                   weightsInitialisedAtStartup )
 {
-   MappedParticleLayout*		self;
+	MappedParticleLayout* self = (MappedParticleLayout*)particleLayout;
+	
+	self->isConstructed = True;
 
-   /* Allocate memory */
-   assert( _sizeOfSelf >= sizeof(MappedParticleLayout) );
-   self = (MappedParticleLayout*)_ParticleLayout_New(  PARTICLELAYOUT_PASSARGS  );
-
-   return self;
-}
-
-
-void _MappedParticleLayout_Init( void* particleLayout ) {
-	MappedParticleLayout* self;
-
-	self = (MappedParticleLayout*)particleLayout;
+	_ParticleLayout_Init( particleLayout, coordSystem, weightsInitialisedAtStartup );
 }
 
 void _MappedParticleLayout_Delete( void* particleLayout ) {
-    MappedParticleLayout* self = (MappedParticleLayout*)particleLayout;
+	MappedParticleLayout* self = (MappedParticleLayout*)particleLayout;
 	
-    _ParticleLayout_Delete( self );
+	_ParticleLayout_Delete( self );
 }
 
 void _MappedParticleLayout_Print( void* particleLayout, Stream* stream ) {
-    MappedParticleLayout* self = (MappedParticleLayout*)particleLayout;
+	MappedParticleLayout* self = (MappedParticleLayout*)particleLayout;
 	
-    Journal_Printf( stream, "MappedParticleLayout (ptr): %p\n", self );
+	Journal_Printf( stream, "MappedParticleLayout (ptr): %p\n", self );
 	
-    /* Parent class info */
-    _ParticleLayout_Print( self, stream );
+	/* Parent class info */
+	_ParticleLayout_Print( self, stream );
 	
 }
 
+
 void* _MappedParticleLayout_Copy( void* particleLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    MappedParticleLayout*		self = (MappedParticleLayout*)particleLayout;
-    MappedParticleLayout*		newMappedParticleLayout;
+	MappedParticleLayout*		self = (MappedParticleLayout*)particleLayout;
+	MappedParticleLayout*		newMappedParticleLayout;
 	
-    newMappedParticleLayout = (MappedParticleLayout*)_ParticleLayout_Copy( self, dest, deep, nameExt, ptrMap );
+	newMappedParticleLayout = (MappedParticleLayout*)_ParticleLayout_Copy( self, dest, deep, nameExt, ptrMap );
 
-    return (void*)newMappedParticleLayout;
+	return (void*)newMappedParticleLayout;
 }
 
 void* _MappedParticleLayout_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                        _sizeOfSelf = sizeof(MappedParticleLayout);
-	Type                                                                type = MappedParticleLayout_Type;
-	Stg_Class_DeleteFunction*                                        _delete = _MappedParticleLayout_Delete;
-	Stg_Class_PrintFunction*                                          _print = _MappedParticleLayout_Print;
-	Stg_Class_CopyFunction*                                            _copy = _MappedParticleLayout_Copy;
-	Stg_Component_DefaultConstructorFunction*            _defaultConstructor = _MappedParticleLayout_DefaultNew;
-	Stg_Component_ConstructFunction*                              _construct = _MappedParticleLayout_AssignFromXML;
-	Stg_Component_BuildFunction*                                      _build = _MappedParticleLayout_Build;
-	Stg_Component_InitialiseFunction*                            _initialise = _MappedParticleLayout_Initialise;
-	Stg_Component_ExecuteFunction*                                  _execute = _MappedParticleLayout_Execute;
-	Stg_Component_DestroyFunction*                                  _destroy = _MappedParticleLayout_Destroy;
-	AllocationType                                        nameAllocationType = NON_GLOBAL;
-	ParticleLayout_SetInitialCountsFunction*               _setInitialCounts = _MappedParticleLayout_SetInitialCounts;
-	ParticleLayout_InitialiseParticlesFunction*         _initialiseParticles = _MappedParticleLayout_InitialiseParticles;
-	CoordSystem                                                  coordSystem = LocalCoordSystem;
-	Bool                                         weightsInitialisedAtStartup = False;
-
-    return _MappedParticleLayout_New(  MAPPEDPARTICLELAYOUT_PASSARGS  );
+	return _MappedParticleLayout_New(
+			sizeof(MappedParticleLayout),
+			MappedParticleLayout_Type,
+			_MappedParticleLayout_Delete,
+			_MappedParticleLayout_Print,
+			_MappedParticleLayout_Copy,
+			_MappedParticleLayout_DefaultNew,
+			_MappedParticleLayout_Construct,
+			_MappedParticleLayout_Build,
+			_MappedParticleLayout_Initialise,
+			_MappedParticleLayout_Execute,
+			_MappedParticleLayout_Destroy,
+			_MappedParticleLayout_SetInitialCounts,
+			_MappedParticleLayout_InitialiseParticles,
+			name,
+			False,
+			LocalCoordSystem,
+			False );
 }
-void  _MappedParticleLayout_AssignFromXML( void* component, Stg_ComponentFactory* cf, void* data ) {
-    MappedParticleLayout*		self = (MappedParticleLayout*)component;
-
-    _ParticleLayout_AssignFromXML( self, cf, data );
-
-    _MappedParticleLayout_Init( self );
-}
+void  _MappedParticleLayout_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {}
 void  _MappedParticleLayout_Build( void* component, void* data ) {}
 void  _MappedParticleLayout_Initialise( void* component, void* data ) {}
 void  _MappedParticleLayout_Execute( void* component, void* data ) {}
-void  _MappedParticleLayout_Destroy( void* component, void* data ) {
-    MappedParticleLayout*		self = (MappedParticleLayout*)component;
+void  _MappedParticleLayout_Destroy( void* component, void* data ) {}
 
-    _ParticleLayout_Destroy( self, data );
-}
 
 void _MappedParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm )
 {
-    Swarm*			swarm = (Swarm*)_swarm;
-    Cell_DomainIndex	cell_I = 0;
-    char			tempStr[100];
+	Swarm*			swarm = (Swarm*)_swarm;
+	Cell_DomainIndex	cell_I = 0;
+	char			tempStr[100];
 
-    for( cell_I = 0; cell_I < swarm->cellLocalCount; cell_I++ ) {
-        /* Set initial counts to empty, till we add the particles */
-        swarm->cellParticleCountTbl[cell_I] = 0; 
-        swarm->cellParticleSizeTbl[cell_I] = 1; /* Just to create array */
+	for( cell_I = 0; cell_I < swarm->cellLocalCount; cell_I++ ) {
+		/* Set initial counts to empty, till we add the particles */
+		swarm->cellParticleCountTbl[cell_I] = 0; 
+		swarm->cellParticleSizeTbl[cell_I] = 1; /* Just to create array */
 
-        sprintf( tempStr, "Swarm->cellParticleTbl[%d]", cell_I );
-        swarm->cellParticleTbl[cell_I] = Memory_Alloc_Array( Particle_Index, swarm->cellParticleSizeTbl[cell_I], tempStr );
-    }
+		sprintf( tempStr, "Swarm->cellParticleTbl[%d]", cell_I );
+		swarm->cellParticleTbl[cell_I] = Memory_Alloc_Array( Particle_Index, swarm->cellParticleSizeTbl[cell_I], tempStr );
+	}
 
-    /* Now initialise the shadow cell particle counts */
-    for (; cell_I < swarm->cellDomainCount; cell_I++ ) {
-        swarm->cellParticleCountTbl[cell_I] = 0;
-        swarm->cellParticleSizeTbl[cell_I] = 0;
-        swarm->cellParticleTbl[cell_I] = NULL;
-    }
+	/* Now initialise the shadow cell particle counts */
+	for (; cell_I < swarm->cellDomainCount; cell_I++ ) {
+		swarm->cellParticleCountTbl[cell_I] = 0;
+		swarm->cellParticleSizeTbl[cell_I] = 0;
+		swarm->cellParticleTbl[cell_I] = NULL;
+	}
 }
 
 void _MappedParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm )
 {
-    /* Don't need to do anything */
+	/* Don't need to do anything */
 }
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/MappedParticleLayout.h
--- a/MaterialPoints/src/MappedParticleLayout.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/MappedParticleLayout.h	Tue Feb 02 16:55:08 2010 +1100
@@ -1,57 +1,58 @@
 #ifndef __PICellerator_MaterialPoints_MappedParticleLayout_h__
 #define __PICellerator_MaterialPoints_MappedParticleLayout_h__
 	
-/* Textual name of this class */
-extern const Type MappedParticleLayout_Type;
+	/* Textual name of this class */
+	extern const Type MappedParticleLayout_Type;
 	
-/* ParticleLayout information */
-#define __MappedParticleLayout                          \
-    /* General info */                                  \
-    __ParticleLayout                                    \
+	/* ParticleLayout information */
+	#define __MappedParticleLayout \
+		/* General info */ \
+		__ParticleLayout \
 
-struct MappedParticleLayout { __MappedParticleLayout };
+	struct MappedParticleLayout { __MappedParticleLayout };
 	
-MappedParticleLayout* MappedParticleLayout_New( 
-      Name name, 
-      AbstractContext* context,
-      CoordSystem      coordSystem,
-      Bool             weightsInitialisedAtStartup);
+	MappedParticleLayout* _MappedParticleLayout_New( 
+		SizeT                                                        _sizeOfSelf,
+		Type                                                         type,
+		Stg_Class_DeleteFunction*                                    _delete,
+		Stg_Class_PrintFunction*                                     _print,
+		Stg_Class_CopyFunction*                                      _copy,
+		Stg_Component_DefaultConstructorFunction*                    _defaultConstructor,
+		Stg_Component_ConstructFunction*                             _construct,
+		Stg_Component_BuildFunction*                                 _build,
+		Stg_Component_InitialiseFunction*                            _initialise,
+		Stg_Component_ExecuteFunction*                               _execute,
+		Stg_Component_DestroyFunction*                               _destroy,
+		ParticleLayout_SetInitialCountsFunction*                     _setInitialCounts,
+		ParticleLayout_InitialiseParticlesFunction*                  _initialiseParticles,
+		Name                                                         name,
+		Bool                                                         initFlag,
+		CoordSystem                                                  coordSystem,
+		Bool                                                         weightsInitialisedAtStartup );
+	
+	/* Initialise implementation */
+	void _MappedParticleLayout_Init( 
+			void*                  particleLayout, 
+			CoordSystem            coordSystem, 
+			Bool                   weightsInitialisedAtStartup );
+	
+	void _MappedParticleLayout_Delete( void* particleLayout );
+	void _MappedParticleLayout_Print( void* particleLayout, Stream* stream );
+	#define MappedParticleLayout_Copy( self ) \
+		(MappedParticleLayout*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define MappedParticleLayout_DeepCopy( self ) \
+		(MappedParticleLayout*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _MappedParticleLayout_Copy( void* particleLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
+	void* _MappedParticleLayout_DefaultNew( Name name );
+	void  _MappedParticleLayout_Construct( void* component, Stg_ComponentFactory* cf, void* data );
+	void  _MappedParticleLayout_Build( void* component, void* data );
+	void  _MappedParticleLayout_Initialise( void* component, void* data );
+	void  _MappedParticleLayout_Execute( void* component, void* data );
+	void  _MappedParticleLayout_Destroy( void* component, void* data );
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define MAPPEDPARTICLELAYOUT_DEFARGS \
-                PARTICLELAYOUT_DEFARGS
-
-	#define MAPPEDPARTICLELAYOUT_PASSARGS \
-                PARTICLELAYOUT_PASSARGS
-
-MappedParticleLayout* _MappedParticleLayout_New(  MAPPEDPARTICLELAYOUT_DEFARGS  );
-	
-/* Initialise implementation */
-void _MappedParticleLayout_Init( 
-    void*                  particleLayout );
-	
-void _MappedParticleLayout_Delete( void* particleLayout );
-void _MappedParticleLayout_Print( void* particleLayout, Stream* stream );
-#define MappedParticleLayout_Copy( self )                               \
-    (MappedParticleLayout*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define MappedParticleLayout_DeepCopy( self )                           \
-    (MappedParticleLayout*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _MappedParticleLayout_Copy( void* particleLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-
-void* _MappedParticleLayout_DefaultNew( Name name );
-void  _MappedParticleLayout_AssignFromXML( void* component, Stg_ComponentFactory* cf, void* data );
-void  _MappedParticleLayout_Build( void* component, void* data );
-void  _MappedParticleLayout_Initialise( void* component, void* data );
-void  _MappedParticleLayout_Execute( void* component, void* data );
-void  _MappedParticleLayout_Destroy( void* component, void* data );
-	
-void _MappedParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm );
-void _MappedParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm );
+	void _MappedParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm );
+	void _MappedParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm );
 
 	
 #endif /* __PICellerator_MaterialPoints_MappedParticleLayout_h__ */
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/Material.c
--- a/MaterialPoints/src/Material.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/Material.c	Tue Feb 02 16:55:08 2010 +1100
@@ -61,72 +61,107 @@ const Index UNDEFINED_MATERIAL = (unsign
 
 /* Public Constructor */
 Material* Material_New( 
-	Name						name,
-	PICelleratorContext*	context,
-	Stg_Shape*				shape,
-	Dictionary*				materialDictionary,
-	Materials_Register*	materialRegister )
+		Name                                            name,
+		Stg_Shape*                                      shape,
+		Dictionary*                                     materialDictionary,
+		Materials_Register*                             materialRegister )
 {
-	Material* self = _Material_DefaultNew( name );
+	Material* self;
 
-	self->isConstructed = True;
-	_Material_Init( self, context, shape, materialDictionary, materialRegister );
+	self = (Material*) _Material_New(			
+			sizeof(Material),
+			Material_Type,
+			_Material_Delete, 
+			_Material_Print, 
+			_Material_Copy, 
+			_Material_DefaultNew, 
+			_Material_Construct, 
+			_Material_Build, 
+			_Material_Initialise, 
+			_Material_Execute, 
+			_Material_Destroy,
+			name,
+			shape,
+			materialDictionary,
+			materialRegister );
 
 	return self;
 }
 
 
 void* _Material_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(Material);
-	Type                                                      type = Material_Type;
-	Stg_Class_DeleteFunction*                              _delete = _Material_Delete;
-	Stg_Class_PrintFunction*                                _print = _Material_Print;
-	Stg_Class_CopyFunction*                                  _copy = _Material_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _Material_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _Material_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _Material_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _Material_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _Material_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _Material_Destroy;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return (void*) _Material_New(  MATERIAL_PASSARGS  );
+	return (void*) _Material_New(
+			sizeof(Material),
+			Material_Type,
+			_Material_Delete, 
+			_Material_Print, 
+			_Material_Copy, 
+			_Material_DefaultNew, 
+			_Material_Construct, 
+			_Material_Build, 
+			_Material_Initialise, 
+			_Material_Execute, 
+			_Material_Destroy,
+			name,
+			NULL,
+			NULL,
+			NULL );
 }
 
 
 /* Private Constructor */
-Material* _Material_New(  MATERIAL_DEFARGS  )
+Material* _Material_New(
+		SizeT                                           _sizeOfSelf,
+		Type                                            type,
+		Stg_Class_DeleteFunction*                       _delete,
+		Stg_Class_PrintFunction*                        _print,
+		Stg_Class_CopyFunction*                         _copy,
+		Stg_Component_DefaultConstructorFunction*       _defaultConstructor,
+		Stg_Component_ConstructFunction*                _construct,
+		Stg_Component_BuildFunction*                    _build,
+		Stg_Component_InitialiseFunction*               _initialise,
+		Stg_Component_ExecuteFunction*                  _execute,
+		Stg_Component_DestroyFunction*                  _destroy,
+		Name                                            name,
+		Stg_Shape*                                      shape,
+		Dictionary*                                     materialDictionary,
+		Materials_Register*                             materialRegister )
 {
 	Material* self;
 	
 	assert( _sizeOfSelf >= sizeof(Material) );
-	/* The following terms are parameters that have been passed into this function but are being set before being passed onto the parent */
-	/* This means that any values of these parameters that are passed into this function are not passed onto the parent function
-	   and so should be set to ZERO in any children of this class. */
-	nameAllocationType = NON_GLOBAL;
+	self = (Material*) _Stg_Component_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			name,
+			NON_GLOBAL );
 
-	self = (Material*) _Stg_Component_New(  STG_COMPONENT_PASSARGS  );
+	_Material_Init( self, shape, materialDictionary, materialRegister );
 
 	return self;
 }
 
 
 void _Material_Init( 
-	void*						material,
-	PICelleratorContext*	context,
-	Stg_Shape*				shape,
-	Dictionary*				materialDictionary,
-	Materials_Register*	materialRegister )
+		void*                                           material,
+		Stg_Shape*                                      shape,
+		Dictionary*                                     materialDictionary,
+		Materials_Register*                             materialRegister )
 {
 	Material* self = (Material*)material;
 	
 	/* Set Values */
-	self->context = context;
 	self->dictionary = materialDictionary;
-	self->shape = shape;
+	self->shape      = shape;
 
 	/* Register material */
 	if (materialRegister != NULL)	
@@ -140,8 +175,7 @@ void _Material_Delete( void* material ) 
 void _Material_Delete( void* material ) {
 	Material* self = (Material*) material;
 
-   Stg_Class_Delete( self->extensionMgr );
-   
+	Stg_Class_Delete( self->extensionMgr );
 	_Stg_Component_Delete( material );
 }
 
@@ -169,43 +203,24 @@ void* _Material_Copy( void* material, vo
 }
 
 
-void _Material_AssignFromXML( void* material, Stg_ComponentFactory* cf, void* data ) {
-	Material*				self = (Material*) material;
-	Dictionary*				materialDictionary;
-	Stg_Shape*				shape;
-	Materials_Register*	materials_Register;
-	PICelleratorContext*	context;
-
-	context = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Context", PICelleratorContext, False, data );
-	if( !context  ) 
-		context = Stg_ComponentFactory_ConstructByName( cf, (Name)"context", PICelleratorContext, True, data  );
+void _Material_Construct( void* material, Stg_ComponentFactory* cf, void* data ) {
+	Material*             self               = (Material*) material;
+	Dictionary*           materialDictionary;
+	Stg_Shape*            shape;
+	Materials_Register*   materials_Register;
 
 	materialDictionary = Dictionary_GetDictionary( cf->componentDict, self->name );
-	shape =  Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Shape", Stg_Shape, True, data   ) ;
-	materials_Register = context->materials_Register;
+	shape =  Stg_ComponentFactory_ConstructByKey(  cf,  self->name,  "Shape", Stg_Shape,  True, data  ) ;
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
 
-	_Material_Init( self, context, shape, materialDictionary, materials_Register );
+	_Material_Init( self, shape, materialDictionary, materials_Register );
 }
 
 
-void _Material_Build( void* material, void* data ) {
-	Material*				self = (Material*) material;
-
-   Stg_Component_Build( self->shape, data , False );
-}
-void _Material_Initialise( void* material, void* data ) {
-	Material*				self = (Material*) material;
-
-   Stg_Component_Initialise( self->shape, data , False );
-}
+void _Material_Build( void* material, void* data ) {}
+void _Material_Initialise( void* material, void* data ) {}
 void _Material_Execute( void* material, void* data ) {}
-
-void _Material_Destroy( void* material, void* data ) {
-	Material* self = (Material*) material;
-
-	Stg_Component_Destroy( self->shape, data , False );
-}
-
+void _Material_Destroy( void* material, void* data ) {}
 
 void Material_Layout( void* material, MaterialPointsSwarm* swarm ) {	
 	Material*             self               = (Material*) material;
@@ -356,5 +371,3 @@ void Material_IntegrateField(
 	Memory_Free( fieldValue );
 	Memory_Free( localResult );
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/Material.h
--- a/MaterialPoints/src/Material.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/Material.h	Tue Feb 02 16:55:08 2010 +1100
@@ -52,60 +52,56 @@
 	#define __Material \
 		__Stg_Component \
 		\
-		PICelleratorContext*	context; \
-		Dictionary*				dictionary; \
-		Stg_Shape*				shape; \
-		Material_Index			index; /**< The index inside the Materials_Register */ \
-		ExtensionManager*		extensionMgr; 
+		Dictionary*                           dictionary;       \
+		Stg_Shape*                            shape;            \
+		Material_Index                        index;            /**< The index inside the Materials_Register */ \
+		ExtensionManager*                     extensionMgr;     \
 		
 	struct Material { __Material };
 
 	/* Public Constructor */
 	Material* Material_New(
-		Name						name,
-		PICelleratorContext*	context, 
-		Stg_Shape*				shape,
-		Dictionary*				materialDictionary,
-		Materials_Register*	materialRegister );
+		Name                                            name,
+		Stg_Shape*                                      shape,
+		Dictionary*                                     materialDictionary,
+		Materials_Register*                             materialRegister );
 
 	void* _Material_DefaultNew( Name name );
 
 	/* Private Constructor */
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
+	Material* _Material_New(
+		SizeT                                           _sizeOfSelf,
+		Type                                            type,
+		Stg_Class_DeleteFunction*                       _delete,
+		Stg_Class_PrintFunction*                        _print,
+		Stg_Class_CopyFunction*                         _copy, 
+		Stg_Component_DefaultConstructorFunction*       _defaultConstructor,
+		Stg_Component_ConstructFunction*                _construct,
+		Stg_Component_BuildFunction*                    _build,
+		Stg_Component_InitialiseFunction*               _initialise,
+		Stg_Component_ExecuteFunction*                  _execute,
+		Stg_Component_DestroyFunction*                  _destroy,				
+		Name                                            name,
+		Stg_Shape*                                      shape,
+		Dictionary*                                     materialDictionary,
+		Materials_Register*                             materialRegister );
 
-	#define MATERIAL_DEFARGS \
-                STG_COMPONENT_DEFARGS
-
-	#define MATERIAL_PASSARGS \
-                STG_COMPONENT_PASSARGS
-
-	Material* _Material_New(  MATERIAL_DEFARGS  );
-
-	void _Material_AssignFromXML( void* material, Stg_ComponentFactory* cf, void* data );
+	void _Material_Construct( void* material, Stg_ComponentFactory* cf, void* data );
 
 	void _Material_Init( 
-		void*						material, 	
-		PICelleratorContext*	context, 
-		Stg_Shape*				shape,
-		Dictionary*				materialDictionary,
-		Materials_Register*	materialRegister );
+		void*                                           material, 	
+		Stg_Shape*                                      shape,
+		Dictionary*                                     materialDictionary,
+		Materials_Register*                             materialRegister ) ;
 
 	/** Virtual Functions */
-	void _Material_Delete( void* material );
-
-	void _Material_Print( void* material, Stream* stream );
-
-	void* _Material_Copy( void* material, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void _Material_Delete( void* material ) ;
+	void _Material_Print( void* material, Stream* stream ) ;
+	void* _Material_Copy( void* material, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) ;
 
 	void _Material_Build( void* material, void* data );
-
 	void _Material_Initialise( void* material, void* data );
-
 	void _Material_Execute( void* material, void* data );
-
 	void _Material_Destroy( void* material, void* data );
 
 	/** Performs a layout of this material onto the points of the swarm, assigning the material index if the global
@@ -124,11 +120,10 @@
 	 *                         field and store it in result. result must be an array of as many doubles as there are components
 	 *                         in the field. */
 	void Material_IntegrateField( 
-		void*                   material, 
-		IntegrationPointsSwarm* swarm, 
-		FeVariable*             field, 
-		double*                 volumeGlobal, 
-		double*                 result );
+			void*                   material, 
+			IntegrationPointsSwarm* swarm, 
+			FeVariable*             field, 
+			double*                 volumeGlobal, 
+			double*                 result );
 
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/MaterialFeVariable.c
--- a/MaterialPoints/src/MaterialFeVariable.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/MaterialFeVariable.c	Tue Feb 02 16:55:08 2010 +1100
@@ -56,12 +56,54 @@
 
 const Type MaterialFeVariable_Type = "MaterialFeVariable";
 
-MaterialFeVariable* _MaterialFeVariable_New(  MATERIALFEVARIABLE_DEFARGS  ) {
-	MaterialFeVariable* self;
+MaterialFeVariable* _MaterialFeVariable_New(
+ 		SizeT                                             _sizeOfSelf,
+		Type                                              type,
+		Stg_Class_DeleteFunction*                         _delete,
+		Stg_Class_PrintFunction*                          _print,
+		Stg_Class_CopyFunction*                           _copy, 
+		Stg_Component_DefaultConstructorFunction*         _defaultConstructor,
+		Stg_Component_ConstructFunction*                  _construct,
+		Stg_Component_BuildFunction*                      _build,
+		Stg_Component_InitialiseFunction*                 _initialise,
+		Stg_Component_ExecuteFunction*                    _execute,
+		Stg_Component_DestroyFunction*                    _destroy,
+		FieldVariable_InterpolateValueAtFunction*         _interpolateValueAt,
+		FieldVariable_GetValueFunction*	                  _getMinGlobalFeMagnitude,
+		FieldVariable_GetValueFunction*                   _getMaxGlobalFeMagnitude,
+		FieldVariable_GetCoordFunction*                   _getMinAndMaxLocalCoords,
+		FieldVariable_GetCoordFunction*                   _getMinAndMaxGlobalCoords,		
+		FeVariable_InterpolateWithinElementFunction*      _interpolateWithinElement,	
+		FeVariable_GetValueAtNodeFunction*                _getValueAtNode,
+		ParticleFeVariable_ValueAtParticleFunction*       _valueAtParticle,
+		Name                                              name )
+{
+	MaterialFeVariable*		self;
 	
 	/* Allocate memory */
 	assert( _sizeOfSelf >= sizeof(MaterialFeVariable) );
-	self = (MaterialFeVariable*) _ParticleFeVariable_New(  PARTICLEFEVARIABLE_PASSARGS  );
+	self = (MaterialFeVariable*)
+		_ParticleFeVariable_New(
+			_sizeOfSelf, 
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute, 
+			_destroy,
+			_interpolateValueAt,
+			_getMinGlobalFeMagnitude, 
+			_getMaxGlobalFeMagnitude,
+			_getMinAndMaxLocalCoords, 
+			_getMinAndMaxGlobalCoords,
+			_interpolateWithinElement,
+			_getValueAtNode,
+			_valueAtParticle,
+			name );
 	
 	return self;
 }
@@ -72,7 +114,7 @@ void _MaterialFeVariable_Init( MaterialF
 	/* Assign Pointers */
 	swarm = Stg_CheckType( self->assemblyTerm->integrationSwarm, IntegrationPointsSwarm );
 	self->picIntegrationPoints = swarm;
-	self->material = material;
+	self->material       = material;
 }
 
 /* --- Virtual Function Implementations --- */
@@ -95,6 +137,7 @@ void _MaterialFeVariable_Print( void* ma
 	Journal_PrintPointer( stream, self->material );
 }
 
+
 void* _MaterialFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	MaterialFeVariable*	self = (MaterialFeVariable*)feVariable;
 	MaterialFeVariable*	newMaterialFeVariable;
@@ -108,43 +151,39 @@ void* _MaterialFeVariable_Copy( void* fe
 }
 
 void* _MaterialFeVariable_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                       _sizeOfSelf = sizeof(MaterialFeVariable);
-	Type                                                               type = MaterialFeVariable_Type;
-	Stg_Class_DeleteFunction*                                       _delete = _MaterialFeVariable_Delete;
-	Stg_Class_PrintFunction*                                         _print = _MaterialFeVariable_Print;
-	Stg_Class_CopyFunction*                                           _copy = _MaterialFeVariable_Copy;
-	Stg_Component_DefaultConstructorFunction*           _defaultConstructor = _MaterialFeVariable_DefaultNew;
-	Stg_Component_ConstructFunction*                             _construct = _MaterialFeVariable_AssignFromXML;
-	Stg_Component_BuildFunction*                                     _build = _MaterialFeVariable_Build;
-	Stg_Component_InitialiseFunction*                           _initialise = _MaterialFeVariable_Initialise;
-	Stg_Component_ExecuteFunction*                                 _execute = _MaterialFeVariable_Execute;
-	Stg_Component_DestroyFunction*                                 _destroy = _MaterialFeVariable_Destroy;
-	FieldVariable_InterpolateValueAtFunction*           _interpolateValueAt = _FeVariable_InterpolateValueAt;
-	FieldVariable_GetCoordFunction*                _getMinAndMaxLocalCoords = _FeVariable_GetMinAndMaxLocalCoords;
-	FieldVariable_GetCoordFunction*               _getMinAndMaxGlobalCoords = _FeVariable_GetMinAndMaxGlobalCoords;
-	FeVariable_InterpolateWithinElementFunction*  _interpolateWithinElement = _FeVariable_InterpolateNodeValuesToElLocalCoord;
-	FeVariable_GetValueAtNodeFunction*                      _getValueAtNode = _FeVariable_GetValueAtNode;
-	ParticleFeVariable_ValueAtParticleFunction*            _valueAtParticle = _MaterialFeVariable_ValueAtParticle;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType                             nameAllocationType = ZERO;
-	FieldVariable_GetValueFunction*   _getMinGlobalFieldMagnitude = ZERO;
-	FieldVariable_GetValueFunction*   _getMaxGlobalFieldMagnitude = ZERO;
-	FeVariable_SyncShadowValuesFunc*            _syncShadowValues = ZERO;
-
-	return (void*) _MaterialFeVariable_New(  MATERIALFEVARIABLE_PASSARGS  );
+	return (void*) _MaterialFeVariable_New(
+		sizeof(MaterialFeVariable),
+		MaterialFeVariable_Type,
+		_MaterialFeVariable_Delete,
+		_MaterialFeVariable_Print,
+		_MaterialFeVariable_Copy,
+		_MaterialFeVariable_DefaultNew,
+		_MaterialFeVariable_Construct,
+		_MaterialFeVariable_Build, 
+		_MaterialFeVariable_Initialise,
+		_MaterialFeVariable_Execute,
+		_MaterialFeVariable_Destroy,
+		_FeVariable_InterpolateValueAt,
+		_FeVariable_GetMinGlobalFieldMagnitude,
+		_FeVariable_GetMaxGlobalFieldMagnitude,
+		_FeVariable_GetMinAndMaxLocalCoords,
+		_FeVariable_GetMinAndMaxGlobalCoords,
+		_FeVariable_InterpolateNodeValuesToElLocalCoord,
+		_FeVariable_GetValueAtNode,
+		_MaterialFeVariable_ValueAtParticle,
+		name );
 }
 
-void _MaterialFeVariable_AssignFromXML( void* materialFeVariable, Stg_ComponentFactory* cf, void* data ){
-	MaterialFeVariable*	self = (MaterialFeVariable*) materialFeVariable;
-	Material*				material;
+void _MaterialFeVariable_Construct( void* materialFeVariable, Stg_ComponentFactory* cf, void* data ){
+	MaterialFeVariable*   self              = (MaterialFeVariable*) materialFeVariable;
+	Material*             material;
 	
-	material = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Material", Material, True, data  );
+	material = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Material", Material, True, data );
 
 	/* Construct Parent */
-	_ParticleFeVariable_AssignFromXML( self, cf, data );
+	_ParticleFeVariable_Construct( self, cf, data );
 
+	_FieldVariable_Construct( self, cf, data );
 	_MaterialFeVariable_Init( self, material );
 }
 
@@ -161,49 +200,50 @@ void _MaterialFeVariable_Build( void* ma
 	if ( swarm->swarmVariable_Register )
 		variable_Register = swarm->swarmVariable_Register->variable_Register;
 
-	tmpName = Stg_Object_AppendSuffix( self, (Name)"DataVariable"  );
+	tmpName = Stg_Object_AppendSuffix( self, "DataVariable" );
 	assert( Class_IsSuper( self->feMesh->topo, IGraph ) );
-	self->dataVariable = Variable_NewScalar( tmpName, (AbstractContext*)self->context, Variable_DataType_Double, (Index*)&((IGraph*)self->feMesh->topo)->remotes[MT_VERTEX]->nDomains, NULL, (void**)&self->data, variable_Register );
-	Memory_Free( tmpName  );
+	self->dataVariable = Variable_NewScalar( 
+			tmpName,
+			Variable_DataType_Double, 
+			&((IGraph*)self->feMesh->topo)->remotes[MT_VERTEX]->nDomains, 
+			NULL,
+			(void**)&self->data, 
+			variable_Register );
+	Memory_Free( tmpName );
 	self->fieldComponentCount = 1;
 	
-	tmpName = Stg_Object_AppendSuffix( self, (Name)"DofLayout"  );
-	self->dofLayout = DofLayout_New( tmpName, self->context, variable_Register, ((IGraph*)self->feMesh->topo)->remotes[MT_VERTEX]->nDomains, NULL );
+	tmpName = Stg_Object_AppendSuffix( self, "DofLayout" );
+	self->dofLayout = DofLayout_New( tmpName, variable_Register, 
+					 ((IGraph*)self->feMesh->topo)->remotes[MT_VERTEX]->nDomains, NULL );
 	DofLayout_AddAllFromVariableArray( self->dofLayout, 1, &self->dataVariable );
 	Memory_Free( tmpName );
 	self->eqNum->dofLayout = self->dofLayout;
 	
 	_ParticleFeVariable_Build( self, data );
 }
-
 void _MaterialFeVariable_Initialise( void* materialFeVariable, void* data ) {
 	MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
 
 	_ParticleFeVariable_Initialise( self, data );
 }
-
 void _MaterialFeVariable_Execute( void* materialFeVariable, void* data ) {
 	MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
 
 	_ParticleFeVariable_Execute( self, data );
 }
-
 void _MaterialFeVariable_Destroy( void* materialFeVariable, void* data ) {
 	MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
 
 	_ParticleFeVariable_Destroy( self, data );
 }
-
 void _MaterialFeVariable_ValueAtParticle( 
-	void*                   materialFeVariable,
-	IntegrationPointsSwarm* swarm,
-	Element_LocalIndex      lElement_I,
-	void*                   particle,
-	double*                 particleValue )
+		void*                   materialFeVariable,
+		IntegrationPointsSwarm* swarm,
+		Element_LocalIndex      lElement_I,
+		void*                   particle,
+		double*                 particleValue )
 {
 	MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
 	*particleValue = (double) ( self->material->index == IntegrationPointsSwarm_GetMaterialIndexOn( swarm, particle ) );
 }
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/MaterialFeVariable.h
--- a/MaterialPoints/src/MaterialFeVariable.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/MaterialFeVariable.h	Tue Feb 02 16:55:08 2010 +1100
@@ -57,18 +57,27 @@
 	struct MaterialFeVariable { __MaterialFeVariable };
 	
 	/* --- Contstructors / Destructors --- */
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define MATERIALFEVARIABLE_DEFARGS \
-                PARTICLEFEVARIABLE_DEFARGS
-
-	#define MATERIALFEVARIABLE_PASSARGS \
-                PARTICLEFEVARIABLE_PASSARGS
-
-	MaterialFeVariable* _MaterialFeVariable_New(  MATERIALFEVARIABLE_DEFARGS  );
+	MaterialFeVariable* _MaterialFeVariable_New(
+ 		SizeT                                             _sizeOfSelf,
+		Type                                              type,
+		Stg_Class_DeleteFunction*                         _delete,
+		Stg_Class_PrintFunction*                          _print,
+		Stg_Class_CopyFunction*                           _copy, 
+		Stg_Component_DefaultConstructorFunction*         _defaultConstructor,
+		Stg_Component_ConstructFunction*                  _construct,
+		Stg_Component_BuildFunction*                      _build,
+		Stg_Component_InitialiseFunction*                 _initialise,
+		Stg_Component_ExecuteFunction*                    _execute,
+		Stg_Component_DestroyFunction*                    _destroy,
+		FieldVariable_InterpolateValueAtFunction*         _interpolateValueAt,
+		FieldVariable_GetValueFunction*	                  _getMinGlobalFeMagnitude,
+		FieldVariable_GetValueFunction*                   _getMaxGlobalFeMagnitude,
+		FieldVariable_GetCoordFunction*                   _getMinAndMaxLocalCoords,
+		FieldVariable_GetCoordFunction*                   _getMinAndMaxGlobalCoords,		
+		FeVariable_InterpolateWithinElementFunction*      _interpolateWithinElement,	
+		FeVariable_GetValueAtNodeFunction*                _getValueAtNode,
+		ParticleFeVariable_ValueAtParticleFunction*       _valueAtParticle,
+		Name                                              name );
 	
 	void _MaterialFeVariable_Init( MaterialFeVariable* self, Material* material ) ;
 	
@@ -78,7 +87,7 @@
 	void _MaterialFeVariable_Print( void* variable, Stream* stream );
 	void* _MaterialFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
-	void _MaterialFeVariable_AssignFromXML( void* variable, Stg_ComponentFactory* cf, void* data );
+	void _MaterialFeVariable_Construct( void* variable, Stg_ComponentFactory* cf, void* data );
 	void _MaterialFeVariable_Build( void* variable, void* data );
 	void _MaterialFeVariable_Initialise( void* variable, void* data );
 	void _MaterialFeVariable_Execute( void* variable, void* data );
@@ -91,4 +100,3 @@
 			double*                 particleValue );
 
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/MaterialPoint.c
--- a/MaterialPoints/src/MaterialPoint.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/MaterialPoint.c	Tue Feb 02 16:55:08 2010 +1100
@@ -54,5 +54,3 @@
 #include "MaterialPoint.h"
 
 const Type MaterialPoint_Type = "MaterialPoint";
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/MaterialPoints.h
--- a/MaterialPoints/src/MaterialPoints.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/MaterialPoints.h	Tue Feb 02 16:55:08 2010 +1100
@@ -40,8 +40,8 @@
 **
 */
 
-#ifndef __PICellerator_MaterialPoints_MaterialPoints_h__
-#define __PICellerator_MaterialPoints_MaterialPoints_h__
+#ifndef __PICellerator_MaterialPoints_h__
+#define __PICellerator_MaterialPoints_h__
 	
 	#include "types.h"
 	#include "Materials_Register.h"
@@ -59,7 +59,6 @@
 
 	#include "IntegrationPointMapper.h"
 	#include "OneToOneMapper.h"
-        #include "OneToManyMapper.h"
 	#include "CoincidentMapper.h"
 	#include "GaussCoincidentMapper.h"
 	#include "GaussMapper.h"
@@ -71,7 +70,7 @@
 	/* dave 21.09.07 */
 	#include "SwarmVariableField.h"
 
-	#include "PICelleratorContext.h"
+	#include "Context.h"
 	#include "Init.h"
 	#include "Finalise.h"
 
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/MaterialPointsSwarm.c
--- a/MaterialPoints/src/MaterialPointsSwarm.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/MaterialPointsSwarm.c	Tue Feb 02 16:55:08 2010 +1100
@@ -61,80 +61,110 @@ const Type MaterialPointsSwarm_Type = "M
 const Type MaterialPointsSwarm_Type = "MaterialPointsSwarm";
 
 MaterialPointsSwarm* MaterialPointsSwarm_New(
-      Name                                  name,
-      AbstractContext*                      context,
-      void*                                 cellLayout,
-      void*                                 particleLayout,
-      Dimension_Index                       dim,
-      SizeT                                 particleSize,
-      FeMesh*                               mesh,
-      EscapedRoutine*                       escapedRoutine, 
-      Material*                             material,
-      Variable_Register*                    swarmVariable_Register,
-      ExtensionManager_Register*            extensionMgr_Register,
-      Materials_Register*                   materials_Register,		
-      MPI_Comm                              comm,
-      void*                                 ics_dummy ) 
+		Name                                  name,
+		void*                                 cellLayout,
+		void*                                 particleLayout,
+		Dimension_Index                       dim,
+		SizeT                                 particleSize,
+		FeMesh*                               mesh,
+		EscapedRoutine*                       escapedRoutine, 
+		Material*                             material,
+		Variable_Register*                    swarmVariable_Register,
+		ExtensionManager_Register*            extensionMgr_Register,
+		Materials_Register*                   materials_Register,		
+		MPI_Comm                              comm) 
 {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(MaterialPointsSwarm);
-	Type                                                      type = MaterialPointsSwarm_Type;
-	Stg_Class_DeleteFunction*                              _delete = _MaterialPointsSwarm_Delete;
-	Stg_Class_PrintFunction*                                _print = _MaterialPointsSwarm_Print;
-	Stg_Class_CopyFunction*                                  _copy = _MaterialPointsSwarm_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _MaterialPointsSwarm_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _MaterialPointsSwarm_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _MaterialPointsSwarm_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _MaterialPointsSwarm_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _MaterialPointsSwarm_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _MaterialPointsSwarm_Destroy;
+	MaterialPointsSwarm* self = (MaterialPointsSwarm*) _MaterialPointsSwarm_DefaultNew( name );
+	
+	self->particleSize = particleSize;
 
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-	void*                          ics = ZERO;
+	/* 	MaterialPointsSwarm_InitAll */
+	_Swarm_Init(  	(Swarm*)self, 
+			cellLayout, 
+			particleLayout, 
+			dim, 
+			DEFAULT_CELL_PARTICLE_TBL_DELTA,
+			DEFAULT_EXTRA_PARTICLES_FACTOR,
+			extensionMgr_Register,
+			swarmVariable_Register, 
+			comm,
+			NULL );
 
-	/* The following terms are parameters that have been passed into or defined in this function but are being set before being passed onto the parent */
-	Particle_InCellIndex  cellParticleTblDelta = DEFAULT_CELL_PARTICLE_TBL_DELTA;
-	double                extraParticlesFactor = DEFAULT_EXTRA_PARTICLES_FACTOR;
+	_MaterialPointsSwarm_Init(	self, 
+					mesh, 
+					escapedRoutine, 
+					material, 
+					materials_Register);
 
-  MaterialPointsSwarm* self = _MaterialPointsSwarm_New(  MATERIALPOINTSSWARM_PASSARGS  );
-
-   _Swarm_Init( 
-         (Swarm*)self, context,
-         cellLayout,
-         particleLayout,
-         dim,
-         particleSize,
-         cellParticleTblDelta,
-         extraParticlesFactor,
-         extensionMgr_Register,
-         swarmVariable_Register,
-         comm, 
-         ics_dummy );
-
-   _MaterialPointsSwarm_Init( 
-      self, 
-      mesh,
-      escapedRoutine, 
-      material,
-      materials_Register );
-
-   return self;
+	return self;
 }
 
 
-MaterialPointsSwarm* _MaterialPointsSwarm_New(  MATERIALPOINTSSWARM_DEFARGS  )
+MaterialPointsSwarm* _MaterialPointsSwarm_New(
+		SizeT                                           _sizeOfSelf,
+		Type                                            type,
+		Stg_Class_DeleteFunction*                       _delete,
+		Stg_Class_PrintFunction*                        _print,
+		Stg_Class_CopyFunction*                         _copy,
+		Stg_Component_DefaultConstructorFunction*       _defaultConstructor,
+		Stg_Component_ConstructFunction*                _construct,
+		Stg_Component_BuildFunction*                    _build,
+		Stg_Component_InitialiseFunction*               _initialise,
+		Stg_Component_ExecuteFunction*                  _execute,
+		Stg_Component_DestroyFunction*                  _destroy,
+		Name                                            name,
+		Bool                                            initFlag,
+		CellLayout*                                     cellLayout,
+		ParticleLayout*                                 particleLayout,
+		Dimension_Index                                 dim,
+		SizeT                                           particleSize,
+		Particle_InCellIndex                            cellParticleTblDelta,
+		double                                          extraParticlesFactor,
+		FeMesh*                   	                mesh,
+		EscapedRoutine*                                 escapedRoutine, 
+		Material*                                       material,
+		Variable_Register*                              swarmVariable_Register,
+		ExtensionManager_Register*                      extensionMgr_Register,
+		Materials_Register*                             materials_Register,
+		MPI_Comm                                        comm )
 {
 	MaterialPointsSwarm* self;
 	
 	/* Allocate memory */
 	assert( _sizeOfSelf >= sizeof(MaterialPointsSwarm) );
-	/* The following terms are parameters that have been passed into this function but are being set before being passed onto the parent */
-	/* This means that any values of these parameters that are passed into this function are not passed onto the parent function
-	   and so should be set to ZERO in any children of this class. */
-	ics = NULL;
+	self = (MaterialPointsSwarm*)_Swarm_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			name,
+			initFlag,
+			cellLayout,
+			particleLayout,
+			dim,
+			particleSize,
+			cellParticleTblDelta,
+			extraParticlesFactor,
+			extensionMgr_Register,
+			swarmVariable_Register,
+			comm,
+		        NULL	);
 
-	self = (MaterialPointsSwarm*)_Swarm_New(  SWARM_PASSARGS  );
+	if (initFlag) {
+	 	_MaterialPointsSwarm_Init( 
+			self,
+			mesh,
+			escapedRoutine, 
+			material,
+			materials_Register );
+	}	
 
 	return self;
 }
@@ -157,18 +187,21 @@ void _MaterialPointsSwarm_Init(
 	self->material           = material;
 	self->materials_Register = materials_Register;
 	
-	self->particleCoordVariable = Swarm_NewVectorVariable( self, (Name)"Position", GetOffsetOfMember( globalParticle, coord ),
+	self->particleCoordVariable = Swarm_NewVectorVariable(
+		self,
+		"Position",
+		GetOffsetOfMember( globalParticle, coord ),
 		Variable_DataType_Double,
 		self->dim,
 		"PositionX",
 		"PositionY",
 		"PositionZ" );
-   LiveComponentRegister_Add( LiveComponentRegister_GetLiveComponentRegister(), (Stg_Component*)self->particleCoordVariable->variable );
-   LiveComponentRegister_Add( LiveComponentRegister_GetLiveComponentRegister(), (Stg_Component*)self->particleCoordVariable );
 
-	self->materialIndexVariable = Swarm_NewScalarVariable( self, (Name)"MaterialIndex", GetOffsetOfMember( particle , materialIndex  ), Variable_DataType_Int ); /* Should be unsigned int */
-   LiveComponentRegister_Add( LiveComponentRegister_GetLiveComponentRegister(), (Stg_Component*)self->materialIndexVariable->variable );
-   LiveComponentRegister_Add( LiveComponentRegister_GetLiveComponentRegister(), (Stg_Component*)self->materialIndexVariable );
+	self->materialIndexVariable = Swarm_NewScalarVariable( 
+			self,
+			"MaterialIndex",
+			GetOffsetOfMember( particle , materialIndex ), 
+			Variable_DataType_Int ); /* Should be unsigned int */
 
 	/* If we have an escaped routine, clear the defensive flag. */
 #if 0
@@ -194,6 +227,8 @@ void _MaterialPointsSwarm_Print( void* s
 	_Swarm_Print( self, stream );
 }
 
+
+
 void* _MaterialPointsSwarm_Copy( void* swarm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	MaterialPointsSwarm*	self = (MaterialPointsSwarm*)swarm;
 	MaterialPointsSwarm*	newMaterialPointsSwarm;
@@ -211,45 +246,51 @@ void* _MaterialPointsSwarm_Copy( void* s
 }
 
 void* _MaterialPointsSwarm_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                 _sizeOfSelf = sizeof(MaterialPointsSwarm);
-	Type                                                         type = MaterialPointsSwarm_Type;
-	Stg_Class_DeleteFunction*                                 _delete = _MaterialPointsSwarm_Delete;
-	Stg_Class_PrintFunction*                                   _print = _MaterialPointsSwarm_Print;
-	Stg_Class_CopyFunction*                                     _copy = _MaterialPointsSwarm_Copy;
-	Stg_Component_DefaultConstructorFunction*     _defaultConstructor = _MaterialPointsSwarm_DefaultNew;
-	Stg_Component_ConstructFunction*                       _construct = _MaterialPointsSwarm_AssignFromXML;
-	Stg_Component_BuildFunction*                               _build = _MaterialPointsSwarm_Build;
-	Stg_Component_InitialiseFunction*                     _initialise = _MaterialPointsSwarm_Initialise;
-	Stg_Component_ExecuteFunction*                           _execute = _MaterialPointsSwarm_Execute;
-	Stg_Component_DestroyFunction*                           _destroy = _MaterialPointsSwarm_Destroy;
-	SizeT                                                particleSize = sizeof(MaterialPoint);
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-	void*                          ics = ZERO;
-
-	return _MaterialPointsSwarm_New(  MATERIALPOINTSSWARM_PASSARGS  );
+	return _MaterialPointsSwarm_New(
+			sizeof(MaterialPointsSwarm),
+			MaterialPointsSwarm_Type,
+			_MaterialPointsSwarm_Delete,
+			_MaterialPointsSwarm_Print,
+			_MaterialPointsSwarm_Copy,
+			_MaterialPointsSwarm_DefaultNew,
+			_MaterialPointsSwarm_Construct,
+			_MaterialPointsSwarm_Build,
+			_MaterialPointsSwarm_Initialise,
+			_MaterialPointsSwarm_Execute,
+			_MaterialPointsSwarm_Destroy,
+			name,
+			False,
+			NULL,			/* cellLayout */
+			NULL,                   /* particleLayout */
+			0,                      /* dim */
+			sizeof(MaterialPoint),  /* particleSize */
+			0,                      /* cellParticleTblDelta */
+			0.0,                    /* extraParticlesFactor */
+			NULL,                   /* mesh */
+			NULL,                   /* escapedRoutine */
+			NULL,                   /* material */
+			NULL,                   /* swarmVariable_Register */
+			NULL,                   /* extensionMgr_Register */
+			NULL,                   /* materials_Register */
+			0                       /* comm */
+			);
 }
 
 
-void _MaterialPointsSwarm_AssignFromXML( void* swarm, Stg_ComponentFactory* cf, void* data ) {
+void _MaterialPointsSwarm_Construct( void* swarm, Stg_ComponentFactory* cf, void* data ) {
 	MaterialPointsSwarm*	        self          = (MaterialPointsSwarm*) swarm;
-	FeMesh*             		mesh;
+	FeMesh*             mesh;
 	EscapedRoutine*                 escapedRoutine;
 	Material*                       material;
 	Materials_Register*             materials_Register;
-	PICelleratorContext*		context;
 
-	_Swarm_AssignFromXML( self, cf, data );
+	_Swarm_Construct( self, cf, data );
 
-	mesh             = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"FeMesh", FeMesh, True, data  );
-	escapedRoutine   = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"EscapedRoutine", EscapedRoutine, False, data  );
-	material         = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Material", Material, False, data );
+	mesh             = Stg_ComponentFactory_ConstructByKey( cf, self->name, "FeMesh", FeMesh, True, data );
+	escapedRoutine   = Stg_ComponentFactory_ConstructByKey( cf, self->name, "EscapedRoutine",     EscapedRoutine,     False, data );
+	material         = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Material",           Material,           False, data );
 
-	context = (PICelleratorContext* )self->context;
-	assert( Stg_CheckType( context, PICelleratorContext ) );
-	materials_Register = context->materials_Register; 
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
 	assert( materials_Register );
 
 	_MaterialPointsSwarm_Init(
@@ -259,21 +300,17 @@ void _MaterialPointsSwarm_AssignFromXML(
 			material,
 			materials_Register );
 
-	self->geomodHack = Dictionary_GetBool_WithDefault( cf->rootDict, (Dictionary_Entry_Key)"geomodHacks", False  );
+	self->geomodHack = Dictionary_GetBool_WithDefault( cf->rootDict, "geomodHacks", False );
 }
 
 void _MaterialPointsSwarm_Build( void* swarm, void* data ) {
 	MaterialPointsSwarm*	self = (MaterialPointsSwarm*) swarm;
 	int			commHandler_I;
 	Bool                    movementCommHandlerFound = False;
-	Stream*                 errorStream = Journal_Register( Error_Type, (Name)self->type  );
+	Stream*                 errorStream = Journal_Register( Error_Type, self->type );
 	int var_I;
 
 	_Swarm_Build( self, data );
-
-	Stg_Component_Build( self->mesh, data , False );
-	if( self->escapedRoutine != NULL) Stg_Component_Build( self->escapedRoutine, data , False );
-	if( self->material       != NULL) Stg_Component_Build( self->material,       data , False );
 
 	/* Since this swarm is being set up to advect a PICellerator material, it should make sure
 	 * at least one ParticleMovementHandler-type ParticleCommHandler has been added to the base
@@ -295,49 +332,24 @@ void _MaterialPointsSwarm_Build( void* s
 	for( var_I = 0 ; var_I < self->nSwarmVars ; var_I++ ) {
 		Stg_Component_Build( self->swarmVars[var_I], data , False );
 	}
+
 }
 void _MaterialPointsSwarm_Initialise( void* swarm, void* data ) {
-	MaterialPointsSwarm*	self 	= (MaterialPointsSwarm*) swarm;
-	AbstractContext* 	context = (AbstractContext*)self->context;
-	Index            	var_I	= 0;
+	MaterialPointsSwarm*    self = (MaterialPointsSwarm*) swarm;
+	AbstractContext*        context = (AbstractContext*)data;
+	Index                   var_I=0;
 	Particle_Index          lParticle_I=0;
-	MaterialPoint*		matPoint=NULL;
-
+	MaterialPoint*          matPoint=NULL;
+	
 	_Swarm_Initialise( self, data );
-
-	Stg_Component_Initialise( self->mesh, data , False );
-	if( self->escapedRoutine != NULL) Stg_Component_Initialise( self->escapedRoutine, data , False );
-	if( self->material       != NULL) Stg_Component_Initialise( self->material,       data , False );
-
 	for( var_I = 0 ; var_I < self->nSwarmVars ; var_I++ ) {
 		Stg_Component_Initialise( self->swarmVars[var_I], data , False );
 	}
 
-	/* Now setup the material properties */
-   if(  False == context->loadSwarmsFromCheckpoint ) {
-
-      /* Beforehand, set each particle to have UNDEFINED_MATERIAL */
-      for ( lParticle_I = 0; lParticle_I < self->particleLocalCount; lParticle_I++ ) {
-         matPoint = (MaterialPoint*)Swarm_ParticleAt( self, lParticle_I );
-         matPoint->materialIndex = UNDEFINED_MATERIAL;
-      }
-		if( self->material == NULL ) {
-			/* Do it by the layout of all known materials */
-			Materials_Register_SetupSwarm( self->materials_Register, self );
-		}
-		else {
-			Material_Layout( self->material, self );
-			Materials_Register_AssignParticleProperties( 
-					self->materials_Register, 
-					self, 
-					self->swarmVariable_Register->variable_Register );
-		}
-	}
-
 	/** if loading from checkpoint, particle materials etc have already been loaded in Swarm_Build() - */ 
 	/** possibly need to check for empty cells (and populate) if performing a interpolation restart */
-   if ( True == context->loadSwarmsFromCheckpoint ){
-      if ( (True == self->isSwarmTypeToCheckPointAndReload) && (True == context->interpolateRestart) ) {	   
+   if ( context && (True == context->loadFromCheckPoint)  ){
+      if ( True == self->isSwarmTypeToCheckPointAndReload && (True == context->interpolateRestart) ) {	   
          Particle_InCellIndex cParticle_I         = 0;
          Particle_InCellIndex particle_I          = 0;
          GlobalParticle*      particle            = NULL;
@@ -424,17 +436,15 @@ void _MaterialPointsSwarm_Initialise( vo
             }
          }
          /** populate empty cells */ 
-         for(ii = 0 ; ii < count ; ii++)
-            Swarm_AddParticleToCell( self, cellID[ii], particleCPUID[ii] );
+         for(ii = 0 ; ii < count ; ii++) {
+		Swarm_AddParticleToCell( self, cellID[ii], particleCPUID[ii] );
+	}
          Memory_Free( cellID );
          Memory_Free( particleCPUID );
       }
 	/* TODO: print info / debug message */
 	}
-#if 0
 	else {
-		Particle_Index          lParticle_I=0;
-		MaterialPoint*		matPoint=NULL;
 
 		/* Beforehand, set each particle to have UNDEFINED_MATERIAL */
 		for ( lParticle_I = 0; lParticle_I < self->particleLocalCount; lParticle_I++ ) {
@@ -454,8 +464,24 @@ void _MaterialPointsSwarm_Initialise( vo
 					self->swarmVariable_Register->variable_Register );
 		}
 	}
-#endif
+	/* ensure all particles have been allocated to a material during Layout process
+	 * (if not, you may wish to include a backgroundLayout in the application's XML */
+	for ( lParticle_I = 0; lParticle_I < self->particleLocalCount; lParticle_I++ ) {
+		matPoint = (MaterialPoint*)Swarm_ParticleAt( self, lParticle_I );
+		Journal_Firewall(
+			matPoint->materialIndex != UNDEFINED_MATERIAL,
+			Journal_MyStream( Error_Type, self ),
+			"In func %s: MaterialPoint '%d' not allocated to a Material after Layout.\n"
+			"Coord = {%g, %g, %g}\n",
+			__func__,
+			lParticle_I,
+			matPoint->coord[ I_AXIS ],
+			matPoint->coord[ J_AXIS ],
+			matPoint->coord[ K_AXIS ] );
+	}
 }
+
+
 void _MaterialPointsSwarm_Execute( void* swarm, void* data ) {
 	MaterialPointsSwarm*	self = (MaterialPointsSwarm*)swarm;
 	
@@ -463,16 +489,7 @@ void _MaterialPointsSwarm_Execute( void*
 }
 void _MaterialPointsSwarm_Destroy( void* swarm, void* data ) {
 	MaterialPointsSwarm*	self = (MaterialPointsSwarm*)swarm;
-   int var_I;
 	
-	Stg_Component_Destroy( self->mesh, data , False );
-	if( self->escapedRoutine != NULL) Stg_Component_Destroy( self->escapedRoutine, data , False );
-	if( self->material       != NULL) Stg_Component_Destroy( self->material,       data , False );
-
-	for( var_I = 0 ; var_I < self->nSwarmVars ; var_I++ ) {
-		Stg_Component_Destroy( self->swarmVars[var_I], data , False );
-	}
-
 	_Swarm_Destroy( self, data );
 }
 
@@ -494,7 +511,7 @@ void _MaterialPointsSwarm_UpdateHook( vo
 			materialPoint = (MaterialPoint*)Swarm_ParticleAt( self, point_I );
 			cell = materialPoint->owningCell;
 			Journal_Firewall(
-					 cell < FeMesh_GetElementDomainSize( mesh ), 
+				cell < FeMesh_GetElementDomainSize( mesh ), 
 				Journal_MyStream( Error_Type, self ),
 				"In func %s: MaterialPoint '%d' outside element. Coord = {%g, %g, %g}\n",
 				__func__,
@@ -540,22 +557,6 @@ Index MaterialPointsSwarm_GetMaterialInd
 	return point->materialIndex;
 }
 
-void* MaterialPointsSwarm_GetMaterialExtensionOn( void* swarm, void *matPoint, Index extHandle ) {
-	MaterialPointsSwarm *self  = (MaterialPointsSwarm*)swarm;
-	Material *mat;
-
-	mat = MaterialPointsSwarm_GetMaterialOn(self, matPoint);
-	return ExtensionManager_Get(mat->extensionMgr, mat, extHandle);
-}
-
-void* MaterialPointsSwarm_GetMaterialExtensionAt( void* swarm, int matPointInd, Index extHandle ) {
-	MaterialPointsSwarm *self  = (MaterialPointsSwarm*)swarm;
-	Material *mat;
-
-	mat = MaterialPointsSwarm_GetMaterialAt(self, matPointInd);
-	return ExtensionManager_Get(mat->extensionMgr, mat, extHandle);
-}
-
 void* MaterialPointsSwarm_GetExtensionAt( void* swarm, Index point_I, Index extHandle ) {
 	MaterialPointsSwarm* self  = (MaterialPointsSwarm*)swarm;
 	MaterialPoint*       point;
@@ -564,5 +565,3 @@ void* MaterialPointsSwarm_GetExtensionAt
 	return ExtensionManager_Get( self->particleExtensionMgr, point, extHandle );
 	
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/MaterialPointsSwarm.h
--- a/MaterialPoints/src/MaterialPointsSwarm.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/MaterialPointsSwarm.h	Tue Feb 02 16:55:08 2010 +1100
@@ -78,34 +78,47 @@
 	** Constructors
 	*/
 	
-   MaterialPointsSwarm* MaterialPointsSwarm_New(
-      Name                                  name,
-      AbstractContext*                      context,
-      void*                                 cellLayout,
-      void*                                 particleLayout,
-      Dimension_Index                       dim,
-      SizeT                                 particleSize,
-      FeMesh*                               mesh,
-      EscapedRoutine*                       escapedRoutine, 
-      Material*                             material,
-      Variable_Register*                    swarmVariable_Register,
-      ExtensionManager_Register*            extensionMgr_Register,
-      Materials_Register*                   materials_Register,		
-      MPI_Comm                              comm,
-      void*                                 ics );
+	MaterialPointsSwarm* MaterialPointsSwarm_New(
+		Name                                            name,
+		void*                                           cellLayout,
+		void*                                           particleLayout,
+		Dimension_Index                                 dim,
+		SizeT                                           particleSize,
+		FeMesh*                   	                     mesh,
+		EscapedRoutine*                                 escapedRoutine, 
+		Material*                                       material,
+		Variable_Register*                              swarmVariable_Register,
+		ExtensionManager_Register*                      extensionMgr_Register,
+		Materials_Register*                             materials_Register,		
+		MPI_Comm                                        comm);
 		
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define MATERIALPOINTSSWARM_DEFARGS \
-                SWARM_DEFARGS
-
-	#define MATERIALPOINTSSWARM_PASSARGS \
-                SWARM_PASSARGS
-
-	MaterialPointsSwarm* _MaterialPointsSwarm_New(  MATERIALPOINTSSWARM_DEFARGS  );
+	MaterialPointsSwarm* _MaterialPointsSwarm_New(
+		SizeT                                           _sizeOfSelf, 
+		Type                                            type,
+		Stg_Class_DeleteFunction*                       _delete,
+		Stg_Class_PrintFunction*                        _print,
+		Stg_Class_CopyFunction*                         _copy, 
+		Stg_Component_DefaultConstructorFunction*       _defaultConstructor,
+		Stg_Component_ConstructFunction*                _construct,
+		Stg_Component_BuildFunction*                    _build,
+		Stg_Component_InitialiseFunction*               _initialise,
+		Stg_Component_ExecuteFunction*                  _execute,
+		Stg_Component_DestroyFunction*                  _destroy,		
+		Name                                            name,
+		Bool                                            initFlag,
+		CellLayout*                                     cellLayout,
+		ParticleLayout*                                 particleLayout,
+		Dimension_Index                                 dim,
+		SizeT                                           particleSize,
+		Particle_InCellIndex                            cellParticleTblDelta, 
+		double                                          extraParticlesFactor,
+		FeMesh*                   	                     mesh,
+		EscapedRoutine*                                 escapedRoutine, 
+		Material*                                       material,
+		Variable_Register*                              swarmVariable_Register,
+		ExtensionManager_Register*                      extensionMgr_Register,
+		Materials_Register*                             materials_Register,		
+		MPI_Comm                                        comm);
 
 	void _MaterialPointsSwarm_Delete( void* swarm );
 	void _MaterialPointsSwarm_Print( void* swarm, Stream* stream );
@@ -117,7 +130,7 @@
 	
 	void* _MaterialPointsSwarm_DefaultNew( Name name ) ;
 
-	void _MaterialPointsSwarm_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _MaterialPointsSwarm_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
 	void _MaterialPointsSwarm_Build( void* swarm, void* data ) ;
 	void _MaterialPointsSwarm_Initialise( void* swarm, void* data ) ;
 	void _MaterialPointsSwarm_Execute( void* swarm, void* data );
@@ -148,14 +161,7 @@
 	/** Returns the material instance associated with the given point index */
 	Index MaterialPointsSwarm_GetMaterialIndexAt( void* swarm, Index point_I );
 
-        /** Get the extension on a material. */
-        void* MaterialPointsSwarm_GetMaterialExtensionOn( void* swarm, void *matPoint, Index extHandle );
-
-        /** Get the extension on a material index. */
-        void* MaterialPointsSwarm_GetMaterialExtensionAt( void* swarm, int matPointInd, Index extHandle );
-
 	/** Returns the particle extension at given point index */
 	void* MaterialPointsSwarm_GetExtensionAt( void* swarm, Index point_I, Index extHandle );
 	
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/Materials_Register.c
--- a/MaterialPoints/src/Materials_Register.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/Materials_Register.c	Tue Feb 02 16:55:08 2010 +1100
@@ -59,16 +59,14 @@ const Type Materials_Register_Type = "Ma
 const Type Materials_Register_Type = "Materials_Register";
 
 Materials_Register* Materials_Register_New( void ) {
-	/* Variables set in this function */
-	SizeT                      _sizeOfSelf = sizeof(Materials_Register);
-	Type                              type = Materials_Register_Type;
-	Stg_Class_DeleteFunction*      _delete = _Materials_Register_Delete;
-	Stg_Class_PrintFunction*        _print = _Materials_Register_Print;
-	Stg_Class_CopyFunction*          _copy = _Materials_Register_Copy;
-
 	Materials_Register* self;
 
-	self = (Materials_Register*) _NamedObject_Register_New(  NAMEDOBJECT_REGISTER_PASSARGS  );
+	self = (Materials_Register*) _NamedObject_Register_New(
+		sizeof(Materials_Register),
+		Materials_Register_Type,
+		_Materials_Register_Delete,
+		_Materials_Register_Print,
+		_Materials_Register_Copy );
 
 	return self;
 }
@@ -125,14 +123,14 @@ ExtensionInfo_Index Materials_Register_A
 	for ( material_I = 0 ; material_I < Materials_Register_GetCount( self ) ; material_I++) {
 		material = Materials_Register_GetByIndex( self, material_I );
 
-		result = ExtensionManager_Add( material->extensionMgr, (Name)type, extensionSize );
+		result = ExtensionManager_Add( material->extensionMgr, type, extensionSize );
 
-		if ( material_I == 0  )
+		if ( material_I == 0 )
 			firstResult = result;
 		else {
 			Journal_Firewall( 
 				firstResult == result, 
-				Journal_Register( Error_Type, (Name)self->type  ),
+				Journal_Register( Error_Type, self->type ),
 				"Material '%s' has a different number of extensions than eariler materials.\n", 
 				material->name );
 		}
@@ -162,7 +160,7 @@ void Materials_Register_AssignParticlePr
 	Particle_Index      lParticle_I;
 	Particle_Index      particleLocalCount = swarm->particleLocalCount;
 	Particle_Index      particleGlobalCount = 0;
-	Stream*             stream = Journal_Register( Info_Type, (Name)self->type  );
+	Stream*             stream = Journal_Register( Info_Type, self->type );
 	Processor_Index     formerStreamPrintingRank;
 	double              setupStartTime = 0;
 	double              setupTime = 0, tmin, tmax;
@@ -218,11 +216,10 @@ void _Materials_Register_PrintParticleAs
 	static Particle_Index      nextCompletedParticleCountToPrint=0;
 	static Particle_Index      nextPlusOneCompletedParticleCountToPrint=0;
 
-	if (*firstStatusPrint) {
+	if (firstStatusPrint) {
 		nextCompletionRatioToPrint = completionRatioIncrement;
 		nextCompletedParticleCountToPrint = ceil(swarm->particleLocalCount * nextCompletionRatioToPrint - 0.001 );
 		nextPlusOneCompletedParticleCountToPrint=0;
-		*firstStatusPrint = False;
 	}
 
 	if ( /*(swarm->myRank == 0) && */ ((lParticle_I+1) >= nextCompletedParticleCountToPrint ) ) {
@@ -267,7 +264,7 @@ void Variable_SetValueFromDictionary( vo
 			Variable_SetValueShort( variable, index, Dictionary_GetUnsignedInt( dictionary, variable->name ));
 			break;
 		case Variable_DataType_Int:
-			Variable_SetValueInt( variable, index, Dictionary_GetInt( dictionary, (Dictionary_Entry_Key)variable->name ) );
+			Variable_SetValueInt( variable, index, Dictionary_GetInt( dictionary, variable->name ));
 			break;
 		case Variable_DataType_Float:
 			Variable_SetValueFloat(  variable, index, Dictionary_GetDouble( dictionary, variable->name ));
@@ -307,5 +304,3 @@ void Variable_Register_SetAllVariablesFr
 }
 
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/Materials_Register.h
--- a/MaterialPoints/src/Materials_Register.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/Materials_Register.h	Tue Feb 02 16:55:08 2010 +1100
@@ -58,9 +58,6 @@
 	
 	
 	extern const Type Materials_Register_Type;
-
-	/* global, default instantiation of this register (created in Init.c) */
-	extern Materials_Register* materials_Register;
 	
 	#define __Materials_Register \
 		__NamedObject_Register
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/OneToManyMapper.c
--- a/MaterialPoints/src/OneToManyMapper.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,193 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**	Melbourne, 3053, Australia.
-** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**	Victoria, 3800, Australia
-**
-** Primary Contributing Organisations:
-**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**	Monash Cluster Computing - http://www.mcc.monash.edu.au
-**
-** Contributors:
-**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id:  $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <mpi.h>
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include <PICellerator/PopulationControl/PopulationControl.h>
-#include <PICellerator/Weights/Weights.h>
-
-#include <assert.h>
-#include <string.h>
-#include <math.h>
-
-#include "MaterialPoints.h"
-
-const Type OneToManyMapper_Type = "OneToManyMapper";
-
-OneToManyMapper* _OneToManyMapper_New( ONETOMANYMAPPER_DEFARGS ) {
-	OneToManyMapper* result;
-
-	result = (OneToManyMapper*)_IntegrationPointMapper_New( INTEGRATIONPOINTMAPPER_PASSARGS );
-		
-	return result;
-}
-
-void _OneToManyMapper_Init( void* mapper, MaterialPointsSwarm* materialSwarm ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-
-	self->errorStream = Journal_MyStream( Error_Type, self );
-	self->materialSwarm = materialSwarm;
-
-	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, False );
-	self->refHandle = ExtensionManager_Add( self->integrationSwarm->particleExtensionMgr, (Name)materialSwarm->name, sizeof(OneToManyRef)  );
-	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, True );
-}
-
-void _OneToManyMapper_Delete( void* mapper ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-	
-	_IntegrationPointMapper_Delete( self );
-}
-void _OneToManyMapper_Print( void* mapper, Stream* stream ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-	
-	_IntegrationPointMapper_Print( self, stream );
-	Stream_Indent( stream );
-	Stg_Class_Print( self->materialSwarm, stream );
-	Stream_UnIndent( stream );
-}
-void* _OneToManyMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-	OneToManyMapper* newCopy;
-	
-	newCopy = (OneToManyMapper*)_IntegrationPointMapper_Copy( self, dest, deep, nameExt, ptrMap );
-	newCopy->materialSwarm = (MaterialPointsSwarm*)Stg_Class_Copy( self->materialSwarm, NULL, deep, nameExt, ptrMap );
-
-	return newCopy;
-}
-
-void _OneToManyMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-	MaterialPointsSwarm* materialSwarm;
-	
-	_IntegrationPointMapper_AssignFromXML( self, cf, data );
-
-	materialSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)MaterialPointsSwarm_Type, MaterialPointsSwarm, True, data   );
-
-	_OneToManyMapper_Init( self, materialSwarm );
-
-}
-
-void _OneToManyMapper_Build( void* mapper, void* data ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-
-	_IntegrationPointMapper_Build( mapper, data );
-	Stg_Component_Build( self->materialSwarm, data, False );
-	
-}
-void _OneToManyMapper_Initialise( void* mapper, void* data ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-
-	_IntegrationPointMapper_Initialise( mapper, data );
-	Stg_Component_Initialise( self->materialSwarm, data, False );
-}
-void _OneToManyMapper_Execute( void* mapper, void* data ) {}
-
-void _OneToManyMapper_Destroy( void* mapper, void* data ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-
-	/*Stg_Class_Delete( self->materialSwarm );*/
-
-	_IntegrationPointMapper_Destroy( self, data );
-}
-
-OneToManyRef* OneToManyMapper_GetMaterialRef( void* mapper, void* intPoint ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-
-	return (OneToManyRef*)ExtensionManager_Get( 
-			self->integrationSwarm->particleExtensionMgr, 
-			intPoint,
-			self->refHandle );
-}
-
-MaterialPointsSwarm** _OneToManyMapper_GetMaterialPointsSwarms( void* mapper, Index* count ) {
-	OneToManyMapper* self = (OneToManyMapper*)mapper;
-	MaterialPointsSwarm** result = Memory_Alloc_Array( MaterialPointsSwarm*, 1,  "Swarms" );
-	result[0] = self->materialSwarm;
-	*count = 1;
-
-	return result;
-}
-
-Material_Index _OneToManyMapper_GetMaterialIndexOn( void* mapper, void* point ) {
-    /* This method cannot work with a one-to-many mapping. */
-    return -1;
-}
-
-void* _OneToManyMapper_GetExtensionOn( void* mapper, void* point, ExtensionInfo_Index extHandle ) {
-    /* This method cannot work with a one-to-many mapping. */
-    return NULL;
-}
-
-double _OneToManyMapper_GetDoubleFromExtension(void* mapper, void* intPoint, ExtensionInfo_Index extHandle, int offs) {
-    OneToManyMapper *self = (OneToManyMapper*)mapper;
-    OneToManyRef *ref;
-    double v = 0.0, c;
-    int ii;
-
-    ref = OneToManyMapper_GetMaterialRef(mapper, intPoint);
-    for(ii = 0; ii < ref->numParticles; ii++) {
-	c = *(double*)(MaterialPointsSwarm_GetExtensionAt(self->materialSwarm, ref->particleInds[ii], extHandle) + offs);
-	v += ((double)ref->weights[ii])*c;
-    }
-
-    return v;
-}
-
-double _OneToManyMapper_GetDoubleFromMaterial(void* mapper, void* intPoint, ExtensionInfo_Index extHandle, int offs) {
-    OneToManyMapper *self = (OneToManyMapper*)mapper;
-    OneToManyRef *ref;
-    double v = 0.0, c;
-    int ii;
-
-    ref = OneToManyMapper_GetMaterialRef(mapper, intPoint);
-    for(ii = 0; ii < ref->numParticles; ii++) {
-	c = *(double*)(MaterialPointsSwarm_GetMaterialExtensionAt(self->materialSwarm, ref->particleInds[ii], extHandle) + offs);
-	v += ((double)ref->weights[ii])*c;
-    }
-
-    return v;
-}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/OneToManyMapper.h
--- a/MaterialPoints/src/OneToManyMapper.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**	Melbourne, 3053, Australia.
-** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**	Victoria, 3800, Australia
-**
-** Primary Contributing Organisations:
-**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**	Monash Cluster Computing - http://www.mcc.monash.edu.au
-**
-** Contributors:
-**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-*/
-/** \file
-**  Role:
-**     An IntegrationPointMapper which maps one MaterialPointsSwarm to one IntegrationPointsSwarm.
-**     Each material point will then have a corresponding integration point generated during mapping.
-**
-** Assumptions:
-**
-** Comments:
-**     Reverse mapping between integration point to material can be done through the IntegrationPointsSwarm or
-**     IntegrationPointMapper interface. It does this by extending each IntegrationPoint with a MaterialPointRef
-**     struct, which has enough information to fetch a particular point out of a particular swarm again.
-**     
-**
-** $Id: OneToManyMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#ifndef __PICellerator_MaterialPoints_OneToManyMapper_h__
-#define __PICellerator_MaterialPoints_OneToManyMapper_h__
-
-	extern const Type OneToManyMapper_Type;
-
-        struct OneToManyRef {
-	    int numParticles;
-	    int *particleInds;
-	    float *weights;
-        };
-
-	/* OneToManyMapper information */
-	#define __OneToManyMapper \
-		__IntegrationPointMapper \
-		\
-		Stream*				errorStream; \
-		MaterialPointsSwarm*		materialSwarm; \
-		Index                           refHandle; /**< Extension handle to reference struct of material points */
-
-	struct OneToManyMapper { __OneToManyMapper };
-
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define ONETOMANYMAPPER_DEFARGS \
-                INTEGRATIONPOINTMAPPER_DEFARGS
-
-	#define ONETOMANYMAPPER_PASSARGS \
-                INTEGRATIONPOINTMAPPER_PASSARGS
-	
-OneToManyMapper* _OneToManyMapper_New( ONETOMANYMAPPER_DEFARGS );
-
-void _OneToManyMapper_Init( void* mapper, MaterialPointsSwarm* materialSwarm );
-
-	void _OneToManyMapper_Delete( void* mapper );
-	void _OneToManyMapper_Print( void* mapper, Stream* stream );
-	#define OneToManyMapper_Copy( self ) \
-		(OneToManyMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-	#define OneToManyMapper_DeepCopy( self ) \
-		(OneToManyMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-	void* _OneToManyMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-	
-	void _OneToManyMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
-	void _OneToManyMapper_Build( void* mapper, void* data ) ;
-	void _OneToManyMapper_Initialise( void* mapper, void* data );
-	void _OneToManyMapper_Execute( void* mapper, void* data );
-	void _OneToManyMapper_Destroy( void* mapper, void* data );
-
-	MaterialPointsSwarm** _OneToManyMapper_GetMaterialPointsSwarms( void* mapper, Index* count );	
-	Material_Index _OneToManyMapper_GetMaterialIndexOn( void* mapper, void* point );
-	void* _OneToManyMapper_GetExtensionOn( void* mapper, void* point, ExtensionInfo_Index extHandle );
-        double _OneToManyMapper_GetDoubleFromExtension(void* mapper, void* intPoint, ExtensionInfo_Index extHandle, int offs);
-        double _OneToManyMapper_GetDoubleFromMaterial(void* mapper, void* intPoint, ExtensionInfo_Index extHandle, int offs);
-
-        OneToManyRef* OneToManyMapper_GetMaterialRef( void* mapper, void* intPoint );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/OneToManyMapper.meta
--- a/MaterialPoints/src/OneToManyMapper.meta	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-
-<param name="Name">OneToManyMapper</param>
-<param name="Author">...</param>
-<param name="Organisation">VPAC and MCC</param>
-<param name="Project">PICellerator</param>
-<param name="Location">./PICellerator/MaterialPoints/src/</param>
-<param name="Project Web">http://www.stgermainproject.org/PICellerator.html</param>
-<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
-<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
-<param name="Parent">IntegrationPointMapper</param>
-<param name="Reference">...</param>
-<param name="Summary">...</param>
-<param name="Description">An abstract mapper which will yield one-to-one mapping of integration points to material points.</param>
-
-<!--Now the interesting stuff-->
-<list name="Params">
-</list>
-
-<list name="Dependencies">
-	<struct>
-		<param name="Essential">True</param>
-		<param name="Name">MaterialPointsSwarm</param>
-		<param name="Type">MaterialPointsSwarm</param>
-		<param name="Description">The list of material points to be mapped.</param>
-	</struct>
-</list>
-
-<!-- Add an exmaple XML if possible -->
-<param name="Example">n/a</param>
-
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/OneToOneMapper.c
--- a/MaterialPoints/src/OneToOneMapper.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/OneToOneMapper.c	Tue Feb 02 16:55:08 2010 +1100
@@ -58,31 +58,79 @@
 
 const Type OneToOneMapper_Type = "OneToOneMapper";
 
-OneToOneMapper* _OneToOneMapper_New(  ONETOONEMAPPER_DEFARGS  ) {
+OneToOneMapper* _OneToOneMapper_New(
+		SizeT                                                           _sizeOfSelf,
+		Type                                                            type,
+		Stg_Class_DeleteFunction*                                       _delete,
+		Stg_Class_PrintFunction*                                        _print,
+		Stg_Class_CopyFunction*                                         _copy,
+		Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+		Stg_Component_ConstructFunction*                                _construct,
+		Stg_Component_BuildFunction*                                    _build,
+		Stg_Component_InitialiseFunction*                               _initialise,
+		Stg_Component_ExecuteFunction*                                  _execute,
+		Stg_Component_DestroyFunction*                                  _destroy,
+		IntegrationPointMapper_MapFunction*                             _map,
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+		IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+		IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+		Name                                                            name,
+		Bool                                                            initFlag,
+		IntegrationPointsSwarm*                                         integrationSwarm,
+		MaterialPointsSwarm*                                            materialSwarm )
+{
 	OneToOneMapper* result;
 
-	result = (OneToOneMapper*)_IntegrationPointMapper_New(  INTEGRATIONPOINTMAPPER_PASSARGS  );
+	result = (OneToOneMapper*)_IntegrationPointMapper_New(
+					_sizeOfSelf,
+					type,
+					_delete,
+					_print,
+					_copy,
+					_defaultConstructor,
+					_construct,
+					_build,
+					_initialise,
+					_execute,
+					_destroy,
+					_map,
+					_getMaterialPointsSwarms,
+					_getMaterialIndexOn,
+					_getExtensionOn,
+					name,
+					initFlag,
+					integrationSwarm );
 
+	if (initFlag) {
+		_OneToOneMapper_Init( result, integrationSwarm, materialSwarm );
+	}
+		
 	return result;
 }
 
-void _OneToOneMapper_Init( void* mapper, MaterialPointsSwarm* materialSwarm ) {
+void _OneToOneMapper_Init( void* mapper, IntegrationPointsSwarm* integrationSwarm, MaterialPointsSwarm* materialSwarm ) {
 	OneToOneMapper* self = (OneToOneMapper*)mapper;
+
+	_IntegrationPointMapper_Init( mapper, integrationSwarm );
 	
 	self->errorStream = Journal_MyStream( Error_Type, self );
 	self->materialSwarm = materialSwarm;
 
 	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, False );
-	self->materialRefHandle = ExtensionManager_Add( self->integrationSwarm->particleExtensionMgr, (Name)materialSwarm->name, sizeof(MaterialPointRef)  );
+	self->materialRefHandle = ExtensionManager_Add( 
+				self->integrationSwarm->particleExtensionMgr,
+				materialSwarm->name, 
+				sizeof(MaterialPointRef) );
 	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, True );
 }
 
 void _OneToOneMapper_Delete( void* mapper ) {
 	OneToOneMapper* self = (OneToOneMapper*)mapper;
 
+	Stg_Class_Delete( self->materialSwarm );
+	
 	_IntegrationPointMapper_Delete( self );
 }
-
 void _OneToOneMapper_Print( void* mapper, Stream* stream ) {
 	OneToOneMapper* self = (OneToOneMapper*)mapper;
 	
@@ -91,7 +139,6 @@ void _OneToOneMapper_Print( void* mapper
 	Stg_Class_Print( self->materialSwarm, stream );
 	Stream_UnIndent( stream );
 }
-
 void* _OneToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	OneToOneMapper* self = (OneToOneMapper*)mapper;
 	OneToOneMapper* newCopy;
@@ -102,15 +149,22 @@ void* _OneToOneMapper_Copy( void* mapper
 	return newCopy;
 }
 
-void _OneToOneMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-	OneToOneMapper*		self = (OneToOneMapper*)mapper;
-	MaterialPointsSwarm*	materialSwarm;
+void _OneToOneMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
+	MaterialPointsSwarm* materialSwarm;
+	
+	_IntegrationPointMapper_Construct( self, cf, data );
 
-	_IntegrationPointMapper_AssignFromXML( self, cf, data );
+	materialSwarm = Stg_ComponentFactory_ConstructByKey( 
+				cf, 
+				self->name, 
+				MaterialPointsSwarm_Type, 
+				MaterialPointsSwarm,  
+				True,
+				data  );
 
-	materialSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)MaterialPointsSwarm_Type, MaterialPointsSwarm, True, data  );
+	_OneToOneMapper_Init( self, self->integrationSwarm, materialSwarm );
 
-	_OneToOneMapper_Init( self, materialSwarm );
 }
 
 void _OneToOneMapper_Build( void* mapper, void* data ) {
@@ -118,61 +172,65 @@ void _OneToOneMapper_Build( void* mapper
 
 	_IntegrationPointMapper_Build( mapper, data );
 	Stg_Component_Build( self->materialSwarm, data, False );
+	
 }
-
 void _OneToOneMapper_Initialise( void* mapper, void* data ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
-
-    _IntegrationPointMapper_Initialise( mapper, data );
-    Stg_Component_Initialise( self->materialSwarm, data, False );
-}
-
-void _OneToOneMapper_Execute( void* mapper, void* data ) {}
-
-void _OneToOneMapper_Destroy( void* mapper, void* data ) {
 	OneToOneMapper* self = (OneToOneMapper*)mapper;
 
-	_IntegrationPointMapper_Destroy( self, data );
+	_IntegrationPointMapper_Initialise( mapper, data );
+	Stg_Component_Initialise( self->materialSwarm, data, False );
 }
+void _OneToOneMapper_Execute( void* mapper, void* data ) {}
+void _OneToOneMapper_Destroy( void* mapper, void* data ) {}
 
 MaterialPointRef* OneToOneMapper_GetMaterialRef( void* mapper, void* integrationPoint ) {
 	OneToOneMapper* self = (OneToOneMapper*)mapper;
 
-	return (MaterialPointRef*)ExtensionManager_Get( self->integrationSwarm->particleExtensionMgr, integrationPoint, self->materialRefHandle );
+	return (MaterialPointRef*)ExtensionManager_Get( 
+			self->integrationSwarm->particleExtensionMgr, 
+			integrationPoint, 
+			self->materialRefHandle );
 }
 
 MaterialPoint* OneToOneMapper_GetMaterialPoint( void* mapper, void* integrationPoint, MaterialPointsSwarm** materialSwarm ) {
-	OneToOneMapper*		self = (OneToOneMapper*)mapper;
-	MaterialPointRef*		ref;
-	MaterialPointsSwarm*	swarm;
-	MaterialPoint*			materialPoint; /* Assumes that material swarm holds Material particle or derivative */
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
+	MaterialPointRef*       ref;
+	MaterialPointsSwarm*    swarm;
+	MaterialPoint*          materialPoint; /* Assumes that material swarm holds Material particle or derivative */
 
 	ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
-	Journal_Firewall( ref != NULL, self->errorStream, "In func %s, no MaterialPointRef found on point\n", __func__ );
+	Journal_Firewall(
+			ref != NULL,
+			self->errorStream, 
+			"In func %s, no MaterialPointRef found on point\n",
+			__func__ );
 
 	swarm = (MaterialPointsSwarm*)Swarm_Register_At( Swarm_Register_GetSwarm_Register(), ref->swarm_I );
-	Journal_Firewall( swarm != NULL, self->errorStream, "In func %s, no swarm found on for index %d\n", __func__, ref->swarm_I );
-
+	Journal_Firewall(
+			swarm != NULL,
+			self->errorStream, 
+			"In func %s, no swarm found on for index %d\n",
+			__func__,
+			ref->swarm_I );
 	if ( materialSwarm != NULL ) {
 		*materialSwarm = swarm;
 	}
 
 	materialPoint = (MaterialPoint*)Swarm_ParticleAt( swarm, ref->particle_I );
 	Journal_Firewall(
-		materialPoint != NULL,
-		self->errorStream, 
-		"In func %s, no MaterialPoint found for swarm index %d, point index %d\n",
-		__func__,
-		ref->swarm_I,
-		ref->particle_I );
+			materialPoint != NULL,
+			self->errorStream, 
+			"In func %s, no MaterialPoint found for swarm index %d, point index %d\n",
+			__func__,
+			ref->swarm_I,
+			ref->particle_I );
 
 	return materialPoint;
 }
 
 MaterialPointsSwarm** _OneToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count ) {
-	OneToOneMapper*			self = (OneToOneMapper*)mapper;
-	MaterialPointsSwarm**	result = Memory_Alloc_Array( MaterialPointsSwarm*, 1,  "Swarms" );
-
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
+	MaterialPointsSwarm** result = Memory_Alloc_Array( MaterialPointsSwarm*, 1,  "Swarms" );
 	result[0] = self->materialSwarm;
 	*count = 1;
 
@@ -180,32 +238,19 @@ MaterialPointsSwarm** _OneToOneMapper_Ge
 }
 
 Material_Index _OneToOneMapper_GetMaterialIndexOn( void* mapper, void* point ) {
-	OneToOneMapper*	self = (OneToOneMapper*)mapper;
-	MaterialPoint*		materialPoint; /* Assumes that material swarm holds Material particle or derivative */
+	OneToOneMapper*         self           = (OneToOneMapper*)mapper;
+	MaterialPoint*          materialPoint; /* Assumes that material swarm holds Material particle or derivative */
 	
 	materialPoint = OneToOneMapper_GetMaterialPoint( self, point, NULL );
 
 	return materialPoint->materialIndex;
 }
-
 void* _OneToOneMapper_GetExtensionOn( void* mapper, void* point, ExtensionInfo_Index extHandle ) {
-	OneToOneMapper*		self = (OneToOneMapper*)mapper;
-	MaterialPointsSwarm*	swarm;
-	MaterialPoint*			materialPoint; /* Assumes that material swarm holds Material particle or derivative */
+	OneToOneMapper*         self = (OneToOneMapper*)mapper;
+	MaterialPointsSwarm*    swarm;
+	MaterialPoint*          materialPoint; /* Assumes that material swarm holds Material particle or derivative */
 
 	materialPoint = OneToOneMapper_GetMaterialPoint( self, point, &swarm );
 
 	return ExtensionManager_Get( swarm->particleExtensionMgr, materialPoint, extHandle );
 }
-
-double _OneToOneMapper_GetDoubleFromExtension(void* mapper, void* intPoint, ExtensionInfo_Index extHandle, int offs) {
-    return *(double*)(IntegrationPointMapper_GetExtensionOn(mapper, intPoint, extHandle) + offs);
-}
-
-double _OneToOneMapper_GetDoubleFromMaterial(void* mapper, void* intPoint, ExtensionInfo_Index extHandle, int offs) {
-    MaterialPointsSwarm *matSwarm;
-    MaterialPoint *matPoint;
-
-    matPoint = OneToOneMapper_GetMaterialPoint(mapper, intPoint, &matSwarm);
-    return *(double*)(MaterialPointsSwarm_GetMaterialExtensionOn(matSwarm, matPoint, extHandle) + offs);
-}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/OneToOneMapper.h
--- a/MaterialPoints/src/OneToOneMapper.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/OneToOneMapper.h	Tue Feb 02 16:55:08 2010 +1100
@@ -40,21 +40,21 @@
 **
 */
 /** \file
- **  Role:
- **     An IntegrationPointMapper which maps one MaterialPointsSwarm to one IntegrationPointsSwarm.
- **     Each material point will then have a corresponding integration point generated during mapping.
- **
- ** Assumptions:
- **
- ** Comments:
- **     Reverse mapping between integration point to material can be done through the IntegrationPointsSwarm or
- **     IntegrationPointMapper interface. It does this by extending each IntegrationPoint with a MaterialPointRef
- **     struct, which has enough information to fetch a particular point out of a particular swarm again.
- **     
- **
- ** $Id: OneToOneMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**     An IntegrationPointMapper which maps one MaterialPointsSwarm to one IntegrationPointsSwarm.
+**     Each material point will then have a corresponding integration point generated during mapping.
+**
+** Assumptions:
+**
+** Comments:
+**     Reverse mapping between integration point to material can be done through the IntegrationPointsSwarm or
+**     IntegrationPointMapper interface. It does this by extending each IntegrationPoint with a MaterialPointRef
+**     struct, which has enough information to fetch a particular point out of a particular swarm again.
+**     
+**
+** $Id: OneToOneMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_MaterialPoints_OneToOneMapper_h__
 #define __PICellerator_MaterialPoints_OneToOneMapper_h__
@@ -65,61 +65,58 @@
 	#define __OneToOneMapper \
 		__IntegrationPointMapper \
 		\
-		Stream*					errorStream; \
-		MaterialPointsSwarm*	materialSwarm; \
-		Index						materialRefHandle; /**< Extension handle to reference struct of material points */
+		Stream*				errorStream; \
+		MaterialPointsSwarm*		materialSwarm; \
+		Index                           materialRefHandle; /**< Extension handle to reference struct of material points */
 
 	struct OneToOneMapper { __OneToOneMapper };
+	
+	OneToOneMapper* _OneToOneMapper_New(
+			SizeT                                                           _sizeOfSelf,
+			Type                                                            type,
+			Stg_Class_DeleteFunction*                                       _delete,
+			Stg_Class_PrintFunction*                                        _print,
+			Stg_Class_CopyFunction*                                         _copy,
+			Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
+			Stg_Component_ConstructFunction*                                _construct,
+			Stg_Component_BuildFunction*                                    _build,
+			Stg_Component_InitialiseFunction*                               _initialise,
+			Stg_Component_ExecuteFunction*                                  _execute,
+			Stg_Component_DestroyFunction*                                  _destroy,
+			IntegrationPointMapper_MapFunction*                             _map,
+			IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
+			IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
+			IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
+			Name                                                            name,
+			Bool                                                            initFlag,
+			IntegrationPointsSwarm*                                         integrationSwarm,
+			MaterialPointsSwarm*                                            materialSwarm );
 
-
-	
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define ONETOONEMAPPER_DEFARGS \
-                INTEGRATIONPOINTMAPPER_DEFARGS
-
-	#define ONETOONEMAPPER_PASSARGS \
-                INTEGRATIONPOINTMAPPER_PASSARGS
-
-	OneToOneMapper* _OneToOneMapper_New(  ONETOONEMAPPER_DEFARGS  );
-
-	void _OneToOneMapper_Init( void* mapper, MaterialPointsSwarm* materialSwarm );
+	void _OneToOneMapper_Init( 
+			void*                   mapper, 
+			IntegrationPointsSwarm* integrationSwarm,
+			MaterialPointsSwarm*    materialSwarm );
 
 	void _OneToOneMapper_Delete( void* mapper );
-
 	void _OneToOneMapper_Print( void* mapper, Stream* stream );
-
 	#define OneToOneMapper_Copy( self ) \
 		(OneToOneMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define OneToOneMapper_DeepCopy( self ) \
 		(OneToOneMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
 	void* _OneToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-	void _OneToOneMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
-
-	void _OneToOneMapper_Build( void* mapper, void* data );
-
+	void _OneToOneMapper_Construct( void* shape, Stg_ComponentFactory* cf, void* data );
+	void _OneToOneMapper_Build( void* mapper, void* data ) ;
 	void _OneToOneMapper_Initialise( void* mapper, void* data );
-
 	void _OneToOneMapper_Execute( void* mapper, void* data );
-
 	void _OneToOneMapper_Destroy( void* mapper, void* data );
 
 	MaterialPointsSwarm** _OneToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count );	
-
 	Material_Index _OneToOneMapper_GetMaterialIndexOn( void* mapper, void* point );
-
 	void* _OneToOneMapper_GetExtensionOn( void* mapper, void* point, ExtensionInfo_Index extHandle );
-    double _OneToOneMapper_GetDoubleFromExtension(void* mapper, void* intPoint, ExtensionInfo_Index extHandle, int offs);
-    double _OneToOneMapper_GetDoubleFromMaterial(void* mapper, void* intPoint, ExtensionInfo_Index extHandle, int offs);
 
 	MaterialPointRef* OneToOneMapper_GetMaterialRef( void* mapper, void* integrationPoint );
-
 	MaterialPoint* OneToOneMapper_GetMaterialPoint( void* mapper, void* integrationPoint, MaterialPointsSwarm** materialSwarm );
 	
+	
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/PICelleratorContext.c
--- a/MaterialPoints/src/PICelleratorContext.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**	Melbourne, 3053, Australia.
-** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**	Victoria, 3800, Australia
-**
-** Primary Contributing Organisations:
-**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**	Monash Cluster Computing - http://www.mcc.monash.edu.au
-**
-** Contributors:
-**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: Context.c 518 2007-10-11 08:07:50Z SteveQuenette $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <mpi.h>
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-
-#include "types.h"
-#include "Materials_Register.h"
-#include "Material.h"
-#include "PICelleratorContext.h"
-
-/* Textual name of this class */
-const Type PICelleratorContext_Type = "PICelleratorContext";
-
-/* Constructors ------------------------------------------------------------------------------------------------*/
-
-PICelleratorContext* PICelleratorContext_New( 
-	Name			name,
-	double		start,
-	double		stop,
-	MPI_Comm		communicator,
-	Dictionary*	dictionary )
-{
-	PICelleratorContext* self = _PICelleratorContext_DefaultNew( name );
-
-	self->isConstructed = True;
-	_AbstractContext_Init( (AbstractContext*) self );
-	_DomainContext_Init( (DomainContext*) self );	
-	_FiniteElementContext_Init( (FiniteElementContext*) self );
-	_PICelleratorContext_Init( self );
-
-	return self;
-}	
-
-PICelleratorContext* _PICelleratorContext_New(  PICELLERATORCONTEXT_DEFARGS  ) {
-	PICelleratorContext* self;
-	
-	/* Allocate memory */
-	self = (PICelleratorContext*)_FiniteElementContext_New(  FINITEELEMENTCONTEXT_PASSARGS  );
-	
-	/* General info */
-	
-	/* Virtual info */
-	
-	return self;
-}
-
-void* _PICelleratorContext_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(PICelleratorContext);
-	Type                                                      type = PICelleratorContext_Type;
-	Stg_Class_DeleteFunction*                              _delete = _PICelleratorContext_Delete;
-	Stg_Class_PrintFunction*                                _print = _PICelleratorContext_Print;
-	Stg_Class_CopyFunction*                                  _copy = NULL;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _PICelleratorContext_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _PICelleratorContext_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _AbstractContext_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _AbstractContext_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = (Stg_Component_ExecuteFunction*)_AbstractContext_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _PICelleratorContext_Destroy;
-	AllocationType                              nameAllocationType = NON_GLOBAL;
-	AbstractContext_SetDt*                                  _setDt = _PICelleratorContext_SetDt;
-	double                                               startTime = 0;
-	double                                                stopTime = 0;
-	MPI_Comm                                          communicator = MPI_COMM_WORLD;
-	Dictionary*                                         dictionary = NULL;
-
-	return (void*) _PICelleratorContext_New(  PICELLERATORCONTEXT_PASSARGS  );
-}
-
-void _PICelleratorContext_Init( void* context ) {
-	PICelleratorContext* self = (PICelleratorContext*)context;
-	self->isConstructed = True;
-
-	self->materials_Register = Materials_Register_New();
-
-	ContextEP_Prepend( self, AbstractContext_EP_AssignFromXMLExtensions, 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 */
-}
-
-
-/* Virtual Functions -------------------------------------------------------------------------------------------------------------*/
-
-void _PICelleratorContext_Delete( void* context ) {
-	PICelleratorContext* self = (PICelleratorContext*)context;
-	
-	Journal_DPrintf( self->debug, "In: %s()\n", __func__ );
-
-	Stg_Class_Delete( self->materials_Register );
-
-	/* Stg_Class_Delete parent */
-	_FiniteElementContext_Delete( self );
-}
-
-void _PICelleratorContext_Destroy( void* context ) {
-	PICelleratorContext* self = (PICelleratorContext*)context;
-	
-	_FiniteElementContext_Destroy( self );
-}
-
-void _PICelleratorContext_Print( void* context, Stream* stream ) {
-	PICelleratorContext* self = (PICelleratorContext*)context;
-	
-	/* General info */
-	Journal_Printf( (void*) stream, "PICelleratorContext (ptr): %p\n", self );
-	
-	/* Print parent */
-	_FiniteElementContext_Print( self, stream );
-
-	Journal_PrintPointer( stream, self->materials_Register );
-
-}
-
-void _PICelleratorContext_SetDt( void* context, double dt ) {
-	PICelleratorContext* self = (PICelleratorContext*)context;
-	
-	self->dt = dt;
-}
-
-
-/* Public Functions ----------------------------------------------------------------------------------------------------*/
-
-
-
-/* EntryPoint Hooks ----------------------------------------------------------------------------------------------------*/
-void PICelleratorContext_CreateDefaultMaterial( void* context ) {
-	PICelleratorContext* self = (PICelleratorContext*) context;
-	
-	if ( Materials_Register_GetCount( self->materials_Register ) == 0 ) {
-		Stg_Shape* everywhereShape = (Stg_Shape*) Everywhere_New( "defaultShape", self->dim );
-
-		Material_New( "backgroundMaterial", self, everywhereShape, self->dictionary, self->materials_Register );
-	}
-}
-
-void _PICelleratorContext_AssignFromXML( void* context, Stg_ComponentFactory *cf, void* data ){
-	PICelleratorContext* self = (PICelleratorContext*) context;
-	
-	_FiniteElementContext_AssignFromXML( context, cf, data );
-
-	_PICelleratorContext_Init( self );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/PICelleratorContext.h
--- a/MaterialPoints/src/PICelleratorContext.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**	Melbourne, 3053, Australia.
-** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**	Victoria, 3800, Australia
-**
-** Primary Contributing Organisations:
-**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**	Monash Cluster Computing - http://www.mcc.monash.edu.au
-**
-** Contributors:
-**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-*/
-/** \file
-**  Role:
-**	Class allowing the user to construct and solve a hybrid FEM/PIC problem
-**
-** Assumptions:
-**
-** Comments:
-**
-** $Id: Context.h 374 2006-10-12 08:59:41Z SteveQuenette $
-*
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#ifndef __PICellerator_MaterialPoints_Context_h__
-#define __PICellerator_MaterialPoints_Context_h__
-	
-	/* Textual name of this class */
-	extern const Type PICelleratorContext_Type;
-	
-	#define __PICelleratorContext \
-		/* General info */ \
-		__FiniteElementContext \
-		\
-		/* Virtual info */ \
-		\
-		/* PICelleratorContext info */ \
-		Materials_Register*	materials_Register;
-
-	struct PICelleratorContext { __PICelleratorContext };
-
-
-	
-	/* Constructors ----------------------------------------------------------------------------------------------------*/
-	
-	/** Constructor */
-	void* _PICelleratorContext_DefaultNew( Name name );
-	
-	PICelleratorContext* PICelleratorContext_New( 
-		Name			name,
-		double		start,
-		double		stop,
-		MPI_Comm		communicator,
-		Dictionary*	dictionary );
-	
-	/** Creation implementation / Virtual constructor */
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define PICELLERATORCONTEXT_DEFARGS \
-                FINITEELEMENTCONTEXT_DEFARGS
-
-	#define PICELLERATORCONTEXT_PASSARGS \
-                FINITEELEMENTCONTEXT_PASSARGS
-
-	PICelleratorContext* _PICelleratorContext_New(  PICELLERATORCONTEXT_DEFARGS  );
-	
-	/** Initialisation implementation */
-	void _PICelleratorContext_Init( void* context );
-
-	/* Virtual Functions -----------------------------------------------------------------------------------------------*/
-
-	void _PICelleratorContext_AssignFromXML( void* context, Stg_ComponentFactory* cf, void* data );
-	
-	/* Stg_Class_Delete implementation */
-	void _PICelleratorContext_Delete( void* context );
-
-	/* Destroy implementation */	
-	void _PICelleratorContext_Destroy( void* context );
-
-	/* Print implementation */
-	void _PICelleratorContext_Print( void* context, Stream* stream );
-	
-	/* Set the dt */
-	void _PICelleratorContext_SetDt( void* context, double dt );
-
-	void _PICelleratorContext_AssignFromXML( void* context, Stg_ComponentFactory* cf, void* data );
-	
-	/* Public functions -----------------------------------------------------------------------------------------------*/
-	void PICelleratorContext_CreateDefaultMaterial( void* context ) ;
-	
-	/* Private functions -----------------------------------------------------------------------------------------------*/
-#endif /* __PICelleratorContext_h__ */
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/PICelleratorContext.meta
--- a/MaterialPoints/src/PICelleratorContext.meta	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-
-<param name="Name">PICelleratorContext</param>
-<param name="Organisation">VPAC and MCC</param>
-<param name="Project">PICellerator</param>
-<param name="Location">./PICellerator/MaterialPoints/src/</param>
-<param name="Project Web">http://www.stgermainproject.org/PICellerator.html</param>
-<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
-<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
-<param name="Parent">FiniteElementContext</param>
-<param name="Description">...</param>
-
-<!--Now the interesting stuff-->
-
-
-<list name="Params">
-
-</list>
-
-<list name="Dependencies">
-
-</list>
-<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
-
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/ParticleFeVariable.c
--- a/MaterialPoints/src/ParticleFeVariable.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/ParticleFeVariable.c	Tue Feb 02 16:55:08 2010 +1100
@@ -60,52 +60,105 @@ int ParticleFeVariable_nNames = 0;
 int ParticleFeVariable_nNames = 0;
 int ParticleFeVariable_curName = 0;
 
-ParticleFeVariable* _ParticleFeVariable_New(  PARTICLEFEVARIABLE_DEFARGS  ) {
-	ParticleFeVariable* self;
+ParticleFeVariable* _ParticleFeVariable_New(
+ 		SizeT                                             _sizeOfSelf,
+		Type                                              type,
+		Stg_Class_DeleteFunction*                         _delete,
+		Stg_Class_PrintFunction*                          _print,
+		Stg_Class_CopyFunction*                           _copy, 
+		Stg_Component_DefaultConstructorFunction*         _defaultConstructor,
+		Stg_Component_ConstructFunction*                  _construct,
+		Stg_Component_BuildFunction*                      _build,
+		Stg_Component_InitialiseFunction*                 _initialise,
+		Stg_Component_ExecuteFunction*                    _execute,
+		Stg_Component_DestroyFunction*                    _destroy,
+		FieldVariable_InterpolateValueAtFunction*         _interpolateValueAt,
+		FieldVariable_GetValueFunction*	                  _getMinGlobalFeMagnitude,
+		FieldVariable_GetValueFunction*                   _getMaxGlobalFeMagnitude,
+		FieldVariable_GetCoordFunction*                   _getMinAndMaxLocalCoords,
+		FieldVariable_GetCoordFunction*                   _getMinAndMaxGlobalCoords,		
+		FeVariable_InterpolateWithinElementFunction*      _interpolateWithinElement,	
+		FeVariable_GetValueAtNodeFunction*                _getValueAtNode,
+		ParticleFeVariable_ValueAtParticleFunction*       _valueAtParticle,
+		Name                                              name )
+{
+	ParticleFeVariable*		self;
 	
 	/* Allocate memory */
 	assert( _sizeOfSelf >= sizeof(ParticleFeVariable) );
-	/* The following terms are parameters that have been passed into this function but are being set before being passed onto the parent */
-	/* This means that any values of these parameters that are passed into this function are not passed onto the parent function
-	   and so should be set to ZERO in any children of this class. */
-	nameAllocationType = NON_GLOBAL;
-	_syncShadowValues  = _FeVariable_SyncShadowValues;
-	_getMinGlobalFieldMagnitude = _FeVariable_GetMinGlobalFieldMagnitude;
-	_getMaxGlobalFieldMagnitude = _FeVariable_GetMaxGlobalFieldMagnitude;
-
-	self = (ParticleFeVariable*) _FeVariable_New(  FEVARIABLE_PASSARGS  );
+	self = (ParticleFeVariable*)
+		_FeVariable_New(
+			_sizeOfSelf, 
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute, 
+			_destroy,
+			name,
+			False,
+			_interpolateValueAt,
+			_getMinGlobalFeMagnitude, 
+			_getMaxGlobalFeMagnitude,
+			_getMinAndMaxLocalCoords, 
+			_getMinAndMaxGlobalCoords,
+			_interpolateWithinElement,
+			_getValueAtNode,
+			_FeVariable_SyncShadowValues, 
+			NULL,
+			NULL,
+			NULL,
+			NULL,   /* bcs */
+			NULL,   /* ics */
+			NULL,   /* linkedDofInfo */
+			NULL,   /* templateFeVariable */
+			0,      /* fieldComponentCount */
+			0,	/* dim */
+			True, /* isCheckpointedAndReloaded */
+			False,  /* use a reference solution from file */
+			False,  /* load the reference solution at each time step */
+			0,	/* communicator */
+			NULL	/* fv_Register */
+			);
 
 	self->_valueAtParticle = _valueAtParticle;
 	
 	return self;
 }
 
-void _ParticleFeVariable_Init( ParticleFeVariable* self, IntegrationPointsSwarm* swarm ) {
+void _ParticleFeVariable_Init( ParticleFeVariable* self, IntegrationPointsSwarm* swarm, FiniteElementContext* context ) 
+{
 	/* Create Vector */
-	self->assemblyVectorName = Stg_Object_AppendSuffix( self, (Name)"assemblyVector"  );
-	self->assemblyVector = ForceVector_New( 
-		self->assemblyVectorName,
-		(FiniteElementContext*) self->context,
-		(FeVariable*) self, 
-		self->dim, 
-		self->context->entryPoint_Register, 
-		self->communicator );
-	self->assemblyTerm = ForceTerm_New( "assemblyTerm", (FiniteElementContext*) self->context, self->assemblyVector, (Swarm*)swarm, (Stg_Component*) self );
+	self->assemblyVectorName = Stg_Object_AppendSuffix( self, "assemblyVector" );
+	self->assemblyVector = 
+		ForceVector_New( 
+			self->assemblyVectorName,
+			(FeVariable*) self, 
+			self->dim, 
+			context->entryPoint_Register, 
+			self->communicator );
+	self->assemblyTerm = ForceTerm_New( "assemblyTerm", self->assemblyVector, (Swarm*)swarm, (Stg_Component*) self );
 
-	self->massMatrixName = Stg_Object_AppendSuffix( self, (Name)"massMatrix"  );
-	self->massMatrix = ForceVector_New( 
-		self->massMatrixName,
-		(FiniteElementContext*) self->context,
-		(FeVariable*) self, 
-		self->dim, 
-		self->context->entryPoint_Register, 
-		self->communicator );
-	self->massMatrixForceTerm = ForceTerm_New( "massMatrixForceTerm", (FiniteElementContext*) self->context, self->massMatrix, (Swarm*)swarm, (Stg_Component*) self );
+	self->massMatrixName = Stg_Object_AppendSuffix( self, "massMatrix" );
+	self->massMatrix = 
+		ForceVector_New( 
+			self->massMatrixName,
+			(FeVariable*) self, 
+			self->dim, 
+			context->entryPoint_Register, 
+			self->communicator );
+	self->massMatrixForceTerm = 
+		ForceTerm_New( "massMatrixForceTerm", self->massMatrix, (Swarm*)swarm, (Stg_Component*) self );
 	ForceTerm_SetAssembleElementFunction( self->massMatrixForceTerm, ParticleFeVariable_AssembleElementShapeFunc );
+	
    
    /* Changed by PatrickSunter, 8/7/2009 - used to append onto stokesEqn-execute. However
     * this component should work for other FE systems other than the Stokes solver */
-	EP_InsertClassHookBefore( Context_GetEntryPoint( self->context, AbstractContext_EP_UpdateClass ), "TimeIntegrator_UpdateClass", _ParticleFeVariable_Execute, self );
+	EP_InsertClassHookBefore( Context_GetEntryPoint( context, AbstractContext_EP_UpdateClass ), "TimeIntegrator_UpdateClass", _ParticleFeVariable_Execute, self );
 	ParticleFeVariable_names[ParticleFeVariable_nNames++] = self->name;
 
 	self->useDeriv = False;
@@ -115,6 +168,16 @@ void _ParticleFeVariable_Init( ParticleF
 /* --- Virtual Function Implementations --- */
 void _ParticleFeVariable_Delete( void* materialFeVariable ) {
 	ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
+
+	Memory_Free( self->data );
+
+	Stg_Class_Delete( self->assemblyVector );
+	Memory_Free( self->assemblyVectorName );
+	Stg_Class_Delete( self->assemblyTerm );
+
+	Stg_Class_Delete( self->massMatrix );
+	Memory_Free( self->massMatrixName );
+	Stg_Class_Delete( self->massMatrixForceTerm );
 
 	_FeVariable_Delete( self );
 }
@@ -131,26 +194,27 @@ void _ParticleFeVariable_Print( void* ma
 	/* ParticleFeVariable info */
 }
 
+
 void* _ParticleFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	abort();
 	
 	return NULL;
 }
 
-void _ParticleFeVariable_AssignFromXML( void* materialFeVariable, Stg_ComponentFactory* cf, void* data ){
-	ParticleFeVariable*		self = (ParticleFeVariable*) materialFeVariable;
-	IntegrationPointsSwarm*	swarm;
-	FiniteElementContext*	context;
-	FeMesh*						mesh;
+void _ParticleFeVariable_Construct( void* materialFeVariable, Stg_ComponentFactory* cf, void* data ){
+	ParticleFeVariable*     self            = (ParticleFeVariable*) materialFeVariable;
+	IntegrationPointsSwarm* swarm;
+	FiniteElementContext*   context;
+	FeMesh*     mesh;
 
-	_FieldVariable_AssignFromXML( self, cf, data );
+	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", FeMesh, True, data );
 
-	swarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Swarm", IntegrationPointsSwarm, True, data  );
-	context = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Context", FiniteElementContext, False, data  );
-	mesh = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Mesh", FeMesh, True, data );
-
-	_FeVariable_Init( (FeVariable* )self, mesh, NULL, NULL, NULL, NULL, NULL, NULL, False, False );
-	_ParticleFeVariable_Init( self, swarm );
+	/* Construct Parent */
+	_FieldVariable_Construct( self, cf, data );
+	_FeVariable_Init( (FeVariable*)self, mesh, NULL, NULL, NULL, NULL, NULL, NULL, False, False );
+	_ParticleFeVariable_Init( self, swarm, context );
 }
 
 void _ParticleFeVariable_Build( void* materialFeVariable, void* data ) {
@@ -199,8 +263,9 @@ void _ParticleFeVariable_Initialise( voi
 	Variable_Update( self->dataVariable );
 	/* If loading from CP, _don't_ recalculate the field as we've already just loaded it!
 		-- PatrickSunter 22 Nov 2006 */
-	if ( context && (False == context->loadFromCheckPoint) )
+	if ( !(context && (True == context->loadFromCheckPoint)  ) ) {
 		ParticleFeVariable_Update( self );
+	}
 }
 
 void _ParticleFeVariable_Execute( void* materialFeVariable, void* _ctx ) {
@@ -208,27 +273,20 @@ void _ParticleFeVariable_Execute( void* 
 
    if( ParticleFeVariable_curName >= ParticleFeVariable_nNames )
       ParticleFeVariable_curName = 0;
-   ParticleFeVariable_Update( LiveComponentRegister_Get( ctx->CF->LCRegister, (Name)ParticleFeVariable_names[ParticleFeVariable_curName++] )  );
+   ParticleFeVariable_Update( LiveComponentRegister_Get( ctx->CF->LCRegister, ParticleFeVariable_names[ParticleFeVariable_curName++] ) );
 }
 
 void _ParticleFeVariable_Destroy( void* materialFeVariable, void* data ) {
 	ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
 
-	Memory_Free( self->assemblyVectorName );
-	Memory_Free( self->massMatrixName );
-	Memory_Free( self->data );
-
-	Stg_Component_Destroy( self->assemblyVector, data, False );
-	Stg_Component_Destroy( self->assemblyTerm, data, False );
-
-	Stg_Component_Destroy( self->massMatrix, data, False );
-	Stg_Component_Destroy( self->massMatrixForceTerm, data, False );
-
 	_FeVariable_Destroy( self, data );
 }
 
+
 void ParticleFeVariable_Update( void* materialFeVariable ) {
 	ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
+
+	/* printf( "***\n*** Updating %s\n***\n", self->name );   Why - shouldn't this be done properly ?? */
 
 	/* Initialise Vectors */
 	VecSet( self->assemblyVector->vector, 0.0 );
@@ -242,11 +300,12 @@ void ParticleFeVariable_Update( void* ma
 	SolutionVector_UpdateSolutionOntoNodes( self->assemblyVector );
 }
 
-void ParticleFeVariable_AssembleElement( void* _forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVector ) {
+void ParticleFeVariable_AssembleElement( void* _forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVector ) 
+{
 	ForceTerm*                 forceTerm         = (ForceTerm*) _forceTerm;
 	ParticleFeVariable*        self              = Stg_CheckType( forceVector->feVariable, ParticleFeVariable );
 	IntegrationPointsSwarm*    swarm             = (IntegrationPointsSwarm*)forceTerm->integrationSwarm;
-	FeMesh*							mesh              = self->feMesh;
+	FeMesh*        		   mesh              = self->feMesh;
 	Element_NodeIndex          elementNodeCount  = FeMesh_GetElementNodeSize( mesh, lElement_I );
 	ElementType*               elementType       = FeMesh_GetElementType( mesh, lElement_I );
 	Cell_Index                 cell_I            = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
@@ -285,7 +344,7 @@ void ParticleFeVariable_AssembleElementS
 	ForceTerm*                 forceTerm         = (ForceTerm*) _forceTerm;
 	ParticleFeVariable*        self              = Stg_CheckType( forceVector->feVariable, ParticleFeVariable );
 	Swarm*                     swarm             = forceTerm->integrationSwarm;
-	FeMesh*							mesh              = self->feMesh;
+	FeMesh*        		   mesh              = self->feMesh;
 	Element_NodeIndex          elementNodeCount  = FeMesh_GetElementNodeSize( mesh, lElement_I );
 	ElementType*               elementType       = FeMesh_GetElementType( mesh, lElement_I );
 	Cell_Index                 cell_I            = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
@@ -315,5 +374,3 @@ void ParticleFeVariable_AssembleElementS
 		}
 	}
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/ParticleFeVariable.h
--- a/MaterialPoints/src/ParticleFeVariable.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/ParticleFeVariable.h	Tue Feb 02 16:55:08 2010 +1100
@@ -45,11 +45,11 @@
 
 	/** @see ParticleFeVariable_ValueAtParticle */
 	typedef void ParticleFeVariable_ValueAtParticleFunction( 
-		void*							particleFeVariable, 
-		IntegrationPointsSwarm*	swarm, 
-		Element_LocalIndex		lElement_I, 
-		void*							particle, 
-		double*						particleValue );
+			void*                   particleFeVariable, 
+			IntegrationPointsSwarm* swarm, 
+			Element_LocalIndex      lElement_I, 
+			void*                   particle, 
+			double*                 particleValue );
 	
 	/** Textual name of this class */
 	extern const Type ParticleFeVariable_Type;
@@ -60,84 +60,114 @@
 		__FeVariable \
 		\
 		/* Virtual info */ \
-		ParticleFeVariable_ValueAtParticleFunction*	_valueAtParticle; \
+		ParticleFeVariable_ValueAtParticleFunction*       _valueAtParticle;               \
 		\
 		/* ParticleFeVariable info */ \
-		double*													data; \
-		Variable*												dataVariable; \
-		Name														assemblyVectorName; \
-		ForceVector*											assemblyVector; \
-		ForceTerm*												assemblyTerm; \
-		Name														massMatrixName; \
-		ForceVector*											massMatrix; \
-		ForceTerm*												massMatrixForceTerm; \
-		int														currentParticleIndex; \
-		Bool														useDeriv; 
+		double*                                           data;                           \
+		Variable*                                         dataVariable;                   \
+		Name                                              assemblyVectorName;             \
+		ForceVector*                                      assemblyVector;                 \
+		ForceTerm*                                        assemblyTerm;                   \
+		Name                                              massMatrixName;                 \
+		ForceVector*                                      massMatrix;                     \
+		ForceTerm*                                        massMatrixForceTerm;            \
+		int                                               currentParticleIndex;           \
+		Bool                                              useDeriv;                       \
+		
 		
 	struct ParticleFeVariable { __ParticleFeVariable };
 
+#define PARTICLEFEVARIABLE_ARGS						\
+   SizeT _sizeOfSelf,							\
+      Type type,							\
+      Stg_Class_DeleteFunction* _delete,				\
+      Stg_Class_PrintFunction* _print,					\
+      Stg_Class_CopyFunction* _copy,					\
+      Stg_Component_DefaultConstructorFunction* _defaultConstructor,	\
+      Stg_Component_ConstructFunction* _construct,			\
+      Stg_Component_BuildFunction* _build,				\
+      Stg_Component_InitialiseFunction*_initialise,			\
+      Stg_Component_ExecuteFunction* _execute,				\
+      Stg_Component_DestroyFunction* _destroy,				\
+      FieldVariable_InterpolateValueAtFunction* _interpolateValueAt,	\
+      FieldVariable_GetValueFunction* _getMinGlobalFeMagnitude,		\
+      FieldVariable_GetValueFunction* _getMaxGlobalFeMagnitude,		\
+      FieldVariable_GetCoordFunction* _getMinAndMaxLocalCoords,		\
+      FieldVariable_GetCoordFunction* _getMinAndMaxGlobalCoords,	\
+      FeVariable_InterpolateWithinElementFunction* _interpolateWithinElement, \
+      FeVariable_GetValueAtNodeFunction* _getValueAtNode,		\
+      ParticleFeVariable_ValueAtParticleFunction* _valueAtParticle,	\
+      Name name
+
+#define PARTICLEFEVARIABLE_PASSARGS					\
+   _sizeOfSelf, type, _delete, _print, _copy, _defaultConstructor,	\
+      _construct, _build, _initialise, _execute, _destroy,		\
+      _interpolateValueAt, _getMinGlobalFeMagnitude,			\
+      _getMaxGlobalFeMagnitude, _getMinAndMaxLocalCoords,		\
+      _getMinAndMaxGlobalCoords, _interpolateWithinElement,		\
+      _getValueAtNode, _valueAtParticle, name
+	
 	/* --- Contstructors / Destructors --- */
+	ParticleFeVariable* _ParticleFeVariable_New(
+ 		SizeT                                             _sizeOfSelf,
+		Type                                              type,
+		Stg_Class_DeleteFunction*                         _delete,
+		Stg_Class_PrintFunction*                          _print,
+		Stg_Class_CopyFunction*                           _copy, 
+		Stg_Component_DefaultConstructorFunction*         _defaultConstructor,
+		Stg_Component_ConstructFunction*                  _construct,
+		Stg_Component_BuildFunction*                      _build,
+		Stg_Component_InitialiseFunction*                 _initialise,
+		Stg_Component_ExecuteFunction*                    _execute,
+		Stg_Component_DestroyFunction*                    _destroy,
+		FieldVariable_InterpolateValueAtFunction*         _interpolateValueAt,
+		FieldVariable_GetValueFunction*	                  _getMinGlobalFeMagnitude,
+		FieldVariable_GetValueFunction*                   _getMaxGlobalFeMagnitude,
+		FieldVariable_GetCoordFunction*                   _getMinAndMaxLocalCoords,
+		FieldVariable_GetCoordFunction*                   _getMinAndMaxGlobalCoords,		
+		FeVariable_InterpolateWithinElementFunction*      _interpolateWithinElement,	
+		FeVariable_GetValueAtNodeFunction*                _getValueAtNode,
+		ParticleFeVariable_ValueAtParticleFunction*       _valueAtParticle,
+		Name                                              name );
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define PARTICLEFEVARIABLE_DEFARGS \
-                FEVARIABLE_DEFARGS, \
-                ParticleFeVariable_ValueAtParticleFunction*  _valueAtParticle
-
-	#define PARTICLEFEVARIABLE_PASSARGS \
-                FEVARIABLE_PASSARGS, \
-	        _valueAtParticle
-
-	ParticleFeVariable* _ParticleFeVariable_New(  PARTICLEFEVARIABLE_DEFARGS  );
-	
-	void _ParticleFeVariable_Init( ParticleFeVariable* self, IntegrationPointsSwarm* swarm );
+	void _ParticleFeVariable_Init( ParticleFeVariable* self, IntegrationPointsSwarm* swarm, FiniteElementContext* context );
 	
 	void _ParticleFeVariable_Delete( void* variable );
-
 	void _ParticleFeVariable_Print( void* variable, Stream* stream );
-
 	void* _ParticleFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 
-	void _ParticleFeVariable_AssignFromXML( void* variable, Stg_ComponentFactory* cf, void* data );
-
+	void _ParticleFeVariable_Construct( void* variable, Stg_ComponentFactory* cf, void* data );
 	void _ParticleFeVariable_Build( void* variable, void* data );
-
 	void _ParticleFeVariable_Initialise( void* variable, void* data );
-
 	void _ParticleFeVariable_Execute( void* variable, void* data );
-
 	void _ParticleFeVariable_Destroy( void* variable, void* data );
 
 	/** Returns in particleValue the value represented on this particle */
 	#define ParticleFeVariable_ValueAtParticle( particleFeVariable, swarm, lElement_I, particle, particleValue ) \
 		( (ParticleFeVariable*)(particleFeVariable) )->_valueAtParticle(                                     \
-			(particleFeVariable), \
-			(swarm), \
-			(lElement_I), \
-			(particle), \
-			(particleValue) )
+									(particleFeVariable),                        \
+									(swarm),                                     \
+									(lElement_I),                                \
+									(particle),                                  \
+									(particleValue) )
 
 	void ParticleFeVariable_Update( void* materialFeVariable );
 
 	void ParticleFeVariable_AssembleElement( 
-		void*						forceTerm, 
-		ForceVector*			forceVector, 
-		Element_LocalIndex	lElement_I, 
-		double*					elForceVector );
+			void*                   forceTerm, 
+			ForceVector*            forceVector, 
+			Element_LocalIndex      lElement_I, 
+			double*                 elForceVector );
 
-	void ParticleFeVariable_AssembleElement_Deriv(
-		void*						_forceTerm,
-		ForceVector*			forceVector,
-		Element_LocalIndex	lElement_I,
-		double*					elForceVector ) ;
+void ParticleFeVariable_AssembleElement_Deriv( void* _forceTerm,
+					       ForceVector* forceVector,
+					       Element_LocalIndex lElement_I,
+					       double* elForceVector ) ;
 
 	void ParticleFeVariable_AssembleElementShapeFunc( 
-		void*						forceTerm, 
-		ForceVector*			forceVector, 
-		Element_LocalIndex	lElement_I, 
-		double*					elForceVector );
+			void*                   forceTerm, 
+			ForceVector*            forceVector, 
+			Element_LocalIndex      lElement_I, 
+			double*                 elForceVector );
 
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/ParticleFeVariable.meta
--- a/MaterialPoints/src/ParticleFeVariable.meta	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/ParticleFeVariable.meta	Tue Feb 02 16:55:08 2010 +1100
@@ -2,43 +2,45 @@
 <!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 
-	<param name="Name">ParticleFeVariable</param>
-	<param name="Author">...</param>
-	<param name="Organisation">VPAC and MCC</param>
-	<param name="Project">PICellerator</param>
-	<param name="Location">./PICellerator/MaterialPoints/src/</param>
-	<param name="Project Web">http://www.stgermainproject.org/PICellerator.html</param>
-	<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
-	<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
-	<param name="Parent">FeVariable</param>
-	<param name="Reference"></param>
-	<param name="Summary"></param>
-	<param name="Description"><![CDATA[An abstract class which maps particle variables onto a mesh through the operator $\\hat{\\phi} = \frac{\\sum_{n}N(\\zeta)\\phi(\\zeta)}{\\sum_{n}N(\\zeta)}$<br/>, where $\\hat{\\phi}$ is the new mesh variable, $N$ are shape functions and $\\phi$ is a particle value. <br/>This class sets up a domain-wide massMatrix (really a vector), forceVector and solutionVector. The massMatrix is the denominator of the equation, while the foceVector is the numerator. <br>This variable is evaluated at the end of the Solve_EP]]></param>
+<param name="Name">ParticleFeVariable</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/MaterialPoints/src/</param>
+<param name="Project Web">http://www.stgermainproject.org/PICellerator.html</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">FeVariable</param>
+<param name="Reference"></param>
+<param name="Summary"></param>
+<param name="Description"><![CDATA[An abstract class which maps particle variables onto a mesh through the operator $\hat{\phi} = \frac{\sum_{n}N(\zeta)\phi(\zeta)}{\sum_{n}N(\zeta)}$<br/>, where $\hat{\phi}$ is the new mesh variable, $N$ are shape functions and $\phi$ is a particle value. <br/>This class sets up a domain-wide massMatrix (really a vector), forceVector and solutionVector. The massMatrix is the denominator of the equation, while the foceVector is the numerator. <br>This variable is evaluated at the end of the Solve_EP]]></param>
 
-	<list name="Params">
-	</list>
+<list name="Params">
 
-	<list name="Dependencies">
-		<struct>
-			<param name="Essential">True</param>
-			<param name="Name">Swarm</param>
-			<param name="Type">Swarm</param>
-			<param name="Description">The swarm to take shape function and particle values from</param>
-		</struct>
-		<struct>
-			<param name="Essential">True</param>
-			<param name="Name">Context</param>
-			<param name="Type">FiniteElementContext</param>
-			<param name="Description">The context, is required for adding an EP</param>
-		</struct>
-		<struct>
-			<param name="Essential">True</param>
-			<param name="Name">Mesh</param>
-			<param name="Type">FeMesh</param>
-			<param name="Description">The mesh to map the particle values to.</param>
-		</struct>
-	</list>
+</list>
 
-	<param name="Example">N/A, see ViscosityField</param>
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Swarm</param>
+		<param name="Type">Swarm</param>
+		<param name="Description">The swarm to take shape function and particle values from</param>
+	</struct>
+
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Context</param>
+		<param name="Type">FiniteElementContext</param>
+		<param name="Description">The context, is required for adding an EP</param>
+	</struct>
+
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Mesh</param>
+		<param name="Type">FeMesh</param>
+		<param name="Description">The mesh to map the particle values to.</param>
+	</struct>
+</list>
+<param name="Example">N/A, see ViscosityField</param>
 
 </StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/PeriodicBoundariesManager.c
--- a/MaterialPoints/src/PeriodicBoundariesManager.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/PeriodicBoundariesManager.c	Tue Feb 02 16:55:08 2010 +1100
@@ -51,7 +51,6 @@
 #include <PICellerator/Weights/Weights.h>
 
 #include "types.h"
-#include "PICelleratorContext.h"
 #include "PeriodicBoundariesManager.h"
 
 #include <string.h>
@@ -63,62 +62,109 @@ const Type PeriodicBoundariesManager_Typ
 const Type PeriodicBoundariesManager_Type = "PeriodicBoundariesManager";
 
 /* Constructors ------------------------------------------------------------------------------------------------*/
+void* _PeriodicBoundariesManager_DefaultNew( Name name ) {
+	return (void*) _PeriodicBoundariesManager_New(
+		sizeof(PeriodicBoundariesManager),
+		PeriodicBoundariesManager_Type,
+		_PeriodicBoundariesManager_Delete,
+		_PeriodicBoundariesManager_Print,
+		NULL, 
+		_PeriodicBoundariesManager_DefaultNew,
+		_PeriodicBoundariesManager_Construct,
+		_PeriodicBoundariesManager_Build,
+		_PeriodicBoundariesManager_Initialise,
+		_PeriodicBoundariesManager_Execute,
+		_PeriodicBoundariesManager_Destroy,
+		name,
+		False,
+		NULL,
+		NULL,
+		NULL);
+}
+
 PeriodicBoundariesManager* PeriodicBoundariesManager_New( 
-	Name						name,
-	PICelleratorContext*	context,
-	Mesh*						mesh, 
-	Swarm*					swarm,
-	Dictionary*				dictionary )
+		Name                        name,
+		Mesh*			    mesh, 
+		Swarm*                      swarm,
+		Dictionary*                 dictionary )
 {
-	PeriodicBoundariesManager* self = _PeriodicBoundariesManager_DefaultNew( name );
-
-	self->isConstructed = True;
-	_PeriodicBoundariesManager_Init( self, context, mesh, swarm, dictionary );
-
-	return self;
+	return _PeriodicBoundariesManager_New(
+		sizeof(PeriodicBoundariesManager),
+		PeriodicBoundariesManager_Type,
+		_PeriodicBoundariesManager_Delete,
+		_PeriodicBoundariesManager_Print,
+		_PeriodicBoundariesManager_Copy, 
+		_PeriodicBoundariesManager_DefaultNew,
+		_PeriodicBoundariesManager_Construct,
+		_PeriodicBoundariesManager_Build,
+		_PeriodicBoundariesManager_Initialise,
+		_PeriodicBoundariesManager_Execute,
+		_PeriodicBoundariesManager_Destroy,
+		name,
+		True,
+		mesh, 
+		swarm,
+		dictionary );
 }	
 
-void* _PeriodicBoundariesManager_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(PeriodicBoundariesManager);
-	Type                                                      type = PeriodicBoundariesManager_Type;
-	Stg_Class_DeleteFunction*                              _delete = _PeriodicBoundariesManager_Delete;
-	Stg_Class_PrintFunction*                                _print = _PeriodicBoundariesManager_Print;
-	Stg_Class_CopyFunction*                                  _copy = NULL;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _PeriodicBoundariesManager_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _PeriodicBoundariesManager_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _PeriodicBoundariesManager_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _PeriodicBoundariesManager_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _PeriodicBoundariesManager_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _PeriodicBoundariesManager_Destroy;
-	AllocationType                              nameAllocationType = NON_GLOBAL;
 
-	return (void*) _PeriodicBoundariesManager_New(  PERIODICBOUNDARIESMANAGER_PASSARGS  );
-}
-
-PeriodicBoundariesManager* _PeriodicBoundariesManager_New(  PERIODICBOUNDARIESMANAGER_DEFARGS  ) {
+PeriodicBoundariesManager* _PeriodicBoundariesManager_New( 
+		SizeT                                  sizeOfSelf,
+		Type                                   type,
+		Stg_Class_DeleteFunction*              _delete,
+		Stg_Class_PrintFunction*               _print,
+		Stg_Class_CopyFunction*                _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*       _construct,
+		Stg_Component_BuildFunction*           _build,
+		Stg_Component_InitialiseFunction*      _initialise,
+		Stg_Component_ExecuteFunction*         _execute,
+		Stg_Component_DestroyFunction*         _destroy,
+		Name                                   name,
+		Bool                                   initFlag,
+		Mesh*				       mesh, 
+		Swarm*                                 swarm,
+		Dictionary*                            dictionary )		
+{
 	PeriodicBoundariesManager* self;
 	
 	/* Allocate memory */
-	self = (PeriodicBoundariesManager*)_Stg_Component_New(  STG_COMPONENT_PASSARGS  );
+	self = (PeriodicBoundariesManager*)_Stg_Component_New( 
+		sizeOfSelf, 
+		type, 
+		_delete, 
+		_print, 
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,
+		name,
+		initFlag );
 	
 	/* General info */
 	
 	/* Virtual info */
 	
+	if( initFlag ){
+		_PeriodicBoundariesManager_Init( self, mesh, swarm, dictionary );
+	}
+	
 	return self;
 }
 
+
 void _PeriodicBoundariesManager_Init(
-	void*						periodicBCsManager,
-	PICelleratorContext*	context,
-	Mesh*						mesh, 
-	Swarm*					swarm,
-	Dictionary*				dictionary )
+		void*             periodicBCsManager,
+		Mesh*		  mesh, 
+		Swarm*            swarm,
+		Dictionary*       dictionary )
 {
 	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)periodicBCsManager;
 
-	self->context = context;
+	self->isConstructed = True;
 	self->dictionary = dictionary;
 	self->mesh = mesh;
 	self->swarm = swarm;
@@ -126,29 +172,28 @@ void _PeriodicBoundariesManager_Init(
 	self->delta = 0;
 	self->size = 0;
 	self->boundaries = NULL;
-	self->debug = Journal_Register( Debug_Type, (Name)self->type  );
+	self->debug = Journal_Register( Debug_Type, self->type );
 }
 
-void _PeriodicBoundariesManager_AssignFromXML( void* periodicBCsManager, Stg_ComponentFactory* cf, void* data ) {
+
+void _PeriodicBoundariesManager_Construct( void* periodicBCsManager, Stg_ComponentFactory* cf, void* data ) {
 	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)periodicBCsManager;
-	Dictionary*						dictionary = NULL;
-	Mesh*								mesh = NULL;
-	Swarm*							swarm = NULL;
-	PICelleratorContext*			context;
-
-	context = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Context", PICelleratorContext, False, data );
-	if( !context  ) 
-		context = Stg_ComponentFactory_ConstructByName( cf, (Name)"context", PICelleratorContext, True, data  );
+	Dictionary*			dictionary = NULL;
+	Mesh*				mesh = NULL;
+	Swarm*                          swarm = NULL;
 
 	dictionary = Dictionary_GetDictionary( cf->componentDict, self->name );
-	mesh = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"mesh", Mesh, True, data  );
-	swarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Swarm", Swarm, 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, context, mesh, swarm, dictionary );
+	_PeriodicBoundariesManager_Init( self, mesh, swarm, dictionary );
 }
+
 
 void _PeriodicBoundariesManager_Delete( void* perBCsManager ) {
 	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)perBCsManager;
+	
+	Memory_Free( self->boundaries );
 	
 	/* Stg_Class_Delete parent */
 	_Stg_Component_Delete( self );
@@ -157,8 +202,8 @@ void _PeriodicBoundariesManager_Delete( 
 /* Virtual Functions -------------------------------------------------------------------------------------------------------------*/
 
 void _PeriodicBoundariesManager_Print( void* perBCsManager, Stream* stream ) {
-	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)perBCsManager;
-	Index								perBoundary_I = 0;
+	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)perBCsManager;
+	Index		perBoundary_I = 0;
 	
 	/* General info */
 	Journal_Printf( stream, "PeriodicBoundariesManager (ptr): %p\n", self );
@@ -168,7 +213,6 @@ void _PeriodicBoundariesManager_Print( v
 
 	Journal_Printf( stream, "%d periodic boundaries registered: %p\n", self );
 	Stream_Indent( stream );
-
 	for ( perBoundary_I = 0; perBoundary_I < self->count; perBoundary_I++ ) {
 		Journal_Printf( stream, "Boundary %d: Axis %d, Min=%f, Max=%f\n", perBoundary_I,
 			self->boundaries[perBoundary_I].axis,
@@ -178,11 +222,12 @@ void _PeriodicBoundariesManager_Print( v
 	Stream_UnIndent( stream );
 }
 
+
 void* _PeriodicBoundariesManager_Copy( void* periodicBCsManager, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)periodicBCsManager;
-	PeriodicBoundariesManager*	newPeriodicBCsManager;
-	PtrMap*							map = ptrMap;
-	Bool								ownMap = False;
+	PeriodicBoundariesManager*   self = (PeriodicBoundariesManager*)periodicBCsManager;
+	PeriodicBoundariesManager*   newPeriodicBCsManager;
+	PtrMap*	                     map = ptrMap;
+	Bool                         ownMap = False;
 	
 	if( !map ) {
 		map = PtrMap_New( 10 );
@@ -200,7 +245,8 @@ void* _PeriodicBoundariesManager_Copy( v
 		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, "PeriodicBoundaries" );
+		newPeriodicBCsManager->boundaries = Memory_Alloc_Array( PeriodicBoundary, self->size,
+			"PeriodicBoundaries" );
 		memcpy( newPeriodicBCsManager->boundaries, self->boundaries, sizeof(PeriodicBoundary)*self->count );	
 	}
 	else {
@@ -216,19 +262,22 @@ void* _PeriodicBoundariesManager_Copy( v
 	}
 	
 	return (void*)newPeriodicBCsManager;
+
+
+	
+	return NULL;
 }
+
 
 void _PeriodicBoundariesManager_Build( void* periodicBCsManager, void* data ) {	
 	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)periodicBCsManager;
 	Dictionary_Entry_Value*    periodicBCsList = NULL;
-
-	Stg_Component_Build( self->swarm, data, False );
-	Stg_Component_Build( self->mesh, data, False );
+	
 	self->size = 4;
 	self->boundaries = Memory_Alloc_Array( PeriodicBoundary, self->size, "PeriodicBoundariesManager->boundaries" );
 
 	if ( self->dictionary ) {
-		periodicBCsList = Dictionary_Get( self->dictionary, (Dictionary_Entry_Key)"PeriodicBoundaries" );
+		periodicBCsList = Dictionary_Get( self->dictionary, "PeriodicBoundaries" );
 		
 		/* Dictionary entry is optional - users may prefer to enter in code */
 		if ( periodicBCsList ) {
@@ -239,7 +288,7 @@ void _PeriodicBoundariesManager_Build( v
 			
 			numPeriodicBCs = Dictionary_Entry_Value_GetCount( periodicBCsList );
 
-			for ( periodicBC_I = 0; periodicBC_I < numPeriodicBCs; periodicBC_I++  ) {
+			for ( periodicBC_I = 0; periodicBC_I < numPeriodicBCs; periodicBC_I++ ) {
 				periodicBC = Dictionary_Entry_Value_GetElement( periodicBCsList, periodicBC_I );
 				perBCAxis = Dictionary_Entry_Value_AsString( periodicBC );
 
@@ -266,33 +315,27 @@ void _PeriodicBoundariesManager_Build( v
 				PeriodicBoundariesManager_AddPeriodicBoundary( self, dim_I );
 		}		
 	}
+
+
+
 }
 
-void _PeriodicBoundariesManager_Initialise( void* periodicBCsManager, void* data ) {
-	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)periodicBCsManager;
 
-	Stg_Component_Initialise( self->swarm, data, False );
-	Stg_Component_Initialise( self->mesh, data, False );
+void _PeriodicBoundariesManager_Initialise( void* periodicBCsManager, void* data ) {	
 }
 
 void _PeriodicBoundariesManager_Execute( void* periodicBCsManager, void* data ) {	
 }
 
 void _PeriodicBoundariesManager_Destroy( void* periodicBCsManager, void* data ) {	
-	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)periodicBCsManager;
-
-	Stg_Component_Destroy( self->swarm, data, False );
-	Stg_Component_Destroy( self->mesh, data, False );
-
-	Memory_Free( self->boundaries );
 }
 
 /* Public Functions -------------------------------------------------------------------------------------------------------------*/
 
 void PeriodicBoundariesManager_AddPeriodicBoundary( void* periodicBCsManager, Axis axis ) {
 	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)periodicBCsManager;	
-	PeriodicBoundary*				newPeriodicBoundary;
-	double							min[3], max[3];
+	PeriodicBoundary*		newPeriodicBoundary;
+	double				min[3], max[3];
 
 	Mesh_GetGlobalCoordRange( self->mesh, min, max );
 	
@@ -300,7 +343,6 @@ void PeriodicBoundariesManager_AddPeriod
 		self->size += self->delta;
 		self->boundaries = Memory_Realloc_Array( self->boundaries, PeriodicBoundary, self->size );
 	}
-
 	newPeriodicBoundary = &self->boundaries[self->count];
 	newPeriodicBoundary->axis = axis;
 	newPeriodicBoundary->minWall = min[axis];
@@ -310,41 +352,49 @@ void PeriodicBoundariesManager_AddPeriod
 	self->count++;
 }
 
+
 void PeriodicBoundariesManager_UpdateParticle( void* periodicBCsManager, Particle_Index lParticle_I ) {
-	Axis								boundaryAxis;	
+	Axis				boundaryAxis;	
 	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)periodicBCsManager;
-	double							difference = 0.0;
-	GlobalParticle*				particle = NULL;
-	Index								perBoundary_I = 0;
-	PeriodicBoundary*				perBoundary = NULL;
+	double				difference = 0.0;
+	GlobalParticle*                 particle = NULL;
+	Index				perBoundary_I = 0;
+	PeriodicBoundary*		perBoundary = NULL;
 
 	Journal_DPrintfL( self->debug, 2, "In %s:\n", __func__ );
 	Stream_Indent( self->debug );
 
 	particle = (GlobalParticle*)Swarm_ParticleAt( self->swarm, lParticle_I );
 
-	Journal_DPrintfL( self->debug, 2, "Checking particle %d at (%.4g,%.4g,%.4g)\n", lParticle_I, particle->coord[0], particle->coord[1], particle->coord[2] );
+	Journal_DPrintfL( self->debug, 2, "Checking particle %d at (%.4g,%.4g,%.4g)\n", lParticle_I,
+		particle->coord[0], particle->coord[1], particle->coord[2] );
 
 	for ( perBoundary_I = 0; perBoundary_I < self->count; perBoundary_I++ ) {
+
 		perBoundary = &self->boundaries[perBoundary_I];
 		boundaryAxis = perBoundary->axis;
 
 		Journal_DPrintfL( self->debug, 2, "Checking axis %d:\n", boundaryAxis );
+
+			
 		Stream_Indent( self->debug );
-
 		if ( particle->coord[boundaryAxis] < perBoundary->minWall ) {
 			Journal_DPrintfL( self->debug, 3, "coord is < min wall %.4f:\n", perBoundary->minWall );
 			difference = perBoundary->minWall - particle->coord[boundaryAxis];
 			particle->coord[boundaryAxis] = perBoundary->maxWall - difference;
 			perBoundary->particlesUpdatedMinEndCount++;
-			Journal_DPrintfL( self->debug, 3, "moving to (%.4f,%.4f,%.4f).\n", particle->coord[I_AXIS], particle->coord[J_AXIS], particle->coord[K_AXIS] );
+			Journal_DPrintfL( self->debug, 3, "moving to (%.4f,%.4f,%.4f).\n",
+				particle->coord[I_AXIS], particle->coord[J_AXIS],
+				particle->coord[K_AXIS] );
 		}
 		else if ( particle->coord[perBoundary->axis] > perBoundary->maxWall ) {
 			Journal_DPrintfL( self->debug, 3, "coord is > max wall %.4f:\n", perBoundary->maxWall );
 			difference = particle->coord[boundaryAxis] - perBoundary->maxWall; 
 			particle->coord[boundaryAxis] = perBoundary->minWall + difference;
 			perBoundary->particlesUpdatedMaxEndCount++;
-			Journal_DPrintfL( self->debug, 3, "moving to (%.4f,%.4f,%.4f).\n", particle->coord[I_AXIS], particle->coord[J_AXIS], particle->coord[K_AXIS] );
+			Journal_DPrintfL( self->debug, 3, "moving to (%.4f,%.4f,%.4f).\n",
+				particle->coord[I_AXIS], particle->coord[J_AXIS],
+				particle->coord[K_AXIS] );
 		}
 		Stream_UnIndent( self->debug );
 	}	
@@ -355,12 +405,11 @@ void PeriodicBoundariesManager_UpdatePar
 	the only way I can see given this func is part of the SwarmAdvector intermediate. Should really be a 
 	function on this class that updates all the particles. -- Main.PatrickSunter 15 May 2006 */
 	if ( lParticle_I == (self->swarm->particleLocalCount-1) ) {
-		PeriodicBoundary*	boundary = NULL;
-		Index					perB_I;
+		PeriodicBoundary*      boundary = NULL;
+		Index                  perB_I;
 	
 		Journal_DPrintfL( self->debug, 1, "PeriodicBoundariesManager total particles updated:\n" );
 		Stream_Indent( self->debug );
-
 		for ( perB_I = 0; perB_I < self->count; perB_I++ ) {
 			boundary = &self->boundaries[perB_I];
 
@@ -375,5 +424,3 @@ void PeriodicBoundariesManager_UpdatePar
 	}
 }	
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/PeriodicBoundariesManager.h
--- a/MaterialPoints/src/PeriodicBoundariesManager.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/PeriodicBoundariesManager.h	Tue Feb 02 16:55:08 2010 +1100
@@ -51,67 +51,67 @@
 *
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
-#ifndef __PICellerator_MaterialPoints_PeriodicBoundariesManager_h__
-#define __PICellerator_MaterialPoints_PeriodicBoundariesManager_h__
+#ifndef __PICellerator_PeriodicBoundaries_PeriodicBoundariesManager_h__
+#define __PICellerator_PeriodicBoundaries_PeriodicBoundariesManager_h__
 	
 	/* Textual name of this class */
 	extern const Type PeriodicBoundariesManager_Type;
 
 	typedef struct PeriodicBoundary {
-		Axis				axis; /* Which plane the BC is in */
-		double			minWall;
-		double			maxWall;
-		unsigned int	particlesUpdatedMinEndCount;
-		unsigned int	particlesUpdatedMaxEndCount;
+		Axis		axis;	/* Which plane the BC is in */
+		double		minWall;
+		double		maxWall;
+		unsigned int    particlesUpdatedMinEndCount;
+		unsigned int    particlesUpdatedMaxEndCount;
 	} PeriodicBoundary;
 
 	#define __PeriodicBoundariesManager \
 		__Stg_Component \
-		PICelleratorContext*	context; \
 		\
-		Dictionary*				dictionary; \
-		Mesh*						mesh; \
-		Index						count; \
-		Index						size; \
-		Index						delta; \
-		PeriodicBoundary*		boundaries; \
-		Swarm*					swarm; \
-		Stream*					debug; 
+		Dictionary*		dictionary; \
+		Mesh*			mesh; \
+		Index			count; \
+		Index			size; \
+		Index			delta; \
+		PeriodicBoundary*	boundaries; \
+		Swarm*			swarm; \
+		Stream*                 debug; \
 
 	struct PeriodicBoundariesManager { __PeriodicBoundariesManager };
-
-
 
 	void* _PeriodicBoundariesManager_DefaultNew( Name name );
 
 	PeriodicBoundariesManager* PeriodicBoundariesManager_New( 
-		Name						name,
-		PICelleratorContext*	context,
+		Name                    			name,
 		Mesh*						mesh, 
-		Swarm*					swarm,
-		Dictionary*				dictionary );
+		Swarm*                                          swarm,
+		Dictionary*					dictionary );
 
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define PERIODICBOUNDARIESMANAGER_DEFARGS \
-                STG_COMPONENT_DEFARGS
-
-	#define PERIODICBOUNDARIESMANAGER_PASSARGS \
-                STG_COMPONENT_PASSARGS
-
-	PeriodicBoundariesManager* _PeriodicBoundariesManager_New(  PERIODICBOUNDARIESMANAGER_DEFARGS  );
+	PeriodicBoundariesManager* _PeriodicBoundariesManager_New( 
+		SizeT                                  sizeOfSelf,
+		Type                                   type,
+		Stg_Class_DeleteFunction*              _delete,
+		Stg_Class_PrintFunction*               _print,
+		Stg_Class_CopyFunction*                _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*       _construct,
+		Stg_Component_BuildFunction*           _build,
+		Stg_Component_InitialiseFunction*      _initialise,
+		Stg_Component_ExecuteFunction*         _execute,
+		Stg_Component_DestroyFunction*         _destroy,
+		Name                                   name,
+		Bool                                   initFlag,
+		Mesh*				       mesh, 
+		Swarm*                                 swarm,
+		Dictionary*                            dictionary );
 
 	void _PeriodicBoundariesManager_Init(
-		void*						periodicBCsManager,
-		PICelleratorContext*	context,
-		Mesh*						mesh, 
-		Swarm*					swarm,
-		Dictionary*				dictionary );
+		void*             periodicBCsManager,
+		Mesh*		  mesh, 
+		Swarm*            swarm,
+		Dictionary*       dictionary );
 		
-	void _PeriodicBoundariesManager_AssignFromXML( void* periodicBCsManager, Stg_ComponentFactory* cf, void* data );
+	void _PeriodicBoundariesManager_Construct( void* periodicBCsManager, Stg_ComponentFactory* cf, void* data );
 	
 	void _PeriodicBoundariesManager_Delete( void* context );
 
@@ -132,4 +132,3 @@
 	void PeriodicBoundariesManager_UpdateParticle( void* periodicBCsManager, Particle_Index lParticle_I );
 
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/SwarmAdvectionInAPlane.c
--- a/MaterialPoints/src/SwarmAdvectionInAPlane.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/SwarmAdvectionInAPlane.c	Tue Feb 02 16:55:08 2010 +1100
@@ -71,7 +71,6 @@ const Type SwarmAdvectionInAPlane_Type =
 */
 SwarmAdvectionInAPlane* SwarmAdvectionInAPlane_New(
 		Name                                       name,
-		DomainContext*                             context,
 		TimeIntegrator*                            timeIntegrator,
 		FeVariable*                                velocityField,
 		Bool                                       allowFallbackToFirstOrder,
@@ -82,7 +81,7 @@ SwarmAdvectionInAPlane* SwarmAdvectionIn
 	int whichaxis;
 	
 	/* 	SwarmAdvectionInAPlane_InitAll */
-	_TimeIntegrand_Init( self, context, timeIntegrator, swarm->particleCoordVariable->variable, 0, NULL,
+	_TimeIntegratee_Init( self, timeIntegrator, swarm->particleCoordVariable->variable, 0, NULL,
 		allowFallbackToFirstOrder );
 	_SwarmAdvector_Init( (SwarmAdvector*)self, velocityField, swarm, periodicBCsManager);
 	_SwarmAdvectionInAPlane_Init( self, whichaxis );
@@ -90,13 +89,41 @@ SwarmAdvectionInAPlane* SwarmAdvectionIn
 	return self;
 }
 
-SwarmAdvectionInAPlane* _SwarmAdvectionInAPlane_New(  SWARMADVECTIONINAPLANE_DEFARGS  )
+SwarmAdvectionInAPlane* _SwarmAdvectionInAPlane_New(
+		SizeT                                      _sizeOfSelf, 
+		Type                                       type,
+		Stg_Class_DeleteFunction*                  _delete,
+		Stg_Class_PrintFunction*                   _print,
+		Stg_Class_CopyFunction*                    _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*           _construct,
+		Stg_Component_BuildFunction*               _build,
+		Stg_Component_InitialiseFunction*          _initialise,
+		Stg_Component_ExecuteFunction*             _execute,
+		Stg_Component_DestroyFunction*             _destroy,		
+		TimeIntegratee_CalculateTimeDerivFunction* _calculateTimeDeriv,
+		TimeIntegratee_IntermediateFunction*       _intermediate,
+		Name                                       name )
 {
 	SwarmAdvectionInAPlane* self;
 	
 	/* Allocate memory */
 	assert( _sizeOfSelf >= sizeof(SwarmAdvectionInAPlane) );
-	self = (SwarmAdvectionInAPlane*)_SwarmAdvector_New(  SWARMADVECTOR_PASSARGS  );
+	self = (SwarmAdvectionInAPlane*)_SwarmAdvector_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculateTimeDeriv,
+			_intermediate,
+			name );
 	
 	/* General info */
 
@@ -115,6 +142,21 @@ void _SwarmAdvectionInAPlane_Init( Swarm
 /*------------------------------------------------------------------------------------------------------------------------
 ** Virtual functions
 */
+void _SwarmAdvectionInAPlane_Delete( void* swarmAdvector ) {
+	SwarmAdvectionInAPlane* self = (SwarmAdvectionInAPlane*)swarmAdvector;
+
+	/* Delete parent */
+	_SwarmAdvector_Delete( self );
+}
+
+
+void _SwarmAdvectionInAPlane_Print( void* swarmAdvector, Stream* stream ) {
+	SwarmAdvectionInAPlane* self = (SwarmAdvectionInAPlane*)swarmAdvector;
+	
+	/* Print parent */
+	_SwarmAdvector_Print( self, stream );
+}
+
 
 void* _SwarmAdvectionInAPlane_Copy( void* swarmAdvector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	SwarmAdvectionInAPlane*	self = (SwarmAdvectionInAPlane*)swarmAdvector;
@@ -130,34 +172,31 @@ void* _SwarmAdvectionInAPlane_Copy( void
 }
 
 void* _SwarmAdvectionInAPlane_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                               _sizeOfSelf = sizeof(SwarmAdvectionInAPlane);
-	Type                                                       type = SwarmAdvectionInAPlane_Type;
-	Stg_Class_DeleteFunction*                               _delete = _SwarmAdvector_Delete;
-	Stg_Class_PrintFunction*                                 _print = _SwarmAdvector_Print;
-	Stg_Class_CopyFunction*                                   _copy = _SwarmAdvectionInAPlane_Copy;
-	Stg_Component_DefaultConstructorFunction*   _defaultConstructor = _SwarmAdvectionInAPlane_DefaultNew;
-	Stg_Component_ConstructFunction*                     _construct = _SwarmAdvectionInAPlane_AssignFromXML;
-	Stg_Component_BuildFunction*                             _build = _SwarmAdvector_Build;
-	Stg_Component_InitialiseFunction*                   _initialise = _SwarmAdvector_Initialise;
-	Stg_Component_ExecuteFunction*                         _execute = _SwarmAdvector_Execute;
-	Stg_Component_DestroyFunction*                         _destroy = _SwarmAdvector_Destroy;
-	TimeIntegrand_CalculateTimeDerivFunction*  _calculateTimeDeriv = _SwarmAdvectionInAPlane_TimeDeriv;
-	TimeIntegrand_IntermediateFunction*              _intermediate = _SwarmAdvector_Intermediate;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return (void*) _SwarmAdvectionInAPlane_New(  SWARMADVECTIONINAPLANE_PASSARGS  );
+	return (void*) _SwarmAdvectionInAPlane_New(
+			sizeof(SwarmAdvectionInAPlane),
+			SwarmAdvectionInAPlane_Type,
+			_SwarmAdvectionInAPlane_Delete,
+			_SwarmAdvectionInAPlane_Print,
+			_SwarmAdvectionInAPlane_Copy,
+			_SwarmAdvectionInAPlane_DefaultNew,
+			_SwarmAdvectionInAPlane_Construct,
+			/* Just use the normal parent's implementation for next few, apart from new TimeDeriv function */
+			_SwarmAdvector_Build,
+			_SwarmAdvector_Initialise,
+			_SwarmAdvector_Execute,
+			_SwarmAdvector_Destroy,
+			_SwarmAdvectionInAPlane_TimeDeriv,
+			_SwarmAdvector_Intermediate,
+			name );
 }
 
 
-void _SwarmAdvectionInAPlane_AssignFromXML( void* swarmAdvector, Stg_ComponentFactory* cf, void* data) {
+void _SwarmAdvectionInAPlane_Construct( void* swarmAdvector, Stg_ComponentFactory* cf, void* data) {
 	SwarmAdvectionInAPlane*	            self          = (SwarmAdvectionInAPlane*) swarmAdvector;
 	int							whichaxis;
-	_SwarmAdvector_AssignFromXML( self, cf, data );
+	_SwarmAdvector_Construct( self, cf, data );
 	/* Everything except whichaxis constructed by parent already */
-	whichaxis = Stg_ComponentFactory_GetInt( cf, self->name, (Dictionary_Entry_Key)"whichaxis", 1  );
+	whichaxis = Stg_ComponentFactory_GetInt( cf, self->name, "whichaxis",  1 );
 	_SwarmAdvectionInAPlane_Init( self, whichaxis );
 }
 
@@ -182,7 +221,7 @@ Bool _SwarmAdvectionInAPlane_TimeDeriv( 
 			( self->swarm->dim == 3 && isinf(timeDeriv[2]) ) ) 
 	{
 		#if 0
-		Journal_Printf( Journal_Register( Error_Type, (Name)self->type  ),
+		Journal_Printf( Journal_Register( Error_Type, self->type ),
 			"Error in func '%s' for particle with index %u.\n\tPosition (%g, %g, %g)\n\tVelocity here is (%g, %g, %g)."
 			"\n\tInteropolation result is %u.\n",
 			__func__, array_I, coord[0], coord[1], coord[2], 
@@ -208,5 +247,3 @@ Bool _SwarmAdvectionInAPlane_TimeDeriv( 
 */
 
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/SwarmAdvectionInAPlane.h
--- a/MaterialPoints/src/SwarmAdvectionInAPlane.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/SwarmAdvectionInAPlane.h	Tue Feb 02 16:55:08 2010 +1100
@@ -71,30 +71,34 @@
 	*/
 	SwarmAdvectionInAPlane* SwarmAdvectionInAPlane_New(
 		Name                                       name,
-		DomainContext*                             context,
 		TimeIntegrator*                            timeIntegrator,
 		FeVariable*                                velocityField,
 		Bool                                       allowFallbackToFirstOrder,
 		MaterialPointsSwarm*                       swarm,
 		PeriodicBoundariesManager*                 periodicBCsManager );
 
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define SWARMADVECTIONINAPLANE_DEFARGS \
-                SWARMADVECTOR_DEFARGS
-
-	#define SWARMADVECTIONINAPLANE_PASSARGS \
-                SWARMADVECTOR_PASSARGS
-
-	SwarmAdvectionInAPlane* _SwarmAdvectionInAPlane_New(  SWARMADVECTIONINAPLANE_DEFARGS  );
+	SwarmAdvectionInAPlane* _SwarmAdvectionInAPlane_New(
+		SizeT                                      _sizeOfSelf, 
+		Type                                       type,
+		Stg_Class_DeleteFunction*                  _delete,
+		Stg_Class_PrintFunction*                   _print,
+		Stg_Class_CopyFunction*                    _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*           _construct,
+		Stg_Component_BuildFunction*               _build,
+		Stg_Component_InitialiseFunction*          _initialise,
+		Stg_Component_ExecuteFunction*             _execute,
+		Stg_Component_DestroyFunction*             _destroy,		
+		TimeIntegratee_CalculateTimeDerivFunction* _calculateTimeDeriv,
+		TimeIntegratee_IntermediateFunction*       _intermediate,
+		Name                                       name );
 
 	void _SwarmAdvectionInAPlane_Init( 
 		SwarmAdvectionInAPlane*                             self,
 		int											whichaxis);
 
+	void _SwarmAdvectionInAPlane_Delete( void* materialSwarm );
+	void _SwarmAdvectionInAPlane_Print( void* materialSwarm, Stream* stream );
 	#define SwarmAdvectionInAPlane_Copy( self ) \
 		(SwarmAdvectionInAPlane*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define SwarmAdvectionInAPlane_DeepCopy( self ) \
@@ -102,7 +106,7 @@
 	void* _SwarmAdvectionInAPlane_Copy( void* materialSwarm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	void* _SwarmAdvectionInAPlane_DefaultNew( Name name ) ;
-void _SwarmAdvectionInAPlane_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+void _SwarmAdvectionInAPlane_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
 	void _SwarmAdvectionInAPlane_Build( void* materialSwarm, void* data ) ;
 	void _SwarmAdvectionInAPlane_Initialise( void* materialSwarm, void* data ) ;
 	void _SwarmAdvectionInAPlane_Execute( void* materialSwarm, void* data );
@@ -126,4 +130,3 @@ void _SwarmAdvectionInAPlane_AssignFromX
 	*/
 
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/SwarmAdvectionInAPlane.meta
--- a/MaterialPoints/src/SwarmAdvectionInAPlane.meta	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/SwarmAdvectionInAPlane.meta	Tue Feb 02 16:55:08 2010 +1100
@@ -10,7 +10,7 @@
 <param name="Project Web">http://www.stgermainproject.org/PICellerator.html</param>
 <param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
 <param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
-<param name="Parent">TimeIntegrand</param>
+<param name="Parent">TimeIntegratee</param>
 <param name="Reference">...</param>
 <param name="Summary">...</param>
 <param name="Description">Special advector that does not advect particles along the chosen axis </param>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/SwarmAdvector.c
--- a/MaterialPoints/src/SwarmAdvector.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/SwarmAdvector.c	Tue Feb 02 16:55:08 2010 +1100
@@ -68,7 +68,6 @@ const Type SwarmAdvector_Type = "SwarmAd
 */
 SwarmAdvector* SwarmAdvector_New(
 		Name                                       name,
-		DomainContext*                             context,
 		TimeIntegrator*                            timeIntegrator,
 		FeVariable*                                velocityField,
 		Bool                                       allowFallbackToFirstOrder,
@@ -78,20 +77,48 @@ SwarmAdvector* SwarmAdvector_New(
 	SwarmAdvector* self = (SwarmAdvector*) _SwarmAdvector_DefaultNew( name );
 
 	/* 	SwarmAdvector_InitAll */
-	_TimeIntegrand_Init( self, context, timeIntegrator, swarm->particleCoordVariable->variable, 0, NULL,
+	_TimeIntegratee_Init( self, timeIntegrator, swarm->particleCoordVariable->variable, 0, NULL,
 		allowFallbackToFirstOrder );
 	_SwarmAdvector_Init( self, velocityField, swarm, periodicBCsManager );
 
 	return self;
 }
 
-SwarmAdvector* _SwarmAdvector_New(  SWARMADVECTOR_DEFARGS  )
+SwarmAdvector* _SwarmAdvector_New(
+		SizeT                                      _sizeOfSelf, 
+		Type                                       type,
+		Stg_Class_DeleteFunction*                  _delete,
+		Stg_Class_PrintFunction*                   _print,
+		Stg_Class_CopyFunction*                    _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*           _construct,
+		Stg_Component_BuildFunction*               _build,
+		Stg_Component_InitialiseFunction*          _initialise,
+		Stg_Component_ExecuteFunction*             _execute,
+		Stg_Component_DestroyFunction*             _destroy,		
+		TimeIntegratee_CalculateTimeDerivFunction* _calculateTimeDeriv,
+		TimeIntegratee_IntermediateFunction*       _intermediate,
+		Name                                       name )
 {
 	SwarmAdvector* self;
 	
 	/* Allocate memory */
 	assert( _sizeOfSelf >= sizeof(SwarmAdvector) );
-	self = (SwarmAdvector*)_TimeIntegrand_New(  TIMEINTEGRAND_PASSARGS  );
+	self = (SwarmAdvector*)_TimeIntegratee_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculateTimeDeriv,
+			_intermediate,
+			name );
 	
 	/* General info */
 
@@ -128,7 +155,7 @@ void _SwarmAdvector_Init(
 		CartesianGenerator* cartesianGenerator = (CartesianGenerator*) swarm->mesh->generator;
 		if ( cartesianGenerator->periodic[ I_AXIS ] || cartesianGenerator->periodic[ J_AXIS ] || cartesianGenerator->periodic[ K_AXIS ] ) {
 			/* Create a periodicBCsManager if there isn't one already */
-			periodicBCsManager = PeriodicBoundariesManager_New( "periodicBCsManager", (PICelleratorContext*)self->context, (Mesh*)swarm->mesh, (Swarm*)swarm, NULL );
+			periodicBCsManager = PeriodicBoundariesManager_New( "periodicBCsManager", (Mesh*)swarm->mesh, (Swarm*)swarm, NULL );
 		}
 	}	
 	self->periodicBCsManager = periodicBCsManager;
@@ -158,7 +185,7 @@ void _SwarmAdvector_Delete( void* swarmA
 	SwarmAdvector* self = (SwarmAdvector*)swarmAdvector;
 
 	/* Delete parent */
-	_TimeIntegrand_Delete( self );
+	_TimeIntegratee_Delete( self );
 }
 
 
@@ -166,7 +193,7 @@ void _SwarmAdvector_Print( void* swarmAd
 	SwarmAdvector* self = (SwarmAdvector*)swarmAdvector;
 	
 	/* Print parent */
-	_TimeIntegrand_Print( self, stream );
+	_TimeIntegratee_Print( self, stream );
 }
 
 
@@ -174,7 +201,7 @@ void* _SwarmAdvector_Copy( void* swarmAd
 	SwarmAdvector*	self = (SwarmAdvector*)swarmAdvector;
 	SwarmAdvector*	newSwarmAdvector;
 	
-	newSwarmAdvector = (SwarmAdvector*)_TimeIntegrand_Copy( self, dest, deep, nameExt, ptrMap );
+	newSwarmAdvector = (SwarmAdvector*)_TimeIntegratee_Copy( self, dest, deep, nameExt, ptrMap );
 
 	newSwarmAdvector->velocityField = self->velocityField;
 	newSwarmAdvector->swarm         = self->swarm;
@@ -184,39 +211,35 @@ void* _SwarmAdvector_Copy( void* swarmAd
 }
 
 void* _SwarmAdvector_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                               _sizeOfSelf = sizeof(SwarmAdvector);
-	Type                                                       type = SwarmAdvector_Type;
-	Stg_Class_DeleteFunction*                               _delete = _SwarmAdvector_Delete;
-	Stg_Class_PrintFunction*                                 _print = _SwarmAdvector_Print;
-	Stg_Class_CopyFunction*                                   _copy = _SwarmAdvector_Copy;
-	Stg_Component_DefaultConstructorFunction*   _defaultConstructor = _SwarmAdvector_DefaultNew;
-	Stg_Component_ConstructFunction*                     _construct = _SwarmAdvector_AssignFromXML;
-	Stg_Component_BuildFunction*                             _build = _SwarmAdvector_Build;
-	Stg_Component_InitialiseFunction*                   _initialise = _SwarmAdvector_Initialise;
-	Stg_Component_ExecuteFunction*                         _execute = _SwarmAdvector_Execute;
-	Stg_Component_DestroyFunction*                         _destroy = _SwarmAdvector_Destroy;
-	TimeIntegrand_CalculateTimeDerivFunction*  _calculateTimeDeriv = _SwarmAdvector_TimeDeriv;
-	TimeIntegrand_IntermediateFunction*              _intermediate = _SwarmAdvector_Intermediate;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return (void*) _SwarmAdvector_New(  SWARMADVECTOR_PASSARGS  );
+	return (void*) _SwarmAdvector_New(
+			sizeof(SwarmAdvector),
+			SwarmAdvector_Type,
+			_SwarmAdvector_Delete,
+			_SwarmAdvector_Print,
+			_SwarmAdvector_Copy,
+			_SwarmAdvector_DefaultNew,
+			_SwarmAdvector_Construct,
+			_SwarmAdvector_Build,
+			_SwarmAdvector_Initialise,
+			_SwarmAdvector_Execute,
+			_SwarmAdvector_Destroy,
+			_SwarmAdvector_TimeDeriv,
+			_SwarmAdvector_Intermediate,
+			name );
 }
 
 
-void _SwarmAdvector_AssignFromXML( void* swarmAdvector, Stg_ComponentFactory* cf, void* data ) {
+void _SwarmAdvector_Construct( void* swarmAdvector, Stg_ComponentFactory* cf, void* data ) {
 	SwarmAdvector*	            self          = (SwarmAdvector*) swarmAdvector;
 	FeVariable*                 velocityField;
 	MaterialPointsSwarm*        swarm;
 	PeriodicBoundariesManager*  periodicBCsManager;
 
-	_TimeIntegrand_AssignFromXML( self, cf, data );
+	_TimeIntegratee_Construct( self, cf, data );
 
-	velocityField      = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"VelocityField", FeVariable, True, data  );
-	swarm              = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Swarm", MaterialPointsSwarm, True, data  );
-	periodicBCsManager = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"PeriodicBCsManager", PeriodicBoundariesManager, False, data  );
+	velocityField      = Stg_ComponentFactory_ConstructByKey( cf, self->name, "VelocityField", FeVariable,  True, data );
+	swarm              = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Swarm",  MaterialPointsSwarm, True, data );
+	periodicBCsManager = Stg_ComponentFactory_ConstructByKey( cf, self->name, "PeriodicBCsManager", PeriodicBoundariesManager, False, data );
 
 	_SwarmAdvector_Init( self, velocityField, swarm, periodicBCsManager );
 }
@@ -224,39 +247,28 @@ void _SwarmAdvector_Build( void* swarmAd
 void _SwarmAdvector_Build( void* swarmAdvector, void* data ) {
 	SwarmAdvector*	self = (SwarmAdvector*) swarmAdvector;
 
-   Stg_Component_Build( self->velocityField, data, False );
-   Stg_Component_Build( self->swarm, data, False );
+	_TimeIntegratee_Build( self, data );
+
 	if ( self->periodicBCsManager )
 		Stg_Component_Build( self->periodicBCsManager, data, False );
-   _TimeIntegrand_Build( self, data );
-
 }
-
 void _SwarmAdvector_Initialise( void* swarmAdvector, void* data ) {
 	SwarmAdvector*	self = (SwarmAdvector*) swarmAdvector;
 	
-   Stg_Component_Initialise( self->velocityField, data, False );
-   Stg_Component_Initialise( self->swarm, data, False );
+	_TimeIntegratee_Initialise( self, data );
+	
 	if ( self->periodicBCsManager )
 		Stg_Component_Initialise( self->periodicBCsManager, data, False );
-   if ( self->context->loadSwarmsFromCheckpoint == False )
-      _TimeIntegrand_Initialise( self, data );
 }
-
 void _SwarmAdvector_Execute( void* swarmAdvector, void* data ) {
 	SwarmAdvector*	self = (SwarmAdvector*)swarmAdvector;
 	
-	_TimeIntegrand_Execute( self, data );
+	_TimeIntegratee_Execute( self, data );
 }
-
 void _SwarmAdvector_Destroy( void* swarmAdvector, void* data ) {
 	SwarmAdvector*	self = (SwarmAdvector*)swarmAdvector;
-
-	_TimeIntegrand_Destroy( self, data );	
-   Stg_Component_Destroy( self->velocityField, data, False );
-   Stg_Component_Destroy( self->swarm, data, False );
-	if ( self->periodicBCsManager )
-		Stg_Component_Destroy( self->periodicBCsManager, data, False );
+	
+	_TimeIntegratee_Destroy( self, data );
 }
 
 Bool _SwarmAdvector_TimeDeriv( void* swarmAdvector, Index array_I, double* timeDeriv ) {
@@ -274,7 +286,7 @@ Bool _SwarmAdvector_TimeDeriv( void* swa
 			( self->swarm->dim == 3 && isinf(timeDeriv[2]) ) ) 
 	{
 		#if 0
-		Journal_Printf( Journal_Register( Error_Type, (Name)self->type  ),
+		Journal_Printf( Journal_Register( Error_Type, self->type ),
 			"Error in func '%s' for particle with index %u.\n\tPosition (%g, %g, %g)\n\tVelocity here is (%g, %g, %g)."
 			"\n\tInterpolation result is %s.\n",
 			__func__, array_I, coord[0], coord[1], coord[2], 
@@ -320,5 +332,3 @@ void SwarmAdvector_AdvectionFinish( Time
 */
 
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/SwarmAdvector.h
--- a/MaterialPoints/src/SwarmAdvector.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/SwarmAdvector.h	Tue Feb 02 16:55:08 2010 +1100
@@ -59,7 +59,7 @@
 	/* SwarmAdvector information */
 	#define __SwarmAdvector \
 		/* General info */ \
-		__TimeIntegrand \
+		__TimeIntegratee \
 		/* Virtual Info */\
 		/* Other Info */\
 		MaterialPointsSwarm*                  swarm;                \
@@ -73,25 +73,27 @@
 	*/
 	SwarmAdvector* SwarmAdvector_New(
 		Name                                       name,
-		DomainContext*                             context,
 		TimeIntegrator*                            timeIntegrator,
 		FeVariable*                                velocityField,
 		Bool                                       allowFallbackToFirstOrder,
 		MaterialPointsSwarm*                       swarm,
 		PeriodicBoundariesManager*                 periodicBCsManager );
 
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define SWARMADVECTOR_DEFARGS \
-                TIMEINTEGRAND_DEFARGS
-
-	#define SWARMADVECTOR_PASSARGS \
-                TIMEINTEGRAND_PASSARGS
-
-	SwarmAdvector* _SwarmAdvector_New(  SWARMADVECTOR_DEFARGS  );
+	SwarmAdvector* _SwarmAdvector_New(
+		SizeT                                      _sizeOfSelf, 
+		Type                                       type,
+		Stg_Class_DeleteFunction*                  _delete,
+		Stg_Class_PrintFunction*                   _print,
+		Stg_Class_CopyFunction*                    _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*           _construct,
+		Stg_Component_BuildFunction*               _build,
+		Stg_Component_InitialiseFunction*          _initialise,
+		Stg_Component_ExecuteFunction*             _execute,
+		Stg_Component_DestroyFunction*             _destroy,		
+		TimeIntegratee_CalculateTimeDerivFunction* _calculateTimeDeriv,
+		TimeIntegratee_IntermediateFunction*       _intermediate,
+		Name                                       name );
 
 	void _SwarmAdvector_Init( 
 		SwarmAdvector*                             self,
@@ -108,7 +110,7 @@
 	void* _SwarmAdvector_Copy( void* materialSwarm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
 	void* _SwarmAdvector_DefaultNew( Name name ) ;
-void _SwarmAdvector_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+void _SwarmAdvector_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
 	void _SwarmAdvector_Build( void* materialSwarm, void* data ) ;
 	void _SwarmAdvector_Initialise( void* materialSwarm, void* data ) ;
 	void _SwarmAdvector_Execute( void* materialSwarm, void* data );
@@ -132,4 +134,3 @@ void _SwarmAdvector_AssignFromXML( void*
 	*/
 
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/SwarmAdvector.meta
--- a/MaterialPoints/src/SwarmAdvector.meta	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/SwarmAdvector.meta	Tue Feb 02 16:55:08 2010 +1100
@@ -10,7 +10,7 @@
 <param name="Project Web">http://www.stgermainproject.org/PICellerator.html</param>
 <param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
 <param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
-<param name="Parent">TimeIntegrand</param>
+<param name="Parent">TimeIntegratee</param>
 <param name="Reference">http://en.wikipedia.org/wiki/Advection</param>
 <param name="Summary">A component which moves particles according to a velocity field each timestep.</param>
 <param name="Description">A component which moves particles according to a velocity field each timestep.</param>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/SwarmVariableField.c
--- a/MaterialPoints/src/SwarmVariableField.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/SwarmVariableField.c	Tue Feb 02 16:55:08 2010 +1100
@@ -63,24 +63,65 @@ const Type SwarmVariableField_Type = "Sw
 const Type SwarmVariableField_Type = "SwarmVariableField";
 
 /* Creation implementation / Virtual constructor */
-SwarmVariableField* _SwarmVariableField_New(  SWARMVARIABLEFIELD_DEFARGS  ) 
+SwarmVariableField* _SwarmVariableField_New( 
+		SizeT                                             _sizeOfSelf,  
+		Type                                              type,
+		Stg_Class_DeleteFunction*                         _delete,
+		Stg_Class_PrintFunction*                          _print,
+		Stg_Class_CopyFunction*                           _copy, 
+		Stg_Component_DefaultConstructorFunction*         _defaultConstructor,
+		Stg_Component_ConstructFunction*                  _construct,
+		Stg_Component_BuildFunction*                      _build,
+		Stg_Component_InitialiseFunction*                 _initialise,
+		Stg_Component_ExecuteFunction*                    _execute,
+		Stg_Component_DestroyFunction*                    _destroy,
+		FieldVariable_InterpolateValueAtFunction*         _interpolateValueAt,
+		FieldVariable_GetValueFunction*	                  _getMinGlobalFeMagnitude,
+		FieldVariable_GetValueFunction*                   _getMaxGlobalFeMagnitude,
+		FieldVariable_GetCoordFunction*             	  _getMinAndMaxLocalCoords,
+		FieldVariable_GetCoordFunction*             	  _getMinAndMaxGlobalCoords,
+		FeVariable_InterpolateWithinElementFunction*      _interpolateWithinElement,	
+		FeVariable_GetValueAtNodeFunction*	  	  _getValueAtNode,
+		/*SwarmVariableField_GetValueAtNodeFunction*	  _getValueAtNode,*/
+		/*SwarmVariableField_ValueAtParticleFunction*       _valueAtParticle,*/
+		ParticleFeVariable_ValueAtParticleFunction*       _valueAtParticle,
+		Name                                              name ) 
 {
 	SwarmVariableField* self;
 	
 	/* Allocate memory */
 	assert( _sizeOfSelf >= sizeof(SwarmVariableField) );
 
-	self = (SwarmVariableField*) _ParticleFeVariable_New(  PARTICLEFEVARIABLE_PASSARGS  );
+	self = (SwarmVariableField*) _ParticleFeVariable_New(
+ 						_sizeOfSelf,
+						type,
+						_delete,
+						_print,
+						_copy, 
+						_defaultConstructor,
+						_construct,
+						_build,
+						_initialise,
+						_execute,
+						_destroy,
+						_interpolateValueAt,
+						_getMinGlobalFeMagnitude,
+						_getMaxGlobalFeMagnitude,
+						_getMinAndMaxLocalCoords,
+						_getMinAndMaxGlobalCoords,		
+						_interpolateWithinElement,	
+						_getValueAtNode,
+						_valueAtParticle,
+						name );
 	/* Virtual info */
 	
 	return self;
 }
 
-void _SwarmVariableField_Init( SwarmVariableField* swarmVariableField, Variable_Register* variable_Register, Name swarmVarName, MaterialPointsSwarm*	materialSwarm ) {
+void _SwarmVariableField_Init( SwarmVariableField* swarmVariableField, SwarmVariable* swarmVar, Variable_Register* variable_Register ) {
 	SwarmVariableField* 	self 	= (SwarmVariableField*)swarmVariableField;
+	self->swarmVar = swarmVar;
 	self->variable_Register = variable_Register;
-	self->swarmVarName = swarmVarName;
-	self->materialSwarm = materialSwarm;
 }
 
 void _SwarmVariableField_Delete( void* swarmVariableField ) {
@@ -96,72 +137,79 @@ void _SwarmVariableField_Print( void* sw
 }
 
 void* _SwarmVariableField_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                       _sizeOfSelf = sizeof(SwarmVariableField);
-	Type                                                               type = SwarmVariableField_Type;
-	Stg_Class_DeleteFunction*                                       _delete = _SwarmVariableField_Delete;
-	Stg_Class_PrintFunction*                                         _print = _SwarmVariableField_Print;
-	Stg_Class_CopyFunction*                                           _copy = NULL;
-	Stg_Component_DefaultConstructorFunction*           _defaultConstructor = _SwarmVariableField_DefaultNew;
-	Stg_Component_ConstructFunction*                             _construct = _SwarmVariableField_AssignFromXML;
-	Stg_Component_BuildFunction*                                     _build = _SwarmVariableField_Build;
-	Stg_Component_InitialiseFunction*                           _initialise = _SwarmVariableField_Initialise;
-	Stg_Component_ExecuteFunction*                                 _execute = _SwarmVariableField_Execute;
-	Stg_Component_DestroyFunction*                                 _destroy = _SwarmVariableField_Destroy;
-	FieldVariable_InterpolateValueAtFunction*           _interpolateValueAt = _FeVariable_InterpolateValueAt;
-	FieldVariable_GetCoordFunction*                _getMinAndMaxLocalCoords = _FeVariable_GetMinAndMaxLocalCoords;
-	FieldVariable_GetCoordFunction*               _getMinAndMaxGlobalCoords = _FeVariable_GetMinAndMaxGlobalCoords;
-	FeVariable_InterpolateWithinElementFunction*  _interpolateWithinElement = _FeVariable_InterpolateNodeValuesToElLocalCoord;
-	FeVariable_GetValueAtNodeFunction*                      _getValueAtNode = _FeVariable_GetValueAtNode;
-	ParticleFeVariable_ValueAtParticleFunction*            _valueAtParticle = (ParticleFeVariable_ValueAtParticleFunction*)_SwarmVariableField_ValueAtParticle;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType                             nameAllocationType = ZERO;
-	FieldVariable_GetValueFunction*   _getMinGlobalFieldMagnitude = ZERO;
-	FieldVariable_GetValueFunction*   _getMaxGlobalFieldMagnitude = ZERO;
-	FeVariable_SyncShadowValuesFunc*            _syncShadowValues = ZERO;
-
-	return (void*)_SwarmVariableField_New(  SWARMVARIABLEFIELD_PASSARGS  );
+	return (void*)_SwarmVariableField_New( 
+			sizeof(SwarmVariableField), 
+			SwarmVariableField_Type,
+			_SwarmVariableField_Delete,
+			_SwarmVariableField_Print,
+			NULL,
+			_SwarmVariableField_DefaultNew,
+			_SwarmVariableField_Construct,
+			_SwarmVariableField_Build,
+			_SwarmVariableField_Initialise,
+			_SwarmVariableField_Execute,
+			_SwarmVariableField_Destroy,
+			_FeVariable_InterpolateValueAt,
+			_FeVariable_GetMinGlobalFieldMagnitude,
+			_FeVariable_GetMaxGlobalFieldMagnitude,
+			_FeVariable_GetMinAndMaxLocalCoords,
+			_FeVariable_GetMinAndMaxGlobalCoords,
+			_FeVariable_InterpolateNodeValuesToElLocalCoord,
+			_FeVariable_GetValueAtNode,
+			/*_SwarmVariableField_GetValueAtNode,*/
+			_SwarmVariableField_ValueAtParticle,
+			name );
 }
 
-void _SwarmVariableField_AssignFromXML( void* swarmVariableField, Stg_ComponentFactory* cf, void* data ) {
-	SwarmVariableField*		self = (SwarmVariableField*)swarmVariableField;
-	IntegrationPointsSwarm*	integrationSwarm;
+void _SwarmVariableField_Construct( void* swarmVariableField, Stg_ComponentFactory* cf, void* data ) {
+	SwarmVariableField*     	self		= (SwarmVariableField*)swarmVariableField;
+	SwarmVariable*			swarmVar;
+	IntegrationPointsSwarm* 	integrationSwarm;
+	FiniteElementContext*		context;
 	Variable_Register*		variable_Register;
-   Name			            swarmVarName;
-   MaterialPointsSwarm*	   materialSwarm;
-	_ParticleFeVariable_AssignFromXML( self, cf, data );
 
-	variable_Register = self->context->variable_Register; 
+	variable_Register = (Variable_Register*) Stg_ObjectList_Get( cf->registerRegister, "Variable_Register" );
+
+	/* Construct Parent */
+	_ParticleFeVariable_Construct( self, cf, data );
 
 	// TODO: just get the textual name here - see gLucifer's SwarmPlotter DrawignObject 
-	swarmVarName = Stg_ComponentFactory_GetString( cf, self->name, (Dictionary_Entry_Key)"swarmVariable", "" );
+	self->swarmVarName = Stg_ComponentFactory_GetString( cf, self->name, "swarmVariable", "" );
+	assert( swarmVar );
 
-	materialSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"MaterialSwarm", MaterialPointsSwarm, True, data );
-	integrationSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Swarm", IntegrationPointsSwarm, True, NULL );
-	assert( integrationSwarm  );
+	self->materialSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "MaterialSwarm", MaterialPointsSwarm, True, data );
 
-	_SwarmVariableField_Init( self, variable_Register, swarmVarName, materialSwarm );
+	integrationSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Swarm", IntegrationPointsSwarm, True, NULL );
+	assert( integrationSwarm );
+
+	context = (FiniteElementContext*) Stg_ComponentFactory_ConstructByKey( cf, self->name, "context", FiniteElementContext, True, data );
+	
+	assert( context );
+
+	_SwarmVariableField_Init( self, swarmVar, variable_Register );
+	_ParticleFeVariable_Init( self, integrationSwarm, context );
 }
 
 void _SwarmVariableField_Build( void* swarmVariableField, void* data ) {
-	SwarmVariableField*	      self	            = (SwarmVariableField*)swarmVariableField;
-	unsigned		               nDomainVerts      = Mesh_GetDomainSize( self->feMesh, MT_VERTEX );
-	SwarmVariable_Register*		swarmVar_Register	= self->materialSwarm->swarmVariable_Register;
-	Stream*				         errorStream		   = Journal_Register( Error_Type, (Name)self->type  );
-	Name			               tmpName;
+	SwarmVariableField*	self	= (SwarmVariableField*)swarmVariableField;
+	Name			tmpName;
+	unsigned		nDomainVerts	= Mesh_GetDomainSize( self->feMesh, MT_VERTEX );
 
-	Stg_Component_Build( self->materialSwarm, data, False );
 	/* make this more flexible to handle vector values at each node - will have to get the num dofs from the XML
 	 * as other components are not necessarily built yet... dave. 03.10.07 */
 	assert( Class_IsSuper( self->feMesh->topo, IGraph ) );
-	tmpName = Stg_Object_AppendSuffix( self, (Name)"DataVariable"  );
-	self->dataVariable = Variable_NewScalar( tmpName, (AbstractContext*)self->context, Variable_DataType_Double, (Index*)&nDomainVerts, NULL, (void**)&self->data, self->variable_Register );
+	tmpName = Stg_Object_AppendSuffix( self, "DataVariable" );
+	self->dataVariable = Variable_NewScalar( tmpName,
+		       				 Variable_DataType_Double,
+						 &nDomainVerts,
+						 NULL,
+						 (void**)&self->data,
+						 self->variable_Register );
 	Memory_Free( tmpName );
 	self->fieldComponentCount = 1;
 
-	tmpName = Stg_Object_AppendSuffix( self, (Name)"DofLayout"  );
-	self->dofLayout = DofLayout_New( tmpName, self->context, self->variable_Register, 0, self->feMesh );
+	tmpName = Stg_Object_AppendSuffix( self, "DofLayout" );
+	self->dofLayout = DofLayout_New( tmpName, self->variable_Register, 0, self->feMesh );
 
 	/* must build before adding the variable to the dof layout, dave. 04.10.07 */
 	//Stg_Component_Build( self->dofLayout, data, False );
@@ -172,15 +220,6 @@ void _SwarmVariableField_Build( void* sw
 	
 	self->eqNum->dofLayout = self->dofLayout;
 
-	/* assign the swarm variable, assume its already built */
-	if( 0 != strcmp( self->swarmVarName, "" ) ) {
-		self->swarmVar = SwarmVariable_Register_GetByName( swarmVar_Register, self->swarmVarName );
-		Journal_Firewall( self->swarmVar != NULL, errorStream, "Error - cannot find swarm variable \"%s\" in %s() for swarm \"%s\".\n",
-			          self->swarmVarName, __func__, self->materialSwarm->name );
-
-		Stg_Component_Build( self->swarmVar, data, False );
-	}
-
 	_ParticleFeVariable_Build( self, data );
 	/* TODO: build self->swarmVar */
 	// TODO: granb self->SwarmVariableName out of the swarm vart register, save reference as self->swarmVar
@@ -189,12 +228,22 @@ void _SwarmVariableField_Build( void* sw
 
 void _SwarmVariableField_Initialise( void* swarmVariableField, void* data ) {
 	SwarmVariableField*		self			= (SwarmVariableField*)swarmVariableField;
+	SwarmVariable_Register*		swarmVar_Register	= self->materialSwarm->swarmVariable_Register;
+	Stream*				errorStream		= Journal_Register( Error_Type, self->type );
 
-   Stg_Component_Initialise( self->materialSwarm, data, False );
+	/* assign the swarm variable, assume its already built */
+	if( 0 != strcmp( self->swarmVarName, "" ) ) {
+		self->swarmVar = SwarmVariable_Register_GetByName( swarmVar_Register, self->swarmVarName );
+		Journal_Firewall( self->swarmVar != NULL, errorStream, "Error - cannot find swarm variable \"%s\" in %s() for swarm \"%s\".\n",
+			          self->swarmVarName, __func__, self->materialSwarm->name );
 
-   if( self->swarmVar ) Stg_Component_Initialise( self->swarmVar, data, False );
+		Stg_Component_Build( self->swarmVar, data, False );
+		Stg_Component_Initialise( self->swarmVar, data, False );
+	}
 
 	_ParticleFeVariable_Initialise( self, data );
+
+	_SwarmVariable_Initialise( self->swarmVar, data );
 }
 
 void _SwarmVariableField_Execute( void* swarmVariableField, void* data ) {
@@ -202,30 +251,28 @@ void _SwarmVariableField_Execute( void* 
 }
 
 void _SwarmVariableField_Destroy( void* swarmVariableField, void* data ) {
-	SwarmVariableField*		self			= (SwarmVariableField*)swarmVariableField;
-
-   Stg_Component_Destroy( self->materialSwarm, data, False );
-   if( self->swarmVar ) Stg_Component_Destroy( self->swarmVar, data, False );
-   
 	_ParticleFeVariable_Destroy( swarmVariableField, data );
 }
 
-void _SwarmVariableField_ValueAtParticle(
-	void*							swarmVariableField, 
-	IntegrationPointsSwarm*	swarm, 
-	Element_LocalIndex		lElement_I, 
-	IntegrationPoint*			particle,
-	double*						value ) 
+void _SwarmVariableField_ValueAtParticle( void* swarmVariableField, 
+					  IntegrationPointsSwarm* swarm, 
+					  Element_LocalIndex lElement_I, 
+					  IntegrationPoint* particle,
+					  double* value ) 
 {
-	SwarmVariableField*	self = (SwarmVariableField*)swarmVariableField;
-	double					distance;
-	Cell_Index				cell_I;
+	SwarmVariableField*	self            = (SwarmVariableField*)swarmVariableField;
+	GlobalParticle*		matParticle;
+	double			distance;
+	Cell_Index		cell_I;
 	Particle_InCellIndex	cParticle_I;
-	Particle_Index			lParticle_I;
+	Particle_Index		lParticle_I;
 
 	cell_I = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
-	cParticle_I = Swarm_FindClosestParticleInCell( swarm, cell_I, Mesh_GetDimSize( self->dofLayout->mesh ), particle->xi, &distance );
-
+	cParticle_I = Swarm_FindClosestParticleInCell( swarm,
+		       				       cell_I,
+						       Mesh_GetDimSize( self->dofLayout->mesh ),
+						       particle->xi,
+						       &distance );
 	// this function doesn't seem to be doing its joob properly!
 	//lParticle_I = IntegrationPointMapper_GetMaterialIndexAt( swarm->mapper, swarm->cellParticleTbl[cell_I][cParticle_I] );
 	
@@ -252,5 +299,3 @@ double _SwarmVariableField_GetMaxGlobalM
 
 
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/SwarmVariableField.h
--- a/MaterialPoints/src/SwarmVariableField.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/SwarmVariableField.h	Tue Feb 02 16:55:08 2010 +1100
@@ -41,8 +41,8 @@
 */
 
 
-#ifndef __PICellerator_MaterialPoints_SwarmVariableField_h__
-#define __PICellerator_MaterialPoints_SwarmVariableField_h__
+#ifndef __PICellerator_Utils_SwarmVariableField_h__
+#define __PICellerator_Utils_SwarmVariableField_h__
 
 	/** Textual name of this class */
 	extern const Type SwarmVariableField_Type;
@@ -69,27 +69,37 @@
 		MaterialPointsSwarm*                                swarm,
 		Index                                               dofCount );
 */	
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define SWARMVARIABLEFIELD_DEFARGS \
-                PARTICLEFEVARIABLE_DEFARGS
-
-	#define SWARMVARIABLEFIELD_PASSARGS \
-                PARTICLEFEVARIABLE_PASSARGS
-
-	SwarmVariableField* _SwarmVariableField_New(  SWARMVARIABLEFIELD_DEFARGS  );
+	SwarmVariableField* _SwarmVariableField_New( 
+		SizeT                                             sizeOfSelf,  
+		Type                                              type,
+		Stg_Class_DeleteFunction*                         _delete,
+		Stg_Class_PrintFunction*                          _print,
+		Stg_Class_CopyFunction*                           _copy, 
+		Stg_Component_DefaultConstructorFunction*         _defaultConstructor,
+		Stg_Component_ConstructFunction*                  _construct,
+		Stg_Component_BuildFunction*                      _build,
+		Stg_Component_InitialiseFunction*                 _initialise,
+		Stg_Component_ExecuteFunction*                    _execute,
+		Stg_Component_DestroyFunction*                    _destroy,
+		FieldVariable_InterpolateValueAtFunction*         _interpolateValueAt,
+		FieldVariable_GetValueFunction*	                  _getMinGlobalFeMagnitude,
+		FieldVariable_GetValueFunction*                   _getMaxGlobalFeMagnitude,
+		FieldVariable_GetCoordFunction*             	  _getMinAndMaxLocalCoords,
+		FieldVariable_GetCoordFunction*             	  _getMinAndMaxGlobalCoords,
+		FeVariable_InterpolateWithinElementFunction*      _interpolateWithinElement,	
+		FeVariable_GetValueAtNodeFunction*	  	  _getValueAtNode,
+		/*SwarmVariableField_GetValueAtNodeFunction*	  _getValueAtNode,*/
+		/*SwarmVariableField_ValueAtParticleFunction*       _valueAtParticle,*/
+		ParticleFeVariable_ValueAtParticleFunction*       _valueAtParticle,
+		Name                                              name );
 	
 	void _SwarmVariableField_Delete( void* swarmVariable );
 	void _SwarmVariableField_Print( void* swarmVariable, Stream* stream );
 
 	void* _SwarmVariableField_DefaultNew( Name name ) ;
-	void _SwarmVariableField_AssignFromXML( void* swarmVariable, Stg_ComponentFactory* cf, void* data ) ;
+	void _SwarmVariableField_Construct( void* swarmVariable, Stg_ComponentFactory* cf, void* data ) ;
 	void _SwarmVariableField_Build( void* swarmVariable, void* data ) ;
 	void _SwarmVariableField_Initialise( void* swarmVariable, void* data ) ;
-   void _SwarmVariableField_Init( SwarmVariableField* swarmVariableField, Variable_Register* variable_Register, Name swarmVarName, MaterialPointsSwarm*	materialSwarm ) ;
 	void _SwarmVariableField_Execute( void* swarmVariable, void* data ) ;
 	void _SwarmVariableField_Destroy( void* swarmVariable, void* data ) ;
 
@@ -103,4 +113,3 @@
 	void _SwarmVariableField_ValueAtParticle( void* swarmVariableField, IntegrationPointsSwarm* swarm, Element_LocalIndex lElement_I, /*Particle_Index lParticle_I*/ IntegrationPoint* particle, double* value );
 	
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/SwarmVariableField.meta
--- a/MaterialPoints/src/SwarmVariableField.meta	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/SwarmVariableField.meta	Tue Feb 02 16:55:08 2010 +1100
@@ -17,7 +17,7 @@
 
 <list name="Params">
 	<struct>
-		<param name="Name">swarmVariableName</param>
+		<param name="Name">swarmVariable</param>
 		<param name="Type">String</param>
 		<param name="Default">""</param>
 		<param name="Description">Textual name of the swarm variable which will be interpolated onto the mesh</param>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/src/types.h
--- a/MaterialPoints/src/types.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/src/types.h	Tue Feb 02 16:55:08 2010 +1100
@@ -61,8 +61,6 @@
 
 	typedef struct IntegrationPointMapper       IntegrationPointMapper;
 	typedef struct OneToOneMapper               OneToOneMapper;
-        typedef struct OneToManyRef OneToManyRef;
-        typedef struct OneToManyMapper OneToManyMapper;
 	typedef struct CoincidentMapper             CoincidentMapper;
 	typedef struct GaussCoincidentMapper        GaussCoincidentMapper;
 	typedef struct GaussMapper                  GaussMapper;
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/AdvectionSuite.c
--- a/MaterialPoints/tests/AdvectionSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,229 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** Role:
-**   Tests the AdvectionSuite
-**
-** $Id: testAdvection.c 3462 2006-02-19 06:53:24Z WalterLandry $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include <PICellerator/PICellerator.h>
-#include "AdvectionSuite.h"
-
-#define CURR_MODULE_NAME "AdvectionSuite"
-
-ExtensionInfo_Index handle;
-
-typedef struct {
-} AdvectionSuiteData;
-
-
-void AdvectionSuite_Setup( AdvectionSuiteData* data ) {
-}
-
-void AdvectionSuite_Teardown( AdvectionSuiteData* data ) {
-}
-
-double dt( void* class, PICelleratorContext* context ) {
-	return Dictionary_GetDouble_WithDefault( context->dictionary, (Dictionary_Entry_Key)"dt", 0.01 );
-}
-
-void check( PICelleratorContext* context  ) {
-	MaterialPointsSwarm*   materialPointsSwarm;
-	GlobalParticle*   particle;
-	double*           originalCoord;
-	double*           coord;
-	Particle_Index    lParticle_I;
-	double            maxRadiusError       = 0.0;
-	double            maxThetaError        = 0.0;
-	double            maxDepthError        = 0.0;
-	double            maxRadiusErrorGlobal;
-	double            maxThetaErrorGlobal;
-	double            maxDepthErrorGlobal;
-	double            currentRadius;
-	double            originalRadius;
-	double            originalTheta;
-	Coord             analyticCoord;
-	double            time                 = context->currentTime + context->dt;
-	Dictionary*       dictionary           = context->dictionary;
-	double		  depthErrorTolerance  = Dictionary_GetDouble( dictionary, "depthErrorTolerance" );
-	double		  radiusErrorTolerance = Dictionary_GetDouble( dictionary, "radiusErrorTolerance" );
-	double		  thetaErrorTolerance  = Dictionary_GetDouble( dictionary, "thetaErrorTolerance" );
-	double		  theta;
-
-	/* Add original pos to particle */
-	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialPointsSwarm" );
-
-	for ( lParticle_I = 0 ; lParticle_I < materialPointsSwarm->particleLocalCount ; lParticle_I++ ) {
-		particle      = (GlobalParticle* )Swarm_ParticleAt( materialPointsSwarm, lParticle_I );
-		coord         = particle->coord;
-		originalCoord = ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr, particle, handle );
-
-		currentRadius  = StGermain_VectorMagnitude( coord, 2 );
-		originalRadius = StGermain_VectorMagnitude( originalCoord, 2 );
-		
-		originalTheta = acos( originalCoord[ I_AXIS ]/originalRadius );
-		if ( originalCoord[ J_AXIS ] < 0.0 )
-			originalTheta = 2 * M_PI - originalTheta;
-
-		analyticCoord[ I_AXIS ] = originalRadius*cos( time + originalTheta );
-		analyticCoord[ J_AXIS ] = originalRadius*sin( time + originalTheta );
-		analyticCoord[ K_AXIS ] = originalCoord[ K_AXIS ];
-
-		maxDepthError  = MAX( maxDepthError,  fabs( originalCoord[ K_AXIS ] - coord[ K_AXIS ] ) );
-		maxRadiusError = MAX( maxRadiusError, fabs( currentRadius - originalRadius ) );
-
-		theta = StGermain_AngleBetweenVectors( analyticCoord, coord, 2 );
-		if( theta > maxThetaError )
-			maxThetaError = theta;
-		//maxThetaError  = MAX( maxThetaError, theta );
-	}
-
-	MPI_Allreduce( &maxDepthError,  &maxDepthErrorGlobal,  1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
-	MPI_Allreduce( &maxRadiusError, &maxRadiusErrorGlobal, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
-	MPI_Allreduce( &maxThetaError,  &maxThetaErrorGlobal,  1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
-
-	pcu_check_true( maxDepthErrorGlobal < depthErrorTolerance );
-	pcu_check_true( maxRadiusErrorGlobal < radiusErrorTolerance );
-	pcu_check_true( maxThetaErrorGlobal < thetaErrorTolerance );
-}
-
-void AdvectionSuite_TestEuler( AdvectionSuiteData* data ) {
-	Stg_ComponentFactory* 	cf;
-	PICelleratorContext* 	context;
-	char			filename[PCU_PATH_MAX];
-	MaterialPointsSwarm*	matSwarm;
-	unsigned		particle_i;
-	GlobalParticle*		particle;
-	double*			origCoord;
-	
-	pcu_filename_input( "testEuler.xml", filename );
-	context = (PICelleratorContext*)_PICelleratorContext_DefaultNew( "context" );
-	cf = stgMainInitFromXML( filename, MPI_COMM_WORLD, context );
-
-	matSwarm = (MaterialPointsSwarm*)LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialPointsSwarm"  );
-	handle = ExtensionManager_Add( matSwarm->particleExtensionMgr, (Name)CURR_MODULE_NAME, sizeof(Coord)  );
-
-	Stg_ComponentFactory_BuildComponents( cf, NULL );
-	Stg_ComponentFactory_InitialiseComponents( cf, NULL );
-
-	for( particle_i = 0; particle_i < matSwarm->particleLocalCount; particle_i++ ) {
-		particle = (GlobalParticle*)Swarm_ParticleAt( matSwarm, particle_i );
-		origCoord = ExtensionManager_Get( matSwarm->particleExtensionMgr, particle, handle );
-		memcpy( origCoord, particle->coord, sizeof(Coord) );
-	}
-
-	ContextEP_Prepend( context, AbstractContext_EP_Step, check );
-	EP_AppendClassHook( Context_GetEntryPoint( context, FiniteElementContext_EP_CalcDt ), dt, context );
-
-	stgMainLoop( cf );
-
-	Stg_ComponentFactory_DestroyComponents( cf, data );
-}
-
-void AdvectionSuite_TestRK2( AdvectionSuiteData* data ) {
-	Stg_ComponentFactory* 	cf;
-	PICelleratorContext* 	context;
-	char			filename[PCU_PATH_MAX];
-	MaterialPointsSwarm*	matSwarm;
-	unsigned		particle_i;
-	GlobalParticle*		particle;
-	double*			origCoord;
-	
-	pcu_filename_input( "testRK2.xml", filename );
-	context = (PICelleratorContext*)_PICelleratorContext_DefaultNew( "context" );
-	cf = stgMainInitFromXML( filename, MPI_COMM_WORLD, context );
-
-	matSwarm = (MaterialPointsSwarm*)LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialPointsSwarm"  );
-	handle = ExtensionManager_Add( matSwarm->particleExtensionMgr, (Name)CURR_MODULE_NAME, sizeof(Coord)  );
-
-	Stg_ComponentFactory_BuildComponents( cf, NULL );
-	Stg_ComponentFactory_InitialiseComponents( cf, NULL );
-
-	for( particle_i = 0; particle_i < matSwarm->particleLocalCount; particle_i++ ) {
-		particle = (GlobalParticle*)Swarm_ParticleAt( matSwarm, particle_i );
-		origCoord = ExtensionManager_Get( matSwarm->particleExtensionMgr, particle, handle );
-		memcpy( origCoord, particle->coord, sizeof(Coord) );
-	}
-
-	ContextEP_Prepend( context, AbstractContext_EP_Step, check );
-	EP_AppendClassHook( Context_GetEntryPoint( context, FiniteElementContext_EP_CalcDt ), dt, context );
-
-	stgMainLoop( cf );
-
-	Stg_ComponentFactory_DestroyComponents( cf, data );
-}
-
-void AdvectionSuite_TestRK4( AdvectionSuiteData* data ) {
-	Stg_ComponentFactory* 	cf;
-	PICelleratorContext* 	context;
-	char			filename[PCU_PATH_MAX];
-	MaterialPointsSwarm*	matSwarm;
-	unsigned		particle_i;
-	GlobalParticle*		particle;
-	double*			origCoord;
-	
-	pcu_filename_input( "testRK4.xml", filename );
-	context = (PICelleratorContext*)_PICelleratorContext_DefaultNew( "context" );
-	cf = stgMainInitFromXML( filename, MPI_COMM_WORLD, context );
-
-	matSwarm = (MaterialPointsSwarm*)LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialPointsSwarm"  );
-	handle = ExtensionManager_Add( matSwarm->particleExtensionMgr, (Name)CURR_MODULE_NAME, sizeof(Coord)  );
-
-	Stg_ComponentFactory_BuildComponents( cf, NULL );
-	Stg_ComponentFactory_InitialiseComponents( cf, NULL );
-
-	for( particle_i = 0; particle_i < matSwarm->particleLocalCount; particle_i++ ) {
-		particle = (GlobalParticle*)Swarm_ParticleAt( matSwarm, particle_i );
-		origCoord = ExtensionManager_Get( matSwarm->particleExtensionMgr, particle, handle );
-		memcpy( origCoord, particle->coord, sizeof(Coord) );
-	}
-
-	ContextEP_Prepend( context, AbstractContext_EP_Step, check );
-	EP_AppendClassHook( Context_GetEntryPoint( context, FiniteElementContext_EP_CalcDt ), dt, context );
-
-	stgMainLoop( cf );
-
-	Stg_ComponentFactory_DestroyComponents( cf, data );
-}
-
-void AdvectionSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, AdvectionSuiteData );
-   pcu_suite_setFixtures( suite, AdvectionSuite_Setup, AdvectionSuite_Teardown );
-   pcu_suite_addTest( suite, AdvectionSuite_TestEuler );
-   pcu_suite_addTest( suite, AdvectionSuite_TestRK2 );
-   pcu_suite_addTest( suite, AdvectionSuite_TestRK4 );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/AdvectionSuite.h
--- a/MaterialPoints/tests/AdvectionSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef PICellerator_AdvectionSuite_h
-#define PICellerator_AdvectionSuite_h
-
-void AdvectionSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/MaterialComponentsSuite.c
--- a/MaterialPoints/tests/MaterialComponentsSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,380 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-/*******************
-** Note: this test is currently designed to test the 3 components MaterialPointsSwarm, Material, and Materials_Register.
-**  The reason is that their design and implementation is very tightly coupled (especially during Build and Init phases).
-** 
-********************/
-
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include "PICellerator/PopulationControl/PopulationControl.h"
-#include "PICellerator/Weights/Weights.h"
-#include "PICellerator/MaterialPoints/MaterialPoints.h"
-
-struct _Node {
-   Coord            coord;
-};
-
-struct _Element {
-   Coord            coord;
-};
-
-struct _Particle {
-   __MaterialPoint
-   unsigned int   matProp1;
-   double         matProp2;
-   Bool           matProp3;
-   Bool           matProp4;
-};
-
-typedef struct {
-   FeMesh*                       feMesh;
-   CellLayout*                   cellLayout;
-   ParticleLayout*               particleLayout;
-   MaterialPointsSwarm*          mpSwarm;
-   Variable_Register*            svRegister;
-   ExtensionManager_Register*    eRegister;
-   Materials_Register*           mRegister;
-   Dictionary*                   matDict1;
-   Dictionary*                   matDict2;
-   Stg_Shape*                    shape1;
-   Stg_Shape*                    shape2;
-   Material*                     mat1;
-   Material*                     mat2;
-   SwarmVariable*                matPropVar1;
-   SwarmVariable*                matPropVar2;
-   SwarmVariable*                matPropVar3;
-   SwarmVariable*                matPropVar4;
-} MaterialComponentsSuiteData;
-
-
-FeMesh* buildFeMesh( unsigned nDims, unsigned* size, 
-           double* minCrds, double* maxCrds, 
-           ExtensionManager_Register* emReg )
-{
-   CartesianGenerator*   gen;
-   FeMesh*         feMesh;
-
-   gen = CartesianGenerator_New( "", NULL );
-   CartesianGenerator_SetDimSize( gen, nDims );
-   CartesianGenerator_SetTopologyParams( gen, size, 0, NULL, NULL );
-   CartesianGenerator_SetGeometryParams( gen, minCrds, maxCrds );
-   MeshGenerator_SetIncidenceState( gen, nDims, nDims, True );
-
-   feMesh = FeMesh_New( "", NULL );
-   Mesh_SetExtensionManagerRegister( feMesh, emReg );
-   Mesh_SetGenerator( feMesh, gen );
-   FeMesh_SetElementFamily( feMesh, "linear" );
-
-   Stg_Component_Build( feMesh, NULL, False );
-   Stg_Component_Initialise( feMesh, NULL, False );
-
-   KillObject( feMesh->generator );
-
-   return feMesh;
-}
-
-
-void MaterialComponentsSuite_BuildInitSwarmBasics( MaterialComponentsSuiteData* data ) {
-   Index             var_I;
-   Particle_Index    pI;
-   MaterialPoint*    matPoint;
-
-   /* Mesh will already be initialised */
-   /* Manually do the basic Swarm building and initialising */
-   _Swarm_Build( data->mpSwarm, NULL );
-   for( var_I = 0 ; var_I < data->mpSwarm->nSwarmVars ; var_I++ ) {
-		Stg_Component_Build( data->mpSwarm->swarmVars[var_I], NULL , False );
-	}
-   _Swarm_Initialise( data->mpSwarm, NULL );
-   for( var_I = 0 ; var_I < data->mpSwarm->nSwarmVars ; var_I++ ) {
-		Stg_Component_Initialise( data->mpSwarm->swarmVars[var_I], NULL , False );
-	}
-   /* Pre-set the swarm particle material indexes to undefined, as in the build function */
-   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
-      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
-      matPoint->materialIndex = UNDEFINED_MATERIAL;
-   }
-}
-
-
-void MaterialComponentsSuite_Setup( MaterialComponentsSuiteData* data ) {
-   unsigned    dim = 3;
-   unsigned    meshSize[3] = {2, 2, 2};
-   double      minCrds[3] = {0.0, 0.0, 0.0};
-   double      maxCrds[3] = {1.0, 1.0, 1.0};
-   XYZ         boxCentre = {0.25,0.25,0.25};
-   XYZ         boxWidth = {0.4,0.4,0.4};
-   XYZ         sphereCentre = {0.75,0.75,0.75};
-   double      sphereRadius = 0.2;
-   Particle_Index    pI;
-   Particle*         matPoint;
-   Particle          particle;
-
-   data->svRegister = Variable_Register_New();
-   data->eRegister = ExtensionManager_Register_New();
-   data->mRegister = Materials_Register_New();
-
-   /* Turn off the journal to avoid debug messages about parsing */
-   Journal_Enable_TypedStream( Debug_Type, False );
-   Journal_Enable_TypedStream( Info_Type, False );
-
-   data->feMesh = buildFeMesh( dim, meshSize, minCrds, maxCrds, data->eRegister );
-
-   data->cellLayout = (CellLayout*)ElementCellLayout_New( "elementCellLayout", NULL, data->feMesh );
-   data->particleLayout = (ParticleLayout*)RandomParticleLayout_New( "randomParticleCellLayout", NULL, GlobalCoordSystem, False, 20, 13 );
-
-   data->mpSwarm = MaterialPointsSwarm_New(
-         "testSwarm", NULL,
-         data->cellLayout,
-         data->particleLayout,
-         dim,                      /* dim */
-         sizeof(Particle),
-         data->feMesh,
-         NULL,                   /* escapedRoutine*/
-         NULL,                   /* material */
-         data->svRegister,
-         data->eRegister,
-         data->mRegister,
-         MPI_COMM_WORLD,
-         NULL );
-
-   data->shape1 = (Stg_Shape*)Box_New( "boxShape", dim, boxCentre, 0, 0, 0, boxWidth );
-   data->shape2 = (Stg_Shape*)Sphere_New( "sphereShape", dim, sphereCentre, 0, 0, 0, sphereRadius );
-
-   /* Set up the dictionaries, and set some sample properties for testing */
-   data->matDict1 = Dictionary_New();
-   Dictionary_Add( data->matDict1, (Dictionary_Entry_Key)"testSwarm-matProp1", Dictionary_Entry_Value_FromUnsignedInt( 1 )  );
-   Dictionary_Add( data->matDict1, (Dictionary_Entry_Key)"testSwarm-matProp2", Dictionary_Entry_Value_FromDouble( 1.1 )  );
-   Dictionary_Add( data->matDict1, (Dictionary_Entry_Key)"testSwarm-matProp3", Dictionary_Entry_Value_FromBool( False ) );
-   data->matDict2 = Dictionary_New( );
-   Dictionary_Add( data->matDict2, (Dictionary_Entry_Key)"testSwarm-matProp1", Dictionary_Entry_Value_FromUnsignedInt( 2 )  );
-   Dictionary_Add( data->matDict2, (Dictionary_Entry_Key)"testSwarm-matProp2", Dictionary_Entry_Value_FromDouble( 2.2 )  );
-   Dictionary_Add( data->matDict2, (Dictionary_Entry_Key)"testSwarm-matProp3", Dictionary_Entry_Value_FromBool( True )  );
-   Dictionary_Add( data->matDict2, (Dictionary_Entry_Key)"testSwarm-matProp4", Dictionary_Entry_Value_FromBool( True )  );
-
-   /* Now update the svRegister to match the material properties */
-	data->matPropVar1 = Swarm_NewScalarVariable( data->mpSwarm, (Name)"matProp1", GetOffsetOfMember( particle , matProp1  ), Variable_DataType_Int );
-	data->matPropVar2 = Swarm_NewScalarVariable( data->mpSwarm, (Name)"matProp2", GetOffsetOfMember( particle , matProp2  ), Variable_DataType_Double );
-	data->matPropVar3 = Swarm_NewScalarVariable( data->mpSwarm, (Name)"matProp3", GetOffsetOfMember( particle , matProp3  ), Variable_DataType_Int );
-	data->matPropVar4 = Swarm_NewScalarVariable( data->mpSwarm, (Name)"matProp4", GetOffsetOfMember( particle , matProp4  ), Variable_DataType_Int );
-
-   data->mat1 = Material_New( "mat1", NULL, data->shape1, data->matDict1, data->mRegister );
-   data->mat2 = Material_New( "mat2", NULL, data->shape2, data->matDict2, data->mRegister );
-
-   MaterialComponentsSuite_BuildInitSwarmBasics( data );
-   /* Now set them all the swarm var properties to 0 / False initially */
-   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
-      matPoint = (Particle*)Swarm_ParticleAt( data->mpSwarm, pI );
-      matPoint->matProp1 = 0;
-      matPoint->matProp2 = 0.0;
-      matPoint->matProp3 = False;
-      matPoint->matProp4 = False;
-   }
-}
-
-
-void MaterialComponentsSuite_Teardown( MaterialComponentsSuiteData* data ) {
-   _Stg_Component_Delete( data->mpSwarm );
-   _Stg_Component_Delete( data->cellLayout );
-   _Stg_Component_Delete( data->particleLayout );
-   _Stg_Component_Delete( data->feMesh );
-   Stg_Class_Delete( data->eRegister );
-   Stg_Class_Delete( data->svRegister );
-   Stg_Class_Delete( data->mRegister );
-   _Stg_Component_Delete( data->mat1 );
-   _Stg_Component_Delete( data->mat2 );
-   Stg_Class_Delete( data->matDict1 );
-   Stg_Class_Delete( data->matDict2 );
-   _Stg_Component_Delete( data->shape1 );
-   _Stg_Component_Delete( data->shape2 );
-}
-
-
-/*Tests*/
-void MaterialComponentsSuite_TestRegisterSetup( MaterialComponentsSuiteData* data ) {
-
-   pcu_docstring( "This test simply checks that the Material_Register associated to a test MP_Swarm is correctly set-up as part of the "
-      "Swarm's Build phase (performed already in test suite setup." );
-
-   pcu_check_true( data->mRegister != NULL );
-   pcu_check_true( Materials_Register_GetCount( data->mRegister ) == 2 );
-   pcu_check_true( Materials_Register_GetByIndex( data->mRegister, 0 ) == data->mat1 );
-   pcu_check_true( Materials_Register_GetByIndex( data->mRegister, 1 ) == data->mat2 );
-}
-
-
-void MaterialComponentsSuite_TestMaterialLayout( MaterialComponentsSuiteData* data ) {
-   Particle_Index    pI;
-   MaterialPoint*    matPoint;
-
-   pcu_docstring( "Tests that 2 given materials can be successfully 'layed out' - that is, the particles of a swarm have their materialIndex"
-      "correctly updated to index the right material in the material register, thus setting up an ownership relationship." );
-   
-   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
-      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
-      pcu_check_true( matPoint->materialIndex == UNDEFINED_MATERIAL );
-   }
-
-   Material_Layout( data->mat1, data->mpSwarm );
-   Material_Layout( data->mat2, data->mpSwarm );
-
-   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
-      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
-      if ( Stg_Shape_IsCoordInside( data->shape1, matPoint->coord ) ) {
-         pcu_check_true( matPoint->materialIndex == 0 );
-      }
-      else if ( Stg_Shape_IsCoordInside( data->shape2, matPoint->coord ) ) {
-         pcu_check_true( matPoint->materialIndex == 1 );
-      }
-      else {
-         pcu_check_true( matPoint->materialIndex == UNDEFINED_MATERIAL );
-      }
-   }
-}
-
-
-void MaterialComponentsSuite_TestLayoutGeometry( MaterialComponentsSuiteData* data ) {
-   Particle_Index    pI;
-   MaterialPoint*    matPoint;
-
-   pcu_docstring( "Similar to TestMaterialLayout, checks that all materials in a register can be 'layed out' correctly - ie the individual"
-      "Particles in a MaterialPointSwarm updated to index the correct material in the register." );
-   _Materials_Register_LayoutGeometry( data->mRegister, data->mpSwarm );
-   
-   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
-      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
-      if ( Stg_Shape_IsCoordInside( data->shape1, matPoint->coord ) ) {
-         pcu_check_true( matPoint->materialIndex == 0 );
-      }
-      else if ( Stg_Shape_IsCoordInside( data->shape2, matPoint->coord ) ) {
-         pcu_check_true( matPoint->materialIndex == 1 );
-      }
-      else {
-         pcu_check_true( matPoint->materialIndex == UNDEFINED_MATERIAL );
-      }
-   }
-}
-
-void MaterialComponentsSuite_TestGetMaterial( MaterialComponentsSuiteData* data ) {
-   Particle_Index    pI;
-   MaterialPoint*    matPoint;
-   Material*         material = NULL;
-   Material*         materialOn = NULL;
-   Material_Index    matIndex;
-
-   pcu_docstring( "Tests that after a layout has been performed, the material that a particle belongs to can be successfully looked up."
-      "Thus requires TestLayoutGeometry to pass beforehand." );
-
-   _Materials_Register_LayoutGeometry( data->mRegister, data->mpSwarm );
-
-   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
-      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
-      material = MaterialPointsSwarm_GetMaterialAt( data->mpSwarm, pI );
-      materialOn = MaterialPointsSwarm_GetMaterialOn( data->mpSwarm, matPoint );
-      matIndex = MaterialPointsSwarm_GetMaterialIndexAt( data->mpSwarm, pI );
-
-      if ( Stg_Shape_IsCoordInside( data->shape1, matPoint->coord ) ) {
-         pcu_check_true( material == data->mat1 );
-         pcu_check_true( materialOn == data->mat1 );
-         pcu_check_true( matIndex == 0 );
-      }
-      else if ( Stg_Shape_IsCoordInside( data->shape2, matPoint->coord ) ) {
-         pcu_check_true( material == data->mat2 );
-         pcu_check_true( materialOn == data->mat2 );
-         pcu_check_true( matIndex == 1 );
-      }
-      else {
-         pcu_check_true( NULL == material );
-         pcu_check_true( NULL == materialOn );
-         pcu_check_true( UNDEFINED_MATERIAL == matIndex );
-      }
-   }
-}
-
-
-void MaterialComponentsSuite_TestAssignParticleProperties( MaterialComponentsSuiteData* data ) {
-   Particle_Index    pI;
-   Particle*         matPoint;
-
-   pcu_docstring( "This tests the function Materials_Register_AssignParticleProperties: essentially, material "
-      "properties that should be allowed to vary on a per-particle basis during simulation are set up as "
-      "SwarmVariables, and this test ensures they are applied correctly at startup." );
-
-   _Materials_Register_LayoutGeometry( data->mRegister, data->mpSwarm );
-   Materials_Register_AssignParticleProperties( data->mRegister, data->mpSwarm, data->svRegister );
-
-   /* check the properties have been assigned as expected - see Setup phase */
-   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
-      matPoint = (Particle*)Swarm_ParticleAt( data->mpSwarm, pI );
-      if ( Stg_Shape_IsCoordInside( data->shape1, matPoint->coord ) ) {
-         pcu_check_true( matPoint->matProp1 == 1 );
-         pcu_check_true( matPoint->matProp2 == 1.1 );
-         pcu_check_true( matPoint->matProp3 == False );
-         pcu_check_true( matPoint->matProp4 == False );
-      }
-      else if ( Stg_Shape_IsCoordInside( data->shape2, matPoint->coord ) ) {
-         pcu_check_true( matPoint->matProp1 == 2 );
-         pcu_check_true( matPoint->matProp2 == 2.2 );
-         pcu_check_true( matPoint->matProp3 == True );
-         pcu_check_true( matPoint->matProp4 == True );
-      }
-      else {
-         pcu_check_true( matPoint->matProp1 == 0 );
-         pcu_check_true( matPoint->matProp2 == 0.0 );
-         pcu_check_true( matPoint->matProp3 == False );
-         pcu_check_true( matPoint->matProp4 == False );
-      }
-   }
-}
-
-/* TODO M_Register: Test the extension functions work correctly */
-
-
-void MaterialComponentsSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, MaterialComponentsSuiteData );
-   pcu_suite_setFixtures( suite, MaterialComponentsSuite_Setup, MaterialComponentsSuite_Teardown );
-   pcu_suite_addTest( suite, MaterialComponentsSuite_TestRegisterSetup );
-   pcu_suite_addTest( suite, MaterialComponentsSuite_TestMaterialLayout );
-   pcu_suite_addTest( suite, MaterialComponentsSuite_TestLayoutGeometry );
-   pcu_suite_addTest( suite, MaterialComponentsSuite_TestGetMaterial );
-   pcu_suite_addTest( suite, MaterialComponentsSuite_TestAssignParticleProperties );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/MaterialComponentsSuite.c.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/MaterialComponentsSuite.c.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,396 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+/*******************
+** Note: this test is currently designed to test the 3 components MaterialPointsSwarm, Material, and Materials_Register.
+**  The reason is that their design and implementation is very tightly coupled (especially during Build and Init phases).
+** 
+********************/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "pcu/pcu.h"
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include "PICellerator/PopulationControl/PopulationControl.h"
+#include "PICellerator/Weights/Weights.h"
+#include "PICellerator/MaterialPoints/MaterialPoints.h"
+
+struct _Node {
+   Coord            coord;
+};
+
+struct _Element {
+   Coord            coord;
+};
+
+struct _Particle {
+   __MaterialPoint
+   unsigned int   matProp1;
+   double         matProp2;
+   Bool           matProp3;
+   Bool           matProp4;
+};
+
+typedef struct {
+   FeMesh*                       feMesh;
+   CellLayout*                   cellLayout;
+   ParticleLayout*               particleLayout;
+   MaterialPointsSwarm*          mpSwarm;
+   Variable_Register*            svRegister;
+   ExtensionManager_Register*    eRegister;
+   Materials_Register*           mRegister;
+   Dictionary*                   matDict1;
+   Dictionary*                   matDict2;
+   Stg_Shape*                    shape1;
+   Stg_Shape*                    shape2;
+   Material*                     mat1;
+   Material*                     mat2;
+   SwarmVariable*                matPropVar1;
+   SwarmVariable*                matPropVar2;
+   SwarmVariable*                matPropVar3;
+   SwarmVariable*                matPropVar4;
+} MaterialComponentsSuiteData;
+
+
+FeMesh* buildFeMesh( unsigned nDims, unsigned* size, 
+           double* minCrds, double* maxCrds, 
+           ExtensionManager_Register* emReg )
+{
+   CartesianGenerator*   gen;
+   FeMesh*         feMesh;
+
+   gen = CartesianGenerator_New( "" );
+   CartesianGenerator_SetDimSize( gen, nDims );
+   CartesianGenerator_SetTopologyParams( gen, size, 0, NULL, NULL );
+   CartesianGenerator_SetGeometryParams( gen, minCrds, maxCrds );
+   MeshGenerator_SetIncidenceState( gen, nDims, nDims, True );
+
+   feMesh = FeMesh_New( "" );
+   Mesh_SetExtensionManagerRegister( feMesh, emReg );
+   Mesh_SetGenerator( feMesh, gen );
+   FeMesh_SetElementFamily( feMesh, "linear" );
+
+   Stg_Component_Build( feMesh, NULL, False );
+   Stg_Component_Initialise( feMesh, NULL, False );
+
+   KillObject( feMesh->generator );
+
+   return feMesh;
+}
+
+
+void MaterialComponentsSuite_BuildInitSwarmBasics( MaterialComponentsSuiteData* data ) {
+   Index             var_I;
+   Particle_Index    pI;
+   MaterialPoint*    matPoint;
+
+   /* Mesh will already be initialised */
+   /* Manually do the basic Swarm building and initialising */
+   _Swarm_Build( data->mpSwarm, NULL );
+   for( var_I = 0 ; var_I < data->mpSwarm->nSwarmVars ; var_I++ ) {
+		Stg_Component_Build( data->mpSwarm->swarmVars[var_I], NULL , False );
+	}
+   _Swarm_Initialise( data->mpSwarm, NULL );
+   for( var_I = 0 ; var_I < data->mpSwarm->nSwarmVars ; var_I++ ) {
+		Stg_Component_Initialise( data->mpSwarm->swarmVars[var_I], NULL , False );
+	}
+   /* Pre-set the swarm particle material indexes to undefined, as in the build function */
+   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
+      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
+      matPoint->materialIndex = UNDEFINED_MATERIAL;
+   }
+}
+
+
+void MaterialComponentsSuite_Setup( MaterialComponentsSuiteData* data ) {
+   unsigned    dim = 3;
+   unsigned    meshSize[3] = {2, 2, 2};
+   double      minCrds[3] = {0.0, 0.0, 0.0};
+   double      maxCrds[3] = {1.0, 1.0, 1.0};
+   XYZ         boxCentre = {0.25,0.25,0.25};
+   XYZ         boxWidth = {0.4,0.4,0.4};
+   XYZ         sphereCentre = {0.75,0.75,0.75};
+   double      sphereRadius = 0.2;
+   Particle_Index    pI;
+   Particle*         matPoint;
+   Particle          particle;
+
+   data->svRegister = Variable_Register_New();
+   data->eRegister = ExtensionManager_Register_New();
+   data->mRegister = Materials_Register_New();
+
+   /* Turn off the journal to avoid debug messages about parsing */
+   Journal_Enable_TypedStream( Debug_Type, False );
+   Journal_Enable_TypedStream( Info_Type, False );
+
+   data->feMesh = buildFeMesh( dim, meshSize, minCrds, maxCrds, data->eRegister );
+
+   data->cellLayout = (CellLayout*)ElementCellLayout_New( "elementCellLayout", data->feMesh );
+   data->particleLayout = (ParticleLayout*)RandomParticleLayout_New( "randomParticleCellLayout", 20, 13 );
+
+   data->mpSwarm = MaterialPointsSwarm_New(
+      "testSwarm",
+      data->cellLayout,
+      data->particleLayout,
+      dim,                      /* dim */
+      sizeof(Particle),
+      data->feMesh,
+      NULL,                   /* escapedRoutine*/
+      NULL,                   /* material */
+      data->svRegister,
+      data->eRegister,
+      data->mRegister,
+      MPI_COMM_WORLD );
+
+   data->shape1 = (Stg_Shape*)Box_New( "boxShape", dim, boxCentre, 0, 0, 0, boxWidth );
+   data->shape2 = (Stg_Shape*)Sphere_New( "sphereShape", dim, sphereCentre, 0, 0, 0, sphereRadius );
+
+   /* Set up the dictionaries, and set some sample properties for testing */
+   data->matDict1 = Dictionary_New();
+   Dictionary_Add( data->matDict1, "testSwarm-matProp1", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+   Dictionary_Add( data->matDict1, "testSwarm-matProp2", Dictionary_Entry_Value_FromDouble( 1.1 ) );
+   Dictionary_Add( data->matDict1, "testSwarm-matProp3", Dictionary_Entry_Value_FromBool( False ) );
+   data->matDict2 = Dictionary_New();
+   Dictionary_Add( data->matDict2, "testSwarm-matProp1", Dictionary_Entry_Value_FromUnsignedInt( 2 ) );
+   Dictionary_Add( data->matDict2, "testSwarm-matProp2", Dictionary_Entry_Value_FromDouble( 2.2 ) );
+   Dictionary_Add( data->matDict2, "testSwarm-matProp3", Dictionary_Entry_Value_FromBool( True ) );
+   Dictionary_Add( data->matDict2, "testSwarm-matProp4", Dictionary_Entry_Value_FromBool( True ) );
+
+   /* Now update the svRegister to match the material properties */
+	data->matPropVar1 = Swarm_NewScalarVariable( 
+			data->mpSwarm,
+			"matProp1",
+			GetOffsetOfMember( particle , matProp1 ), 
+			Variable_DataType_Int );
+	data->matPropVar2 = Swarm_NewScalarVariable( 
+			data->mpSwarm,
+			"matProp2",
+			GetOffsetOfMember( particle , matProp2 ), 
+			Variable_DataType_Double );
+	data->matPropVar3 = Swarm_NewScalarVariable( 
+			data->mpSwarm,
+			"matProp3",
+			GetOffsetOfMember( particle , matProp3 ), 
+			Variable_DataType_Int );
+	data->matPropVar4 = Swarm_NewScalarVariable( 
+			data->mpSwarm,
+			"matProp4",
+			GetOffsetOfMember( particle , matProp4 ), 
+			Variable_DataType_Int );
+
+   data->mat1 = Material_New( "mat1", data->shape1, data->matDict1, data->mRegister );
+   data->mat2 = Material_New( "mat2", data->shape2, data->matDict2, data->mRegister );
+
+   MaterialComponentsSuite_BuildInitSwarmBasics( data );
+   /* Now set them all the swarm var properties to 0 / False initially */
+   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
+      matPoint = (Particle*)Swarm_ParticleAt( data->mpSwarm, pI );
+      matPoint->matProp1 = 0;
+      matPoint->matProp2 = 0.0;
+      matPoint->matProp3 = False;
+      matPoint->matProp4 = False;
+   }
+}
+
+
+void MaterialComponentsSuite_Teardown( MaterialComponentsSuiteData* data ) {
+   Stg_Class_Delete( data->mpSwarm );
+   Stg_Class_Delete( data->cellLayout );
+   Stg_Class_Delete( data->particleLayout );
+   Stg_Class_Delete( data->feMesh );
+   Stg_Class_Delete( data->eRegister );
+   Stg_Class_Delete( data->svRegister );
+   Stg_Class_Delete( data->mRegister );
+   Stg_Class_Delete( data->mat1 );
+   Stg_Class_Delete( data->mat2 );
+   Stg_Class_Delete( data->matDict1 );
+   Stg_Class_Delete( data->matDict2 );
+   Stg_Class_Delete( data->shape1 );
+   Stg_Class_Delete( data->shape2 );
+}
+
+
+/*Tests*/
+void MaterialComponentsSuite_TestRegisterSetup( MaterialComponentsSuiteData* data ) {
+
+   pcu_docstring( "This test simply checks that the Material_Register associated to a test MP_Swarm is correctly set-up as part of the "
+      "Swarm's Build phase (performed already in test suite setup." );
+
+   pcu_check_true( data->mRegister != NULL );
+
+   pcu_check_true( Materials_Register_GetCount( data->mRegister ) == 2 );
+   pcu_check_true( Materials_Register_GetByIndex( data->mRegister, 0 ) == data->mat1 );
+   pcu_check_true( Materials_Register_GetByIndex( data->mRegister, 1 ) == data->mat2 );
+
+
+}
+
+
+void MaterialComponentsSuite_TestMaterialLayout( MaterialComponentsSuiteData* data ) {
+   Particle_Index    pI;
+   MaterialPoint*    matPoint;
+
+   pcu_docstring( "Tests that 2 given materials can be successfully 'layed out' - that is, the particles of a swarm have their materialIndex"
+      "correctly updated to index the right material in the material register, thus setting up an ownership relationship." );
+   
+   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
+      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
+      pcu_check_true( matPoint->materialIndex == UNDEFINED_MATERIAL );
+   }
+
+   Material_Layout( data->mat1, data->mpSwarm );
+   Material_Layout( data->mat2, data->mpSwarm );
+
+   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
+      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
+      if ( Stg_Shape_IsCoordInside( data->shape1, matPoint->coord ) ) {
+         pcu_check_true( matPoint->materialIndex == 0 );
+      }
+      else if ( Stg_Shape_IsCoordInside( data->shape2, matPoint->coord ) ) {
+         pcu_check_true( matPoint->materialIndex == 1 );
+      }
+      else {
+         pcu_check_true( matPoint->materialIndex == UNDEFINED_MATERIAL );
+      }
+   }
+}
+
+
+void MaterialComponentsSuite_TestLayoutGeometry( MaterialComponentsSuiteData* data ) {
+   Particle_Index    pI;
+   MaterialPoint*    matPoint;
+
+   pcu_docstring( "Similar to TestMaterialLayout, checks that all materials in a register can be 'layed out' correctly - ie the individual"
+      "Particles in a MaterialPointSwarm updated to index the correct material in the register." );
+   _Materials_Register_LayoutGeometry( data->mRegister, data->mpSwarm );
+   
+   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
+      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
+      if ( Stg_Shape_IsCoordInside( data->shape1, matPoint->coord ) ) {
+         pcu_check_true( matPoint->materialIndex == 0 );
+      }
+      else if ( Stg_Shape_IsCoordInside( data->shape2, matPoint->coord ) ) {
+         pcu_check_true( matPoint->materialIndex == 1 );
+      }
+      else {
+         pcu_check_true( matPoint->materialIndex == UNDEFINED_MATERIAL );
+      }
+   }
+}
+
+void MaterialComponentsSuite_TestGetMaterial( MaterialComponentsSuiteData* data ) {
+   Particle_Index    pI;
+   MaterialPoint*    matPoint;
+   Material*         material = NULL;
+   Material*         materialOn = NULL;
+   Material_Index    matIndex;
+
+   pcu_docstring( "Tests that after a layout has been performed, the material that a particle belongs to can be successfully looked up."
+      "Thus requires TestLayoutGeometry to pass beforehand." );
+
+   _Materials_Register_LayoutGeometry( data->mRegister, data->mpSwarm );
+
+   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
+      matPoint = (MaterialPoint*)Swarm_ParticleAt( data->mpSwarm, pI );
+      material = MaterialPointsSwarm_GetMaterialAt( data->mpSwarm, pI );
+      materialOn = MaterialPointsSwarm_GetMaterialOn( data->mpSwarm, matPoint );
+      matIndex = MaterialPointsSwarm_GetMaterialIndexAt( data->mpSwarm, pI );
+
+      if ( Stg_Shape_IsCoordInside( data->shape1, matPoint->coord ) ) {
+         pcu_check_true( material == data->mat1 );
+         pcu_check_true( materialOn == data->mat1 );
+         pcu_check_true( matIndex == 0 );
+      }
+      else if ( Stg_Shape_IsCoordInside( data->shape2, matPoint->coord ) ) {
+         pcu_check_true( material == data->mat2 );
+         pcu_check_true( materialOn == data->mat2 );
+         pcu_check_true( matIndex == 1 );
+      }
+      else {
+         pcu_check_true( NULL == material );
+         pcu_check_true( NULL == materialOn );
+         pcu_check_true( UNDEFINED_MATERIAL == matIndex );
+      }
+   }
+}
+
+
+void MaterialComponentsSuite_TestAssignParticleProperties( MaterialComponentsSuiteData* data ) {
+   Particle_Index    pI;
+   Particle*         matPoint;
+
+   pcu_docstring( "This tests the function Materials_Register_AssignParticleProperties: essentially, material "
+      "properties that should be allowed to vary on a per-particle basis during simulation are set up as "
+      "SwarmVariables, and this test ensures they are applied correctly at startup." );
+
+   _Materials_Register_LayoutGeometry( data->mRegister, data->mpSwarm );
+   Materials_Register_AssignParticleProperties( data->mRegister, data->mpSwarm, data->svRegister );
+
+   /* check the properties have been assigned as expected - see Setup phase */
+   for ( pI = 0; pI < data->mpSwarm->particleLocalCount; pI++ ) {
+      matPoint = (Particle*)Swarm_ParticleAt( data->mpSwarm, pI );
+      if ( Stg_Shape_IsCoordInside( data->shape1, matPoint->coord ) ) {
+         pcu_check_true( matPoint->matProp1 == 1 );
+         pcu_check_true( matPoint->matProp2 == 1.1 );
+         pcu_check_true( matPoint->matProp3 == False );
+         pcu_check_true( matPoint->matProp4 == False );
+      }
+      else if ( Stg_Shape_IsCoordInside( data->shape2, matPoint->coord ) ) {
+         pcu_check_true( matPoint->matProp1 == 2 );
+         pcu_check_true( matPoint->matProp2 == 2.2 );
+         pcu_check_true( matPoint->matProp3 == True );
+         pcu_check_true( matPoint->matProp4 == True );
+      }
+      else {
+         pcu_check_true( matPoint->matProp1 == 0 );
+         pcu_check_true( matPoint->matProp2 == 0.0 );
+         pcu_check_true( matPoint->matProp3 == False );
+         pcu_check_true( matPoint->matProp4 == False );
+      }
+   }
+}
+
+/* TODO M_Register: Test the extension functions work correctly */
+
+
+void MaterialComponentsSuite( pcu_suite_t* suite ) {
+   pcu_suite_setData( suite, MaterialComponentsSuiteData );
+   pcu_suite_setFixtures( suite, MaterialComponentsSuite_Setup, MaterialComponentsSuite_Teardown );
+   pcu_suite_addTest( suite, MaterialComponentsSuite_TestRegisterSetup );
+   pcu_suite_addTest( suite, MaterialComponentsSuite_TestMaterialLayout );
+   pcu_suite_addTest( suite, MaterialComponentsSuite_TestLayoutGeometry );
+   pcu_suite_addTest( suite, MaterialComponentsSuite_TestGetMaterial );
+   pcu_suite_addTest( suite, MaterialComponentsSuite_TestAssignParticleProperties );
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/MaterialComponentsSuite.h
--- a/MaterialPoints/tests/MaterialComponentsSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef StGermain_MaterialComponents_h
-#define StGermain_MaterialComponents_h
-
-void MaterialComponentsSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/MaterialComponentsSuite.h.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/MaterialComponentsSuite.h.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,6 @@
+#ifndef StGermain_MaterialComponents_h
+#define StGermain_MaterialComponents_h
+
+void MaterialComponentsSuite( pcu_suite_t* suite );
+
+#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/MaterialFeVariableSuite.c
--- a/MaterialPoints/tests/MaterialFeVariableSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include "PICellerator/PopulationControl/PopulationControl.h"
-#include "PICellerator/Weights/Weights.h"
-#include "PICellerator/MaterialPoints/MaterialPoints.h"
-
-typedef struct {
-   PICelleratorContext* context;
-   Stg_ComponentFactory* cf;
-} MaterialFeVariableSuiteData;
-
-void MaterialFeVariableSuite_Setup( MaterialFeVariableSuiteData* data ) {
-   char xmlInputFilename[PCU_PATH_MAX];
-
-   pcu_filename_input( "testMaterialFeVariable.xml", xmlInputFilename );
-   data->cf = stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD, NULL );
-	data->context = (PICelleratorContext*)LiveComponentRegister_Get( data->cf->LCRegister, (Name)"context" );
-	stgMainBuildAndInitialise( data->cf );
-
-	stgMainLoop( data->cf );
-} 
-
-
-void MaterialFeVariableSuite_Teardown( MaterialFeVariableSuiteData* data ) {
-   stgMainDestroy( data->cf );
-}
-
-
-void MaterialFeVariableSuite_TestVolume( MaterialFeVariableSuiteData* data ) {
-/** Test Definition: This test compares the volume of a swarm as calculated based on the material points swarm and as calculate from a MaterialFeVariable */
-   IntegrationPointsSwarm* swarm;
-   MaterialFeVariable* materialFeVariable;
-   Material*           material;
-   Swarm*              gaussSwarm;
-   double              volumePIC;
-   double              volumeFEM;
-   Coord               centroid;
-
-   materialFeVariable = (MaterialFeVariable* ) LiveComponentRegister_Get( data->context->CF->LCRegister, (Name)"materialFeVariable" );
-   gaussSwarm = (Swarm* ) LiveComponentRegister_Get( data->context->CF->LCRegister, (Name)"gaussSwarm" );
-
-   assert(materialFeVariable);
-   assert(gaussSwarm );
-
-   material = materialFeVariable->material;
-   swarm = materialFeVariable->picIntegrationPoints;
-
-   volumePIC = Material_Volume( material, swarm, centroid );
-   volumeFEM = FeVariable_Integrate( materialFeVariable, gaussSwarm );
-
-   pcu_check_true(  fabs(volumePIC-volumeFEM) < 1e-4 );
-}
-
-void MaterialFeVariableSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, MaterialFeVariableSuiteData );
-   pcu_suite_setFixtures( suite, MaterialFeVariableSuite_Setup, MaterialFeVariableSuite_Teardown );
-   pcu_suite_addTest( suite, MaterialFeVariableSuite_TestVolume );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/MaterialFeVariableSuite.c.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/MaterialFeVariableSuite.c.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,93 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "pcu/pcu.h"
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include "PICellerator/PopulationControl/PopulationControl.h"
+#include "PICellerator/Weights/Weights.h"
+#include "PICellerator/MaterialPoints/MaterialPoints.h"
+
+typedef struct {
+   PICelleratorContext* context;
+} MaterialFeVariableSuiteData;
+
+void MaterialFeVariableSuite_Setup( MaterialFeVariableSuiteData* data ) {
+   char              xmlInputFilename[PCU_PATH_MAX];
+
+   pcu_filename_input( "testMaterialFeVariable.xml", xmlInputFilename );
+   data->context = (PICelleratorContext*)stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD );
+
+   stgMainLoop( (AbstractContext*)data->context );
+} 
+
+
+void MaterialFeVariableSuite_Teardown( MaterialFeVariableSuiteData* data ) {
+   stgMainDestroy( (AbstractContext*)data->context );
+}
+
+
+void MaterialFeVariableSuite_TestVolume( MaterialFeVariableSuiteData* data ) {
+/** Test Definition: This test compares the volume of a swarm as calculated based on the material points swarm and as calculate from a MaterialFeVariable */
+   IntegrationPointsSwarm* swarm;
+   MaterialFeVariable* materialFeVariable;
+   Material*           material;
+   Swarm*              gaussSwarm;
+   double              volumePIC;
+   double              volumeFEM;
+   Coord               centroid;
+
+   char   testStr[] = "This test compares the volume of a swarm as calculated based on the material points swarm and as calculate from a MaterialFeVariable\n";
+
+   materialFeVariable = (MaterialFeVariable*) LiveComponentRegister_Get( data->context->CF->LCRegister, "materialFeVariable" );
+   gaussSwarm = (Swarm*) LiveComponentRegister_Get( data->context->CF->LCRegister, "gaussSwarm" );
+
+   assert(materialFeVariable);
+   assert(gaussSwarm);
+
+   material = materialFeVariable->material;
+   swarm = materialFeVariable->picIntegrationPoints;
+
+   volumePIC = Material_Volume( material, swarm, centroid );
+   volumeFEM = FeVariable_Integrate( materialFeVariable, gaussSwarm );
+
+   pcu_check_true(  fabs(volumePIC-volumeFEM) < 1e-4 );
+}
+
+void MaterialFeVariableSuite( pcu_suite_t* suite ) {
+   pcu_suite_setData( suite, MaterialFeVariableSuiteData );
+   pcu_suite_setFixtures( suite, MaterialFeVariableSuite_Setup, MaterialFeVariableSuite_Teardown );
+   pcu_suite_addTest( suite, MaterialFeVariableSuite_TestVolume );
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/MaterialFeVariableSuite.h
--- a/MaterialPoints/tests/MaterialFeVariableSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef StGermain_MaterialFeVariable_h
-#define StGermain_MaterialFeVariable_h
-
-void MaterialFeVariableSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/MaterialFeVariableSuite.h.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/MaterialFeVariableSuite.h.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,6 @@
+#ifndef StGermain_MaterialFeVariable_h
+#define StGermain_MaterialFeVariable_h
+
+void MaterialFeVariableSuite( pcu_suite_t* suite );
+
+#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/PeriodicBoundariesManagerSuite.c
--- a/MaterialPoints/tests/PeriodicBoundariesManagerSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include "PICellerator/PopulationControl/PopulationControl.h"
-#include "PICellerator/Weights/Weights.h"
-#include "PICellerator/MaterialPoints/MaterialPoints.h"
-
-
-struct _Node {
-   Coord            coord;
-};
-
-struct _Element {
-   Coord            coord;
-};
-
-struct _Particle {
-   __GlobalParticle
-};
-
-void UpdateParticlePositionsToLeft( Swarm* swarm );
-
-typedef struct {
-   PICelleratorContext*       context;
-   Stg_ComponentFactory*	cf;
-} PeriodicBoundariesManagerSuiteData;
-
-
-void PeriodicBoundariesManagerSuite_Setup( PeriodicBoundariesManagerSuiteData* data ) {
-   char              xmlInputFilename[PCU_PATH_MAX];
-
-   pcu_filename_input( "testPeriodicBoundariesManager.xml", xmlInputFilename );
-   data->cf = stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD, NULL );
-	stgMainBuildAndInitialise( data->cf );
-   data->context = (PICelleratorContext*)LiveComponentRegister_Get( data->cf->LCRegister, (Name)"context" );
-} 
-
-
-void PeriodicBoundariesManagerSuite_Teardown( PeriodicBoundariesManagerSuiteData* data ) {
-   stgMainDestroy( data->cf );
-}
-
-
-void PeriodicBoundariesManagerSuite_TestAdvectOverLeftBoundary( PeriodicBoundariesManagerSuiteData* data ) {
-   Swarm*                     swarm;
-   PeriodicBoundariesManager* perBCsManager;
-   Index                      timeStep;
-   GlobalParticle*            currParticle;
-   Particle_Index             lParticle_I;
-
-   swarm = (Swarm* ) LiveComponentRegister_Get( data->context->CF->LCRegister, (Name)"swarm" );
-   perBCsManager = (PeriodicBoundariesManager* ) LiveComponentRegister_Get( data->context->CF->LCRegister, (Name)"perBCsManager" );
-
-   for ( timeStep=1; timeStep <= 10; timeStep++ ) {
-      UpdateParticlePositionsToLeft( swarm );
-      for ( lParticle_I = 0; lParticle_I < swarm->particleLocalCount ; lParticle_I++  ) {
-         PeriodicBoundariesManager_UpdateParticle( perBCsManager, lParticle_I );
-      }
-      Swarm_UpdateAllParticleOwners( swarm );
-   }
-
-   /* After 10 timesteps, all the particles should have been advected from the left row of cells, to the right row,
-    *  to a coord somewhere between 0.9 and 1.0 */   
-   /* TODO: first check the particles all still exist */
-   for( lParticle_I=0; lParticle_I < swarm->particleLocalCount; lParticle_I++ ) {
-      currParticle = (GlobalParticle*)Swarm_ParticleAt( swarm, lParticle_I );
-      pcu_check_true( currParticle->coord[0] >= 0.9 && currParticle->coord[0] <= 1.0 ); 
-   }
-   /* TODO: check that their cell ownership is correct */
-}
-
-
-void PeriodicBoundariesManagerSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, PeriodicBoundariesManagerSuiteData );
-   pcu_suite_setFixtures( suite, PeriodicBoundariesManagerSuite_Setup, PeriodicBoundariesManagerSuite_Teardown );
-   pcu_suite_addTest( suite, PeriodicBoundariesManagerSuite_TestAdvectOverLeftBoundary );
-}
-
-
-void UpdateParticlePositionsToLeft( Swarm* swarm ) {
-   Cell_LocalIndex         lCell_I;
-   Particle_InCellIndex    cParticle_I;
-   GlobalParticle*         currParticle;
-   Index                   dim_I;
-   Stream*                 debugStream = Journal_Register( Debug_Type, (Name)"UpdateParticlesLeft" );
-
-   Stream_Indent( debugStream );
-   for ( lCell_I=0; lCell_I < swarm->cellLocalCount; lCell_I++  ) {
-      Journal_Printf( debugStream, "Updating Particles positions in local cell %d:\n", lCell_I );
-      for ( cParticle_I=0; cParticle_I < swarm->cellParticleCountTbl[lCell_I]; cParticle_I++ ) {
-         Coord movementVector = {0,0,0};
-         Coord newParticleCoord = {0,0,0};
-         Coord* oldCoord;
-
-         currParticle = (GlobalParticle*)Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
-         oldCoord = &currParticle->coord;
-
-         Stream_Indent( debugStream );
-         Journal_Printf( debugStream, "Updating particleInCell %d:\n", cParticle_I );
-
-         movementVector[I_AXIS] = -0.01;
-
-         for ( dim_I=0; dim_I < 3; dim_I++ ) {
-            newParticleCoord[dim_I] = (*oldCoord)[dim_I] + movementVector[dim_I];
-         }
-
-         Journal_Printf( debugStream, "Changing its coords from (%f,%f,%f) to (%f,%f,%f):\n",
-            (*oldCoord)[0], (*oldCoord)[1], (*oldCoord)[2],
-            newParticleCoord[0], newParticleCoord[1], newParticleCoord[2] );
-
-         for ( dim_I=0; dim_I < 3; dim_I++ ) {
-            currParticle->coord[dim_I] = newParticleCoord[dim_I];
-         }
-         Stream_UnIndent( debugStream );
-      }
-   }
-   Stream_UnIndent( debugStream );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/PeriodicBoundariesManagerSuite.c.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/PeriodicBoundariesManagerSuite.c.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,150 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "pcu/pcu.h"
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include "PICellerator/PopulationControl/PopulationControl.h"
+#include "PICellerator/Weights/Weights.h"
+#include "PICellerator/MaterialPoints/MaterialPoints.h"
+
+
+struct _Node {
+   Coord            coord;
+};
+
+struct _Element {
+   Coord            coord;
+};
+
+struct _Particle {
+   __GlobalParticle
+};
+
+void UpdateParticlePositionsToLeft( Swarm* swarm );
+
+typedef struct {
+   PICelleratorContext*       context;
+} PeriodicBoundariesManagerSuiteData;
+
+
+void PeriodicBoundariesManagerSuite_Setup( PeriodicBoundariesManagerSuiteData* data ) {
+   char              xmlInputFilename[PCU_PATH_MAX];
+
+   pcu_filename_input( "testPeriodicBoundariesManager.xml", xmlInputFilename );
+   data->context = (PICelleratorContext*)stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD );
+} 
+
+
+void PeriodicBoundariesManagerSuite_Teardown( PeriodicBoundariesManagerSuiteData* data ) {
+   stgMainDestroy( (AbstractContext*)data->context );
+}
+
+
+void PeriodicBoundariesManagerSuite_TestAdvectOverLeftBoundary( PeriodicBoundariesManagerSuiteData* data ) {
+   Swarm*                     swarm;
+   PeriodicBoundariesManager* perBCsManager;
+   Index                      timeStep;
+   GlobalParticle*            currParticle;
+   Particle_Index             lParticle_I;
+
+   swarm = (Swarm*) LiveComponentRegister_Get( data->context->CF->LCRegister, "swarm" );
+   perBCsManager = (PeriodicBoundariesManager*) LiveComponentRegister_Get( data->context->CF->LCRegister, "perBCsManager" );
+
+   for ( timeStep=1; timeStep <= 10; timeStep++ ) {
+      UpdateParticlePositionsToLeft( swarm );
+      for ( lParticle_I = 0; lParticle_I < swarm->particleLocalCount ; lParticle_I++ ) {
+         PeriodicBoundariesManager_UpdateParticle( perBCsManager, lParticle_I );
+      }
+      Swarm_UpdateAllParticleOwners( swarm );
+   }
+
+   /* After 10 timesteps, all the particles should have been advected from the left row of cells, to the right row,
+    *  to a coord somewhere between 0.9 and 1.0 */   
+   /* TODO: first check the particles all still exist */
+   for( lParticle_I=0; lParticle_I < swarm->particleLocalCount; lParticle_I++ ) {
+      currParticle = (GlobalParticle*)Swarm_ParticleAt( swarm, lParticle_I );
+      pcu_check_true( currParticle->coord[0] >= 0.9 && currParticle->coord[0] <= 1.0 ); 
+   }
+   /* TODO: check that their cell ownership is correct */
+}
+
+
+void PeriodicBoundariesManagerSuite( pcu_suite_t* suite ) {
+   pcu_suite_setData( suite, PeriodicBoundariesManagerSuiteData );
+   pcu_suite_setFixtures( suite, PeriodicBoundariesManagerSuite_Setup, PeriodicBoundariesManagerSuite_Teardown );
+   pcu_suite_addTest( suite, PeriodicBoundariesManagerSuite_TestAdvectOverLeftBoundary );
+}
+
+
+void UpdateParticlePositionsToLeft( Swarm* swarm ) {
+   Cell_LocalIndex         lCell_I;
+   Particle_InCellIndex    cParticle_I;
+   GlobalParticle*         currParticle;
+   Index                   dim_I;
+   Stream*                 debugStream = Journal_Register( Debug_Type, "UpdateParticlesLeft" );
+
+   Stream_Indent( debugStream );
+   for ( lCell_I=0; lCell_I < swarm->cellLocalCount; lCell_I++ ) {
+      Journal_Printf( debugStream, "Updating Particles positions in local cell %d:\n", lCell_I );
+      for ( cParticle_I=0; cParticle_I < swarm->cellParticleCountTbl[lCell_I]; cParticle_I++ ) {
+         Coord movementVector = {0,0,0};
+         Coord newParticleCoord = {0,0,0};
+         Coord* oldCoord;
+
+         currParticle = (GlobalParticle*)Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+         oldCoord = &currParticle->coord;
+
+         Stream_Indent( debugStream );
+         Journal_Printf( debugStream, "Updating particleInCell %d:\n", cParticle_I );
+
+         movementVector[I_AXIS] = -0.01;
+
+         for ( dim_I=0; dim_I < 3; dim_I++ ) {
+            newParticleCoord[dim_I] = (*oldCoord)[dim_I] + movementVector[dim_I];
+         }
+
+         Journal_Printf( debugStream, "Changing its coords from (%f,%f,%f) to (%f,%f,%f):\n",
+            (*oldCoord)[0], (*oldCoord)[1], (*oldCoord)[2],
+            newParticleCoord[0], newParticleCoord[1], newParticleCoord[2] );
+
+         for ( dim_I=0; dim_I < 3; dim_I++ ) {
+            currParticle->coord[dim_I] = newParticleCoord[dim_I];
+         }
+         Stream_UnIndent( debugStream );
+      }
+   }
+   Stream_UnIndent( debugStream );
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/PeriodicBoundariesManagerSuite.h
--- a/MaterialPoints/tests/PeriodicBoundariesManagerSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef StGermain_PeriodicBoundariesManager_h
-#define StGermain_PeriodicBoundariesManager_h
-
-void PeriodicBoundariesManagerSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/PeriodicBoundariesManagerSuite.h.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/PeriodicBoundariesManagerSuite.h.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,6 @@
+#ifndef StGermain_PeriodicBoundariesManager_h
+#define StGermain_PeriodicBoundariesManager_h
+
+void PeriodicBoundariesManagerSuite( pcu_suite_t* suite );
+
+#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/Viewport.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/Viewport.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,42 @@
+<!-- Rayleigh-Taylor lucifer viewports -->
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<!-- Camera And Colour Maps -->
+		<struct name="camera" mergeType="replace">
+			<param name="Type">lucCamera</param>
+			<param name="CentreFieldVariable">VelocityField</param>
+			<param name="coordZ">1.4762</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="particleDots">
+			<param name="Type">lucSwarmViewer</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="colour">blue</param>
+			<!--
+			-->
+			<param name="MaskVariable">picIntegrationPoints-MaterialIndex</param>
+			<param name="maskValue">1</param>
+			<param name="maskType">EqualTo</param>
+			<param name="pointSize">2.0</param>
+		</struct>		
+		<struct name="border" mergeType="replace">
+			<param name="Type">lucFieldVariableBorder</param>
+			<param name="FieldVariable">VelocityField</param>
+		</struct>
+		<!-- Viewport -->
+		<struct name="DenseMaterialVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>particleDots</param>
+				<param>border</param>
+			</list>
+		</struct>
+		<struct name="window" mergeType="merge">
+			<param name="Viewport">DenseMaterialVP</param>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testEuler.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testEuler.0of1.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,40 @@
+Timestep = 1
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 2
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 3
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 4
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 5
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 6
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 7
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 8
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 9
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 10
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testEuler.0of2.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testEuler.0of2.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,40 @@
+Timestep = 1
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 2
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 3
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 4
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 5
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 6
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 7
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 8
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 9
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 10
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testEuler.0of3.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testEuler.0of3.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,40 @@
+Timestep = 1
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 2
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 3
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 4
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 5
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 6
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 7
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 8
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 9
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 10
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testMaterialFeVariable.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testMaterialFeVariable.0of1.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,2 @@
+Test Passed
+Test Passed
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testMaterialFeVariable.0of2.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testMaterialFeVariable.0of2.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,2 @@
+Test Passed
+Test Passed
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testPeriodicBCs.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testPeriodicBCs.0of1.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,2889 @@
+StGermain Framework revision 4046. Copyright (C) 2003-2005 VPAC.
+StGermain Domain Library revision 4046. Copyright (C) 2003-2007 VPAC.
+StGermain Finite Element Framework revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Discretisation Framework revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain SLE Library revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain PETSc-LinearAlgebra Interface revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Assembly Library revision 793. Copyright (C) 2003-2005 VPAC.
+Watching rank: 0
+Cartesian generator: ''
+	Target mesh: ''
+	Global element size: 6x6
+	Local offset of rank 0: 0x0
+	Local range of rank 0: 6x6
+	Generating vertices...
+		... done.
+	Generating elements...
+		... done.
+	Generating element-vertex incidence...
+		... done.
+	Generating vertex neighbours...
+		... done.
+	Generating geometry...
+		... done.
+	Generating element types...
+		... element types are 'Mesh_HexType',
+		... mesh algorithm type is 'Mesh_RegularAlgorithms',
+		... done.
+	Assigning FeMesh element types...
+		... FE element types are 'BilinearElementType',
+		... done.
+Swarm (ptr): 0x64b8f0
+Stg_Component (ptr): 0x64b8f0
+Stg_Object (ptr): 0x64b8f0
+	Stg_Class (ptr): 0x64b8f0
+		sizeOfSelf: 376
+		_deleteSelf: Yes
+		type: Swarm
+		_delete (func ptr): 0x2aaaab9cb3a0
+		_print (func ptr): 0x2aaaab9caf60
+		_copy (func ptr): 0x2aaaab9ca8c0
+	name: testSwarm
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0x2aaaab9cb920
+	_construct (func ptr): 0x2aaaab9cb6b0
+	_build (func ptr): 0x2aaaab9ca800
+	_initialise (func ptr): 0x2aaaab9ca5b0
+	_execute (func ptr): 0x2aaaab9c9290
+	_destroy (func ptr): 0x2aaaab9c92a0
+	isConstructed: True
+	isBuilt: True
+	isInitialised: True
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: testSwarm-Construct
+	build function name: testSwarm-Build
+	initialise function name: testSwarm-Initialise
+	execute function name: testSwarm-Execute
+	destroy function name: testSwarm-Destroy
+ElementCellLayout (ptr): 0x64aa40
+CellLayout (ptr): 0x64aa40
+Stg_Component (ptr): 0x64aa40
+Stg_Object (ptr): 0x64aa40
+	Stg_Class (ptr): 0x64aa40
+		sizeOfSelf: 248
+		_deleteSelf: Yes
+		type: ElementCellLayout
+		_delete (func ptr): 0x2aaaab9c0c20
+		_print (func ptr): 0x2aaaab9c0bc0
+		_copy (func ptr): 0x2aaaab9c0ae0
+	name: elementCellLayout
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0x2aaaab9c0f00
+	_construct (func ptr): 0x2aaaab9c0cc0
+	_build (func ptr): 0x2aaaab9c0ad0
+	_initialise (func ptr): 0x2aaaab9c0ac0
+	_execute (func ptr): 0x2aaaab9c0760
+	_destroy (func ptr): 0x2aaaab9c0770
+	isConstructed: True
+	isBuilt: True
+	isInitialised: True
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: elementCellLayout-Construct
+	build function name: elementCellLayout-Build
+	initialise function name: elementCellLayout-Initialise
+	execute function name: elementCellLayout-Execute
+	destroy function name: elementCellLayout-Destroy
+	_cellLocalCount (func ptr): 0x2aaaab9c0780
+	_cellShadowCount (func ptr): 0x2aaaab9c0790
+	_pointCount (func ptr): 0x2aaaab9c07a0
+	_initialisePoints (func ptr): 0x2aaaab9c07c0
+	_mapElementIdToCellId (func ptr): 0x2aaaab9c0810
+	_isInCell (func ptr): 0x2aaaab9c0970
+	_cellOf (func ptr): 0x2aaaab9c0830
+	_getShadowInfo (func ptr): 0x2aaaab9c0820
+	mesh (ptr): 0x649330
+RandomParticleLayout (ptr): 0x64b250:
+PerCellParticleLayout (ptr): 0x64b250
+ParticleLayout (ptr): 0x64b250
+Stg_Class (ptr): 0x64b250
+	sizeOfSelf: 232
+	_deleteSelf: Yes
+	type: RandomParticleLayout
+	_delete (func ptr): 0x2aaaab9c7d80
+	_print (func ptr): 0x2aaaab9c7d10
+	_copy (func ptr): 0x2aaaab9c7ce0
+	_setInitialCounts (func ptr): 0x2aaaab9c72b0
+	_initialiseParticles (func ptr): 0x2aaaab9c7200
+	coordSystem: GlobalCoordSystem
+	weightsInitialisedAtStartup : False
+	_initialCount (func ptr): 0x2aaaab9c7c00
+	_initialiseParticlesOfCell (func ptr): 0x2aaaab9c7c10
+	cellParticleCount: 1
+	seed: 13
+	cellLocalCount: 144
+	cellDomainCount: 144
+	cellShadowCount: 0
+	cellPointCountTbl (ptr): 0x658640
+	cellPointCountTbl[0-144]: 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 
+	cellPointTbl (ptr): 0x6588a0
+	cellPointTbl[0-144]: {
+	cellPointTbl[0][0-8]: {0 0 0} {0.0833 0 0} {0.0833 0.0833 0} {0 0.0833 0} {0 0 1} {0.0833 0 1} {0.0833 0.0833 1} {0 0.0833 1} 
+	cellPointTbl[1][0-8]: {0.0833 0 0} {0.167 0 0} {0.167 0.0833 0} {0.0833 0.0833 0} {0.0833 0 1} {0.167 0 1} {0.167 0.0833 1} {0.0833 0.0833 1} 
+	cellPointTbl[2][0-8]: {0.167 0 0} {0.25 0 0} {0.25 0.0833 0} {0.167 0.0833 0} {0.167 0 1} {0.25 0 1} {0.25 0.0833 1} {0.167 0.0833 1} 
+	cellPointTbl[3][0-8]: {0.25 0 0} {0.333 0 0} {0.333 0.0833 0} {0.25 0.0833 0} {0.25 0 1} {0.333 0 1} {0.333 0.0833 1} {0.25 0.0833 1} 
+	cellPointTbl[4][0-8]: {0.333 0 0} {0.417 0 0} {0.417 0.0833 0} {0.333 0.0833 0} {0.333 0 1} {0.417 0 1} {0.417 0.0833 1} {0.333 0.0833 1} 
+	cellPointTbl[5][0-8]: {0.417 0 0} {0.5 0 0} {0.5 0.0833 0} {0.417 0.0833 0} {0.417 0 1} {0.5 0 1} {0.5 0.0833 1} {0.417 0.0833 1} 
+	cellPointTbl[6][0-8]: {0.5 0 0} {0.583 0 0} {0.583 0.0833 0} {0.5 0.0833 0} {0.5 0 1} {0.583 0 1} {0.583 0.0833 1} {0.5 0.0833 1} 
+	cellPointTbl[7][0-8]: {0.583 0 0} {0.667 0 0} {0.667 0.0833 0} {0.583 0.0833 0} {0.583 0 1} {0.667 0 1} {0.667 0.0833 1} {0.583 0.0833 1} 
+	cellPointTbl[8][0-8]: {0.667 0 0} {0.75 0 0} {0.75 0.0833 0} {0.667 0.0833 0} {0.667 0 1} {0.75 0 1} {0.75 0.0833 1} {0.667 0.0833 1} 
+	cellPointTbl[9][0-8]: {0.75 0 0} {0.833 0 0} {0.833 0.0833 0} {0.75 0.0833 0} {0.75 0 1} {0.833 0 1} {0.833 0.0833 1} {0.75 0.0833 1} 
+	cellPointTbl[10][0-8]: {0.833 0 0} {0.917 0 0} {0.917 0.0833 0} {0.833 0.0833 0} {0.833 0 1} {0.917 0 1} {0.917 0.0833 1} {0.833 0.0833 1} 
+	cellPointTbl[11][0-8]: {0.917 0 0} {1 0 0} {1 0.0833 0} {0.917 0.0833 0} {0.917 0 1} {1 0 1} {1 0.0833 1} {0.917 0.0833 1} 
+	cellPointTbl[12][0-8]: {0 0.0833 0} {0.0833 0.0833 0} {0.0833 0.167 0} {0 0.167 0} {0 0.0833 1} {0.0833 0.0833 1} {0.0833 0.167 1} {0 0.167 1} 
+	cellPointTbl[13][0-8]: {0.0833 0.0833 0} {0.167 0.0833 0} {0.167 0.167 0} {0.0833 0.167 0} {0.0833 0.0833 1} {0.167 0.0833 1} {0.167 0.167 1} {0.0833 0.167 1} 
+	cellPointTbl[14][0-8]: {0.167 0.0833 0} {0.25 0.0833 0} {0.25 0.167 0} {0.167 0.167 0} {0.167 0.0833 1} {0.25 0.0833 1} {0.25 0.167 1} {0.167 0.167 1} 
+	cellPointTbl[15][0-8]: {0.25 0.0833 0} {0.333 0.0833 0} {0.333 0.167 0} {0.25 0.167 0} {0.25 0.0833 1} {0.333 0.0833 1} {0.333 0.167 1} {0.25 0.167 1} 
+	cellPointTbl[16][0-8]: {0.333 0.0833 0} {0.417 0.0833 0} {0.417 0.167 0} {0.333 0.167 0} {0.333 0.0833 1} {0.417 0.0833 1} {0.417 0.167 1} {0.333 0.167 1} 
+	cellPointTbl[17][0-8]: {0.417 0.0833 0} {0.5 0.0833 0} {0.5 0.167 0} {0.417 0.167 0} {0.417 0.0833 1} {0.5 0.0833 1} {0.5 0.167 1} {0.417 0.167 1} 
+	cellPointTbl[18][0-8]: {0.5 0.0833 0} {0.583 0.0833 0} {0.583 0.167 0} {0.5 0.167 0} {0.5 0.0833 1} {0.583 0.0833 1} {0.583 0.167 1} {0.5 0.167 1} 
+	cellPointTbl[19][0-8]: {0.583 0.0833 0} {0.667 0.0833 0} {0.667 0.167 0} {0.583 0.167 0} {0.583 0.0833 1} {0.667 0.0833 1} {0.667 0.167 1} {0.583 0.167 1} 
+	cellPointTbl[20][0-8]: {0.667 0.0833 0} {0.75 0.0833 0} {0.75 0.167 0} {0.667 0.167 0} {0.667 0.0833 1} {0.75 0.0833 1} {0.75 0.167 1} {0.667 0.167 1} 
+	cellPointTbl[21][0-8]: {0.75 0.0833 0} {0.833 0.0833 0} {0.833 0.167 0} {0.75 0.167 0} {0.75 0.0833 1} {0.833 0.0833 1} {0.833 0.167 1} {0.75 0.167 1} 
+	cellPointTbl[22][0-8]: {0.833 0.0833 0} {0.917 0.0833 0} {0.917 0.167 0} {0.833 0.167 0} {0.833 0.0833 1} {0.917 0.0833 1} {0.917 0.167 1} {0.833 0.167 1} 
+	cellPointTbl[23][0-8]: {0.917 0.0833 0} {1 0.0833 0} {1 0.167 0} {0.917 0.167 0} {0.917 0.0833 1} {1 0.0833 1} {1 0.167 1} {0.917 0.167 1} 
+	cellPointTbl[24][0-8]: {0 0.167 0} {0.0833 0.167 0} {0.0833 0.25 0} {0 0.25 0} {0 0.167 1} {0.0833 0.167 1} {0.0833 0.25 1} {0 0.25 1} 
+	cellPointTbl[25][0-8]: {0.0833 0.167 0} {0.167 0.167 0} {0.167 0.25 0} {0.0833 0.25 0} {0.0833 0.167 1} {0.167 0.167 1} {0.167 0.25 1} {0.0833 0.25 1} 
+	cellPointTbl[26][0-8]: {0.167 0.167 0} {0.25 0.167 0} {0.25 0.25 0} {0.167 0.25 0} {0.167 0.167 1} {0.25 0.167 1} {0.25 0.25 1} {0.167 0.25 1} 
+	cellPointTbl[27][0-8]: {0.25 0.167 0} {0.333 0.167 0} {0.333 0.25 0} {0.25 0.25 0} {0.25 0.167 1} {0.333 0.167 1} {0.333 0.25 1} {0.25 0.25 1} 
+	cellPointTbl[28][0-8]: {0.333 0.167 0} {0.417 0.167 0} {0.417 0.25 0} {0.333 0.25 0} {0.333 0.167 1} {0.417 0.167 1} {0.417 0.25 1} {0.333 0.25 1} 
+	cellPointTbl[29][0-8]: {0.417 0.167 0} {0.5 0.167 0} {0.5 0.25 0} {0.417 0.25 0} {0.417 0.167 1} {0.5 0.167 1} {0.5 0.25 1} {0.417 0.25 1} 
+	cellPointTbl[30][0-8]: {0.5 0.167 0} {0.583 0.167 0} {0.583 0.25 0} {0.5 0.25 0} {0.5 0.167 1} {0.583 0.167 1} {0.583 0.25 1} {0.5 0.25 1} 
+	cellPointTbl[31][0-8]: {0.583 0.167 0} {0.667 0.167 0} {0.667 0.25 0} {0.583 0.25 0} {0.583 0.167 1} {0.667 0.167 1} {0.667 0.25 1} {0.583 0.25 1} 
+	cellPointTbl[32][0-8]: {0.667 0.167 0} {0.75 0.167 0} {0.75 0.25 0} {0.667 0.25 0} {0.667 0.167 1} {0.75 0.167 1} {0.75 0.25 1} {0.667 0.25 1} 
+	cellPointTbl[33][0-8]: {0.75 0.167 0} {0.833 0.167 0} {0.833 0.25 0} {0.75 0.25 0} {0.75 0.167 1} {0.833 0.167 1} {0.833 0.25 1} {0.75 0.25 1} 
+	cellPointTbl[34][0-8]: {0.833 0.167 0} {0.917 0.167 0} {0.917 0.25 0} {0.833 0.25 0} {0.833 0.167 1} {0.917 0.167 1} {0.917 0.25 1} {0.833 0.25 1} 
+	cellPointTbl[35][0-8]: {0.917 0.167 0} {1 0.167 0} {1 0.25 0} {0.917 0.25 0} {0.917 0.167 1} {1 0.167 1} {1 0.25 1} {0.917 0.25 1} 
+	cellPointTbl[36][0-8]: {0 0.25 0} {0.0833 0.25 0} {0.0833 0.333 0} {0 0.333 0} {0 0.25 1} {0.0833 0.25 1} {0.0833 0.333 1} {0 0.333 1} 
+	cellPointTbl[37][0-8]: {0.0833 0.25 0} {0.167 0.25 0} {0.167 0.333 0} {0.0833 0.333 0} {0.0833 0.25 1} {0.167 0.25 1} {0.167 0.333 1} {0.0833 0.333 1} 
+	cellPointTbl[38][0-8]: {0.167 0.25 0} {0.25 0.25 0} {0.25 0.333 0} {0.167 0.333 0} {0.167 0.25 1} {0.25 0.25 1} {0.25 0.333 1} {0.167 0.333 1} 
+	cellPointTbl[39][0-8]: {0.25 0.25 0} {0.333 0.25 0} {0.333 0.333 0} {0.25 0.333 0} {0.25 0.25 1} {0.333 0.25 1} {0.333 0.333 1} {0.25 0.333 1} 
+	cellPointTbl[40][0-8]: {0.333 0.25 0} {0.417 0.25 0} {0.417 0.333 0} {0.333 0.333 0} {0.333 0.25 1} {0.417 0.25 1} {0.417 0.333 1} {0.333 0.333 1} 
+	cellPointTbl[41][0-8]: {0.417 0.25 0} {0.5 0.25 0} {0.5 0.333 0} {0.417 0.333 0} {0.417 0.25 1} {0.5 0.25 1} {0.5 0.333 1} {0.417 0.333 1} 
+	cellPointTbl[42][0-8]: {0.5 0.25 0} {0.583 0.25 0} {0.583 0.333 0} {0.5 0.333 0} {0.5 0.25 1} {0.583 0.25 1} {0.583 0.333 1} {0.5 0.333 1} 
+	cellPointTbl[43][0-8]: {0.583 0.25 0} {0.667 0.25 0} {0.667 0.333 0} {0.583 0.333 0} {0.583 0.25 1} {0.667 0.25 1} {0.667 0.333 1} {0.583 0.333 1} 
+	cellPointTbl[44][0-8]: {0.667 0.25 0} {0.75 0.25 0} {0.75 0.333 0} {0.667 0.333 0} {0.667 0.25 1} {0.75 0.25 1} {0.75 0.333 1} {0.667 0.333 1} 
+	cellPointTbl[45][0-8]: {0.75 0.25 0} {0.833 0.25 0} {0.833 0.333 0} {0.75 0.333 0} {0.75 0.25 1} {0.833 0.25 1} {0.833 0.333 1} {0.75 0.333 1} 
+	cellPointTbl[46][0-8]: {0.833 0.25 0} {0.917 0.25 0} {0.917 0.333 0} {0.833 0.333 0} {0.833 0.25 1} {0.917 0.25 1} {0.917 0.333 1} {0.833 0.333 1} 
+	cellPointTbl[47][0-8]: {0.917 0.25 0} {1 0.25 0} {1 0.333 0} {0.917 0.333 0} {0.917 0.25 1} {1 0.25 1} {1 0.333 1} {0.917 0.333 1} 
+	cellPointTbl[48][0-8]: {0 0.333 0} {0.0833 0.333 0} {0.0833 0.417 0} {0 0.417 0} {0 0.333 1} {0.0833 0.333 1} {0.0833 0.417 1} {0 0.417 1} 
+	cellPointTbl[49][0-8]: {0.0833 0.333 0} {0.167 0.333 0} {0.167 0.417 0} {0.0833 0.417 0} {0.0833 0.333 1} {0.167 0.333 1} {0.167 0.417 1} {0.0833 0.417 1} 
+	cellPointTbl[50][0-8]: {0.167 0.333 0} {0.25 0.333 0} {0.25 0.417 0} {0.167 0.417 0} {0.167 0.333 1} {0.25 0.333 1} {0.25 0.417 1} {0.167 0.417 1} 
+	cellPointTbl[51][0-8]: {0.25 0.333 0} {0.333 0.333 0} {0.333 0.417 0} {0.25 0.417 0} {0.25 0.333 1} {0.333 0.333 1} {0.333 0.417 1} {0.25 0.417 1} 
+	cellPointTbl[52][0-8]: {0.333 0.333 0} {0.417 0.333 0} {0.417 0.417 0} {0.333 0.417 0} {0.333 0.333 1} {0.417 0.333 1} {0.417 0.417 1} {0.333 0.417 1} 
+	cellPointTbl[53][0-8]: {0.417 0.333 0} {0.5 0.333 0} {0.5 0.417 0} {0.417 0.417 0} {0.417 0.333 1} {0.5 0.333 1} {0.5 0.417 1} {0.417 0.417 1} 
+	cellPointTbl[54][0-8]: {0.5 0.333 0} {0.583 0.333 0} {0.583 0.417 0} {0.5 0.417 0} {0.5 0.333 1} {0.583 0.333 1} {0.583 0.417 1} {0.5 0.417 1} 
+	cellPointTbl[55][0-8]: {0.583 0.333 0} {0.667 0.333 0} {0.667 0.417 0} {0.583 0.417 0} {0.583 0.333 1} {0.667 0.333 1} {0.667 0.417 1} {0.583 0.417 1} 
+	cellPointTbl[56][0-8]: {0.667 0.333 0} {0.75 0.333 0} {0.75 0.417 0} {0.667 0.417 0} {0.667 0.333 1} {0.75 0.333 1} {0.75 0.417 1} {0.667 0.417 1} 
+	cellPointTbl[57][0-8]: {0.75 0.333 0} {0.833 0.333 0} {0.833 0.417 0} {0.75 0.417 0} {0.75 0.333 1} {0.833 0.333 1} {0.833 0.417 1} {0.75 0.417 1} 
+	cellPointTbl[58][0-8]: {0.833 0.333 0} {0.917 0.333 0} {0.917 0.417 0} {0.833 0.417 0} {0.833 0.333 1} {0.917 0.333 1} {0.917 0.417 1} {0.833 0.417 1} 
+	cellPointTbl[59][0-8]: {0.917 0.333 0} {1 0.333 0} {1 0.417 0} {0.917 0.417 0} {0.917 0.333 1} {1 0.333 1} {1 0.417 1} {0.917 0.417 1} 
+	cellPointTbl[60][0-8]: {0 0.417 0} {0.0833 0.417 0} {0.0833 0.5 0} {0 0.5 0} {0 0.417 1} {0.0833 0.417 1} {0.0833 0.5 1} {0 0.5 1} 
+	cellPointTbl[61][0-8]: {0.0833 0.417 0} {0.167 0.417 0} {0.167 0.5 0} {0.0833 0.5 0} {0.0833 0.417 1} {0.167 0.417 1} {0.167 0.5 1} {0.0833 0.5 1} 
+	cellPointTbl[62][0-8]: {0.167 0.417 0} {0.25 0.417 0} {0.25 0.5 0} {0.167 0.5 0} {0.167 0.417 1} {0.25 0.417 1} {0.25 0.5 1} {0.167 0.5 1} 
+	cellPointTbl[63][0-8]: {0.25 0.417 0} {0.333 0.417 0} {0.333 0.5 0} {0.25 0.5 0} {0.25 0.417 1} {0.333 0.417 1} {0.333 0.5 1} {0.25 0.5 1} 
+	cellPointTbl[64][0-8]: {0.333 0.417 0} {0.417 0.417 0} {0.417 0.5 0} {0.333 0.5 0} {0.333 0.417 1} {0.417 0.417 1} {0.417 0.5 1} {0.333 0.5 1} 
+	cellPointTbl[65][0-8]: {0.417 0.417 0} {0.5 0.417 0} {0.5 0.5 0} {0.417 0.5 0} {0.417 0.417 1} {0.5 0.417 1} {0.5 0.5 1} {0.417 0.5 1} 
+	cellPointTbl[66][0-8]: {0.5 0.417 0} {0.583 0.417 0} {0.583 0.5 0} {0.5 0.5 0} {0.5 0.417 1} {0.583 0.417 1} {0.583 0.5 1} {0.5 0.5 1} 
+	cellPointTbl[67][0-8]: {0.583 0.417 0} {0.667 0.417 0} {0.667 0.5 0} {0.583 0.5 0} {0.583 0.417 1} {0.667 0.417 1} {0.667 0.5 1} {0.583 0.5 1} 
+	cellPointTbl[68][0-8]: {0.667 0.417 0} {0.75 0.417 0} {0.75 0.5 0} {0.667 0.5 0} {0.667 0.417 1} {0.75 0.417 1} {0.75 0.5 1} {0.667 0.5 1} 
+	cellPointTbl[69][0-8]: {0.75 0.417 0} {0.833 0.417 0} {0.833 0.5 0} {0.75 0.5 0} {0.75 0.417 1} {0.833 0.417 1} {0.833 0.5 1} {0.75 0.5 1} 
+	cellPointTbl[70][0-8]: {0.833 0.417 0} {0.917 0.417 0} {0.917 0.5 0} {0.833 0.5 0} {0.833 0.417 1} {0.917 0.417 1} {0.917 0.5 1} {0.833 0.5 1} 
+	cellPointTbl[71][0-8]: {0.917 0.417 0} {1 0.417 0} {1 0.5 0} {0.917 0.5 0} {0.917 0.417 1} {1 0.417 1} {1 0.5 1} {0.917 0.5 1} 
+	cellPointTbl[72][0-8]: {0 0.5 0} {0.0833 0.5 0} {0.0833 0.583 0} {0 0.583 0} {0 0.5 1} {0.0833 0.5 1} {0.0833 0.583 1} {0 0.583 1} 
+	cellPointTbl[73][0-8]: {0.0833 0.5 0} {0.167 0.5 0} {0.167 0.583 0} {0.0833 0.583 0} {0.0833 0.5 1} {0.167 0.5 1} {0.167 0.583 1} {0.0833 0.583 1} 
+	cellPointTbl[74][0-8]: {0.167 0.5 0} {0.25 0.5 0} {0.25 0.583 0} {0.167 0.583 0} {0.167 0.5 1} {0.25 0.5 1} {0.25 0.583 1} {0.167 0.583 1} 
+	cellPointTbl[75][0-8]: {0.25 0.5 0} {0.333 0.5 0} {0.333 0.583 0} {0.25 0.583 0} {0.25 0.5 1} {0.333 0.5 1} {0.333 0.583 1} {0.25 0.583 1} 
+	cellPointTbl[76][0-8]: {0.333 0.5 0} {0.417 0.5 0} {0.417 0.583 0} {0.333 0.583 0} {0.333 0.5 1} {0.417 0.5 1} {0.417 0.583 1} {0.333 0.583 1} 
+	cellPointTbl[77][0-8]: {0.417 0.5 0} {0.5 0.5 0} {0.5 0.583 0} {0.417 0.583 0} {0.417 0.5 1} {0.5 0.5 1} {0.5 0.583 1} {0.417 0.583 1} 
+	cellPointTbl[78][0-8]: {0.5 0.5 0} {0.583 0.5 0} {0.583 0.583 0} {0.5 0.583 0} {0.5 0.5 1} {0.583 0.5 1} {0.583 0.583 1} {0.5 0.583 1} 
+	cellPointTbl[79][0-8]: {0.583 0.5 0} {0.667 0.5 0} {0.667 0.583 0} {0.583 0.583 0} {0.583 0.5 1} {0.667 0.5 1} {0.667 0.583 1} {0.583 0.583 1} 
+	cellPointTbl[80][0-8]: {0.667 0.5 0} {0.75 0.5 0} {0.75 0.583 0} {0.667 0.583 0} {0.667 0.5 1} {0.75 0.5 1} {0.75 0.583 1} {0.667 0.583 1} 
+	cellPointTbl[81][0-8]: {0.75 0.5 0} {0.833 0.5 0} {0.833 0.583 0} {0.75 0.583 0} {0.75 0.5 1} {0.833 0.5 1} {0.833 0.583 1} {0.75 0.583 1} 
+	cellPointTbl[82][0-8]: {0.833 0.5 0} {0.917 0.5 0} {0.917 0.583 0} {0.833 0.583 0} {0.833 0.5 1} {0.917 0.5 1} {0.917 0.583 1} {0.833 0.583 1} 
+	cellPointTbl[83][0-8]: {0.917 0.5 0} {1 0.5 0} {1 0.583 0} {0.917 0.583 0} {0.917 0.5 1} {1 0.5 1} {1 0.583 1} {0.917 0.583 1} 
+	cellPointTbl[84][0-8]: {0 0.583 0} {0.0833 0.583 0} {0.0833 0.667 0} {0 0.667 0} {0 0.583 1} {0.0833 0.583 1} {0.0833 0.667 1} {0 0.667 1} 
+	cellPointTbl[85][0-8]: {0.0833 0.583 0} {0.167 0.583 0} {0.167 0.667 0} {0.0833 0.667 0} {0.0833 0.583 1} {0.167 0.583 1} {0.167 0.667 1} {0.0833 0.667 1} 
+	cellPointTbl[86][0-8]: {0.167 0.583 0} {0.25 0.583 0} {0.25 0.667 0} {0.167 0.667 0} {0.167 0.583 1} {0.25 0.583 1} {0.25 0.667 1} {0.167 0.667 1} 
+	cellPointTbl[87][0-8]: {0.25 0.583 0} {0.333 0.583 0} {0.333 0.667 0} {0.25 0.667 0} {0.25 0.583 1} {0.333 0.583 1} {0.333 0.667 1} {0.25 0.667 1} 
+	cellPointTbl[88][0-8]: {0.333 0.583 0} {0.417 0.583 0} {0.417 0.667 0} {0.333 0.667 0} {0.333 0.583 1} {0.417 0.583 1} {0.417 0.667 1} {0.333 0.667 1} 
+	cellPointTbl[89][0-8]: {0.417 0.583 0} {0.5 0.583 0} {0.5 0.667 0} {0.417 0.667 0} {0.417 0.583 1} {0.5 0.583 1} {0.5 0.667 1} {0.417 0.667 1} 
+	cellPointTbl[90][0-8]: {0.5 0.583 0} {0.583 0.583 0} {0.583 0.667 0} {0.5 0.667 0} {0.5 0.583 1} {0.583 0.583 1} {0.583 0.667 1} {0.5 0.667 1} 
+	cellPointTbl[91][0-8]: {0.583 0.583 0} {0.667 0.583 0} {0.667 0.667 0} {0.583 0.667 0} {0.583 0.583 1} {0.667 0.583 1} {0.667 0.667 1} {0.583 0.667 1} 
+	cellPointTbl[92][0-8]: {0.667 0.583 0} {0.75 0.583 0} {0.75 0.667 0} {0.667 0.667 0} {0.667 0.583 1} {0.75 0.583 1} {0.75 0.667 1} {0.667 0.667 1} 
+	cellPointTbl[93][0-8]: {0.75 0.583 0} {0.833 0.583 0} {0.833 0.667 0} {0.75 0.667 0} {0.75 0.583 1} {0.833 0.583 1} {0.833 0.667 1} {0.75 0.667 1} 
+	cellPointTbl[94][0-8]: {0.833 0.583 0} {0.917 0.583 0} {0.917 0.667 0} {0.833 0.667 0} {0.833 0.583 1} {0.917 0.583 1} {0.917 0.667 1} {0.833 0.667 1} 
+	cellPointTbl[95][0-8]: {0.917 0.583 0} {1 0.583 0} {1 0.667 0} {0.917 0.667 0} {0.917 0.583 1} {1 0.583 1} {1 0.667 1} {0.917 0.667 1} 
+	cellPointTbl[96][0-8]: {0 0.667 0} {0.0833 0.667 0} {0.0833 0.75 0} {0 0.75 0} {0 0.667 1} {0.0833 0.667 1} {0.0833 0.75 1} {0 0.75 1} 
+	cellPointTbl[97][0-8]: {0.0833 0.667 0} {0.167 0.667 0} {0.167 0.75 0} {0.0833 0.75 0} {0.0833 0.667 1} {0.167 0.667 1} {0.167 0.75 1} {0.0833 0.75 1} 
+	cellPointTbl[98][0-8]: {0.167 0.667 0} {0.25 0.667 0} {0.25 0.75 0} {0.167 0.75 0} {0.167 0.667 1} {0.25 0.667 1} {0.25 0.75 1} {0.167 0.75 1} 
+	cellPointTbl[99][0-8]: {0.25 0.667 0} {0.333 0.667 0} {0.333 0.75 0} {0.25 0.75 0} {0.25 0.667 1} {0.333 0.667 1} {0.333 0.75 1} {0.25 0.75 1} 
+	cellPointTbl[100][0-8]: {0.333 0.667 0} {0.417 0.667 0} {0.417 0.75 0} {0.333 0.75 0} {0.333 0.667 1} {0.417 0.667 1} {0.417 0.75 1} {0.333 0.75 1} 
+	cellPointTbl[101][0-8]: {0.417 0.667 0} {0.5 0.667 0} {0.5 0.75 0} {0.417 0.75 0} {0.417 0.667 1} {0.5 0.667 1} {0.5 0.75 1} {0.417 0.75 1} 
+	cellPointTbl[102][0-8]: {0.5 0.667 0} {0.583 0.667 0} {0.583 0.75 0} {0.5 0.75 0} {0.5 0.667 1} {0.583 0.667 1} {0.583 0.75 1} {0.5 0.75 1} 
+	cellPointTbl[103][0-8]: {0.583 0.667 0} {0.667 0.667 0} {0.667 0.75 0} {0.583 0.75 0} {0.583 0.667 1} {0.667 0.667 1} {0.667 0.75 1} {0.583 0.75 1} 
+	cellPointTbl[104][0-8]: {0.667 0.667 0} {0.75 0.667 0} {0.75 0.75 0} {0.667 0.75 0} {0.667 0.667 1} {0.75 0.667 1} {0.75 0.75 1} {0.667 0.75 1} 
+	cellPointTbl[105][0-8]: {0.75 0.667 0} {0.833 0.667 0} {0.833 0.75 0} {0.75 0.75 0} {0.75 0.667 1} {0.833 0.667 1} {0.833 0.75 1} {0.75 0.75 1} 
+	cellPointTbl[106][0-8]: {0.833 0.667 0} {0.917 0.667 0} {0.917 0.75 0} {0.833 0.75 0} {0.833 0.667 1} {0.917 0.667 1} {0.917 0.75 1} {0.833 0.75 1} 
+	cellPointTbl[107][0-8]: {0.917 0.667 0} {1 0.667 0} {1 0.75 0} {0.917 0.75 0} {0.917 0.667 1} {1 0.667 1} {1 0.75 1} {0.917 0.75 1} 
+	cellPointTbl[108][0-8]: {0 0.75 0} {0.0833 0.75 0} {0.0833 0.833 0} {0 0.833 0} {0 0.75 1} {0.0833 0.75 1} {0.0833 0.833 1} {0 0.833 1} 
+	cellPointTbl[109][0-8]: {0.0833 0.75 0} {0.167 0.75 0} {0.167 0.833 0} {0.0833 0.833 0} {0.0833 0.75 1} {0.167 0.75 1} {0.167 0.833 1} {0.0833 0.833 1} 
+	cellPointTbl[110][0-8]: {0.167 0.75 0} {0.25 0.75 0} {0.25 0.833 0} {0.167 0.833 0} {0.167 0.75 1} {0.25 0.75 1} {0.25 0.833 1} {0.167 0.833 1} 
+	cellPointTbl[111][0-8]: {0.25 0.75 0} {0.333 0.75 0} {0.333 0.833 0} {0.25 0.833 0} {0.25 0.75 1} {0.333 0.75 1} {0.333 0.833 1} {0.25 0.833 1} 
+	cellPointTbl[112][0-8]: {0.333 0.75 0} {0.417 0.75 0} {0.417 0.833 0} {0.333 0.833 0} {0.333 0.75 1} {0.417 0.75 1} {0.417 0.833 1} {0.333 0.833 1} 
+	cellPointTbl[113][0-8]: {0.417 0.75 0} {0.5 0.75 0} {0.5 0.833 0} {0.417 0.833 0} {0.417 0.75 1} {0.5 0.75 1} {0.5 0.833 1} {0.417 0.833 1} 
+	cellPointTbl[114][0-8]: {0.5 0.75 0} {0.583 0.75 0} {0.583 0.833 0} {0.5 0.833 0} {0.5 0.75 1} {0.583 0.75 1} {0.583 0.833 1} {0.5 0.833 1} 
+	cellPointTbl[115][0-8]: {0.583 0.75 0} {0.667 0.75 0} {0.667 0.833 0} {0.583 0.833 0} {0.583 0.75 1} {0.667 0.75 1} {0.667 0.833 1} {0.583 0.833 1} 
+	cellPointTbl[116][0-8]: {0.667 0.75 0} {0.75 0.75 0} {0.75 0.833 0} {0.667 0.833 0} {0.667 0.75 1} {0.75 0.75 1} {0.75 0.833 1} {0.667 0.833 1} 
+	cellPointTbl[117][0-8]: {0.75 0.75 0} {0.833 0.75 0} {0.833 0.833 0} {0.75 0.833 0} {0.75 0.75 1} {0.833 0.75 1} {0.833 0.833 1} {0.75 0.833 1} 
+	cellPointTbl[118][0-8]: {0.833 0.75 0} {0.917 0.75 0} {0.917 0.833 0} {0.833 0.833 0} {0.833 0.75 1} {0.917 0.75 1} {0.917 0.833 1} {0.833 0.833 1} 
+	cellPointTbl[119][0-8]: {0.917 0.75 0} {1 0.75 0} {1 0.833 0} {0.917 0.833 0} {0.917 0.75 1} {1 0.75 1} {1 0.833 1} {0.917 0.833 1} 
+	cellPointTbl[120][0-8]: {0 0.833 0} {0.0833 0.833 0} {0.0833 0.917 0} {0 0.917 0} {0 0.833 1} {0.0833 0.833 1} {0.0833 0.917 1} {0 0.917 1} 
+	cellPointTbl[121][0-8]: {0.0833 0.833 0} {0.167 0.833 0} {0.167 0.917 0} {0.0833 0.917 0} {0.0833 0.833 1} {0.167 0.833 1} {0.167 0.917 1} {0.0833 0.917 1} 
+	cellPointTbl[122][0-8]: {0.167 0.833 0} {0.25 0.833 0} {0.25 0.917 0} {0.167 0.917 0} {0.167 0.833 1} {0.25 0.833 1} {0.25 0.917 1} {0.167 0.917 1} 
+	cellPointTbl[123][0-8]: {0.25 0.833 0} {0.333 0.833 0} {0.333 0.917 0} {0.25 0.917 0} {0.25 0.833 1} {0.333 0.833 1} {0.333 0.917 1} {0.25 0.917 1} 
+	cellPointTbl[124][0-8]: {0.333 0.833 0} {0.417 0.833 0} {0.417 0.917 0} {0.333 0.917 0} {0.333 0.833 1} {0.417 0.833 1} {0.417 0.917 1} {0.333 0.917 1} 
+	cellPointTbl[125][0-8]: {0.417 0.833 0} {0.5 0.833 0} {0.5 0.917 0} {0.417 0.917 0} {0.417 0.833 1} {0.5 0.833 1} {0.5 0.917 1} {0.417 0.917 1} 
+	cellPointTbl[126][0-8]: {0.5 0.833 0} {0.583 0.833 0} {0.583 0.917 0} {0.5 0.917 0} {0.5 0.833 1} {0.583 0.833 1} {0.583 0.917 1} {0.5 0.917 1} 
+	cellPointTbl[127][0-8]: {0.583 0.833 0} {0.667 0.833 0} {0.667 0.917 0} {0.583 0.917 0} {0.583 0.833 1} {0.667 0.833 1} {0.667 0.917 1} {0.583 0.917 1} 
+	cellPointTbl[128][0-8]: {0.667 0.833 0} {0.75 0.833 0} {0.75 0.917 0} {0.667 0.917 0} {0.667 0.833 1} {0.75 0.833 1} {0.75 0.917 1} {0.667 0.917 1} 
+	cellPointTbl[129][0-8]: {0.75 0.833 0} {0.833 0.833 0} {0.833 0.917 0} {0.75 0.917 0} {0.75 0.833 1} {0.833 0.833 1} {0.833 0.917 1} {0.75 0.917 1} 
+	cellPointTbl[130][0-8]: {0.833 0.833 0} {0.917 0.833 0} {0.917 0.917 0} {0.833 0.917 0} {0.833 0.833 1} {0.917 0.833 1} {0.917 0.917 1} {0.833 0.917 1} 
+	cellPointTbl[131][0-8]: {0.917 0.833 0} {1 0.833 0} {1 0.917 0} {0.917 0.917 0} {0.917 0.833 1} {1 0.833 1} {1 0.917 1} {0.917 0.917 1} 
+	cellPointTbl[132][0-8]: {0 0.917 0} {0.0833 0.917 0} {0.0833 1 0} {0 1 0} {0 0.917 1} {0.0833 0.917 1} {0.0833 1 1} {0 1 1} 
+	cellPointTbl[133][0-8]: {0.0833 0.917 0} {0.167 0.917 0} {0.167 1 0} {0.0833 1 0} {0.0833 0.917 1} {0.167 0.917 1} {0.167 1 1} {0.0833 1 1} 
+	cellPointTbl[134][0-8]: {0.167 0.917 0} {0.25 0.917 0} {0.25 1 0} {0.167 1 0} {0.167 0.917 1} {0.25 0.917 1} {0.25 1 1} {0.167 1 1} 
+	cellPointTbl[135][0-8]: {0.25 0.917 0} {0.333 0.917 0} {0.333 1 0} {0.25 1 0} {0.25 0.917 1} {0.333 0.917 1} {0.333 1 1} {0.25 1 1} 
+	cellPointTbl[136][0-8]: {0.333 0.917 0} {0.417 0.917 0} {0.417 1 0} {0.333 1 0} {0.333 0.917 1} {0.417 0.917 1} {0.417 1 1} {0.333 1 1} 
+	cellPointTbl[137][0-8]: {0.417 0.917 0} {0.5 0.917 0} {0.5 1 0} {0.417 1 0} {0.417 0.917 1} {0.5 0.917 1} {0.5 1 1} {0.417 1 1} 
+	cellPointTbl[138][0-8]: {0.5 0.917 0} {0.583 0.917 0} {0.583 1 0} {0.5 1 0} {0.5 0.917 1} {0.583 0.917 1} {0.583 1 1} {0.5 1 1} 
+	cellPointTbl[139][0-8]: {0.583 0.917 0} {0.667 0.917 0} {0.667 1 0} {0.583 1 0} {0.583 0.917 1} {0.667 0.917 1} {0.667 1 1} {0.583 1 1} 
+	cellPointTbl[140][0-8]: {0.667 0.917 0} {0.75 0.917 0} {0.75 1 0} {0.667 1 0} {0.667 0.917 1} {0.75 0.917 1} {0.75 1 1} {0.667 1 1} 
+	cellPointTbl[141][0-8]: {0.75 0.917 0} {0.833 0.917 0} {0.833 1 0} {0.75 1 0} {0.75 0.917 1} {0.833 0.917 1} {0.833 1 1} {0.75 1 1} 
+	cellPointTbl[142][0-8]: {0.833 0.917 0} {0.917 0.917 0} {0.917 1 0} {0.833 1 0} {0.833 0.917 1} {0.917 0.917 1} {0.917 1 1} {0.833 1 1} 
+	cellPointTbl[143][0-8]: {0.917 0.917 0} {1 0.917 0} {1 1 0} {0.917 1 0} {0.917 0.917 1} {1 0.917 1} {1 1 1} {0.917 1 1} 
+}
+
+	cellParticleCountTbl (ptr): 0x65b140
+	cellParticleCountTbl[0-144]: 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 
+	cellParticleSizeTbl (ptr): 0x65b3a0
+	cellParticleSizeTbl[0-144]: 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 
+	cellParticleTbl (ptr): 0x65b600
+	cellParticleTbl [0-144]: {
+		cellParticleTbl[0][0-1]:
+			(part. index) 0
+
+		cellParticleTbl[1][0-1]:
+			(part. index) 1
+
+		cellParticleTbl[2][0-1]:
+			(part. index) 2
+
+		cellParticleTbl[3][0-1]:
+			(part. index) 3
+
+		cellParticleTbl[4][0-1]:
+			(part. index) 4
+
+		cellParticleTbl[5][0-1]:
+			(part. index) 5
+
+		cellParticleTbl[6][0-1]:
+			(part. index) 6
+
+		cellParticleTbl[7][0-1]:
+			(part. index) 7
+
+		cellParticleTbl[8][0-1]:
+			(part. index) 8
+
+		cellParticleTbl[9][0-1]:
+			(part. index) 9
+
+		cellParticleTbl[10][0-1]:
+			(part. index) 10
+
+		cellParticleTbl[11][0-1]:
+			(part. index) 11
+
+		cellParticleTbl[12][0-1]:
+			(part. index) 12
+
+		cellParticleTbl[13][0-1]:
+			(part. index) 13
+
+		cellParticleTbl[14][0-1]:
+			(part. index) 14
+
+		cellParticleTbl[15][0-1]:
+			(part. index) 15
+
+		cellParticleTbl[16][0-1]:
+			(part. index) 16
+
+		cellParticleTbl[17][0-1]:
+			(part. index) 17
+
+		cellParticleTbl[18][0-1]:
+			(part. index) 18
+
+		cellParticleTbl[19][0-1]:
+			(part. index) 19
+
+		cellParticleTbl[20][0-1]:
+			(part. index) 20
+
+		cellParticleTbl[21][0-1]:
+			(part. index) 21
+
+		cellParticleTbl[22][0-1]:
+			(part. index) 22
+
+		cellParticleTbl[23][0-1]:
+			(part. index) 23
+
+		cellParticleTbl[24][0-1]:
+			(part. index) 24
+
+		cellParticleTbl[25][0-1]:
+			(part. index) 25
+
+		cellParticleTbl[26][0-1]:
+			(part. index) 26
+
+		cellParticleTbl[27][0-1]:
+			(part. index) 27
+
+		cellParticleTbl[28][0-1]:
+			(part. index) 28
+
+		cellParticleTbl[29][0-1]:
+			(part. index) 29
+
+		cellParticleTbl[30][0-1]:
+			(part. index) 30
+
+		cellParticleTbl[31][0-1]:
+			(part. index) 31
+
+		cellParticleTbl[32][0-1]:
+			(part. index) 32
+
+		cellParticleTbl[33][0-1]:
+			(part. index) 33
+
+		cellParticleTbl[34][0-1]:
+			(part. index) 34
+
+		cellParticleTbl[35][0-1]:
+			(part. index) 35
+
+		cellParticleTbl[36][0-1]:
+			(part. index) 36
+
+		cellParticleTbl[37][0-1]:
+			(part. index) 37
+
+		cellParticleTbl[38][0-1]:
+			(part. index) 38
+
+		cellParticleTbl[39][0-1]:
+			(part. index) 39
+
+		cellParticleTbl[40][0-1]:
+			(part. index) 40
+
+		cellParticleTbl[41][0-1]:
+			(part. index) 41
+
+		cellParticleTbl[42][0-1]:
+			(part. index) 42
+
+		cellParticleTbl[43][0-1]:
+			(part. index) 43
+
+		cellParticleTbl[44][0-1]:
+			(part. index) 44
+
+		cellParticleTbl[45][0-1]:
+			(part. index) 45
+
+		cellParticleTbl[46][0-1]:
+			(part. index) 46
+
+		cellParticleTbl[47][0-1]:
+			(part. index) 47
+
+		cellParticleTbl[48][0-1]:
+			(part. index) 48
+
+		cellParticleTbl[49][0-1]:
+			(part. index) 49
+
+		cellParticleTbl[50][0-1]:
+			(part. index) 50
+
+		cellParticleTbl[51][0-1]:
+			(part. index) 51
+
+		cellParticleTbl[52][0-1]:
+			(part. index) 52
+
+		cellParticleTbl[53][0-1]:
+			(part. index) 53
+
+		cellParticleTbl[54][0-1]:
+			(part. index) 54
+
+		cellParticleTbl[55][0-1]:
+			(part. index) 55
+
+		cellParticleTbl[56][0-1]:
+			(part. index) 56
+
+		cellParticleTbl[57][0-1]:
+			(part. index) 57
+
+		cellParticleTbl[58][0-1]:
+			(part. index) 58
+
+		cellParticleTbl[59][0-1]:
+			(part. index) 59
+
+		cellParticleTbl[60][0-1]:
+			(part. index) 60
+
+		cellParticleTbl[61][0-1]:
+			(part. index) 61
+
+		cellParticleTbl[62][0-1]:
+			(part. index) 62
+
+		cellParticleTbl[63][0-1]:
+			(part. index) 63
+
+		cellParticleTbl[64][0-1]:
+			(part. index) 64
+
+		cellParticleTbl[65][0-1]:
+			(part. index) 65
+
+		cellParticleTbl[66][0-1]:
+			(part. index) 66
+
+		cellParticleTbl[67][0-1]:
+			(part. index) 67
+
+		cellParticleTbl[68][0-1]:
+			(part. index) 68
+
+		cellParticleTbl[69][0-1]:
+			(part. index) 69
+
+		cellParticleTbl[70][0-1]:
+			(part. index) 70
+
+		cellParticleTbl[71][0-1]:
+			(part. index) 71
+
+		cellParticleTbl[72][0-1]:
+			(part. index) 72
+
+		cellParticleTbl[73][0-1]:
+			(part. index) 73
+
+		cellParticleTbl[74][0-1]:
+			(part. index) 74
+
+		cellParticleTbl[75][0-1]:
+			(part. index) 75
+
+		cellParticleTbl[76][0-1]:
+			(part. index) 76
+
+		cellParticleTbl[77][0-1]:
+			(part. index) 77
+
+		cellParticleTbl[78][0-1]:
+			(part. index) 78
+
+		cellParticleTbl[79][0-1]:
+			(part. index) 79
+
+		cellParticleTbl[80][0-1]:
+			(part. index) 80
+
+		cellParticleTbl[81][0-1]:
+			(part. index) 81
+
+		cellParticleTbl[82][0-1]:
+			(part. index) 82
+
+		cellParticleTbl[83][0-1]:
+			(part. index) 83
+
+		cellParticleTbl[84][0-1]:
+			(part. index) 84
+
+		cellParticleTbl[85][0-1]:
+			(part. index) 85
+
+		cellParticleTbl[86][0-1]:
+			(part. index) 86
+
+		cellParticleTbl[87][0-1]:
+			(part. index) 87
+
+		cellParticleTbl[88][0-1]:
+			(part. index) 88
+
+		cellParticleTbl[89][0-1]:
+			(part. index) 89
+
+		cellParticleTbl[90][0-1]:
+			(part. index) 90
+
+		cellParticleTbl[91][0-1]:
+			(part. index) 91
+
+		cellParticleTbl[92][0-1]:
+			(part. index) 92
+
+		cellParticleTbl[93][0-1]:
+			(part. index) 93
+
+		cellParticleTbl[94][0-1]:
+			(part. index) 94
+
+		cellParticleTbl[95][0-1]:
+			(part. index) 95
+
+		cellParticleTbl[96][0-1]:
+			(part. index) 96
+
+		cellParticleTbl[97][0-1]:
+			(part. index) 97
+
+		cellParticleTbl[98][0-1]:
+			(part. index) 98
+
+		cellParticleTbl[99][0-1]:
+			(part. index) 99
+
+		cellParticleTbl[100][0-1]:
+			(part. index) 100
+
+		cellParticleTbl[101][0-1]:
+			(part. index) 101
+
+		cellParticleTbl[102][0-1]:
+			(part. index) 102
+
+		cellParticleTbl[103][0-1]:
+			(part. index) 103
+
+		cellParticleTbl[104][0-1]:
+			(part. index) 104
+
+		cellParticleTbl[105][0-1]:
+			(part. index) 105
+
+		cellParticleTbl[106][0-1]:
+			(part. index) 106
+
+		cellParticleTbl[107][0-1]:
+			(part. index) 107
+
+		cellParticleTbl[108][0-1]:
+			(part. index) 108
+
+		cellParticleTbl[109][0-1]:
+			(part. index) 109
+
+		cellParticleTbl[110][0-1]:
+			(part. index) 110
+
+		cellParticleTbl[111][0-1]:
+			(part. index) 111
+
+		cellParticleTbl[112][0-1]:
+			(part. index) 112
+
+		cellParticleTbl[113][0-1]:
+			(part. index) 113
+
+		cellParticleTbl[114][0-1]:
+			(part. index) 114
+
+		cellParticleTbl[115][0-1]:
+			(part. index) 115
+
+		cellParticleTbl[116][0-1]:
+			(part. index) 116
+
+		cellParticleTbl[117][0-1]:
+			(part. index) 117
+
+		cellParticleTbl[118][0-1]:
+			(part. index) 118
+
+		cellParticleTbl[119][0-1]:
+			(part. index) 119
+
+		cellParticleTbl[120][0-1]:
+			(part. index) 120
+
+		cellParticleTbl[121][0-1]:
+			(part. index) 121
+
+		cellParticleTbl[122][0-1]:
+			(part. index) 122
+
+		cellParticleTbl[123][0-1]:
+			(part. index) 123
+
+		cellParticleTbl[124][0-1]:
+			(part. index) 124
+
+		cellParticleTbl[125][0-1]:
+			(part. index) 125
+
+		cellParticleTbl[126][0-1]:
+			(part. index) 126
+
+		cellParticleTbl[127][0-1]:
+			(part. index) 127
+
+		cellParticleTbl[128][0-1]:
+			(part. index) 128
+
+		cellParticleTbl[129][0-1]:
+			(part. index) 129
+
+		cellParticleTbl[130][0-1]:
+			(part. index) 130
+
+		cellParticleTbl[131][0-1]:
+			(part. index) 131
+
+		cellParticleTbl[132][0-1]:
+			(part. index) 132
+
+		cellParticleTbl[133][0-1]:
+			(part. index) 133
+
+		cellParticleTbl[134][0-1]:
+			(part. index) 134
+
+		cellParticleTbl[135][0-1]:
+			(part. index) 135
+
+		cellParticleTbl[136][0-1]:
+			(part. index) 136
+
+		cellParticleTbl[137][0-1]:
+			(part. index) 137
+
+		cellParticleTbl[138][0-1]:
+			(part. index) 138
+
+		cellParticleTbl[139][0-1]:
+			(part. index) 139
+
+		cellParticleTbl[140][0-1]:
+			(part. index) 140
+
+		cellParticleTbl[141][0-1]:
+			(part. index) 141
+
+		cellParticleTbl[142][0-1]:
+			(part. index) 142
+
+		cellParticleTbl[143][0-1]:
+			(part. index) 143
+
+	}
+	particlesArraySize: 151
+	particlesArrayDelta: 7
+	extraParticlesFactor: 0.05
+
+Starting timestep 1:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.020218,0.055930,0.161165) to (-0.079782,0.055930,0.161165):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.142325,0.060967,0.087923) to (0.042325,0.060967,0.087923):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.226628,0.013305,0.428316) to (0.126628,0.013305,0.428316):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.308700,0.070846,0.484961) to (0.208700,0.070846,0.484961):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.395513,0.054303,0.100663) to (0.295513,0.054303,0.100663):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.486236,0.007617,0.153544) to (0.386236,0.007617,0.153544):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.551311,0.057485,0.725730) to (0.451311,0.057485,0.725730):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.611840,0.019907,0.917154) to (0.511840,0.019907,0.917154):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.717361,0.014689,0.469106) to (0.617361,0.014689,0.469106):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.772422,0.007742,0.348450) to (0.672422,0.007742,0.348450):
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.867006,0.023167,0.365872) to (0.767006,0.023167,0.365872):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.934506,0.073097,0.498144) to (0.834506,0.073097,0.498144):
+	Updating Particles positions in local cell 12:
+		Updating particleInCell 0:
+		Changing its coords from (0.025617,0.131893,0.684585) to (-0.074383,0.131893,0.684585):
+	Updating Particles positions in local cell 13:
+		Updating particleInCell 0:
+		Changing its coords from (0.151040,0.118217,0.412512) to (0.051040,0.118217,0.412512):
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.173597,0.144814,0.708363) to (0.073597,0.144814,0.708363):
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.288268,0.094355,0.813771) to (0.188268,0.094355,0.813771):
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.337018,0.100727,0.063715) to (0.237018,0.100727,0.063715):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.488116,0.107236,0.789944) to (0.388116,0.107236,0.789944):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.549385,0.095745,0.211121) to (0.449385,0.095745,0.211121):
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.609731,0.086098,0.671870) to (0.509731,0.086098,0.671870):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.677176,0.128907,0.392572) to (0.577176,0.128907,0.392572):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.829246,0.144943,0.744761) to (0.729246,0.144943,0.744761):
+	Updating Particles positions in local cell 22:
+		Updating particleInCell 0:
+		Changing its coords from (0.849212,0.117057,0.516097) to (0.749212,0.117057,0.516097):
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.920799,0.111560,0.881840) to (0.820799,0.111560,0.881840):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.007569,0.220237,0.185594) to (-0.092431,0.220237,0.185594):
+	Updating Particles positions in local cell 25:
+		Updating particleInCell 0:
+		Changing its coords from (0.106618,0.176914,0.669197) to (0.006618,0.176914,0.669197):
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.182432,0.223996,0.379149) to (0.082432,0.223996,0.379149):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.279420,0.209246,0.558967) to (0.179420,0.209246,0.558967):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.380429,0.204775,0.925924) to (0.280429,0.204775,0.925924):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.417008,0.233736,0.757598) to (0.317008,0.233736,0.757598):
+	Updating Particles positions in local cell 30:
+		Updating particleInCell 0:
+		Changing its coords from (0.578434,0.234579,0.751425) to (0.478434,0.234579,0.751425):
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.599936,0.213040,0.739388) to (0.499936,0.213040,0.739388):
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.741211,0.200583,0.382567) to (0.641211,0.200583,0.382567):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.817248,0.240369,0.632784) to (0.717248,0.240369,0.632784):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.850534,0.175532,0.077820) to (0.750534,0.175532,0.077820):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.993245,0.214135,0.582185) to (0.893245,0.214135,0.582185):
+	Updating Particles positions in local cell 36:
+		Updating particleInCell 0:
+		Changing its coords from (0.065683,0.264829,0.736755) to (-0.034317,0.264829,0.736755):
+	Updating Particles positions in local cell 37:
+		Updating particleInCell 0:
+		Changing its coords from (0.136213,0.325754,0.451488) to (0.036213,0.325754,0.451488):
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.179352,0.279855,0.321813) to (0.079352,0.279855,0.321813):
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.308758,0.296891,0.230269) to (0.208758,0.296891,0.230269):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.344624,0.253993,0.377044) to (0.244624,0.253993,0.377044):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.498848,0.305396,0.466709) to (0.398848,0.305396,0.466709):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.581050,0.284045,0.376295) to (0.481050,0.284045,0.376295):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.616190,0.299720,0.774592) to (0.516190,0.299720,0.774592):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.713733,0.289242,0.408698) to (0.613733,0.289242,0.408698):
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.831828,0.283468,0.032166) to (0.731828,0.283468,0.032166):
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.885139,0.274493,0.771763) to (0.785139,0.274493,0.771763):
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.918318,0.257582,0.233312) to (0.818318,0.257582,0.233312):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.022725,0.362652,0.106081) to (-0.077275,0.362652,0.106081):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.157951,0.345596,0.126605) to (0.057951,0.345596,0.126605):
+	Updating Particles positions in local cell 50:
+		Updating particleInCell 0:
+		Changing its coords from (0.237365,0.392358,0.316657) to (0.137365,0.392358,0.316657):
+	Updating Particles positions in local cell 51:
+		Updating particleInCell 0:
+		Changing its coords from (0.255175,0.395699,0.170111) to (0.155175,0.395699,0.170111):
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.337709,0.369255,0.860921) to (0.237709,0.369255,0.860921):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.458807,0.415579,0.711434) to (0.358807,0.415579,0.711434):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.505346,0.344532,0.516861) to (0.405346,0.344532,0.516861):
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.657111,0.405103,0.724586) to (0.557111,0.405103,0.724586):
+	Updating Particles positions in local cell 56:
+		Updating particleInCell 0:
+		Changing its coords from (0.676621,0.378505,0.483519) to (0.576621,0.378505,0.483519):
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.792326,0.365403,0.929035) to (0.692326,0.365403,0.929035):
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.857797,0.335222,0.991404) to (0.757797,0.335222,0.991404):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.961117,0.334950,0.115447) to (0.861117,0.334950,0.115447):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.026061,0.422658,0.451692) to (-0.073939,0.422658,0.451692):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.132779,0.451592,0.892297) to (0.032779,0.451592,0.892297):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.235808,0.482726,0.081151) to (0.135808,0.482726,0.081151):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.325043,0.416841,0.137948) to (0.225043,0.416841,0.137948):
+	Updating Particles positions in local cell 64:
+		Updating particleInCell 0:
+		Changing its coords from (0.374786,0.449349,0.534845) to (0.274786,0.449349,0.534845):
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.428320,0.434366,0.601838) to (0.328320,0.434366,0.601838):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.507840,0.436869,0.543898) to (0.407840,0.436869,0.543898):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.607648,0.494438,0.311891) to (0.507648,0.494438,0.311891):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.746266,0.417322,0.071914) to (0.646266,0.417322,0.071914):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.805396,0.453880,0.262791) to (0.705396,0.453880,0.262791):
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.893736,0.446017,0.518640) to (0.793736,0.446017,0.518640):
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.981395,0.469559,0.488147) to (0.881395,0.469559,0.488147):
+	Updating Particles positions in local cell 72:
+		Updating particleInCell 0:
+		Changing its coords from (0.023555,0.547874,0.464087) to (-0.076445,0.547874,0.464087):
+	Updating Particles positions in local cell 73:
+		Updating particleInCell 0:
+		Changing its coords from (0.158705,0.524700,0.598479) to (0.058705,0.524700,0.598479):
+	Updating Particles positions in local cell 74:
+		Updating particleInCell 0:
+		Changing its coords from (0.219183,0.566147,0.810155) to (0.119183,0.566147,0.810155):
+	Updating Particles positions in local cell 75:
+		Updating particleInCell 0:
+		Changing its coords from (0.272347,0.578168,0.153943) to (0.172347,0.578168,0.153943):
+	Updating Particles positions in local cell 76:
+		Updating particleInCell 0:
+		Changing its coords from (0.360453,0.555529,0.280554) to (0.260453,0.555529,0.280554):
+	Updating Particles positions in local cell 77:
+		Updating particleInCell 0:
+		Changing its coords from (0.439431,0.520572,0.006777) to (0.339431,0.520572,0.006777):
+	Updating Particles positions in local cell 78:
+		Updating particleInCell 0:
+		Changing its coords from (0.574892,0.539611,0.863758) to (0.474892,0.539611,0.863758):
+	Updating Particles positions in local cell 79:
+		Updating particleInCell 0:
+		Changing its coords from (0.598551,0.507831,0.392552) to (0.498551,0.507831,0.392552):
+	Updating Particles positions in local cell 80:
+		Updating particleInCell 0:
+		Changing its coords from (0.717884,0.553317,0.094829) to (0.617884,0.553317,0.094829):
+	Updating Particles positions in local cell 81:
+		Updating particleInCell 0:
+		Changing its coords from (0.815318,0.555593,0.307147) to (0.715318,0.555593,0.307147):
+	Updating Particles positions in local cell 82:
+		Updating particleInCell 0:
+		Changing its coords from (0.851093,0.564149,0.760207) to (0.751093,0.564149,0.760207):
+	Updating Particles positions in local cell 83:
+		Updating particleInCell 0:
+		Changing its coords from (0.982854,0.572838,0.228172) to (0.882854,0.572838,0.228172):
+	Updating Particles positions in local cell 84:
+		Updating particleInCell 0:
+		Changing its coords from (0.073478,0.609781,0.048507) to (-0.026522,0.609781,0.048507):
+	Updating Particles positions in local cell 85:
+		Updating particleInCell 0:
+		Changing its coords from (0.105332,0.641739,0.534200) to (0.005332,0.641739,0.534200):
+	Updating Particles positions in local cell 86:
+		Updating particleInCell 0:
+		Changing its coords from (0.191551,0.652676,0.264243) to (0.091551,0.652676,0.264243):
+	Updating Particles positions in local cell 87:
+		Updating particleInCell 0:
+		Changing its coords from (0.261191,0.584010,0.556690) to (0.161191,0.584010,0.556690):
+	Updating Particles positions in local cell 88:
+		Updating particleInCell 0:
+		Changing its coords from (0.357470,0.665563,0.382487) to (0.257470,0.665563,0.382487):
+	Updating Particles positions in local cell 89:
+		Updating particleInCell 0:
+		Changing its coords from (0.455497,0.617549,0.683248) to (0.355497,0.617549,0.683248):
+	Updating Particles positions in local cell 90:
+		Updating particleInCell 0:
+		Changing its coords from (0.528409,0.630944,0.297079) to (0.428409,0.630944,0.297079):
+	Updating Particles positions in local cell 91:
+		Updating particleInCell 0:
+		Changing its coords from (0.584344,0.651320,0.860231) to (0.484344,0.651320,0.860231):
+	Updating Particles positions in local cell 92:
+		Updating particleInCell 0:
+		Changing its coords from (0.741604,0.635915,0.819066) to (0.641604,0.635915,0.819066):
+	Updating Particles positions in local cell 93:
+		Updating particleInCell 0:
+		Changing its coords from (0.753863,0.593017,0.014169) to (0.653863,0.593017,0.014169):
+	Updating Particles positions in local cell 94:
+		Updating particleInCell 0:
+		Changing its coords from (0.845241,0.632992,0.268398) to (0.745241,0.632992,0.268398):
+	Updating Particles positions in local cell 95:
+		Updating particleInCell 0:
+		Changing its coords from (0.997250,0.617722,0.678490) to (0.897250,0.617722,0.678490):
+	Updating Particles positions in local cell 96:
+		Updating particleInCell 0:
+		Changing its coords from (0.031526,0.688006,0.805419) to (-0.068474,0.688006,0.805419):
+	Updating Particles positions in local cell 97:
+		Updating particleInCell 0:
+		Changing its coords from (0.139513,0.710536,0.650537) to (0.039513,0.710536,0.650537):
+	Updating Particles positions in local cell 98:
+		Updating particleInCell 0:
+		Changing its coords from (0.214507,0.715229,0.172700) to (0.114507,0.715229,0.172700):
+	Updating Particles positions in local cell 99:
+		Updating particleInCell 0:
+		Changing its coords from (0.296771,0.667611,0.503939) to (0.196771,0.667611,0.503939):
+	Updating Particles positions in local cell 100:
+		Updating particleInCell 0:
+		Changing its coords from (0.392519,0.732025,0.786987) to (0.292519,0.732025,0.786987):
+	Updating Particles positions in local cell 101:
+		Updating particleInCell 0:
+		Changing its coords from (0.491157,0.707541,0.740305) to (0.391157,0.707541,0.740305):
+	Updating Particles positions in local cell 102:
+		Updating particleInCell 0:
+		Changing its coords from (0.525149,0.680752,0.710421) to (0.425149,0.680752,0.710421):
+	Updating Particles positions in local cell 103:
+		Updating particleInCell 0:
+		Changing its coords from (0.587566,0.715174,0.131602) to (0.487566,0.715174,0.131602):
+	Updating Particles positions in local cell 104:
+		Updating particleInCell 0:
+		Changing its coords from (0.736450,0.689118,0.078428) to (0.636450,0.689118,0.078428):
+	Updating Particles positions in local cell 105:
+		Updating particleInCell 0:
+		Changing its coords from (0.761120,0.733203,0.312395) to (0.661120,0.733203,0.312395):
+	Updating Particles positions in local cell 106:
+		Updating particleInCell 0:
+		Changing its coords from (0.868448,0.667515,0.129199) to (0.768448,0.667515,0.129199):
+	Updating Particles positions in local cell 107:
+		Updating particleInCell 0:
+		Changing its coords from (0.953746,0.700469,0.362601) to (0.853746,0.700469,0.362601):
+	Updating Particles positions in local cell 108:
+		Updating particleInCell 0:
+		Changing its coords from (0.019869,0.771640,0.405653) to (-0.080131,0.771640,0.405653):
+	Updating Particles positions in local cell 109:
+		Updating particleInCell 0:
+		Changing its coords from (0.151410,0.750586,0.148631) to (0.051410,0.750586,0.148631):
+	Updating Particles positions in local cell 110:
+		Updating particleInCell 0:
+		Changing its coords from (0.170484,0.829588,0.587796) to (0.070484,0.829588,0.587796):
+	Updating Particles positions in local cell 111:
+		Updating particleInCell 0:
+		Changing its coords from (0.257384,0.761885,0.111413) to (0.157384,0.761885,0.111413):
+	Updating Particles positions in local cell 112:
+		Updating particleInCell 0:
+		Changing its coords from (0.375867,0.782017,0.263024) to (0.275867,0.782017,0.263024):
+	Updating Particles positions in local cell 113:
+		Updating particleInCell 0:
+		Changing its coords from (0.470813,0.785118,0.832115) to (0.370813,0.785118,0.832115):
+	Updating Particles positions in local cell 114:
+		Updating particleInCell 0:
+		Changing its coords from (0.529937,0.822625,0.301131) to (0.429937,0.822625,0.301131):
+	Updating Particles positions in local cell 115:
+		Updating particleInCell 0:
+		Changing its coords from (0.592553,0.795928,0.932317) to (0.492553,0.795928,0.932317):
+	Updating Particles positions in local cell 116:
+		Updating particleInCell 0:
+		Changing its coords from (0.704757,0.767063,0.389654) to (0.604757,0.767063,0.389654):
+	Updating Particles positions in local cell 117:
+		Updating particleInCell 0:
+		Changing its coords from (0.826693,0.806052,0.766668) to (0.726693,0.806052,0.766668):
+	Updating Particles positions in local cell 118:
+		Updating particleInCell 0:
+		Changing its coords from (0.865451,0.806915,0.786630) to (0.765451,0.806915,0.786630):
+	Updating Particles positions in local cell 119:
+		Updating particleInCell 0:
+		Changing its coords from (0.990906,0.831802,0.079259) to (0.890906,0.831802,0.079259):
+	Updating Particles positions in local cell 120:
+		Updating particleInCell 0:
+		Changing its coords from (0.008471,0.870356,0.978446) to (-0.091529,0.870356,0.978446):
+	Updating Particles positions in local cell 121:
+		Updating particleInCell 0:
+		Changing its coords from (0.145677,0.894197,0.164508) to (0.045677,0.894197,0.164508):
+	Updating Particles positions in local cell 122:
+		Updating particleInCell 0:
+		Changing its coords from (0.240690,0.862953,0.774475) to (0.140690,0.862953,0.774475):
+	Updating Particles positions in local cell 123:
+		Updating particleInCell 0:
+		Changing its coords from (0.300064,0.849542,0.008698) to (0.200064,0.849542,0.008698):
+	Updating Particles positions in local cell 124:
+		Updating particleInCell 0:
+		Changing its coords from (0.349165,0.916347,0.443317) to (0.249165,0.916347,0.443317):
+	Updating Particles positions in local cell 125:
+		Updating particleInCell 0:
+		Changing its coords from (0.485189,0.906007,0.018015) to (0.385189,0.906007,0.018015):
+	Updating Particles positions in local cell 126:
+		Updating particleInCell 0:
+		Changing its coords from (0.564356,0.885679,0.214158) to (0.464356,0.885679,0.214158):
+	Updating Particles positions in local cell 127:
+		Updating particleInCell 0:
+		Changing its coords from (0.612505,0.876272,0.962228) to (0.512505,0.876272,0.962228):
+	Updating Particles positions in local cell 128:
+		Updating particleInCell 0:
+		Changing its coords from (0.680133,0.906697,0.274473) to (0.580133,0.906697,0.274473):
+	Updating Particles positions in local cell 129:
+		Updating particleInCell 0:
+		Changing its coords from (0.756186,0.892969,0.628853) to (0.656186,0.892969,0.628853):
+	Updating Particles positions in local cell 130:
+		Updating particleInCell 0:
+		Changing its coords from (0.844726,0.887403,0.062195) to (0.744726,0.887403,0.062195):
+	Updating Particles positions in local cell 131:
+		Updating particleInCell 0:
+		Changing its coords from (0.943125,0.848438,0.363551) to (0.843125,0.848438,0.363551):
+	Updating Particles positions in local cell 132:
+		Updating particleInCell 0:
+		Changing its coords from (0.016334,0.947029,0.632948) to (-0.083666,0.947029,0.632948):
+	Updating Particles positions in local cell 133:
+		Updating particleInCell 0:
+		Changing its coords from (0.163505,0.941543,0.200554) to (0.063505,0.941543,0.200554):
+	Updating Particles positions in local cell 134:
+		Updating particleInCell 0:
+		Changing its coords from (0.226091,0.987365,0.673773) to (0.126091,0.987365,0.673773):
+	Updating Particles positions in local cell 135:
+		Updating particleInCell 0:
+		Changing its coords from (0.258623,0.923919,0.642657) to (0.158623,0.923919,0.642657):
+	Updating Particles positions in local cell 136:
+		Updating particleInCell 0:
+		Changing its coords from (0.344486,0.935294,0.917260) to (0.244486,0.935294,0.917260):
+	Updating Particles positions in local cell 137:
+		Updating particleInCell 0:
+		Changing its coords from (0.449055,0.927436,0.056589) to (0.349055,0.927436,0.056589):
+	Updating Particles positions in local cell 138:
+		Updating particleInCell 0:
+		Changing its coords from (0.506981,0.993211,0.746238) to (0.406981,0.993211,0.746238):
+	Updating Particles positions in local cell 139:
+		Updating particleInCell 0:
+		Changing its coords from (0.584940,0.922172,0.353679) to (0.484940,0.922172,0.353679):
+	Updating Particles positions in local cell 140:
+		Updating particleInCell 0:
+		Changing its coords from (0.690388,0.930229,0.295629) to (0.590388,0.930229,0.295629):
+	Updating Particles positions in local cell 141:
+		Updating particleInCell 0:
+		Changing its coords from (0.803534,0.998106,0.030401) to (0.703534,0.998106,0.030401):
+	Updating Particles positions in local cell 142:
+		Updating particleInCell 0:
+		Changing its coords from (0.912755,0.928183,0.580515) to (0.812755,0.928183,0.580515):
+	Updating Particles positions in local cell 143:
+		Updating particleInCell 0:
+		Changing its coords from (0.975714,0.989690,0.582861) to (0.875714,0.989690,0.582861):
+
+Updating periodic BCs
+
+Starting timestep 2:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.042325,0.060967,0.087923) to (-0.057675,0.060967,0.087923):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.126628,0.013305,0.428316) to (0.026628,0.013305,0.428316):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.208700,0.070846,0.484961) to (0.108700,0.070846,0.484961):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.295513,0.054303,0.100663) to (0.195513,0.054303,0.100663):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.386236,0.007617,0.153544) to (0.286236,0.007617,0.153544):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.451311,0.057485,0.725730) to (0.351311,0.057485,0.725730):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.511840,0.019907,0.917154) to (0.411840,0.019907,0.917154):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.617361,0.014689,0.469106) to (0.517361,0.014689,0.469106):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.672422,0.007742,0.348450) to (0.572422,0.007742,0.348450):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.767006,0.023167,0.365872) to (0.667006,0.023167,0.365872):
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.834506,0.073097,0.498144) to (0.734506,0.073097,0.498144):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.920218,0.055930,0.161165) to (0.820218,0.055930,0.161165):
+	Updating Particles positions in local cell 12:
+		Updating particleInCell 0:
+		Changing its coords from (0.051040,0.118217,0.412512) to (-0.048960,0.118217,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.073597,0.144814,0.708363) to (-0.026403,0.144814,0.708363):
+	Updating Particles positions in local cell 13:
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.188268,0.094355,0.813771) to (0.088268,0.094355,0.813771):
+		Updating particleInCell 1:
+		Changing its coords from (0.237018,0.100727,0.063715) to (0.137018,0.100727,0.063715):
+	Updating Particles positions in local cell 15:
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.388116,0.107236,0.789944) to (0.288116,0.107236,0.789944):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.449385,0.095745,0.211121) to (0.349385,0.095745,0.211121):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.509731,0.086098,0.671870) to (0.409731,0.086098,0.671870):
+		Updating particleInCell 1:
+		Changing its coords from (0.577176,0.128907,0.392572) to (0.477176,0.128907,0.392572):
+	Updating Particles positions in local cell 19:
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.729246,0.144943,0.744761) to (0.629246,0.144943,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.749212,0.117057,0.516097) to (0.649212,0.117057,0.516097):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.820799,0.111560,0.881840) to (0.720799,0.111560,0.881840):
+	Updating Particles positions in local cell 22:
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.925617,0.131893,0.684585) to (0.825617,0.131893,0.684585):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.006618,0.176914,0.669197) to (-0.093382,0.176914,0.669197):
+		Updating particleInCell 1:
+		Changing its coords from (0.082432,0.223996,0.379149) to (-0.017568,0.223996,0.379149):
+	Updating Particles positions in local cell 25:
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.179420,0.209246,0.558967) to (0.079420,0.209246,0.558967):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.280429,0.204775,0.925924) to (0.180429,0.204775,0.925924):
+		Updating particleInCell 1:
+		Changing its coords from (0.317008,0.233736,0.757598) to (0.217008,0.233736,0.757598):
+	Updating Particles positions in local cell 28:
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.478434,0.234579,0.751425) to (0.378434,0.234579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.499936,0.213040,0.739388) to (0.399936,0.213040,0.739388):
+	Updating Particles positions in local cell 30:
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.641211,0.200583,0.382567) to (0.541211,0.200583,0.382567):
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.717248,0.240369,0.632784) to (0.617248,0.240369,0.632784):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.750534,0.175532,0.077820) to (0.650534,0.175532,0.077820):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.907569,0.220237,0.185594) to (0.807569,0.220237,0.185594):
+		Updating particleInCell 1:
+		Changing its coords from (0.893245,0.214135,0.582185) to (0.793245,0.214135,0.582185):
+	Updating Particles positions in local cell 35:
+	Updating Particles positions in local cell 36:
+		Updating particleInCell 0:
+		Changing its coords from (0.036213,0.325754,0.451488) to (-0.063787,0.325754,0.451488):
+		Updating particleInCell 1:
+		Changing its coords from (0.079352,0.279855,0.321813) to (-0.020648,0.279855,0.321813):
+	Updating Particles positions in local cell 37:
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.208758,0.296891,0.230269) to (0.108758,0.296891,0.230269):
+		Updating particleInCell 1:
+		Changing its coords from (0.244624,0.253993,0.377044) to (0.144624,0.253993,0.377044):
+	Updating Particles positions in local cell 39:
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.398848,0.305396,0.466709) to (0.298848,0.305396,0.466709):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.481050,0.284045,0.376295) to (0.381050,0.284045,0.376295):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.516190,0.299720,0.774592) to (0.416190,0.299720,0.774592):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.613733,0.289242,0.408698) to (0.513733,0.289242,0.408698):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.731828,0.283468,0.032166) to (0.631828,0.283468,0.032166):
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.785139,0.274493,0.771763) to (0.685139,0.274493,0.771763):
+		Updating particleInCell 1:
+		Changing its coords from (0.818318,0.257582,0.233312) to (0.718318,0.257582,0.233312):
+	Updating Particles positions in local cell 46:
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.965683,0.264829,0.736755) to (0.865683,0.264829,0.736755):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.057951,0.345596,0.126605) to (-0.042049,0.345596,0.126605):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.137365,0.392358,0.316657) to (0.037365,0.392358,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.155175,0.395699,0.170111) to (0.055175,0.395699,0.170111):
+	Updating Particles positions in local cell 50:
+		Updating particleInCell 0:
+		Changing its coords from (0.237709,0.369255,0.860921) to (0.137709,0.369255,0.860921):
+	Updating Particles positions in local cell 51:
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.358807,0.415579,0.711434) to (0.258807,0.415579,0.711434):
+		Updating particleInCell 1:
+		Changing its coords from (0.405346,0.344532,0.516861) to (0.305346,0.344532,0.516861):
+	Updating Particles positions in local cell 53:
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.557111,0.405103,0.724586) to (0.457111,0.405103,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.576621,0.378505,0.483519) to (0.476621,0.378505,0.483519):
+	Updating Particles positions in local cell 55:
+	Updating Particles positions in local cell 56:
+		Updating particleInCell 0:
+		Changing its coords from (0.692326,0.365403,0.929035) to (0.592326,0.365403,0.929035):
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.757797,0.335222,0.991404) to (0.657797,0.335222,0.991404):
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.861117,0.334950,0.115447) to (0.761117,0.334950,0.115447):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.922725,0.362652,0.106081) to (0.822725,0.362652,0.106081):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.032779,0.451592,0.892297) to (-0.067221,0.451592,0.892297):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.135808,0.482726,0.081151) to (0.035808,0.482726,0.081151):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.225043,0.416841,0.137948) to (0.125043,0.416841,0.137948):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.274786,0.449349,0.534845) to (0.174786,0.449349,0.534845):
+		Updating particleInCell 1:
+		Changing its coords from (0.328320,0.434366,0.601838) to (0.228320,0.434366,0.601838):
+	Updating Particles positions in local cell 64:
+		Updating particleInCell 0:
+		Changing its coords from (0.407840,0.436869,0.543898) to (0.307840,0.436869,0.543898):
+	Updating Particles positions in local cell 65:
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.507648,0.494438,0.311891) to (0.407648,0.494438,0.311891):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.646266,0.417322,0.071914) to (0.546266,0.417322,0.071914):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.705396,0.453880,0.262791) to (0.605396,0.453880,0.262791):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.793736,0.446017,0.518640) to (0.693736,0.446017,0.518640):
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.881395,0.469559,0.488147) to (0.781395,0.469559,0.488147):
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.926061,0.422658,0.451692) to (0.826061,0.422658,0.451692):
+	Updating Particles positions in local cell 72:
+		Updating particleInCell 0:
+		Changing its coords from (0.058705,0.524700,0.598479) to (-0.041295,0.524700,0.598479):
+	Updating Particles positions in local cell 73:
+		Updating particleInCell 0:
+		Changing its coords from (0.119183,0.566147,0.810155) to (0.019183,0.566147,0.810155):
+	Updating Particles positions in local cell 74:
+		Updating particleInCell 0:
+		Changing its coords from (0.172347,0.578168,0.153943) to (0.072347,0.578168,0.153943):
+	Updating Particles positions in local cell 75:
+		Updating particleInCell 0:
+		Changing its coords from (0.260453,0.555529,0.280554) to (0.160453,0.555529,0.280554):
+	Updating Particles positions in local cell 76:
+		Updating particleInCell 0:
+		Changing its coords from (0.339431,0.520572,0.006777) to (0.239431,0.520572,0.006777):
+	Updating Particles positions in local cell 77:
+		Updating particleInCell 0:
+		Changing its coords from (0.474892,0.539611,0.863758) to (0.374892,0.539611,0.863758):
+		Updating particleInCell 1:
+		Changing its coords from (0.498551,0.507831,0.392552) to (0.398551,0.507831,0.392552):
+	Updating Particles positions in local cell 78:
+	Updating Particles positions in local cell 79:
+		Updating particleInCell 0:
+		Changing its coords from (0.617884,0.553317,0.094829) to (0.517884,0.553317,0.094829):
+	Updating Particles positions in local cell 80:
+		Updating particleInCell 0:
+		Changing its coords from (0.715318,0.555593,0.307147) to (0.615318,0.555593,0.307147):
+	Updating Particles positions in local cell 81:
+		Updating particleInCell 0:
+		Changing its coords from (0.751093,0.564149,0.760207) to (0.651093,0.564149,0.760207):
+	Updating Particles positions in local cell 82:
+		Updating particleInCell 0:
+		Changing its coords from (0.882854,0.572838,0.228172) to (0.782854,0.572838,0.228172):
+	Updating Particles positions in local cell 83:
+		Updating particleInCell 0:
+		Changing its coords from (0.923555,0.547874,0.464087) to (0.823555,0.547874,0.464087):
+	Updating Particles positions in local cell 84:
+		Updating particleInCell 0:
+		Changing its coords from (0.005332,0.641739,0.534200) to (-0.094668,0.641739,0.534200):
+	Updating Particles positions in local cell 85:
+		Updating particleInCell 0:
+		Changing its coords from (0.091551,0.652676,0.264243) to (-0.008449,0.652676,0.264243):
+		Updating particleInCell 1:
+		Changing its coords from (0.161191,0.584010,0.556690) to (0.061191,0.584010,0.556690):
+	Updating Particles positions in local cell 86:
+	Updating Particles positions in local cell 87:
+		Updating particleInCell 0:
+		Changing its coords from (0.257470,0.665563,0.382487) to (0.157470,0.665563,0.382487):
+	Updating Particles positions in local cell 88:
+		Updating particleInCell 0:
+		Changing its coords from (0.355497,0.617549,0.683248) to (0.255497,0.617549,0.683248):
+	Updating Particles positions in local cell 89:
+		Updating particleInCell 0:
+		Changing its coords from (0.428409,0.630944,0.297079) to (0.328409,0.630944,0.297079):
+		Updating particleInCell 1:
+		Changing its coords from (0.484344,0.651320,0.860231) to (0.384344,0.651320,0.860231):
+	Updating Particles positions in local cell 90:
+	Updating Particles positions in local cell 91:
+		Updating particleInCell 0:
+		Changing its coords from (0.641604,0.635915,0.819066) to (0.541604,0.635915,0.819066):
+		Updating particleInCell 1:
+		Changing its coords from (0.653863,0.593017,0.014169) to (0.553863,0.593017,0.014169):
+	Updating Particles positions in local cell 92:
+		Updating particleInCell 0:
+		Changing its coords from (0.745241,0.632992,0.268398) to (0.645241,0.632992,0.268398):
+	Updating Particles positions in local cell 93:
+	Updating Particles positions in local cell 94:
+		Updating particleInCell 0:
+		Changing its coords from (0.897250,0.617722,0.678490) to (0.797250,0.617722,0.678490):
+	Updating Particles positions in local cell 95:
+		Updating particleInCell 0:
+		Changing its coords from (0.973478,0.609781,0.048507) to (0.873478,0.609781,0.048507):
+	Updating Particles positions in local cell 96:
+		Updating particleInCell 0:
+		Changing its coords from (0.039513,0.710536,0.650537) to (-0.060487,0.710536,0.650537):
+	Updating Particles positions in local cell 97:
+		Updating particleInCell 0:
+		Changing its coords from (0.114507,0.715229,0.172700) to (0.014507,0.715229,0.172700):
+	Updating Particles positions in local cell 98:
+		Updating particleInCell 0:
+		Changing its coords from (0.196771,0.667611,0.503939) to (0.096771,0.667611,0.503939):
+	Updating Particles positions in local cell 99:
+		Updating particleInCell 0:
+		Changing its coords from (0.292519,0.732025,0.786987) to (0.192519,0.732025,0.786987):
+	Updating Particles positions in local cell 100:
+		Updating particleInCell 0:
+		Changing its coords from (0.391157,0.707541,0.740305) to (0.291157,0.707541,0.740305):
+	Updating Particles positions in local cell 101:
+		Updating particleInCell 0:
+		Changing its coords from (0.425149,0.680752,0.710421) to (0.325149,0.680752,0.710421):
+		Updating particleInCell 1:
+		Changing its coords from (0.487566,0.715174,0.131602) to (0.387566,0.715174,0.131602):
+	Updating Particles positions in local cell 102:
+	Updating Particles positions in local cell 103:
+		Updating particleInCell 0:
+		Changing its coords from (0.636450,0.689118,0.078428) to (0.536450,0.689118,0.078428):
+		Updating particleInCell 1:
+		Changing its coords from (0.661120,0.733203,0.312395) to (0.561120,0.733203,0.312395):
+	Updating Particles positions in local cell 104:
+	Updating Particles positions in local cell 105:
+		Updating particleInCell 0:
+		Changing its coords from (0.768448,0.667515,0.129199) to (0.668448,0.667515,0.129199):
+	Updating Particles positions in local cell 106:
+		Updating particleInCell 0:
+		Changing its coords from (0.853746,0.700469,0.362601) to (0.753746,0.700469,0.362601):
+	Updating Particles positions in local cell 107:
+		Updating particleInCell 0:
+		Changing its coords from (0.931526,0.688006,0.805419) to (0.831526,0.688006,0.805419):
+	Updating Particles positions in local cell 108:
+		Updating particleInCell 0:
+		Changing its coords from (0.051410,0.750586,0.148631) to (-0.048590,0.750586,0.148631):
+		Updating particleInCell 1:
+		Changing its coords from (0.070484,0.829588,0.587796) to (-0.029516,0.829588,0.587796):
+	Updating Particles positions in local cell 109:
+		Updating particleInCell 0:
+		Changing its coords from (0.157384,0.761885,0.111413) to (0.057384,0.761885,0.111413):
+	Updating Particles positions in local cell 110:
+	Updating Particles positions in local cell 111:
+		Updating particleInCell 0:
+		Changing its coords from (0.275867,0.782017,0.263024) to (0.175867,0.782017,0.263024):
+	Updating Particles positions in local cell 112:
+		Updating particleInCell 0:
+		Changing its coords from (0.370813,0.785118,0.832115) to (0.270813,0.785118,0.832115):
+	Updating Particles positions in local cell 113:
+		Updating particleInCell 0:
+		Changing its coords from (0.429937,0.822625,0.301131) to (0.329937,0.822625,0.301131):
+		Updating particleInCell 1:
+		Changing its coords from (0.492553,0.795928,0.932317) to (0.392553,0.795928,0.932317):
+	Updating Particles positions in local cell 114:
+	Updating Particles positions in local cell 115:
+		Updating particleInCell 0:
+		Changing its coords from (0.604757,0.767063,0.389654) to (0.504757,0.767063,0.389654):
+	Updating Particles positions in local cell 116:
+		Updating particleInCell 0:
+		Changing its coords from (0.726693,0.806052,0.766668) to (0.626693,0.806052,0.766668):
+	Updating Particles positions in local cell 117:
+		Updating particleInCell 0:
+		Changing its coords from (0.765451,0.806915,0.786630) to (0.665451,0.806915,0.786630):
+	Updating Particles positions in local cell 118:
+		Updating particleInCell 0:
+		Changing its coords from (0.890906,0.831802,0.079259) to (0.790906,0.831802,0.079259):
+	Updating Particles positions in local cell 119:
+		Updating particleInCell 0:
+		Changing its coords from (0.919869,0.771640,0.405653) to (0.819869,0.771640,0.405653):
+	Updating Particles positions in local cell 120:
+		Updating particleInCell 0:
+		Changing its coords from (0.045677,0.894197,0.164508) to (-0.054323,0.894197,0.164508):
+	Updating Particles positions in local cell 121:
+		Updating particleInCell 0:
+		Changing its coords from (0.140690,0.862953,0.774475) to (0.040690,0.862953,0.774475):
+	Updating Particles positions in local cell 122:
+		Updating particleInCell 0:
+		Changing its coords from (0.200064,0.849542,0.008698) to (0.100064,0.849542,0.008698):
+		Updating particleInCell 1:
+		Changing its coords from (0.249165,0.916347,0.443317) to (0.149165,0.916347,0.443317):
+	Updating Particles positions in local cell 123:
+	Updating Particles positions in local cell 124:
+		Updating particleInCell 0:
+		Changing its coords from (0.385189,0.906007,0.018015) to (0.285189,0.906007,0.018015):
+	Updating Particles positions in local cell 125:
+		Updating particleInCell 0:
+		Changing its coords from (0.464356,0.885679,0.214158) to (0.364356,0.885679,0.214158):
+	Updating Particles positions in local cell 126:
+		Updating particleInCell 0:
+		Changing its coords from (0.512505,0.876272,0.962228) to (0.412505,0.876272,0.962228):
+		Updating particleInCell 1:
+		Changing its coords from (0.580133,0.906697,0.274473) to (0.480133,0.906697,0.274473):
+	Updating Particles positions in local cell 127:
+		Updating particleInCell 0:
+		Changing its coords from (0.656186,0.892969,0.628853) to (0.556186,0.892969,0.628853):
+	Updating Particles positions in local cell 128:
+		Updating particleInCell 0:
+		Changing its coords from (0.744726,0.887403,0.062195) to (0.644726,0.887403,0.062195):
+	Updating Particles positions in local cell 129:
+	Updating Particles positions in local cell 130:
+		Updating particleInCell 0:
+		Changing its coords from (0.908471,0.870356,0.978446) to (0.808471,0.870356,0.978446):
+		Updating particleInCell 1:
+		Changing its coords from (0.843125,0.848438,0.363551) to (0.743125,0.848438,0.363551):
+	Updating Particles positions in local cell 131:
+	Updating Particles positions in local cell 132:
+		Updating particleInCell 0:
+		Changing its coords from (0.063505,0.941543,0.200554) to (-0.036495,0.941543,0.200554):
+	Updating Particles positions in local cell 133:
+		Updating particleInCell 0:
+		Changing its coords from (0.126091,0.987365,0.673773) to (0.026091,0.987365,0.673773):
+		Updating particleInCell 1:
+		Changing its coords from (0.158623,0.923919,0.642657) to (0.058623,0.923919,0.642657):
+	Updating Particles positions in local cell 134:
+		Updating particleInCell 0:
+		Changing its coords from (0.244486,0.935294,0.917260) to (0.144486,0.935294,0.917260):
+	Updating Particles positions in local cell 135:
+	Updating Particles positions in local cell 136:
+		Updating particleInCell 0:
+		Changing its coords from (0.349055,0.927436,0.056589) to (0.249055,0.927436,0.056589):
+		Updating particleInCell 1:
+		Changing its coords from (0.406981,0.993211,0.746238) to (0.306981,0.993211,0.746238):
+	Updating Particles positions in local cell 137:
+		Updating particleInCell 0:
+		Changing its coords from (0.484940,0.922172,0.353679) to (0.384940,0.922172,0.353679):
+	Updating Particles positions in local cell 138:
+	Updating Particles positions in local cell 139:
+		Updating particleInCell 0:
+		Changing its coords from (0.590388,0.930229,0.295629) to (0.490388,0.930229,0.295629):
+	Updating Particles positions in local cell 140:
+		Updating particleInCell 0:
+		Changing its coords from (0.703534,0.998106,0.030401) to (0.603534,0.998106,0.030401):
+	Updating Particles positions in local cell 141:
+		Updating particleInCell 0:
+		Changing its coords from (0.812755,0.928183,0.580515) to (0.712755,0.928183,0.580515):
+	Updating Particles positions in local cell 142:
+		Updating particleInCell 0:
+		Changing its coords from (0.916334,0.947029,0.632948) to (0.816334,0.947029,0.632948):
+		Updating particleInCell 1:
+		Changing its coords from (0.875714,0.989690,0.582861) to (0.775714,0.989690,0.582861):
+	Updating Particles positions in local cell 143:
+
+Updating periodic BCs
+
+Starting timestep 3:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.026628,0.013305,0.428316) to (-0.073372,0.013305,0.428316):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.108700,0.070846,0.484961) to (0.008700,0.070846,0.484961):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.195513,0.054303,0.100663) to (0.095513,0.054303,0.100663):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.286236,0.007617,0.153544) to (0.186236,0.007617,0.153544):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.351311,0.057485,0.725730) to (0.251311,0.057485,0.725730):
+		Updating particleInCell 1:
+		Changing its coords from (0.411840,0.019907,0.917154) to (0.311840,0.019907,0.917154):
+	Updating Particles positions in local cell 5:
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.517361,0.014689,0.469106) to (0.417361,0.014689,0.469106):
+		Updating particleInCell 1:
+		Changing its coords from (0.572422,0.007742,0.348450) to (0.472422,0.007742,0.348450):
+	Updating Particles positions in local cell 7:
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.667006,0.023167,0.365872) to (0.567006,0.023167,0.365872):
+		Updating particleInCell 1:
+		Changing its coords from (0.734506,0.073097,0.498144) to (0.634506,0.073097,0.498144):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.820218,0.055930,0.161165) to (0.720218,0.055930,0.161165):
+	Updating Particles positions in local cell 10:
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.942325,0.060967,0.087923) to (0.842325,0.060967,0.087923):
+	Updating Particles positions in local cell 12:
+	Updating Particles positions in local cell 13:
+		Updating particleInCell 0:
+		Changing its coords from (0.088268,0.094355,0.813771) to (-0.011732,0.094355,0.813771):
+		Updating particleInCell 1:
+		Changing its coords from (0.137018,0.100727,0.063715) to (0.037018,0.100727,0.063715):
+	Updating Particles positions in local cell 14:
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.288116,0.107236,0.789944) to (0.188116,0.107236,0.789944):
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.349385,0.095745,0.211121) to (0.249385,0.095745,0.211121):
+		Updating particleInCell 1:
+		Changing its coords from (0.409731,0.086098,0.671870) to (0.309731,0.086098,0.671870):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.477176,0.128907,0.392572) to (0.377176,0.128907,0.392572):
+	Updating Particles positions in local cell 18:
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.629246,0.144943,0.744761) to (0.529246,0.144943,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.649212,0.117057,0.516097) to (0.549212,0.117057,0.516097):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.720799,0.111560,0.881840) to (0.620799,0.111560,0.881840):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.825617,0.131893,0.684585) to (0.725617,0.131893,0.684585):
+	Updating Particles positions in local cell 22:
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.951040,0.118217,0.412512) to (0.851040,0.118217,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.973597,0.144814,0.708363) to (0.873597,0.144814,0.708363):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.079420,0.209246,0.558967) to (-0.020580,0.209246,0.558967):
+	Updating Particles positions in local cell 25:
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.180429,0.204775,0.925924) to (0.080429,0.204775,0.925924):
+		Updating particleInCell 1:
+		Changing its coords from (0.217008,0.233736,0.757598) to (0.117008,0.233736,0.757598):
+	Updating Particles positions in local cell 27:
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.378434,0.234579,0.751425) to (0.278434,0.234579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.399936,0.213040,0.739388) to (0.299936,0.213040,0.739388):
+	Updating Particles positions in local cell 29:
+	Updating Particles positions in local cell 30:
+		Updating particleInCell 0:
+		Changing its coords from (0.541211,0.200583,0.382567) to (0.441211,0.200583,0.382567):
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.617248,0.240369,0.632784) to (0.517248,0.240369,0.632784):
+		Updating particleInCell 1:
+		Changing its coords from (0.650534,0.175532,0.077820) to (0.550534,0.175532,0.077820):
+	Updating Particles positions in local cell 32:
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.807569,0.220237,0.185594) to (0.707569,0.220237,0.185594):
+		Updating particleInCell 1:
+		Changing its coords from (0.793245,0.214135,0.582185) to (0.693245,0.214135,0.582185):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.906618,0.176914,0.669197) to (0.806618,0.176914,0.669197):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.982432,0.223996,0.379149) to (0.882432,0.223996,0.379149):
+	Updating Particles positions in local cell 36:
+	Updating Particles positions in local cell 37:
+		Updating particleInCell 0:
+		Changing its coords from (0.108758,0.296891,0.230269) to (0.008758,0.296891,0.230269):
+		Updating particleInCell 1:
+		Changing its coords from (0.144624,0.253993,0.377044) to (0.044624,0.253993,0.377044):
+	Updating Particles positions in local cell 38:
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.298848,0.305396,0.466709) to (0.198848,0.305396,0.466709):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.381050,0.284045,0.376295) to (0.281050,0.284045,0.376295):
+		Updating particleInCell 1:
+		Changing its coords from (0.416190,0.299720,0.774592) to (0.316190,0.299720,0.774592):
+	Updating Particles positions in local cell 41:
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.513733,0.289242,0.408698) to (0.413733,0.289242,0.408698):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.631828,0.283468,0.032166) to (0.531828,0.283468,0.032166):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.685139,0.274493,0.771763) to (0.585139,0.274493,0.771763):
+		Updating particleInCell 1:
+		Changing its coords from (0.718318,0.257582,0.233312) to (0.618318,0.257582,0.233312):
+	Updating Particles positions in local cell 45:
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.865683,0.264829,0.736755) to (0.765683,0.264829,0.736755):
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.936213,0.325754,0.451488) to (0.836213,0.325754,0.451488):
+		Updating particleInCell 1:
+		Changing its coords from (0.979352,0.279855,0.321813) to (0.879352,0.279855,0.321813):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.037365,0.392358,0.316657) to (-0.062635,0.392358,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.055175,0.395699,0.170111) to (-0.044825,0.395699,0.170111):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.137709,0.369255,0.860921) to (0.037709,0.369255,0.860921):
+	Updating Particles positions in local cell 50:
+	Updating Particles positions in local cell 51:
+		Updating particleInCell 0:
+		Changing its coords from (0.258807,0.415579,0.711434) to (0.158807,0.415579,0.711434):
+		Updating particleInCell 1:
+		Changing its coords from (0.305346,0.344532,0.516861) to (0.205346,0.344532,0.516861):
+	Updating Particles positions in local cell 52:
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.457111,0.405103,0.724586) to (0.357111,0.405103,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.476621,0.378505,0.483519) to (0.376621,0.378505,0.483519):
+	Updating Particles positions in local cell 54:
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.592326,0.365403,0.929035) to (0.492326,0.365403,0.929035):
+		Updating particleInCell 1:
+		Changing its coords from (0.657797,0.335222,0.991404) to (0.557797,0.335222,0.991404):
+	Updating Particles positions in local cell 56:
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.822725,0.362652,0.106081) to (0.722725,0.362652,0.106081):
+		Updating particleInCell 1:
+		Changing its coords from (0.761117,0.334950,0.115447) to (0.661117,0.334950,0.115447):
+	Updating Particles positions in local cell 58:
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.957951,0.345596,0.126605) to (0.857951,0.345596,0.126605):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.035808,0.482726,0.081151) to (-0.064192,0.482726,0.081151):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.125043,0.416841,0.137948) to (0.025043,0.416841,0.137948):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.174786,0.449349,0.534845) to (0.074786,0.449349,0.534845):
+		Updating particleInCell 1:
+		Changing its coords from (0.228320,0.434366,0.601838) to (0.128320,0.434366,0.601838):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.307840,0.436869,0.543898) to (0.207840,0.436869,0.543898):
+	Updating Particles positions in local cell 64:
+		Updating particleInCell 0:
+		Changing its coords from (0.407648,0.494438,0.311891) to (0.307648,0.494438,0.311891):
+	Updating Particles positions in local cell 65:
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.546266,0.417322,0.071914) to (0.446266,0.417322,0.071914):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.605396,0.453880,0.262791) to (0.505396,0.453880,0.262791):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.693736,0.446017,0.518640) to (0.593736,0.446017,0.518640):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.826061,0.422658,0.451692) to (0.726061,0.422658,0.451692):
+		Updating particleInCell 1:
+		Changing its coords from (0.781395,0.469559,0.488147) to (0.681395,0.469559,0.488147):
+	Updating Particles positions in local cell 70:
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.932779,0.451592,0.892297) to (0.832779,0.451592,0.892297):
+	Updating Particles positions in local cell 72:
+		Updating particleInCell 0:
+		Changing its coords from (0.019183,0.566147,0.810155) to (-0.080817,0.566147,0.810155):
+		Updating particleInCell 1:
+		Changing its coords from (0.072347,0.578168,0.153943) to (-0.027653,0.578168,0.153943):
+	Updating Particles positions in local cell 73:
+		Updating particleInCell 0:
+		Changing its coords from (0.160453,0.555529,0.280554) to (0.060453,0.555529,0.280554):
+	Updating Particles positions in local cell 74:
+		Updating particleInCell 0:
+		Changing its coords from (0.239431,0.520572,0.006777) to (0.139431,0.520572,0.006777):
+	Updating Particles positions in local cell 75:
+	Updating Particles positions in local cell 76:
+		Updating particleInCell 0:
+		Changing its coords from (0.374892,0.539611,0.863758) to (0.274892,0.539611,0.863758):
+		Updating particleInCell 1:
+		Changing its coords from (0.398551,0.507831,0.392552) to (0.298551,0.507831,0.392552):
+	Updating Particles positions in local cell 77:
+	Updating Particles positions in local cell 78:
+		Updating particleInCell 0:
+		Changing its coords from (0.517884,0.553317,0.094829) to (0.417884,0.553317,0.094829):
+	Updating Particles positions in local cell 79:
+		Updating particleInCell 0:
+		Changing its coords from (0.615318,0.555593,0.307147) to (0.515318,0.555593,0.307147):
+		Updating particleInCell 1:
+		Changing its coords from (0.651093,0.564149,0.760207) to (0.551093,0.564149,0.760207):
+	Updating Particles positions in local cell 80:
+	Updating Particles positions in local cell 81:
+		Updating particleInCell 0:
+		Changing its coords from (0.823555,0.547874,0.464087) to (0.723555,0.547874,0.464087):
+		Updating particleInCell 1:
+		Changing its coords from (0.782854,0.572838,0.228172) to (0.682854,0.572838,0.228172):
+	Updating Particles positions in local cell 82:
+	Updating Particles positions in local cell 83:
+		Updating particleInCell 0:
+		Changing its coords from (0.958705,0.524700,0.598479) to (0.858705,0.524700,0.598479):
+	Updating Particles positions in local cell 84:
+		Updating particleInCell 0:
+		Changing its coords from (0.061191,0.584010,0.556690) to (-0.038809,0.584010,0.556690):
+	Updating Particles positions in local cell 85:
+		Updating particleInCell 0:
+		Changing its coords from (0.157470,0.665563,0.382487) to (0.057470,0.665563,0.382487):
+	Updating Particles positions in local cell 86:
+	Updating Particles positions in local cell 87:
+		Updating particleInCell 0:
+		Changing its coords from (0.255497,0.617549,0.683248) to (0.155497,0.617549,0.683248):
+		Updating particleInCell 1:
+		Changing its coords from (0.328409,0.630944,0.297079) to (0.228409,0.630944,0.297079):
+	Updating Particles positions in local cell 88:
+		Updating particleInCell 0:
+		Changing its coords from (0.384344,0.651320,0.860231) to (0.284344,0.651320,0.860231):
+	Updating Particles positions in local cell 89:
+	Updating Particles positions in local cell 90:
+		Updating particleInCell 0:
+		Changing its coords from (0.541604,0.635915,0.819066) to (0.441604,0.635915,0.819066):
+		Updating particleInCell 1:
+		Changing its coords from (0.553863,0.593017,0.014169) to (0.453863,0.593017,0.014169):
+	Updating Particles positions in local cell 91:
+		Updating particleInCell 0:
+		Changing its coords from (0.645241,0.632992,0.268398) to (0.545241,0.632992,0.268398):
+	Updating Particles positions in local cell 92:
+	Updating Particles positions in local cell 93:
+		Updating particleInCell 0:
+		Changing its coords from (0.797250,0.617722,0.678490) to (0.697250,0.617722,0.678490):
+	Updating Particles positions in local cell 94:
+		Updating particleInCell 0:
+		Changing its coords from (0.905332,0.641739,0.534200) to (0.805332,0.641739,0.534200):
+		Updating particleInCell 1:
+		Changing its coords from (0.873478,0.609781,0.048507) to (0.773478,0.609781,0.048507):
+	Updating Particles positions in local cell 95:
+		Updating particleInCell 0:
+		Changing its coords from (0.991551,0.652676,0.264243) to (0.891551,0.652676,0.264243):
+	Updating Particles positions in local cell 96:
+		Updating particleInCell 0:
+		Changing its coords from (0.014507,0.715229,0.172700) to (-0.085493,0.715229,0.172700):
+	Updating Particles positions in local cell 97:
+		Updating particleInCell 0:
+		Changing its coords from (0.096771,0.667611,0.503939) to (-0.003229,0.667611,0.503939):
+	Updating Particles positions in local cell 98:
+		Updating particleInCell 0:
+		Changing its coords from (0.192519,0.732025,0.786987) to (0.092519,0.732025,0.786987):
+	Updating Particles positions in local cell 99:
+		Updating particleInCell 0:
+		Changing its coords from (0.291157,0.707541,0.740305) to (0.191157,0.707541,0.740305):
+		Updating particleInCell 1:
+		Changing its coords from (0.325149,0.680752,0.710421) to (0.225149,0.680752,0.710421):
+	Updating Particles positions in local cell 100:
+		Updating particleInCell 0:
+		Changing its coords from (0.387566,0.715174,0.131602) to (0.287566,0.715174,0.131602):
+	Updating Particles positions in local cell 101:
+	Updating Particles positions in local cell 102:
+		Updating particleInCell 0:
+		Changing its coords from (0.536450,0.689118,0.078428) to (0.436450,0.689118,0.078428):
+		Updating particleInCell 1:
+		Changing its coords from (0.561120,0.733203,0.312395) to (0.461120,0.733203,0.312395):
+	Updating Particles positions in local cell 103:
+	Updating Particles positions in local cell 104:
+		Updating particleInCell 0:
+		Changing its coords from (0.668448,0.667515,0.129199) to (0.568448,0.667515,0.129199):
+	Updating Particles positions in local cell 105:
+		Updating particleInCell 0:
+		Changing its coords from (0.831526,0.688006,0.805419) to (0.731526,0.688006,0.805419):
+		Updating particleInCell 1:
+		Changing its coords from (0.753746,0.700469,0.362601) to (0.653746,0.700469,0.362601):
+	Updating Particles positions in local cell 106:
+	Updating Particles positions in local cell 107:
+		Updating particleInCell 0:
+		Changing its coords from (0.939513,0.710536,0.650537) to (0.839513,0.710536,0.650537):
+	Updating Particles positions in local cell 108:
+		Updating particleInCell 0:
+		Changing its coords from (0.057384,0.761885,0.111413) to (-0.042616,0.761885,0.111413):
+	Updating Particles positions in local cell 109:
+	Updating Particles positions in local cell 110:
+		Updating particleInCell 0:
+		Changing its coords from (0.175867,0.782017,0.263024) to (0.075867,0.782017,0.263024):
+	Updating Particles positions in local cell 111:
+		Updating particleInCell 0:
+		Changing its coords from (0.270813,0.785118,0.832115) to (0.170813,0.785118,0.832115):
+		Updating particleInCell 1:
+		Changing its coords from (0.329937,0.822625,0.301131) to (0.229937,0.822625,0.301131):
+	Updating Particles positions in local cell 112:
+		Updating particleInCell 0:
+		Changing its coords from (0.392553,0.795928,0.932317) to (0.292553,0.795928,0.932317):
+	Updating Particles positions in local cell 113:
+	Updating Particles positions in local cell 114:
+		Updating particleInCell 0:
+		Changing its coords from (0.504757,0.767063,0.389654) to (0.404757,0.767063,0.389654):
+	Updating Particles positions in local cell 115:
+		Updating particleInCell 0:
+		Changing its coords from (0.626693,0.806052,0.766668) to (0.526693,0.806052,0.766668):
+		Updating particleInCell 1:
+		Changing its coords from (0.665451,0.806915,0.786630) to (0.565451,0.806915,0.786630):
+	Updating Particles positions in local cell 116:
+	Updating Particles positions in local cell 117:
+		Updating particleInCell 0:
+		Changing its coords from (0.819869,0.771640,0.405653) to (0.719869,0.771640,0.405653):
+		Updating particleInCell 1:
+		Changing its coords from (0.790906,0.831802,0.079259) to (0.690906,0.831802,0.079259):
+	Updating Particles positions in local cell 118:
+	Updating Particles positions in local cell 119:
+		Updating particleInCell 0:
+		Changing its coords from (0.951410,0.750586,0.148631) to (0.851410,0.750586,0.148631):
+		Updating particleInCell 1:
+		Changing its coords from (0.970484,0.829588,0.587796) to (0.870484,0.829588,0.587796):
+	Updating Particles positions in local cell 120:
+		Updating particleInCell 0:
+		Changing its coords from (0.040690,0.862953,0.774475) to (-0.059310,0.862953,0.774475):
+	Updating Particles positions in local cell 121:
+		Updating particleInCell 0:
+		Changing its coords from (0.100064,0.849542,0.008698) to (0.000064,0.849542,0.008698):
+		Updating particleInCell 1:
+		Changing its coords from (0.149165,0.916347,0.443317) to (0.049165,0.916347,0.443317):
+	Updating Particles positions in local cell 122:
+	Updating Particles positions in local cell 123:
+		Updating particleInCell 0:
+		Changing its coords from (0.285189,0.906007,0.018015) to (0.185189,0.906007,0.018015):
+	Updating Particles positions in local cell 124:
+		Updating particleInCell 0:
+		Changing its coords from (0.364356,0.885679,0.214158) to (0.264356,0.885679,0.214158):
+		Updating particleInCell 1:
+		Changing its coords from (0.412505,0.876272,0.962228) to (0.312505,0.876272,0.962228):
+	Updating Particles positions in local cell 125:
+		Updating particleInCell 0:
+		Changing its coords from (0.480133,0.906697,0.274473) to (0.380133,0.906697,0.274473):
+	Updating Particles positions in local cell 126:
+		Updating particleInCell 0:
+		Changing its coords from (0.556186,0.892969,0.628853) to (0.456186,0.892969,0.628853):
+	Updating Particles positions in local cell 127:
+		Updating particleInCell 0:
+		Changing its coords from (0.644726,0.887403,0.062195) to (0.544726,0.887403,0.062195):
+	Updating Particles positions in local cell 128:
+		Updating particleInCell 0:
+		Changing its coords from (0.743125,0.848438,0.363551) to (0.643125,0.848438,0.363551):
+	Updating Particles positions in local cell 129:
+		Updating particleInCell 0:
+		Changing its coords from (0.808471,0.870356,0.978446) to (0.708471,0.870356,0.978446):
+	Updating Particles positions in local cell 130:
+	Updating Particles positions in local cell 131:
+		Updating particleInCell 0:
+		Changing its coords from (0.945677,0.894197,0.164508) to (0.845677,0.894197,0.164508):
+	Updating Particles positions in local cell 132:
+		Updating particleInCell 0:
+		Changing its coords from (0.026091,0.987365,0.673773) to (-0.073909,0.987365,0.673773):
+		Updating particleInCell 1:
+		Changing its coords from (0.058623,0.923919,0.642657) to (-0.041377,0.923919,0.642657):
+	Updating Particles positions in local cell 133:
+		Updating particleInCell 0:
+		Changing its coords from (0.144486,0.935294,0.917260) to (0.044486,0.935294,0.917260):
+	Updating Particles positions in local cell 134:
+		Updating particleInCell 0:
+		Changing its coords from (0.249055,0.927436,0.056589) to (0.149055,0.927436,0.056589):
+	Updating Particles positions in local cell 135:
+		Updating particleInCell 0:
+		Changing its coords from (0.306981,0.993211,0.746238) to (0.206981,0.993211,0.746238):
+	Updating Particles positions in local cell 136:
+		Updating particleInCell 0:
+		Changing its coords from (0.384940,0.922172,0.353679) to (0.284940,0.922172,0.353679):
+	Updating Particles positions in local cell 137:
+		Updating particleInCell 0:
+		Changing its coords from (0.490388,0.930229,0.295629) to (0.390388,0.930229,0.295629):
+	Updating Particles positions in local cell 138:
+	Updating Particles positions in local cell 139:
+		Updating particleInCell 0:
+		Changing its coords from (0.603534,0.998106,0.030401) to (0.503534,0.998106,0.030401):
+	Updating Particles positions in local cell 140:
+		Updating particleInCell 0:
+		Changing its coords from (0.712755,0.928183,0.580515) to (0.612755,0.928183,0.580515):
+	Updating Particles positions in local cell 141:
+		Updating particleInCell 0:
+		Changing its coords from (0.816334,0.947029,0.632948) to (0.716334,0.947029,0.632948):
+		Updating particleInCell 1:
+		Changing its coords from (0.775714,0.989690,0.582861) to (0.675714,0.989690,0.582861):
+	Updating Particles positions in local cell 142:
+	Updating Particles positions in local cell 143:
+		Updating particleInCell 0:
+		Changing its coords from (0.963505,0.941543,0.200554) to (0.863505,0.941543,0.200554):
+
+Updating periodic BCs
+
+Starting timestep 4:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.008700,0.070846,0.484961) to (-0.091300,0.070846,0.484961):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.095513,0.054303,0.100663) to (-0.004487,0.054303,0.100663):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.186236,0.007617,0.153544) to (0.086236,0.007617,0.153544):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.251311,0.057485,0.725730) to (0.151311,0.057485,0.725730):
+		Updating particleInCell 1:
+		Changing its coords from (0.311840,0.019907,0.917154) to (0.211840,0.019907,0.917154):
+	Updating Particles positions in local cell 4:
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.417361,0.014689,0.469106) to (0.317361,0.014689,0.469106):
+		Updating particleInCell 1:
+		Changing its coords from (0.472422,0.007742,0.348450) to (0.372422,0.007742,0.348450):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.567006,0.023167,0.365872) to (0.467006,0.023167,0.365872):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.634506,0.073097,0.498144) to (0.534506,0.073097,0.498144):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.720218,0.055930,0.161165) to (0.620218,0.055930,0.161165):
+	Updating Particles positions in local cell 9:
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.842325,0.060967,0.087923) to (0.742325,0.060967,0.087923):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.926628,0.013305,0.428316) to (0.826628,0.013305,0.428316):
+	Updating Particles positions in local cell 12:
+		Updating particleInCell 0:
+		Changing its coords from (0.037018,0.100727,0.063715) to (-0.062982,0.100727,0.063715):
+	Updating Particles positions in local cell 13:
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.188116,0.107236,0.789944) to (0.088116,0.107236,0.789944):
+		Updating particleInCell 1:
+		Changing its coords from (0.249385,0.095745,0.211121) to (0.149385,0.095745,0.211121):
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.309731,0.086098,0.671870) to (0.209731,0.086098,0.671870):
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.377176,0.128907,0.392572) to (0.277176,0.128907,0.392572):
+	Updating Particles positions in local cell 17:
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.529246,0.144943,0.744761) to (0.429246,0.144943,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.549212,0.117057,0.516097) to (0.449212,0.117057,0.516097):
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.620799,0.111560,0.881840) to (0.520799,0.111560,0.881840):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.725617,0.131893,0.684585) to (0.625617,0.131893,0.684585):
+	Updating Particles positions in local cell 21:
+	Updating Particles positions in local cell 22:
+		Updating particleInCell 0:
+		Changing its coords from (0.851040,0.118217,0.412512) to (0.751040,0.118217,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.873597,0.144814,0.708363) to (0.773597,0.144814,0.708363):
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.988268,0.094355,0.813771) to (0.888268,0.094355,0.813771):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.080429,0.204775,0.925924) to (-0.019571,0.204775,0.925924):
+	Updating Particles positions in local cell 25:
+		Updating particleInCell 0:
+		Changing its coords from (0.117008,0.233736,0.757598) to (0.017008,0.233736,0.757598):
+	Updating Particles positions in local cell 26:
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.278434,0.234579,0.751425) to (0.178434,0.234579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.299936,0.213040,0.739388) to (0.199936,0.213040,0.739388):
+	Updating Particles positions in local cell 28:
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.441211,0.200583,0.382567) to (0.341211,0.200583,0.382567):
+	Updating Particles positions in local cell 30:
+		Updating particleInCell 0:
+		Changing its coords from (0.517248,0.240369,0.632784) to (0.417248,0.240369,0.632784):
+		Updating particleInCell 1:
+		Changing its coords from (0.550534,0.175532,0.077820) to (0.450534,0.175532,0.077820):
+	Updating Particles positions in local cell 31:
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.707569,0.220237,0.185594) to (0.607569,0.220237,0.185594):
+		Updating particleInCell 1:
+		Changing its coords from (0.693245,0.214135,0.582185) to (0.593245,0.214135,0.582185):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.806618,0.176914,0.669197) to (0.706618,0.176914,0.669197):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.882432,0.223996,0.379149) to (0.782432,0.223996,0.379149):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.979420,0.209246,0.558967) to (0.879420,0.209246,0.558967):
+	Updating Particles positions in local cell 36:
+		Updating particleInCell 0:
+		Changing its coords from (0.008758,0.296891,0.230269) to (-0.091242,0.296891,0.230269):
+		Updating particleInCell 1:
+		Changing its coords from (0.044624,0.253993,0.377044) to (-0.055376,0.253993,0.377044):
+	Updating Particles positions in local cell 37:
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.198848,0.305396,0.466709) to (0.098848,0.305396,0.466709):
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.281050,0.284045,0.376295) to (0.181050,0.284045,0.376295):
+		Updating particleInCell 1:
+		Changing its coords from (0.316190,0.299720,0.774592) to (0.216190,0.299720,0.774592):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.413733,0.289242,0.408698) to (0.313733,0.289242,0.408698):
+	Updating Particles positions in local cell 41:
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.531828,0.283468,0.032166) to (0.431828,0.283468,0.032166):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.585139,0.274493,0.771763) to (0.485139,0.274493,0.771763):
+		Updating particleInCell 1:
+		Changing its coords from (0.618318,0.257582,0.233312) to (0.518318,0.257582,0.233312):
+	Updating Particles positions in local cell 44:
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.765683,0.264829,0.736755) to (0.665683,0.264829,0.736755):
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.836213,0.325754,0.451488) to (0.736213,0.325754,0.451488):
+		Updating particleInCell 1:
+		Changing its coords from (0.879352,0.279855,0.321813) to (0.779352,0.279855,0.321813):
+	Updating Particles positions in local cell 47:
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.037709,0.369255,0.860921) to (-0.062291,0.369255,0.860921):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.158807,0.415579,0.711434) to (0.058807,0.415579,0.711434):
+	Updating Particles positions in local cell 50:
+		Updating particleInCell 0:
+		Changing its coords from (0.205346,0.344532,0.516861) to (0.105346,0.344532,0.516861):
+	Updating Particles positions in local cell 51:
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.357111,0.405103,0.724586) to (0.257111,0.405103,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.376621,0.378505,0.483519) to (0.276621,0.378505,0.483519):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.492326,0.365403,0.929035) to (0.392326,0.365403,0.929035):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.557797,0.335222,0.991404) to (0.457797,0.335222,0.991404):
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.661117,0.334950,0.115447) to (0.561117,0.334950,0.115447):
+	Updating Particles positions in local cell 56:
+		Updating particleInCell 0:
+		Changing its coords from (0.722725,0.362652,0.106081) to (0.622725,0.362652,0.106081):
+	Updating Particles positions in local cell 57:
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.857951,0.345596,0.126605) to (0.757951,0.345596,0.126605):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.937365,0.392358,0.316657) to (0.837365,0.392358,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.955175,0.395699,0.170111) to (0.855175,0.395699,0.170111):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.025043,0.416841,0.137948) to (-0.074957,0.416841,0.137948):
+		Updating particleInCell 1:
+		Changing its coords from (0.074786,0.449349,0.534845) to (-0.025214,0.449349,0.534845):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.128320,0.434366,0.601838) to (0.028320,0.434366,0.601838):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.207840,0.436869,0.543898) to (0.107840,0.436869,0.543898):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.307648,0.494438,0.311891) to (0.207648,0.494438,0.311891):
+	Updating Particles positions in local cell 64:
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.446266,0.417322,0.071914) to (0.346266,0.417322,0.071914):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.505396,0.453880,0.262791) to (0.405396,0.453880,0.262791):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.593736,0.446017,0.518640) to (0.493736,0.446017,0.518640):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.726061,0.422658,0.451692) to (0.626061,0.422658,0.451692):
+		Updating particleInCell 1:
+		Changing its coords from (0.681395,0.469559,0.488147) to (0.581395,0.469559,0.488147):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.832779,0.451592,0.892297) to (0.732779,0.451592,0.892297):
+	Updating Particles positions in local cell 70:
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.935808,0.482726,0.081151) to (0.835808,0.482726,0.081151):
+	Updating Particles positions in local cell 72:
+		Updating particleInCell 0:
+		Changing its coords from (0.060453,0.555529,0.280554) to (-0.039547,0.555529,0.280554):
+	Updating Particles positions in local cell 73:
+		Updating particleInCell 0:
+		Changing its coords from (0.139431,0.520572,0.006777) to (0.039431,0.520572,0.006777):
+	Updating Particles positions in local cell 74:
+	Updating Particles positions in local cell 75:
+		Updating particleInCell 0:
+		Changing its coords from (0.274892,0.539611,0.863758) to (0.174892,0.539611,0.863758):
+		Updating particleInCell 1:
+		Changing its coords from (0.298551,0.507831,0.392552) to (0.198551,0.507831,0.392552):
+	Updating Particles positions in local cell 76:
+	Updating Particles positions in local cell 77:
+		Updating particleInCell 0:
+		Changing its coords from (0.417884,0.553317,0.094829) to (0.317884,0.553317,0.094829):
+	Updating Particles positions in local cell 78:
+		Updating particleInCell 0:
+		Changing its coords from (0.515318,0.555593,0.307147) to (0.415318,0.555593,0.307147):
+		Updating particleInCell 1:
+		Changing its coords from (0.551093,0.564149,0.760207) to (0.451093,0.564149,0.760207):
+	Updating Particles positions in local cell 79:
+	Updating Particles positions in local cell 80:
+		Updating particleInCell 0:
+		Changing its coords from (0.723555,0.547874,0.464087) to (0.623555,0.547874,0.464087):
+		Updating particleInCell 1:
+		Changing its coords from (0.682854,0.572838,0.228172) to (0.582854,0.572838,0.228172):
+	Updating Particles positions in local cell 81:
+	Updating Particles positions in local cell 82:
+		Updating particleInCell 0:
+		Changing its coords from (0.858705,0.524700,0.598479) to (0.758705,0.524700,0.598479):
+	Updating Particles positions in local cell 83:
+		Updating particleInCell 0:
+		Changing its coords from (0.919183,0.566147,0.810155) to (0.819183,0.566147,0.810155):
+		Updating particleInCell 1:
+		Changing its coords from (0.972347,0.578168,0.153943) to (0.872347,0.578168,0.153943):
+	Updating Particles positions in local cell 84:
+		Updating particleInCell 0:
+		Changing its coords from (0.057470,0.665563,0.382487) to (-0.042530,0.665563,0.382487):
+	Updating Particles positions in local cell 85:
+		Updating particleInCell 0:
+		Changing its coords from (0.155497,0.617549,0.683248) to (0.055497,0.617549,0.683248):
+	Updating Particles positions in local cell 86:
+		Updating particleInCell 0:
+		Changing its coords from (0.228409,0.630944,0.297079) to (0.128409,0.630944,0.297079):
+	Updating Particles positions in local cell 87:
+		Updating particleInCell 0:
+		Changing its coords from (0.284344,0.651320,0.860231) to (0.184344,0.651320,0.860231):
+	Updating Particles positions in local cell 88:
+	Updating Particles positions in local cell 89:
+		Updating particleInCell 0:
+		Changing its coords from (0.441604,0.635915,0.819066) to (0.341604,0.635915,0.819066):
+		Updating particleInCell 1:
+		Changing its coords from (0.453863,0.593017,0.014169) to (0.353863,0.593017,0.014169):
+	Updating Particles positions in local cell 90:
+		Updating particleInCell 0:
+		Changing its coords from (0.545241,0.632992,0.268398) to (0.445241,0.632992,0.268398):
+	Updating Particles positions in local cell 91:
+	Updating Particles positions in local cell 92:
+		Updating particleInCell 0:
+		Changing its coords from (0.697250,0.617722,0.678490) to (0.597250,0.617722,0.678490):
+	Updating Particles positions in local cell 93:
+		Updating particleInCell 0:
+		Changing its coords from (0.805332,0.641739,0.534200) to (0.705332,0.641739,0.534200):
+		Updating particleInCell 1:
+		Changing its coords from (0.773478,0.609781,0.048507) to (0.673478,0.609781,0.048507):
+	Updating Particles positions in local cell 94:
+		Updating particleInCell 0:
+		Changing its coords from (0.891551,0.652676,0.264243) to (0.791551,0.652676,0.264243):
+	Updating Particles positions in local cell 95:
+		Updating particleInCell 0:
+		Changing its coords from (0.961191,0.584010,0.556690) to (0.861191,0.584010,0.556690):
+	Updating Particles positions in local cell 96:
+	Updating Particles positions in local cell 97:
+		Updating particleInCell 0:
+		Changing its coords from (0.092519,0.732025,0.786987) to (-0.007481,0.732025,0.786987):
+	Updating Particles positions in local cell 98:
+		Updating particleInCell 0:
+		Changing its coords from (0.191157,0.707541,0.740305) to (0.091157,0.707541,0.740305):
+		Updating particleInCell 1:
+		Changing its coords from (0.225149,0.680752,0.710421) to (0.125149,0.680752,0.710421):
+	Updating Particles positions in local cell 99:
+		Updating particleInCell 0:
+		Changing its coords from (0.287566,0.715174,0.131602) to (0.187566,0.715174,0.131602):
+	Updating Particles positions in local cell 100:
+	Updating Particles positions in local cell 101:
+		Updating particleInCell 0:
+		Changing its coords from (0.436450,0.689118,0.078428) to (0.336450,0.689118,0.078428):
+		Updating particleInCell 1:
+		Changing its coords from (0.461120,0.733203,0.312395) to (0.361120,0.733203,0.312395):
+	Updating Particles positions in local cell 102:
+		Updating particleInCell 0:
+		Changing its coords from (0.568448,0.667515,0.129199) to (0.468448,0.667515,0.129199):
+	Updating Particles positions in local cell 103:
+		Updating particleInCell 0:
+		Changing its coords from (0.653746,0.700469,0.362601) to (0.553746,0.700469,0.362601):
+	Updating Particles positions in local cell 104:
+		Updating particleInCell 0:
+		Changing its coords from (0.731526,0.688006,0.805419) to (0.631526,0.688006,0.805419):
+	Updating Particles positions in local cell 105:
+	Updating Particles positions in local cell 106:
+		Updating particleInCell 0:
+		Changing its coords from (0.839513,0.710536,0.650537) to (0.739513,0.710536,0.650537):
+		Updating particleInCell 1:
+		Changing its coords from (0.914507,0.715229,0.172700) to (0.814507,0.715229,0.172700):
+	Updating Particles positions in local cell 107:
+		Updating particleInCell 0:
+		Changing its coords from (0.996771,0.667611,0.503939) to (0.896771,0.667611,0.503939):
+	Updating Particles positions in local cell 108:
+		Updating particleInCell 0:
+		Changing its coords from (0.075867,0.782017,0.263024) to (-0.024133,0.782017,0.263024):
+	Updating Particles positions in local cell 109:
+	Updating Particles positions in local cell 110:
+		Updating particleInCell 0:
+		Changing its coords from (0.170813,0.785118,0.832115) to (0.070813,0.785118,0.832115):
+		Updating particleInCell 1:
+		Changing its coords from (0.229937,0.822625,0.301131) to (0.129937,0.822625,0.301131):
+	Updating Particles positions in local cell 111:
+		Updating particleInCell 0:
+		Changing its coords from (0.292553,0.795928,0.932317) to (0.192553,0.795928,0.932317):
+	Updating Particles positions in local cell 112:
+		Updating particleInCell 0:
+		Changing its coords from (0.404757,0.767063,0.389654) to (0.304757,0.767063,0.389654):
+	Updating Particles positions in local cell 113:
+	Updating Particles positions in local cell 114:
+		Updating particleInCell 0:
+		Changing its coords from (0.526693,0.806052,0.766668) to (0.426693,0.806052,0.766668):
+		Updating particleInCell 1:
+		Changing its coords from (0.565451,0.806915,0.786630) to (0.465451,0.806915,0.786630):
+	Updating Particles positions in local cell 115:
+	Updating Particles positions in local cell 116:
+		Updating particleInCell 0:
+		Changing its coords from (0.719869,0.771640,0.405653) to (0.619869,0.771640,0.405653):
+		Updating particleInCell 1:
+		Changing its coords from (0.690906,0.831802,0.079259) to (0.590906,0.831802,0.079259):
+	Updating Particles positions in local cell 117:
+	Updating Particles positions in local cell 118:
+		Updating particleInCell 0:
+		Changing its coords from (0.851410,0.750586,0.148631) to (0.751410,0.750586,0.148631):
+		Updating particleInCell 1:
+		Changing its coords from (0.870484,0.829588,0.587796) to (0.770484,0.829588,0.587796):
+	Updating Particles positions in local cell 119:
+		Updating particleInCell 0:
+		Changing its coords from (0.957384,0.761885,0.111413) to (0.857384,0.761885,0.111413):
+	Updating Particles positions in local cell 120:
+		Updating particleInCell 0:
+		Changing its coords from (0.000064,0.849542,0.008698) to (-0.099936,0.849542,0.008698):
+		Updating particleInCell 1:
+		Changing its coords from (0.049165,0.916347,0.443317) to (-0.050835,0.916347,0.443317):
+	Updating Particles positions in local cell 121:
+	Updating Particles positions in local cell 122:
+		Updating particleInCell 0:
+		Changing its coords from (0.185189,0.906007,0.018015) to (0.085189,0.906007,0.018015):
+	Updating Particles positions in local cell 123:
+		Updating particleInCell 0:
+		Changing its coords from (0.264356,0.885679,0.214158) to (0.164356,0.885679,0.214158):
+		Updating particleInCell 1:
+		Changing its coords from (0.312505,0.876272,0.962228) to (0.212505,0.876272,0.962228):
+	Updating Particles positions in local cell 124:
+		Updating particleInCell 0:
+		Changing its coords from (0.380133,0.906697,0.274473) to (0.280133,0.906697,0.274473):
+	Updating Particles positions in local cell 125:
+		Updating particleInCell 0:
+		Changing its coords from (0.456186,0.892969,0.628853) to (0.356186,0.892969,0.628853):
+	Updating Particles positions in local cell 126:
+		Updating particleInCell 0:
+		Changing its coords from (0.544726,0.887403,0.062195) to (0.444726,0.887403,0.062195):
+	Updating Particles positions in local cell 127:
+		Updating particleInCell 0:
+		Changing its coords from (0.643125,0.848438,0.363551) to (0.543125,0.848438,0.363551):
+	Updating Particles positions in local cell 128:
+		Updating particleInCell 0:
+		Changing its coords from (0.708471,0.870356,0.978446) to (0.608471,0.870356,0.978446):
+	Updating Particles positions in local cell 129:
+	Updating Particles positions in local cell 130:
+		Updating particleInCell 0:
+		Changing its coords from (0.845677,0.894197,0.164508) to (0.745677,0.894197,0.164508):
+	Updating Particles positions in local cell 131:
+		Updating particleInCell 0:
+		Changing its coords from (0.940690,0.862953,0.774475) to (0.840690,0.862953,0.774475):
+	Updating Particles positions in local cell 132:
+		Updating particleInCell 0:
+		Changing its coords from (0.044486,0.935294,0.917260) to (-0.055514,0.935294,0.917260):
+	Updating Particles positions in local cell 133:
+		Updating particleInCell 0:
+		Changing its coords from (0.149055,0.927436,0.056589) to (0.049055,0.927436,0.056589):
+	Updating Particles positions in local cell 134:
+		Updating particleInCell 0:
+		Changing its coords from (0.206981,0.993211,0.746238) to (0.106981,0.993211,0.746238):
+	Updating Particles positions in local cell 135:
+		Updating particleInCell 0:
+		Changing its coords from (0.284940,0.922172,0.353679) to (0.184940,0.922172,0.353679):
+	Updating Particles positions in local cell 136:
+		Updating particleInCell 0:
+		Changing its coords from (0.390388,0.930229,0.295629) to (0.290388,0.930229,0.295629):
+	Updating Particles positions in local cell 137:
+	Updating Particles positions in local cell 138:
+		Updating particleInCell 0:
+		Changing its coords from (0.503534,0.998106,0.030401) to (0.403534,0.998106,0.030401):
+	Updating Particles positions in local cell 139:
+		Updating particleInCell 0:
+		Changing its coords from (0.612755,0.928183,0.580515) to (0.512755,0.928183,0.580515):
+	Updating Particles positions in local cell 140:
+		Updating particleInCell 0:
+		Changing its coords from (0.716334,0.947029,0.632948) to (0.616334,0.947029,0.632948):
+		Updating particleInCell 1:
+		Changing its coords from (0.675714,0.989690,0.582861) to (0.575714,0.989690,0.582861):
+	Updating Particles positions in local cell 141:
+	Updating Particles positions in local cell 142:
+		Updating particleInCell 0:
+		Changing its coords from (0.863505,0.941543,0.200554) to (0.763505,0.941543,0.200554):
+	Updating Particles positions in local cell 143:
+		Updating particleInCell 0:
+		Changing its coords from (0.926091,0.987365,0.673773) to (0.826091,0.987365,0.673773):
+		Updating particleInCell 1:
+		Changing its coords from (0.958623,0.923919,0.642657) to (0.858623,0.923919,0.642657):
+
+Updating periodic BCs
+
+Starting timestep 5:
+	Updating Particles positions in local cell 0:
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.086236,0.007617,0.153544) to (-0.013764,0.007617,0.153544):
+		Updating particleInCell 1:
+		Changing its coords from (0.151311,0.057485,0.725730) to (0.051311,0.057485,0.725730):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.211840,0.019907,0.917154) to (0.111840,0.019907,0.917154):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.317361,0.014689,0.469106) to (0.217361,0.014689,0.469106):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.372422,0.007742,0.348450) to (0.272422,0.007742,0.348450):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.467006,0.023167,0.365872) to (0.367006,0.023167,0.365872):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.534506,0.073097,0.498144) to (0.434506,0.073097,0.498144):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.620218,0.055930,0.161165) to (0.520218,0.055930,0.161165):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.742325,0.060967,0.087923) to (0.642325,0.060967,0.087923):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.826628,0.013305,0.428316) to (0.726628,0.013305,0.428316):
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.908700,0.070846,0.484961) to (0.808700,0.070846,0.484961):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.995513,0.054303,0.100663) to (0.895513,0.054303,0.100663):
+	Updating Particles positions in local cell 12:
+	Updating Particles positions in local cell 13:
+		Updating particleInCell 0:
+		Changing its coords from (0.088116,0.107236,0.789944) to (-0.011884,0.107236,0.789944):
+		Updating particleInCell 1:
+		Changing its coords from (0.149385,0.095745,0.211121) to (0.049385,0.095745,0.211121):
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.209731,0.086098,0.671870) to (0.109731,0.086098,0.671870):
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.277176,0.128907,0.392572) to (0.177176,0.128907,0.392572):
+	Updating Particles positions in local cell 16:
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.429246,0.144943,0.744761) to (0.329246,0.144943,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.449212,0.117057,0.516097) to (0.349212,0.117057,0.516097):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.520799,0.111560,0.881840) to (0.420799,0.111560,0.881840):
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.625617,0.131893,0.684585) to (0.525617,0.131893,0.684585):
+	Updating Particles positions in local cell 20:
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.751040,0.118217,0.412512) to (0.651040,0.118217,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.773597,0.144814,0.708363) to (0.673597,0.144814,0.708363):
+	Updating Particles positions in local cell 22:
+		Updating particleInCell 0:
+		Changing its coords from (0.888268,0.094355,0.813771) to (0.788268,0.094355,0.813771):
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.937018,0.100727,0.063715) to (0.837018,0.100727,0.063715):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.017008,0.233736,0.757598) to (-0.082992,0.233736,0.757598):
+	Updating Particles positions in local cell 25:
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.178434,0.234579,0.751425) to (0.078434,0.234579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.199936,0.213040,0.739388) to (0.099936,0.213040,0.739388):
+	Updating Particles positions in local cell 27:
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.341211,0.200583,0.382567) to (0.241211,0.200583,0.382567):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.417248,0.240369,0.632784) to (0.317248,0.240369,0.632784):
+		Updating particleInCell 1:
+		Changing its coords from (0.450534,0.175532,0.077820) to (0.350534,0.175532,0.077820):
+	Updating Particles positions in local cell 30:
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.607569,0.220237,0.185594) to (0.507569,0.220237,0.185594):
+		Updating particleInCell 1:
+		Changing its coords from (0.593245,0.214135,0.582185) to (0.493245,0.214135,0.582185):
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.706618,0.176914,0.669197) to (0.606618,0.176914,0.669197):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.782432,0.223996,0.379149) to (0.682432,0.223996,0.379149):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.879420,0.209246,0.558967) to (0.779420,0.209246,0.558967):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.980429,0.204775,0.925924) to (0.880429,0.204775,0.925924):
+	Updating Particles positions in local cell 36:
+	Updating Particles positions in local cell 37:
+		Updating particleInCell 0:
+		Changing its coords from (0.098848,0.305396,0.466709) to (-0.001152,0.305396,0.466709):
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.181050,0.284045,0.376295) to (0.081050,0.284045,0.376295):
+		Updating particleInCell 1:
+		Changing its coords from (0.216190,0.299720,0.774592) to (0.116190,0.299720,0.774592):
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.313733,0.289242,0.408698) to (0.213733,0.289242,0.408698):
+	Updating Particles positions in local cell 40:
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.431828,0.283468,0.032166) to (0.331828,0.283468,0.032166):
+		Updating particleInCell 1:
+		Changing its coords from (0.485139,0.274493,0.771763) to (0.385139,0.274493,0.771763):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.518318,0.257582,0.233312) to (0.418318,0.257582,0.233312):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.665683,0.264829,0.736755) to (0.565683,0.264829,0.736755):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.736213,0.325754,0.451488) to (0.636213,0.325754,0.451488):
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.779352,0.279855,0.321813) to (0.679352,0.279855,0.321813):
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.908758,0.296891,0.230269) to (0.808758,0.296891,0.230269):
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.944624,0.253993,0.377044) to (0.844624,0.253993,0.377044):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.058807,0.415579,0.711434) to (-0.041193,0.415579,0.711434):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.105346,0.344532,0.516861) to (0.005346,0.344532,0.516861):
+	Updating Particles positions in local cell 50:
+	Updating Particles positions in local cell 51:
+		Updating particleInCell 0:
+		Changing its coords from (0.257111,0.405103,0.724586) to (0.157111,0.405103,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.276621,0.378505,0.483519) to (0.176621,0.378505,0.483519):
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.392326,0.365403,0.929035) to (0.292326,0.365403,0.929035):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.457797,0.335222,0.991404) to (0.357797,0.335222,0.991404):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.561117,0.334950,0.115447) to (0.461117,0.334950,0.115447):
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.622725,0.362652,0.106081) to (0.522725,0.362652,0.106081):
+	Updating Particles positions in local cell 56:
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.757951,0.345596,0.126605) to (0.657951,0.345596,0.126605):
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.837365,0.392358,0.316657) to (0.737365,0.392358,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.855175,0.395699,0.170111) to (0.755175,0.395699,0.170111):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.937709,0.369255,0.860921) to (0.837709,0.369255,0.860921):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.028320,0.434366,0.601838) to (-0.071680,0.434366,0.601838):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.107840,0.436869,0.543898) to (0.007840,0.436869,0.543898):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.207648,0.494438,0.311891) to (0.107648,0.494438,0.311891):
+	Updating Particles positions in local cell 63:
+	Updating Particles positions in local cell 64:
+		Updating particleInCell 0:
+		Changing its coords from (0.346266,0.417322,0.071914) to (0.246266,0.417322,0.071914):
+		Updating particleInCell 1:
+		Changing its coords from (0.405396,0.453880,0.262791) to (0.305396,0.453880,0.262791):
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.493736,0.446017,0.518640) to (0.393736,0.446017,0.518640):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.581395,0.469559,0.488147) to (0.481395,0.469559,0.488147):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.626061,0.422658,0.451692) to (0.526061,0.422658,0.451692):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.732779,0.451592,0.892297) to (0.632779,0.451592,0.892297):
+	Updating Particles positions in local cell 69:
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.835808,0.482726,0.081151) to (0.735808,0.482726,0.081151):
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.925043,0.416841,0.137948) to (0.825043,0.416841,0.137948):
+		Updating particleInCell 1:
+		Changing its coords from (0.974786,0.449349,0.534845) to (0.874786,0.449349,0.534845):
+	Updating Particles positions in local cell 72:
+		Updating particleInCell 0:
+		Changing its coords from (0.039431,0.520572,0.006777) to (-0.060569,0.520572,0.006777):
+	Updating Particles positions in local cell 73:
+	Updating Particles positions in local cell 74:
+		Updating particleInCell 0:
+		Changing its coords from (0.174892,0.539611,0.863758) to (0.074892,0.539611,0.863758):
+		Updating particleInCell 1:
+		Changing its coords from (0.198551,0.507831,0.392552) to (0.098551,0.507831,0.392552):
+	Updating Particles positions in local cell 75:
+		Updating particleInCell 0:
+		Changing its coords from (0.317884,0.553317,0.094829) to (0.217884,0.553317,0.094829):
+	Updating Particles positions in local cell 76:
+		Updating particleInCell 0:
+		Changing its coords from (0.415318,0.555593,0.307147) to (0.315318,0.555593,0.307147):
+	Updating Particles positions in local cell 77:
+		Updating particleInCell 0:
+		Changing its coords from (0.451093,0.564149,0.760207) to (0.351093,0.564149,0.760207):
+	Updating Particles positions in local cell 78:
+		Updating particleInCell 0:
+		Changing its coords from (0.582854,0.572838,0.228172) to (0.482854,0.572838,0.228172):
+	Updating Particles positions in local cell 79:
+		Updating particleInCell 0:
+		Changing its coords from (0.623555,0.547874,0.464087) to (0.523555,0.547874,0.464087):
+	Updating Particles positions in local cell 80:
+	Updating Particles positions in local cell 81:
+		Updating particleInCell 0:
+		Changing its coords from (0.758705,0.524700,0.598479) to (0.658705,0.524700,0.598479):
+		Updating particleInCell 1:
+		Changing its coords from (0.819183,0.566147,0.810155) to (0.719183,0.566147,0.810155):
+	Updating Particles positions in local cell 82:
+		Updating particleInCell 0:
+		Changing its coords from (0.872347,0.578168,0.153943) to (0.772347,0.578168,0.153943):
+	Updating Particles positions in local cell 83:
+		Updating particleInCell 0:
+		Changing its coords from (0.960453,0.555529,0.280554) to (0.860453,0.555529,0.280554):
+	Updating Particles positions in local cell 84:
+		Updating particleInCell 0:
+		Changing its coords from (0.055497,0.617549,0.683248) to (-0.044503,0.617549,0.683248):
+	Updating Particles positions in local cell 85:
+		Updating particleInCell 0:
+		Changing its coords from (0.128409,0.630944,0.297079) to (0.028409,0.630944,0.297079):
+	Updating Particles positions in local cell 86:
+		Updating particleInCell 0:
+		Changing its coords from (0.184344,0.651320,0.860231) to (0.084344,0.651320,0.860231):
+	Updating Particles positions in local cell 87:
+	Updating Particles positions in local cell 88:
+		Updating particleInCell 0:
+		Changing its coords from (0.341604,0.635915,0.819066) to (0.241604,0.635915,0.819066):
+		Updating particleInCell 1:
+		Changing its coords from (0.353863,0.593017,0.014169) to (0.253863,0.593017,0.014169):
+	Updating Particles positions in local cell 89:
+		Updating particleInCell 0:
+		Changing its coords from (0.445241,0.632992,0.268398) to (0.345241,0.632992,0.268398):
+	Updating Particles positions in local cell 90:
+	Updating Particles positions in local cell 91:
+		Updating particleInCell 0:
+		Changing its coords from (0.597250,0.617722,0.678490) to (0.497250,0.617722,0.678490):
+	Updating Particles positions in local cell 92:
+		Updating particleInCell 0:
+		Changing its coords from (0.705332,0.641739,0.534200) to (0.605332,0.641739,0.534200):
+		Updating particleInCell 1:
+		Changing its coords from (0.673478,0.609781,0.048507) to (0.573478,0.609781,0.048507):
+	Updating Particles positions in local cell 93:
+		Updating particleInCell 0:
+		Changing its coords from (0.791551,0.652676,0.264243) to (0.691551,0.652676,0.264243):
+	Updating Particles positions in local cell 94:
+		Updating particleInCell 0:
+		Changing its coords from (0.861191,0.584010,0.556690) to (0.761191,0.584010,0.556690):
+	Updating Particles positions in local cell 95:
+		Updating particleInCell 0:
+		Changing its coords from (0.957470,0.665563,0.382487) to (0.857470,0.665563,0.382487):
+	Updating Particles positions in local cell 96:
+	Updating Particles positions in local cell 97:
+		Updating particleInCell 0:
+		Changing its coords from (0.091157,0.707541,0.740305) to (-0.008843,0.707541,0.740305):
+		Updating particleInCell 1:
+		Changing its coords from (0.125149,0.680752,0.710421) to (0.025149,0.680752,0.710421):
+	Updating Particles positions in local cell 98:
+		Updating particleInCell 0:
+		Changing its coords from (0.187566,0.715174,0.131602) to (0.087566,0.715174,0.131602):
+	Updating Particles positions in local cell 99:
+	Updating Particles positions in local cell 100:
+		Updating particleInCell 0:
+		Changing its coords from (0.336450,0.689118,0.078428) to (0.236450,0.689118,0.078428):
+		Updating particleInCell 1:
+		Changing its coords from (0.361120,0.733203,0.312395) to (0.261120,0.733203,0.312395):
+	Updating Particles positions in local cell 101:
+		Updating particleInCell 0:
+		Changing its coords from (0.468448,0.667515,0.129199) to (0.368448,0.667515,0.129199):
+	Updating Particles positions in local cell 102:
+		Updating particleInCell 0:
+		Changing its coords from (0.553746,0.700469,0.362601) to (0.453746,0.700469,0.362601):
+	Updating Particles positions in local cell 103:
+		Updating particleInCell 0:
+		Changing its coords from (0.631526,0.688006,0.805419) to (0.531526,0.688006,0.805419):
+	Updating Particles positions in local cell 104:
+		Updating particleInCell 0:
+		Changing its coords from (0.739513,0.710536,0.650537) to (0.639513,0.710536,0.650537):
+	Updating Particles positions in local cell 105:
+		Updating particleInCell 0:
+		Changing its coords from (0.814507,0.715229,0.172700) to (0.714507,0.715229,0.172700):
+	Updating Particles positions in local cell 106:
+		Updating particleInCell 0:
+		Changing its coords from (0.896771,0.667611,0.503939) to (0.796771,0.667611,0.503939):
+	Updating Particles positions in local cell 107:
+		Updating particleInCell 0:
+		Changing its coords from (0.992519,0.732025,0.786987) to (0.892519,0.732025,0.786987):
+	Updating Particles positions in local cell 108:
+		Updating particleInCell 0:
+		Changing its coords from (0.070813,0.785118,0.832115) to (-0.029187,0.785118,0.832115):
+	Updating Particles positions in local cell 109:
+		Updating particleInCell 0:
+		Changing its coords from (0.129937,0.822625,0.301131) to (0.029937,0.822625,0.301131):
+	Updating Particles positions in local cell 110:
+		Updating particleInCell 0:
+		Changing its coords from (0.192553,0.795928,0.932317) to (0.092553,0.795928,0.932317):
+	Updating Particles positions in local cell 111:
+		Updating particleInCell 0:
+		Changing its coords from (0.304757,0.767063,0.389654) to (0.204757,0.767063,0.389654):
+	Updating Particles positions in local cell 112:
+	Updating Particles positions in local cell 113:
+		Updating particleInCell 0:
+		Changing its coords from (0.426693,0.806052,0.766668) to (0.326693,0.806052,0.766668):
+		Updating particleInCell 1:
+		Changing its coords from (0.465451,0.806915,0.786630) to (0.365451,0.806915,0.786630):
+	Updating Particles positions in local cell 114:
+	Updating Particles positions in local cell 115:
+		Updating particleInCell 0:
+		Changing its coords from (0.619869,0.771640,0.405653) to (0.519869,0.771640,0.405653):
+		Updating particleInCell 1:
+		Changing its coords from (0.590906,0.831802,0.079259) to (0.490906,0.831802,0.079259):
+	Updating Particles positions in local cell 116:
+	Updating Particles positions in local cell 117:
+		Updating particleInCell 0:
+		Changing its coords from (0.751410,0.750586,0.148631) to (0.651410,0.750586,0.148631):
+		Updating particleInCell 1:
+		Changing its coords from (0.770484,0.829588,0.587796) to (0.670484,0.829588,0.587796):
+	Updating Particles positions in local cell 118:
+		Updating particleInCell 0:
+		Changing its coords from (0.857384,0.761885,0.111413) to (0.757384,0.761885,0.111413):
+	Updating Particles positions in local cell 119:
+		Updating particleInCell 0:
+		Changing its coords from (0.975867,0.782017,0.263024) to (0.875867,0.782017,0.263024):
+	Updating Particles positions in local cell 120:
+	Updating Particles positions in local cell 121:
+		Updating particleInCell 0:
+		Changing its coords from (0.085189,0.906007,0.018015) to (-0.014811,0.906007,0.018015):
+		Updating particleInCell 1:
+		Changing its coords from (0.164356,0.885679,0.214158) to (0.064356,0.885679,0.214158):
+	Updating Particles positions in local cell 122:
+		Updating particleInCell 0:
+		Changing its coords from (0.212505,0.876272,0.962228) to (0.112505,0.876272,0.962228):
+	Updating Particles positions in local cell 123:
+		Updating particleInCell 0:
+		Changing its coords from (0.280133,0.906697,0.274473) to (0.180133,0.906697,0.274473):
+	Updating Particles positions in local cell 124:
+		Updating particleInCell 0:
+		Changing its coords from (0.356186,0.892969,0.628853) to (0.256186,0.892969,0.628853):
+	Updating Particles positions in local cell 125:
+		Updating particleInCell 0:
+		Changing its coords from (0.444726,0.887403,0.062195) to (0.344726,0.887403,0.062195):
+	Updating Particles positions in local cell 126:
+		Updating particleInCell 0:
+		Changing its coords from (0.543125,0.848438,0.363551) to (0.443125,0.848438,0.363551):
+	Updating Particles positions in local cell 127:
+		Updating particleInCell 0:
+		Changing its coords from (0.608471,0.870356,0.978446) to (0.508471,0.870356,0.978446):
+	Updating Particles positions in local cell 128:
+		Updating particleInCell 0:
+		Changing its coords from (0.745677,0.894197,0.164508) to (0.645677,0.894197,0.164508):
+	Updating Particles positions in local cell 129:
+	Updating Particles positions in local cell 130:
+		Updating particleInCell 0:
+		Changing its coords from (0.840690,0.862953,0.774475) to (0.740690,0.862953,0.774475):
+		Updating particleInCell 1:
+		Changing its coords from (0.900064,0.849542,0.008698) to (0.800064,0.849542,0.008698):
+	Updating Particles positions in local cell 131:
+		Updating particleInCell 0:
+		Changing its coords from (0.949165,0.916347,0.443317) to (0.849165,0.916347,0.443317):
+	Updating Particles positions in local cell 132:
+		Updating particleInCell 0:
+		Changing its coords from (0.049055,0.927436,0.056589) to (-0.050945,0.927436,0.056589):
+	Updating Particles positions in local cell 133:
+		Updating particleInCell 0:
+		Changing its coords from (0.106981,0.993211,0.746238) to (0.006981,0.993211,0.746238):
+	Updating Particles positions in local cell 134:
+		Updating particleInCell 0:
+		Changing its coords from (0.184940,0.922172,0.353679) to (0.084940,0.922172,0.353679):
+	Updating Particles positions in local cell 135:
+		Updating particleInCell 0:
+		Changing its coords from (0.290388,0.930229,0.295629) to (0.190388,0.930229,0.295629):
+	Updating Particles positions in local cell 136:
+		Updating particleInCell 0:
+		Changing its coords from (0.403534,0.998106,0.030401) to (0.303534,0.998106,0.030401):
+	Updating Particles positions in local cell 137:
+	Updating Particles positions in local cell 138:
+		Updating particleInCell 0:
+		Changing its coords from (0.512755,0.928183,0.580515) to (0.412755,0.928183,0.580515):
+		Updating particleInCell 1:
+		Changing its coords from (0.575714,0.989690,0.582861) to (0.475714,0.989690,0.582861):
+	Updating Particles positions in local cell 139:
+		Updating particleInCell 0:
+		Changing its coords from (0.616334,0.947029,0.632948) to (0.516334,0.947029,0.632948):
+	Updating Particles positions in local cell 140:
+	Updating Particles positions in local cell 141:
+		Updating particleInCell 0:
+		Changing its coords from (0.763505,0.941543,0.200554) to (0.663505,0.941543,0.200554):
+		Updating particleInCell 1:
+		Changing its coords from (0.826091,0.987365,0.673773) to (0.726091,0.987365,0.673773):
+	Updating Particles positions in local cell 142:
+		Updating particleInCell 0:
+		Changing its coords from (0.858623,0.923919,0.642657) to (0.758623,0.923919,0.642657):
+	Updating Particles positions in local cell 143:
+		Updating particleInCell 0:
+		Changing its coords from (0.944486,0.935294,0.917260) to (0.844486,0.935294,0.917260):
+
+Updating periodic BCs
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testPeriodicBCs.0of2.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testPeriodicBCs.0of2.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,1535 @@
+StGermain Framework revision 4046. Copyright (C) 2003-2005 VPAC.
+StGermain Domain Library revision 4046. Copyright (C) 2003-2007 VPAC.
+StGermain Finite Element Framework revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Discretisation Framework revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain SLE Library revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain PETSc-LinearAlgebra Interface revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Assembly Library revision 793. Copyright (C) 2003-2005 VPAC.
+Watching rank: 0
+Swarm (ptr): 0x64c3d0
+Stg_Component (ptr): 0x64c3d0
+Stg_Object (ptr): 0x64c3d0
+	Stg_Class (ptr): 0x64c3d0
+		sizeOfSelf: 376
+		_deleteSelf: Yes
+		type: Swarm
+		_delete (func ptr): 0x2aaaab9cb3a0
+		_print (func ptr): 0x2aaaab9caf60
+		_copy (func ptr): 0x2aaaab9ca8c0
+	name: testSwarm
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0x2aaaab9cb920
+	_construct (func ptr): 0x2aaaab9cb6b0
+	_build (func ptr): 0x2aaaab9ca800
+	_initialise (func ptr): 0x2aaaab9ca5b0
+	_execute (func ptr): 0x2aaaab9c9290
+	_destroy (func ptr): 0x2aaaab9c92a0
+	isConstructed: True
+	isBuilt: True
+	isInitialised: True
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: testSwarm-Construct
+	build function name: testSwarm-Build
+	initialise function name: testSwarm-Initialise
+	execute function name: testSwarm-Execute
+	destroy function name: testSwarm-Destroy
+ElementCellLayout (ptr): 0x64b490
+CellLayout (ptr): 0x64b490
+Stg_Component (ptr): 0x64b490
+Stg_Object (ptr): 0x64b490
+	Stg_Class (ptr): 0x64b490
+		sizeOfSelf: 248
+		_deleteSelf: Yes
+		type: ElementCellLayout
+		_delete (func ptr): 0x2aaaab9c0c20
+		_print (func ptr): 0x2aaaab9c0bc0
+		_copy (func ptr): 0x2aaaab9c0ae0
+	name: elementCellLayout
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0x2aaaab9c0f00
+	_construct (func ptr): 0x2aaaab9c0cc0
+	_build (func ptr): 0x2aaaab9c0ad0
+	_initialise (func ptr): 0x2aaaab9c0ac0
+	_execute (func ptr): 0x2aaaab9c0760
+	_destroy (func ptr): 0x2aaaab9c0770
+	isConstructed: True
+	isBuilt: True
+	isInitialised: True
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: elementCellLayout-Construct
+	build function name: elementCellLayout-Build
+	initialise function name: elementCellLayout-Initialise
+	execute function name: elementCellLayout-Execute
+	destroy function name: elementCellLayout-Destroy
+	_cellLocalCount (func ptr): 0x2aaaab9c0780
+	_cellShadowCount (func ptr): 0x2aaaab9c0790
+	_pointCount (func ptr): 0x2aaaab9c07a0
+	_initialisePoints (func ptr): 0x2aaaab9c07c0
+	_mapElementIdToCellId (func ptr): 0x2aaaab9c0810
+	_isInCell (func ptr): 0x2aaaab9c0970
+	_cellOf (func ptr): 0x2aaaab9c0830
+	_getShadowInfo (func ptr): 0x2aaaab9c0820
+	mesh (ptr): 0x649d80
+RandomParticleLayout (ptr): 0x64bca0:
+PerCellParticleLayout (ptr): 0x64bca0
+ParticleLayout (ptr): 0x64bca0
+Stg_Class (ptr): 0x64bca0
+	sizeOfSelf: 232
+	_deleteSelf: Yes
+	type: RandomParticleLayout
+	_delete (func ptr): 0x2aaaab9c7d80
+	_print (func ptr): 0x2aaaab9c7d10
+	_copy (func ptr): 0x2aaaab9c7ce0
+	_setInitialCounts (func ptr): 0x2aaaab9c72b0
+	_initialiseParticles (func ptr): 0x2aaaab9c7200
+	coordSystem: GlobalCoordSystem
+	weightsInitialisedAtStartup : False
+	_initialCount (func ptr): 0x2aaaab9c7c00
+	_initialiseParticlesOfCell (func ptr): 0x2aaaab9c7c10
+	cellParticleCount: 1
+	seed: 13
+	cellLocalCount: 72
+	cellDomainCount: 84
+	cellShadowCount: 12
+	cellPointCountTbl (ptr): 0x6548f0
+	cellPointCountTbl[0-84]: 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 
+	cellPointTbl (ptr): 0x656830
+	cellPointTbl[0-84]: {
+	cellPointTbl[0][0-8]: {0 0 0} {0.0833 0 0} {0.0833 0.0833 0} {0 0.0833 0} {0 0 1} {0.0833 0 1} {0.0833 0.0833 1} {0 0.0833 1} 
+	cellPointTbl[1][0-8]: {0.0833 0 0} {0.167 0 0} {0.167 0.0833 0} {0.0833 0.0833 0} {0.0833 0 1} {0.167 0 1} {0.167 0.0833 1} {0.0833 0.0833 1} 
+	cellPointTbl[2][0-8]: {0.167 0 0} {0.25 0 0} {0.25 0.0833 0} {0.167 0.0833 0} {0.167 0 1} {0.25 0 1} {0.25 0.0833 1} {0.167 0.0833 1} 
+	cellPointTbl[3][0-8]: {0.25 0 0} {0.333 0 0} {0.333 0.0833 0} {0.25 0.0833 0} {0.25 0 1} {0.333 0 1} {0.333 0.0833 1} {0.25 0.0833 1} 
+	cellPointTbl[4][0-8]: {0.333 0 0} {0.417 0 0} {0.417 0.0833 0} {0.333 0.0833 0} {0.333 0 1} {0.417 0 1} {0.417 0.0833 1} {0.333 0.0833 1} 
+	cellPointTbl[5][0-8]: {0.417 0 0} {0.5 0 0} {0.5 0.0833 0} {0.417 0.0833 0} {0.417 0 1} {0.5 0 1} {0.5 0.0833 1} {0.417 0.0833 1} 
+	cellPointTbl[6][0-8]: {0 0.0833 0} {0.0833 0.0833 0} {0.0833 0.167 0} {0 0.167 0} {0 0.0833 1} {0.0833 0.0833 1} {0.0833 0.167 1} {0 0.167 1} 
+	cellPointTbl[7][0-8]: {0.0833 0.0833 0} {0.167 0.0833 0} {0.167 0.167 0} {0.0833 0.167 0} {0.0833 0.0833 1} {0.167 0.0833 1} {0.167 0.167 1} {0.0833 0.167 1} 
+	cellPointTbl[8][0-8]: {0.167 0.0833 0} {0.25 0.0833 0} {0.25 0.167 0} {0.167 0.167 0} {0.167 0.0833 1} {0.25 0.0833 1} {0.25 0.167 1} {0.167 0.167 1} 
+	cellPointTbl[9][0-8]: {0.25 0.0833 0} {0.333 0.0833 0} {0.333 0.167 0} {0.25 0.167 0} {0.25 0.0833 1} {0.333 0.0833 1} {0.333 0.167 1} {0.25 0.167 1} 
+	cellPointTbl[10][0-8]: {0.333 0.0833 0} {0.417 0.0833 0} {0.417 0.167 0} {0.333 0.167 0} {0.333 0.0833 1} {0.417 0.0833 1} {0.417 0.167 1} {0.333 0.167 1} 
+	cellPointTbl[11][0-8]: {0.417 0.0833 0} {0.5 0.0833 0} {0.5 0.167 0} {0.417 0.167 0} {0.417 0.0833 1} {0.5 0.0833 1} {0.5 0.167 1} {0.417 0.167 1} 
+	cellPointTbl[12][0-8]: {0 0.167 0} {0.0833 0.167 0} {0.0833 0.25 0} {0 0.25 0} {0 0.167 1} {0.0833 0.167 1} {0.0833 0.25 1} {0 0.25 1} 
+	cellPointTbl[13][0-8]: {0.0833 0.167 0} {0.167 0.167 0} {0.167 0.25 0} {0.0833 0.25 0} {0.0833 0.167 1} {0.167 0.167 1} {0.167 0.25 1} {0.0833 0.25 1} 
+	cellPointTbl[14][0-8]: {0.167 0.167 0} {0.25 0.167 0} {0.25 0.25 0} {0.167 0.25 0} {0.167 0.167 1} {0.25 0.167 1} {0.25 0.25 1} {0.167 0.25 1} 
+	cellPointTbl[15][0-8]: {0.25 0.167 0} {0.333 0.167 0} {0.333 0.25 0} {0.25 0.25 0} {0.25 0.167 1} {0.333 0.167 1} {0.333 0.25 1} {0.25 0.25 1} 
+	cellPointTbl[16][0-8]: {0.333 0.167 0} {0.417 0.167 0} {0.417 0.25 0} {0.333 0.25 0} {0.333 0.167 1} {0.417 0.167 1} {0.417 0.25 1} {0.333 0.25 1} 
+	cellPointTbl[17][0-8]: {0.417 0.167 0} {0.5 0.167 0} {0.5 0.25 0} {0.417 0.25 0} {0.417 0.167 1} {0.5 0.167 1} {0.5 0.25 1} {0.417 0.25 1} 
+	cellPointTbl[18][0-8]: {0 0.25 0} {0.0833 0.25 0} {0.0833 0.333 0} {0 0.333 0} {0 0.25 1} {0.0833 0.25 1} {0.0833 0.333 1} {0 0.333 1} 
+	cellPointTbl[19][0-8]: {0.0833 0.25 0} {0.167 0.25 0} {0.167 0.333 0} {0.0833 0.333 0} {0.0833 0.25 1} {0.167 0.25 1} {0.167 0.333 1} {0.0833 0.333 1} 
+	cellPointTbl[20][0-8]: {0.167 0.25 0} {0.25 0.25 0} {0.25 0.333 0} {0.167 0.333 0} {0.167 0.25 1} {0.25 0.25 1} {0.25 0.333 1} {0.167 0.333 1} 
+	cellPointTbl[21][0-8]: {0.25 0.25 0} {0.333 0.25 0} {0.333 0.333 0} {0.25 0.333 0} {0.25 0.25 1} {0.333 0.25 1} {0.333 0.333 1} {0.25 0.333 1} 
+	cellPointTbl[22][0-8]: {0.333 0.25 0} {0.417 0.25 0} {0.417 0.333 0} {0.333 0.333 0} {0.333 0.25 1} {0.417 0.25 1} {0.417 0.333 1} {0.333 0.333 1} 
+	cellPointTbl[23][0-8]: {0.417 0.25 0} {0.5 0.25 0} {0.5 0.333 0} {0.417 0.333 0} {0.417 0.25 1} {0.5 0.25 1} {0.5 0.333 1} {0.417 0.333 1} 
+	cellPointTbl[24][0-8]: {0 0.333 0} {0.0833 0.333 0} {0.0833 0.417 0} {0 0.417 0} {0 0.333 1} {0.0833 0.333 1} {0.0833 0.417 1} {0 0.417 1} 
+	cellPointTbl[25][0-8]: {0.0833 0.333 0} {0.167 0.333 0} {0.167 0.417 0} {0.0833 0.417 0} {0.0833 0.333 1} {0.167 0.333 1} {0.167 0.417 1} {0.0833 0.417 1} 
+	cellPointTbl[26][0-8]: {0.167 0.333 0} {0.25 0.333 0} {0.25 0.417 0} {0.167 0.417 0} {0.167 0.333 1} {0.25 0.333 1} {0.25 0.417 1} {0.167 0.417 1} 
+	cellPointTbl[27][0-8]: {0.25 0.333 0} {0.333 0.333 0} {0.333 0.417 0} {0.25 0.417 0} {0.25 0.333 1} {0.333 0.333 1} {0.333 0.417 1} {0.25 0.417 1} 
+	cellPointTbl[28][0-8]: {0.333 0.333 0} {0.417 0.333 0} {0.417 0.417 0} {0.333 0.417 0} {0.333 0.333 1} {0.417 0.333 1} {0.417 0.417 1} {0.333 0.417 1} 
+	cellPointTbl[29][0-8]: {0.417 0.333 0} {0.5 0.333 0} {0.5 0.417 0} {0.417 0.417 0} {0.417 0.333 1} {0.5 0.333 1} {0.5 0.417 1} {0.417 0.417 1} 
+	cellPointTbl[30][0-8]: {0 0.417 0} {0.0833 0.417 0} {0.0833 0.5 0} {0 0.5 0} {0 0.417 1} {0.0833 0.417 1} {0.0833 0.5 1} {0 0.5 1} 
+	cellPointTbl[31][0-8]: {0.0833 0.417 0} {0.167 0.417 0} {0.167 0.5 0} {0.0833 0.5 0} {0.0833 0.417 1} {0.167 0.417 1} {0.167 0.5 1} {0.0833 0.5 1} 
+	cellPointTbl[32][0-8]: {0.167 0.417 0} {0.25 0.417 0} {0.25 0.5 0} {0.167 0.5 0} {0.167 0.417 1} {0.25 0.417 1} {0.25 0.5 1} {0.167 0.5 1} 
+	cellPointTbl[33][0-8]: {0.25 0.417 0} {0.333 0.417 0} {0.333 0.5 0} {0.25 0.5 0} {0.25 0.417 1} {0.333 0.417 1} {0.333 0.5 1} {0.25 0.5 1} 
+	cellPointTbl[34][0-8]: {0.333 0.417 0} {0.417 0.417 0} {0.417 0.5 0} {0.333 0.5 0} {0.333 0.417 1} {0.417 0.417 1} {0.417 0.5 1} {0.333 0.5 1} 
+	cellPointTbl[35][0-8]: {0.417 0.417 0} {0.5 0.417 0} {0.5 0.5 0} {0.417 0.5 0} {0.417 0.417 1} {0.5 0.417 1} {0.5 0.5 1} {0.417 0.5 1} 
+	cellPointTbl[36][0-8]: {0 0.5 0} {0.0833 0.5 0} {0.0833 0.583 0} {0 0.583 0} {0 0.5 1} {0.0833 0.5 1} {0.0833 0.583 1} {0 0.583 1} 
+	cellPointTbl[37][0-8]: {0.0833 0.5 0} {0.167 0.5 0} {0.167 0.583 0} {0.0833 0.583 0} {0.0833 0.5 1} {0.167 0.5 1} {0.167 0.583 1} {0.0833 0.583 1} 
+	cellPointTbl[38][0-8]: {0.167 0.5 0} {0.25 0.5 0} {0.25 0.583 0} {0.167 0.583 0} {0.167 0.5 1} {0.25 0.5 1} {0.25 0.583 1} {0.167 0.583 1} 
+	cellPointTbl[39][0-8]: {0.25 0.5 0} {0.333 0.5 0} {0.333 0.583 0} {0.25 0.583 0} {0.25 0.5 1} {0.333 0.5 1} {0.333 0.583 1} {0.25 0.583 1} 
+	cellPointTbl[40][0-8]: {0.333 0.5 0} {0.417 0.5 0} {0.417 0.583 0} {0.333 0.583 0} {0.333 0.5 1} {0.417 0.5 1} {0.417 0.583 1} {0.333 0.583 1} 
+	cellPointTbl[41][0-8]: {0.417 0.5 0} {0.5 0.5 0} {0.5 0.583 0} {0.417 0.583 0} {0.417 0.5 1} {0.5 0.5 1} {0.5 0.583 1} {0.417 0.583 1} 
+	cellPointTbl[42][0-8]: {0 0.583 0} {0.0833 0.583 0} {0.0833 0.667 0} {0 0.667 0} {0 0.583 1} {0.0833 0.583 1} {0.0833 0.667 1} {0 0.667 1} 
+	cellPointTbl[43][0-8]: {0.0833 0.583 0} {0.167 0.583 0} {0.167 0.667 0} {0.0833 0.667 0} {0.0833 0.583 1} {0.167 0.583 1} {0.167 0.667 1} {0.0833 0.667 1} 
+	cellPointTbl[44][0-8]: {0.167 0.583 0} {0.25 0.583 0} {0.25 0.667 0} {0.167 0.667 0} {0.167 0.583 1} {0.25 0.583 1} {0.25 0.667 1} {0.167 0.667 1} 
+	cellPointTbl[45][0-8]: {0.25 0.583 0} {0.333 0.583 0} {0.333 0.667 0} {0.25 0.667 0} {0.25 0.583 1} {0.333 0.583 1} {0.333 0.667 1} {0.25 0.667 1} 
+	cellPointTbl[46][0-8]: {0.333 0.583 0} {0.417 0.583 0} {0.417 0.667 0} {0.333 0.667 0} {0.333 0.583 1} {0.417 0.583 1} {0.417 0.667 1} {0.333 0.667 1} 
+	cellPointTbl[47][0-8]: {0.417 0.583 0} {0.5 0.583 0} {0.5 0.667 0} {0.417 0.667 0} {0.417 0.583 1} {0.5 0.583 1} {0.5 0.667 1} {0.417 0.667 1} 
+	cellPointTbl[48][0-8]: {0 0.667 0} {0.0833 0.667 0} {0.0833 0.75 0} {0 0.75 0} {0 0.667 1} {0.0833 0.667 1} {0.0833 0.75 1} {0 0.75 1} 
+	cellPointTbl[49][0-8]: {0.0833 0.667 0} {0.167 0.667 0} {0.167 0.75 0} {0.0833 0.75 0} {0.0833 0.667 1} {0.167 0.667 1} {0.167 0.75 1} {0.0833 0.75 1} 
+	cellPointTbl[50][0-8]: {0.167 0.667 0} {0.25 0.667 0} {0.25 0.75 0} {0.167 0.75 0} {0.167 0.667 1} {0.25 0.667 1} {0.25 0.75 1} {0.167 0.75 1} 
+	cellPointTbl[51][0-8]: {0.25 0.667 0} {0.333 0.667 0} {0.333 0.75 0} {0.25 0.75 0} {0.25 0.667 1} {0.333 0.667 1} {0.333 0.75 1} {0.25 0.75 1} 
+	cellPointTbl[52][0-8]: {0.333 0.667 0} {0.417 0.667 0} {0.417 0.75 0} {0.333 0.75 0} {0.333 0.667 1} {0.417 0.667 1} {0.417 0.75 1} {0.333 0.75 1} 
+	cellPointTbl[53][0-8]: {0.417 0.667 0} {0.5 0.667 0} {0.5 0.75 0} {0.417 0.75 0} {0.417 0.667 1} {0.5 0.667 1} {0.5 0.75 1} {0.417 0.75 1} 
+	cellPointTbl[54][0-8]: {0 0.75 0} {0.0833 0.75 0} {0.0833 0.833 0} {0 0.833 0} {0 0.75 1} {0.0833 0.75 1} {0.0833 0.833 1} {0 0.833 1} 
+	cellPointTbl[55][0-8]: {0.0833 0.75 0} {0.167 0.75 0} {0.167 0.833 0} {0.0833 0.833 0} {0.0833 0.75 1} {0.167 0.75 1} {0.167 0.833 1} {0.0833 0.833 1} 
+	cellPointTbl[56][0-8]: {0.167 0.75 0} {0.25 0.75 0} {0.25 0.833 0} {0.167 0.833 0} {0.167 0.75 1} {0.25 0.75 1} {0.25 0.833 1} {0.167 0.833 1} 
+	cellPointTbl[57][0-8]: {0.25 0.75 0} {0.333 0.75 0} {0.333 0.833 0} {0.25 0.833 0} {0.25 0.75 1} {0.333 0.75 1} {0.333 0.833 1} {0.25 0.833 1} 
+	cellPointTbl[58][0-8]: {0.333 0.75 0} {0.417 0.75 0} {0.417 0.833 0} {0.333 0.833 0} {0.333 0.75 1} {0.417 0.75 1} {0.417 0.833 1} {0.333 0.833 1} 
+	cellPointTbl[59][0-8]: {0.417 0.75 0} {0.5 0.75 0} {0.5 0.833 0} {0.417 0.833 0} {0.417 0.75 1} {0.5 0.75 1} {0.5 0.833 1} {0.417 0.833 1} 
+	cellPointTbl[60][0-8]: {0 0.833 0} {0.0833 0.833 0} {0.0833 0.917 0} {0 0.917 0} {0 0.833 1} {0.0833 0.833 1} {0.0833 0.917 1} {0 0.917 1} 
+	cellPointTbl[61][0-8]: {0.0833 0.833 0} {0.167 0.833 0} {0.167 0.917 0} {0.0833 0.917 0} {0.0833 0.833 1} {0.167 0.833 1} {0.167 0.917 1} {0.0833 0.917 1} 
+	cellPointTbl[62][0-8]: {0.167 0.833 0} {0.25 0.833 0} {0.25 0.917 0} {0.167 0.917 0} {0.167 0.833 1} {0.25 0.833 1} {0.25 0.917 1} {0.167 0.917 1} 
+	cellPointTbl[63][0-8]: {0.25 0.833 0} {0.333 0.833 0} {0.333 0.917 0} {0.25 0.917 0} {0.25 0.833 1} {0.333 0.833 1} {0.333 0.917 1} {0.25 0.917 1} 
+	cellPointTbl[64][0-8]: {0.333 0.833 0} {0.417 0.833 0} {0.417 0.917 0} {0.333 0.917 0} {0.333 0.833 1} {0.417 0.833 1} {0.417 0.917 1} {0.333 0.917 1} 
+	cellPointTbl[65][0-8]: {0.417 0.833 0} {0.5 0.833 0} {0.5 0.917 0} {0.417 0.917 0} {0.417 0.833 1} {0.5 0.833 1} {0.5 0.917 1} {0.417 0.917 1} 
+	cellPointTbl[66][0-8]: {0 0.917 0} {0.0833 0.917 0} {0.0833 1 0} {0 1 0} {0 0.917 1} {0.0833 0.917 1} {0.0833 1 1} {0 1 1} 
+	cellPointTbl[67][0-8]: {0.0833 0.917 0} {0.167 0.917 0} {0.167 1 0} {0.0833 1 0} {0.0833 0.917 1} {0.167 0.917 1} {0.167 1 1} {0.0833 1 1} 
+	cellPointTbl[68][0-8]: {0.167 0.917 0} {0.25 0.917 0} {0.25 1 0} {0.167 1 0} {0.167 0.917 1} {0.25 0.917 1} {0.25 1 1} {0.167 1 1} 
+	cellPointTbl[69][0-8]: {0.25 0.917 0} {0.333 0.917 0} {0.333 1 0} {0.25 1 0} {0.25 0.917 1} {0.333 0.917 1} {0.333 1 1} {0.25 1 1} 
+	cellPointTbl[70][0-8]: {0.333 0.917 0} {0.417 0.917 0} {0.417 1 0} {0.333 1 0} {0.333 0.917 1} {0.417 0.917 1} {0.417 1 1} {0.333 1 1} 
+	cellPointTbl[71][0-8]: {0.417 0.917 0} {0.5 0.917 0} {0.5 1 0} {0.417 1 0} {0.417 0.917 1} {0.5 0.917 1} {0.5 1 1} {0.417 1 1} 
+	cellPointTbl[72][0-8]: {0.5 0 0} {0.583 0 0} {0.583 0.0833 0} {0.5 0.0833 0} {0.5 0 1} {0.583 0 1} {0.583 0.0833 1} {0.5 0.0833 1} 
+	cellPointTbl[73][0-8]: {0.5 0.0833 0} {0.583 0.0833 0} {0.583 0.167 0} {0.5 0.167 0} {0.5 0.0833 1} {0.583 0.0833 1} {0.583 0.167 1} {0.5 0.167 1} 
+	cellPointTbl[74][0-8]: {0.5 0.167 0} {0.583 0.167 0} {0.583 0.25 0} {0.5 0.25 0} {0.5 0.167 1} {0.583 0.167 1} {0.583 0.25 1} {0.5 0.25 1} 
+	cellPointTbl[75][0-8]: {0.5 0.25 0} {0.583 0.25 0} {0.583 0.333 0} {0.5 0.333 0} {0.5 0.25 1} {0.583 0.25 1} {0.583 0.333 1} {0.5 0.333 1} 
+	cellPointTbl[76][0-8]: {0.5 0.333 0} {0.583 0.333 0} {0.583 0.417 0} {0.5 0.417 0} {0.5 0.333 1} {0.583 0.333 1} {0.583 0.417 1} {0.5 0.417 1} 
+	cellPointTbl[77][0-8]: {0.5 0.417 0} {0.583 0.417 0} {0.583 0.5 0} {0.5 0.5 0} {0.5 0.417 1} {0.583 0.417 1} {0.583 0.5 1} {0.5 0.5 1} 
+	cellPointTbl[78][0-8]: {0.5 0.5 0} {0.583 0.5 0} {0.583 0.583 0} {0.5 0.583 0} {0.5 0.5 1} {0.583 0.5 1} {0.583 0.583 1} {0.5 0.583 1} 
+	cellPointTbl[79][0-8]: {0.5 0.583 0} {0.583 0.583 0} {0.583 0.667 0} {0.5 0.667 0} {0.5 0.583 1} {0.583 0.583 1} {0.583 0.667 1} {0.5 0.667 1} 
+	cellPointTbl[80][0-8]: {0.5 0.667 0} {0.583 0.667 0} {0.583 0.75 0} {0.5 0.75 0} {0.5 0.667 1} {0.583 0.667 1} {0.583 0.75 1} {0.5 0.75 1} 
+	cellPointTbl[81][0-8]: {0.5 0.75 0} {0.583 0.75 0} {0.583 0.833 0} {0.5 0.833 0} {0.5 0.75 1} {0.583 0.75 1} {0.583 0.833 1} {0.5 0.833 1} 
+	cellPointTbl[82][0-8]: {0.5 0.833 0} {0.583 0.833 0} {0.583 0.917 0} {0.5 0.917 0} {0.5 0.833 1} {0.583 0.833 1} {0.583 0.917 1} {0.5 0.917 1} 
+	cellPointTbl[83][0-8]: {0.5 0.917 0} {0.583 0.917 0} {0.583 1 0} {0.5 1 0} {0.5 0.917 1} {0.583 0.917 1} {0.583 1 1} {0.5 1 1} 
+}
+
+	cellParticleCountTbl (ptr): 0x657ff0
+	cellParticleCountTbl[0-84]: 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 000 000 000 000 000 000 000 000 000 000 000 000 
+	cellParticleSizeTbl (ptr): 0x658160
+	cellParticleSizeTbl[0-84]: 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 000 000 000 000 000 000 000 000 000 000 000 000 
+	cellParticleTbl (ptr): 0x6582d0
+	cellParticleTbl [0-84]: {
+		cellParticleTbl[0][0-1]:
+			(part. index) 0
+
+		cellParticleTbl[1][0-1]:
+			(part. index) 1
+
+		cellParticleTbl[2][0-1]:
+			(part. index) 2
+
+		cellParticleTbl[3][0-1]:
+			(part. index) 3
+
+		cellParticleTbl[4][0-1]:
+			(part. index) 4
+
+		cellParticleTbl[5][0-1]:
+			(part. index) 5
+
+		cellParticleTbl[6][0-1]:
+			(part. index) 6
+
+		cellParticleTbl[7][0-1]:
+			(part. index) 7
+
+		cellParticleTbl[8][0-1]:
+			(part. index) 8
+
+		cellParticleTbl[9][0-1]:
+			(part. index) 9
+
+		cellParticleTbl[10][0-1]:
+			(part. index) 10
+
+		cellParticleTbl[11][0-1]:
+			(part. index) 11
+
+		cellParticleTbl[12][0-1]:
+			(part. index) 12
+
+		cellParticleTbl[13][0-1]:
+			(part. index) 13
+
+		cellParticleTbl[14][0-1]:
+			(part. index) 14
+
+		cellParticleTbl[15][0-1]:
+			(part. index) 15
+
+		cellParticleTbl[16][0-1]:
+			(part. index) 16
+
+		cellParticleTbl[17][0-1]:
+			(part. index) 17
+
+		cellParticleTbl[18][0-1]:
+			(part. index) 18
+
+		cellParticleTbl[19][0-1]:
+			(part. index) 19
+
+		cellParticleTbl[20][0-1]:
+			(part. index) 20
+
+		cellParticleTbl[21][0-1]:
+			(part. index) 21
+
+		cellParticleTbl[22][0-1]:
+			(part. index) 22
+
+		cellParticleTbl[23][0-1]:
+			(part. index) 23
+
+		cellParticleTbl[24][0-1]:
+			(part. index) 24
+
+		cellParticleTbl[25][0-1]:
+			(part. index) 25
+
+		cellParticleTbl[26][0-1]:
+			(part. index) 26
+
+		cellParticleTbl[27][0-1]:
+			(part. index) 27
+
+		cellParticleTbl[28][0-1]:
+			(part. index) 28
+
+		cellParticleTbl[29][0-1]:
+			(part. index) 29
+
+		cellParticleTbl[30][0-1]:
+			(part. index) 30
+
+		cellParticleTbl[31][0-1]:
+			(part. index) 31
+
+		cellParticleTbl[32][0-1]:
+			(part. index) 32
+
+		cellParticleTbl[33][0-1]:
+			(part. index) 33
+
+		cellParticleTbl[34][0-1]:
+			(part. index) 34
+
+		cellParticleTbl[35][0-1]:
+			(part. index) 35
+
+		cellParticleTbl[36][0-1]:
+			(part. index) 36
+
+		cellParticleTbl[37][0-1]:
+			(part. index) 37
+
+		cellParticleTbl[38][0-1]:
+			(part. index) 38
+
+		cellParticleTbl[39][0-1]:
+			(part. index) 39
+
+		cellParticleTbl[40][0-1]:
+			(part. index) 40
+
+		cellParticleTbl[41][0-1]:
+			(part. index) 41
+
+		cellParticleTbl[42][0-1]:
+			(part. index) 42
+
+		cellParticleTbl[43][0-1]:
+			(part. index) 43
+
+		cellParticleTbl[44][0-1]:
+			(part. index) 44
+
+		cellParticleTbl[45][0-1]:
+			(part. index) 45
+
+		cellParticleTbl[46][0-1]:
+			(part. index) 46
+
+		cellParticleTbl[47][0-1]:
+			(part. index) 47
+
+		cellParticleTbl[48][0-1]:
+			(part. index) 48
+
+		cellParticleTbl[49][0-1]:
+			(part. index) 49
+
+		cellParticleTbl[50][0-1]:
+			(part. index) 50
+
+		cellParticleTbl[51][0-1]:
+			(part. index) 51
+
+		cellParticleTbl[52][0-1]:
+			(part. index) 52
+
+		cellParticleTbl[53][0-1]:
+			(part. index) 53
+
+		cellParticleTbl[54][0-1]:
+			(part. index) 54
+
+		cellParticleTbl[55][0-1]:
+			(part. index) 55
+
+		cellParticleTbl[56][0-1]:
+			(part. index) 56
+
+		cellParticleTbl[57][0-1]:
+			(part. index) 57
+
+		cellParticleTbl[58][0-1]:
+			(part. index) 58
+
+		cellParticleTbl[59][0-1]:
+			(part. index) 59
+
+		cellParticleTbl[60][0-1]:
+			(part. index) 60
+
+		cellParticleTbl[61][0-1]:
+			(part. index) 61
+
+		cellParticleTbl[62][0-1]:
+			(part. index) 62
+
+		cellParticleTbl[63][0-1]:
+			(part. index) 63
+
+		cellParticleTbl[64][0-1]:
+			(part. index) 64
+
+		cellParticleTbl[65][0-1]:
+			(part. index) 65
+
+		cellParticleTbl[66][0-1]:
+			(part. index) 66
+
+		cellParticleTbl[67][0-1]:
+			(part. index) 67
+
+		cellParticleTbl[68][0-1]:
+			(part. index) 68
+
+		cellParticleTbl[69][0-1]:
+			(part. index) 69
+
+		cellParticleTbl[70][0-1]:
+			(part. index) 70
+
+		cellParticleTbl[71][0-1]:
+			(part. index) 71
+
+		cellParticleTbl[72][0-0]:
+
+		cellParticleTbl[73][0-0]:
+
+		cellParticleTbl[74][0-0]:
+
+		cellParticleTbl[75][0-0]:
+
+		cellParticleTbl[76][0-0]:
+
+		cellParticleTbl[77][0-0]:
+
+		cellParticleTbl[78][0-0]:
+
+		cellParticleTbl[79][0-0]:
+
+		cellParticleTbl[80][0-0]:
+
+		cellParticleTbl[81][0-0]:
+
+		cellParticleTbl[82][0-0]:
+
+		cellParticleTbl[83][0-0]:
+
+	}
+	particlesArraySize: 75
+	particlesArrayDelta: 3
+	extraParticlesFactor: 0.05
+
+Starting timestep 1:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.020218,0.055930,0.161165) to (-0.079782,0.055930,0.161165):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.142325,0.060967,0.087923) to (0.042325,0.060967,0.087923):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.226628,0.013305,0.428316) to (0.126628,0.013305,0.428316):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.308700,0.070846,0.484961) to (0.208700,0.070846,0.484961):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.395513,0.054303,0.100663) to (0.295513,0.054303,0.100663):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.486236,0.007617,0.153544) to (0.386236,0.007617,0.153544):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.051311,0.140818,0.725730) to (-0.048689,0.140818,0.725730):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.111840,0.103240,0.917154) to (0.011840,0.103240,0.917154):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.217361,0.098022,0.469106) to (0.117361,0.098022,0.469106):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.272422,0.091075,0.348450) to (0.172422,0.091075,0.348450):
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.367006,0.106500,0.365872) to (0.267006,0.106500,0.365872):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.434506,0.156430,0.498144) to (0.334506,0.156430,0.498144):
+	Updating Particles positions in local cell 12:
+		Updating particleInCell 0:
+		Changing its coords from (0.025617,0.215226,0.684585) to (-0.074383,0.215226,0.684585):
+	Updating Particles positions in local cell 13:
+		Updating particleInCell 0:
+		Changing its coords from (0.151040,0.201550,0.412512) to (0.051040,0.201550,0.412512):
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.173597,0.228148,0.708363) to (0.073597,0.228148,0.708363):
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.288268,0.177688,0.813771) to (0.188268,0.177688,0.813771):
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.337018,0.184061,0.063715) to (0.237018,0.184061,0.063715):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.488116,0.190569,0.789944) to (0.388116,0.190569,0.789944):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.049385,0.262412,0.211121) to (-0.050615,0.262412,0.211121):
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.109731,0.252765,0.671870) to (0.009731,0.252765,0.671870):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.177176,0.295573,0.392572) to (0.077176,0.295573,0.392572):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.329246,0.311610,0.744761) to (0.229246,0.311610,0.744761):
+	Updating Particles positions in local cell 22:
+		Updating particleInCell 0:
+		Changing its coords from (0.349212,0.283724,0.516097) to (0.249212,0.283724,0.516097):
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.420799,0.278227,0.881840) to (0.320799,0.278227,0.881840):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.007569,0.386903,0.185594) to (-0.092431,0.386903,0.185594):
+	Updating Particles positions in local cell 25:
+		Updating particleInCell 0:
+		Changing its coords from (0.106618,0.343580,0.669197) to (0.006618,0.343580,0.669197):
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.182432,0.390663,0.379149) to (0.082432,0.390663,0.379149):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.279420,0.375913,0.558967) to (0.179420,0.375913,0.558967):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.380429,0.371442,0.925924) to (0.280429,0.371442,0.925924):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.417008,0.400402,0.757598) to (0.317008,0.400402,0.757598):
+	Updating Particles positions in local cell 30:
+		Updating particleInCell 0:
+		Changing its coords from (0.078434,0.484579,0.751425) to (-0.021566,0.484579,0.751425):
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.099936,0.463040,0.739388) to (-0.000064,0.463040,0.739388):
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.241211,0.450583,0.382567) to (0.141211,0.450583,0.382567):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.317248,0.490369,0.632784) to (0.217248,0.490369,0.632784):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.350534,0.425532,0.077820) to (0.250534,0.425532,0.077820):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.493245,0.464135,0.582185) to (0.393245,0.464135,0.582185):
+	Updating Particles positions in local cell 36:
+		Updating particleInCell 0:
+		Changing its coords from (0.065683,0.514829,0.736755) to (-0.034317,0.514829,0.736755):
+	Updating Particles positions in local cell 37:
+		Updating particleInCell 0:
+		Changing its coords from (0.136213,0.575754,0.451488) to (0.036213,0.575754,0.451488):
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.179352,0.529855,0.321813) to (0.079352,0.529855,0.321813):
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.308758,0.546891,0.230269) to (0.208758,0.546891,0.230269):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.344624,0.503993,0.377044) to (0.244624,0.503993,0.377044):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.498848,0.555396,0.466709) to (0.398848,0.555396,0.466709):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.081050,0.617379,0.376295) to (-0.018950,0.617379,0.376295):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.116190,0.633054,0.774592) to (0.016190,0.633054,0.774592):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.213733,0.622575,0.408698) to (0.113733,0.622575,0.408698):
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.331828,0.616802,0.032166) to (0.231828,0.616802,0.032166):
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.385139,0.607826,0.771763) to (0.285139,0.607826,0.771763):
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.418318,0.590916,0.233312) to (0.318318,0.590916,0.233312):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.022725,0.695985,0.106081) to (-0.077275,0.695985,0.106081):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.157951,0.678929,0.126605) to (0.057951,0.678929,0.126605):
+	Updating Particles positions in local cell 50:
+		Updating particleInCell 0:
+		Changing its coords from (0.237365,0.725691,0.316657) to (0.137365,0.725691,0.316657):
+	Updating Particles positions in local cell 51:
+		Updating particleInCell 0:
+		Changing its coords from (0.255175,0.729032,0.170111) to (0.155175,0.729032,0.170111):
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.337709,0.702589,0.860921) to (0.237709,0.702589,0.860921):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.458807,0.748913,0.711434) to (0.358807,0.748913,0.711434):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.005346,0.761198,0.516861) to (-0.094654,0.761198,0.516861):
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.157111,0.821769,0.724586) to (0.057111,0.821769,0.724586):
+	Updating Particles positions in local cell 56:
+		Updating particleInCell 0:
+		Changing its coords from (0.176621,0.795172,0.483519) to (0.076621,0.795172,0.483519):
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.292326,0.782070,0.929035) to (0.192326,0.782070,0.929035):
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.357797,0.751889,0.991404) to (0.257797,0.751889,0.991404):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.461117,0.751617,0.115447) to (0.361117,0.751617,0.115447):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.026061,0.839325,0.451692) to (-0.073939,0.839325,0.451692):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.132779,0.868259,0.892297) to (0.032779,0.868259,0.892297):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.235808,0.899393,0.081151) to (0.135808,0.899393,0.081151):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.325043,0.833508,0.137948) to (0.225043,0.833508,0.137948):
+	Updating Particles positions in local cell 64:
+		Updating particleInCell 0:
+		Changing its coords from (0.374786,0.866016,0.534845) to (0.274786,0.866016,0.534845):
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.428320,0.851032,0.601838) to (0.328320,0.851032,0.601838):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.007840,0.936869,0.543898) to (-0.092160,0.936869,0.543898):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.107648,0.994438,0.311891) to (0.007648,0.994438,0.311891):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.246266,0.917322,0.071914) to (0.146266,0.917322,0.071914):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.305396,0.953880,0.262791) to (0.205396,0.953880,0.262791):
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.393736,0.946017,0.518640) to (0.293736,0.946017,0.518640):
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.481395,0.969559,0.488147) to (0.381395,0.969559,0.488147):
+
+Updating periodic BCs
+
+Starting timestep 2:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.042325,0.060967,0.087923) to (-0.057675,0.060967,0.087923):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.126628,0.013305,0.428316) to (0.026628,0.013305,0.428316):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.208700,0.070846,0.484961) to (0.108700,0.070846,0.484961):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.295513,0.054303,0.100663) to (0.195513,0.054303,0.100663):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.386236,0.007617,0.153544) to (0.286236,0.007617,0.153544):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.420218,0.055930,0.161165) to (0.320218,0.055930,0.161165):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.011840,0.103240,0.917154) to (-0.088160,0.103240,0.917154):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.117361,0.098022,0.469106) to (0.017361,0.098022,0.469106):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.172422,0.091075,0.348450) to (0.072422,0.091075,0.348450):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.267006,0.106500,0.365872) to (0.167006,0.106500,0.365872):
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.334506,0.156430,0.498144) to (0.234506,0.156430,0.498144):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.451311,0.140818,0.725730) to (0.351311,0.140818,0.725730):
+	Updating Particles positions in local cell 12:
+		Updating particleInCell 0:
+		Changing its coords from (0.051040,0.201550,0.412512) to (-0.048960,0.201550,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.073597,0.228148,0.708363) to (-0.026403,0.228148,0.708363):
+	Updating Particles positions in local cell 13:
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.188268,0.177688,0.813771) to (0.088268,0.177688,0.813771):
+		Updating particleInCell 1:
+		Changing its coords from (0.237018,0.184061,0.063715) to (0.137018,0.184061,0.063715):
+	Updating Particles positions in local cell 15:
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.388116,0.190569,0.789944) to (0.288116,0.190569,0.789944):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.425617,0.215226,0.684585) to (0.325617,0.215226,0.684585):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.009731,0.252765,0.671870) to (-0.090269,0.252765,0.671870):
+		Updating particleInCell 1:
+		Changing its coords from (0.077176,0.295573,0.392572) to (-0.022824,0.295573,0.392572):
+	Updating Particles positions in local cell 19:
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.229246,0.311610,0.744761) to (0.129246,0.311610,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.249212,0.283724,0.516097) to (0.149212,0.283724,0.516097):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.320799,0.278227,0.881840) to (0.220799,0.278227,0.881840):
+	Updating Particles positions in local cell 22:
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.449385,0.262412,0.211121) to (0.349385,0.262412,0.211121):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.006618,0.343580,0.669197) to (-0.093382,0.343580,0.669197):
+		Updating particleInCell 1:
+		Changing its coords from (0.082432,0.390663,0.379149) to (-0.017568,0.390663,0.379149):
+	Updating Particles positions in local cell 25:
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.179420,0.375913,0.558967) to (0.079420,0.375913,0.558967):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.280429,0.371442,0.925924) to (0.180429,0.371442,0.925924):
+		Updating particleInCell 1:
+		Changing its coords from (0.317008,0.400402,0.757598) to (0.217008,0.400402,0.757598):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.407569,0.386903,0.185594) to (0.307569,0.386903,0.185594):
+	Updating Particles positions in local cell 29:
+	Updating Particles positions in local cell 30:
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.141211,0.450583,0.382567) to (0.041211,0.450583,0.382567):
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.217248,0.490369,0.632784) to (0.117248,0.490369,0.632784):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.250534,0.425532,0.077820) to (0.150534,0.425532,0.077820):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.393245,0.464135,0.582185) to (0.293245,0.464135,0.582185):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.478434,0.484579,0.751425) to (0.378434,0.484579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.499936,0.463040,0.739388) to (0.399936,0.463040,0.739388):
+	Updating Particles positions in local cell 36:
+		Updating particleInCell 0:
+		Changing its coords from (0.036213,0.575754,0.451488) to (-0.063787,0.575754,0.451488):
+		Updating particleInCell 1:
+		Changing its coords from (0.079352,0.529855,0.321813) to (-0.020648,0.529855,0.321813):
+	Updating Particles positions in local cell 37:
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.208758,0.546891,0.230269) to (0.108758,0.546891,0.230269):
+		Updating particleInCell 1:
+		Changing its coords from (0.244624,0.503993,0.377044) to (0.144624,0.503993,0.377044):
+	Updating Particles positions in local cell 39:
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.398848,0.555396,0.466709) to (0.298848,0.555396,0.466709):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.465683,0.514829,0.736755) to (0.365683,0.514829,0.736755):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.016190,0.633054,0.774592) to (-0.083810,0.633054,0.774592):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.113733,0.622575,0.408698) to (0.013733,0.622575,0.408698):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.231828,0.616802,0.032166) to (0.131828,0.616802,0.032166):
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.285139,0.607826,0.771763) to (0.185139,0.607826,0.771763):
+		Updating particleInCell 1:
+		Changing its coords from (0.318318,0.590916,0.233312) to (0.218318,0.590916,0.233312):
+	Updating Particles positions in local cell 46:
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.481050,0.617379,0.376295) to (0.381050,0.617379,0.376295):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.057951,0.678929,0.126605) to (-0.042049,0.678929,0.126605):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.137365,0.725691,0.316657) to (0.037365,0.725691,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.155175,0.729032,0.170111) to (0.055175,0.729032,0.170111):
+	Updating Particles positions in local cell 50:
+		Updating particleInCell 0:
+		Changing its coords from (0.237709,0.702589,0.860921) to (0.137709,0.702589,0.860921):
+	Updating Particles positions in local cell 51:
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.358807,0.748913,0.711434) to (0.258807,0.748913,0.711434):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.422725,0.695985,0.106081) to (0.322725,0.695985,0.106081):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.057111,0.821769,0.724586) to (-0.042889,0.821769,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.076621,0.795172,0.483519) to (-0.023379,0.795172,0.483519):
+	Updating Particles positions in local cell 55:
+	Updating Particles positions in local cell 56:
+		Updating particleInCell 0:
+		Changing its coords from (0.192326,0.782070,0.929035) to (0.092326,0.782070,0.929035):
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.257797,0.751889,0.991404) to (0.157797,0.751889,0.991404):
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.361117,0.751617,0.115447) to (0.261117,0.751617,0.115447):
+		Updating particleInCell 1:
+		Changing its coords from (0.405346,0.761198,0.516861) to (0.305346,0.761198,0.516861):
+	Updating Particles positions in local cell 59:
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.032779,0.868259,0.892297) to (-0.067221,0.868259,0.892297):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.135808,0.899393,0.081151) to (0.035808,0.899393,0.081151):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.225043,0.833508,0.137948) to (0.125043,0.833508,0.137948):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.274786,0.866016,0.534845) to (0.174786,0.866016,0.534845):
+		Updating particleInCell 1:
+		Changing its coords from (0.328320,0.851032,0.601838) to (0.228320,0.851032,0.601838):
+	Updating Particles positions in local cell 64:
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.426061,0.839325,0.451692) to (0.326061,0.839325,0.451692):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.007648,0.994438,0.311891) to (-0.092352,0.994438,0.311891):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.146266,0.917322,0.071914) to (0.046266,0.917322,0.071914):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.205396,0.953880,0.262791) to (0.105396,0.953880,0.262791):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.293736,0.946017,0.518640) to (0.193736,0.946017,0.518640):
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.381395,0.969559,0.488147) to (0.281395,0.969559,0.488147):
+		Updating particleInCell 1:
+		Changing its coords from (0.407840,0.936869,0.543898) to (0.307840,0.936869,0.543898):
+	Updating Particles positions in local cell 71:
+
+Updating periodic BCs
+
+Starting timestep 3:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.026628,0.013305,0.428316) to (-0.073372,0.013305,0.428316):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.108700,0.070846,0.484961) to (0.008700,0.070846,0.484961):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.195513,0.054303,0.100663) to (0.095513,0.054303,0.100663):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.286236,0.007617,0.153544) to (0.186236,0.007617,0.153544):
+		Updating particleInCell 1:
+		Changing its coords from (0.320218,0.055930,0.161165) to (0.220218,0.055930,0.161165):
+	Updating Particles positions in local cell 4:
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.442325,0.060967,0.087923) to (0.342325,0.060967,0.087923):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.017361,0.098022,0.469106) to (-0.082639,0.098022,0.469106):
+		Updating particleInCell 1:
+		Changing its coords from (0.072422,0.091075,0.348450) to (-0.027578,0.091075,0.348450):
+	Updating Particles positions in local cell 7:
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.167006,0.106500,0.365872) to (0.067006,0.106500,0.365872):
+		Updating particleInCell 1:
+		Changing its coords from (0.234506,0.156430,0.498144) to (0.134506,0.156430,0.498144):
+	Updating Particles positions in local cell 9:
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.351311,0.140818,0.725730) to (0.251311,0.140818,0.725730):
+		Updating particleInCell 1:
+		Changing its coords from (0.411840,0.103240,0.917154) to (0.311840,0.103240,0.917154):
+	Updating Particles positions in local cell 11:
+	Updating Particles positions in local cell 12:
+	Updating Particles positions in local cell 13:
+		Updating particleInCell 0:
+		Changing its coords from (0.088268,0.177688,0.813771) to (-0.011732,0.177688,0.813771):
+		Updating particleInCell 1:
+		Changing its coords from (0.137018,0.184061,0.063715) to (0.037018,0.184061,0.063715):
+	Updating Particles positions in local cell 14:
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.288116,0.190569,0.789944) to (0.188116,0.190569,0.789944):
+		Updating particleInCell 1:
+		Changing its coords from (0.325617,0.215226,0.684585) to (0.225617,0.215226,0.684585):
+	Updating Particles positions in local cell 16:
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.451040,0.201550,0.412512) to (0.351040,0.201550,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.473597,0.228148,0.708363) to (0.373597,0.228148,0.708363):
+	Updating Particles positions in local cell 18:
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.129246,0.311610,0.744761) to (0.029246,0.311610,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.149212,0.283724,0.516097) to (0.049212,0.283724,0.516097):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.220799,0.278227,0.881840) to (0.120799,0.278227,0.881840):
+	Updating Particles positions in local cell 21:
+	Updating Particles positions in local cell 22:
+		Updating particleInCell 0:
+		Changing its coords from (0.349385,0.262412,0.211121) to (0.249385,0.262412,0.211121):
+		Updating particleInCell 1:
+		Changing its coords from (0.409731,0.252765,0.671870) to (0.309731,0.252765,0.671870):
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.477176,0.295573,0.392572) to (0.377176,0.295573,0.392572):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.079420,0.375913,0.558967) to (-0.020580,0.375913,0.558967):
+	Updating Particles positions in local cell 25:
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.180429,0.371442,0.925924) to (0.080429,0.371442,0.925924):
+		Updating particleInCell 1:
+		Changing its coords from (0.217008,0.400402,0.757598) to (0.117008,0.400402,0.757598):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.307569,0.386903,0.185594) to (0.207569,0.386903,0.185594):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.406618,0.343580,0.669197) to (0.306618,0.343580,0.669197):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.482432,0.390663,0.379149) to (0.382432,0.390663,0.379149):
+	Updating Particles positions in local cell 30:
+		Updating particleInCell 0:
+		Changing its coords from (0.041211,0.450583,0.382567) to (-0.058789,0.450583,0.382567):
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.117248,0.490369,0.632784) to (0.017248,0.490369,0.632784):
+		Updating particleInCell 1:
+		Changing its coords from (0.150534,0.425532,0.077820) to (0.050534,0.425532,0.077820):
+	Updating Particles positions in local cell 32:
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.293245,0.464135,0.582185) to (0.193245,0.464135,0.582185):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.378434,0.484579,0.751425) to (0.278434,0.484579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.399936,0.463040,0.739388) to (0.299936,0.463040,0.739388):
+	Updating Particles positions in local cell 35:
+	Updating Particles positions in local cell 36:
+	Updating Particles positions in local cell 37:
+		Updating particleInCell 0:
+		Changing its coords from (0.108758,0.546891,0.230269) to (0.008758,0.546891,0.230269):
+		Updating particleInCell 1:
+		Changing its coords from (0.144624,0.503993,0.377044) to (0.044624,0.503993,0.377044):
+	Updating Particles positions in local cell 38:
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.298848,0.555396,0.466709) to (0.198848,0.555396,0.466709):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.365683,0.514829,0.736755) to (0.265683,0.514829,0.736755):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.436213,0.575754,0.451488) to (0.336213,0.575754,0.451488):
+		Updating particleInCell 1:
+		Changing its coords from (0.479352,0.529855,0.321813) to (0.379352,0.529855,0.321813):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.013733,0.622575,0.408698) to (-0.086267,0.622575,0.408698):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.131828,0.616802,0.032166) to (0.031828,0.616802,0.032166):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.185139,0.607826,0.771763) to (0.085139,0.607826,0.771763):
+		Updating particleInCell 1:
+		Changing its coords from (0.218318,0.590916,0.233312) to (0.118318,0.590916,0.233312):
+	Updating Particles positions in local cell 45:
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.381050,0.617379,0.376295) to (0.281050,0.617379,0.376295):
+		Updating particleInCell 1:
+		Changing its coords from (0.416190,0.633054,0.774592) to (0.316190,0.633054,0.774592):
+	Updating Particles positions in local cell 47:
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.037365,0.725691,0.316657) to (-0.062635,0.725691,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.055175,0.729032,0.170111) to (-0.044825,0.729032,0.170111):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.137709,0.702589,0.860921) to (0.037709,0.702589,0.860921):
+	Updating Particles positions in local cell 50:
+	Updating Particles positions in local cell 51:
+		Updating particleInCell 0:
+		Changing its coords from (0.258807,0.748913,0.711434) to (0.158807,0.748913,0.711434):
+		Updating particleInCell 1:
+		Changing its coords from (0.322725,0.695985,0.106081) to (0.222725,0.695985,0.106081):
+	Updating Particles positions in local cell 52:
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.457951,0.678929,0.126605) to (0.357951,0.678929,0.126605):
+	Updating Particles positions in local cell 54:
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.092326,0.782070,0.929035) to (-0.007674,0.782070,0.929035):
+		Updating particleInCell 1:
+		Changing its coords from (0.157797,0.751889,0.991404) to (0.057797,0.751889,0.991404):
+	Updating Particles positions in local cell 56:
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.305346,0.761198,0.516861) to (0.205346,0.761198,0.516861):
+		Updating particleInCell 1:
+		Changing its coords from (0.261117,0.751617,0.115447) to (0.161117,0.751617,0.115447):
+	Updating Particles positions in local cell 58:
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.457111,0.821769,0.724586) to (0.357111,0.821769,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.476621,0.795172,0.483519) to (0.376621,0.795172,0.483519):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.035808,0.899393,0.081151) to (-0.064192,0.899393,0.081151):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.125043,0.833508,0.137948) to (0.025043,0.833508,0.137948):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.174786,0.866016,0.534845) to (0.074786,0.866016,0.534845):
+		Updating particleInCell 1:
+		Changing its coords from (0.228320,0.851032,0.601838) to (0.128320,0.851032,0.601838):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.326061,0.839325,0.451692) to (0.226061,0.839325,0.451692):
+	Updating Particles positions in local cell 64:
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.432779,0.868259,0.892297) to (0.332779,0.868259,0.892297):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.046266,0.917322,0.071914) to (-0.053734,0.917322,0.071914):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.105396,0.953880,0.262791) to (0.005396,0.953880,0.262791):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.193736,0.946017,0.518640) to (0.093736,0.946017,0.518640):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.307840,0.936869,0.543898) to (0.207840,0.936869,0.543898):
+		Updating particleInCell 1:
+		Changing its coords from (0.281395,0.969559,0.488147) to (0.181395,0.969559,0.488147):
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.407648,0.994438,0.311891) to (0.307648,0.994438,0.311891):
+	Updating Particles positions in local cell 71:
+
+Updating periodic BCs
+
+Starting timestep 4:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.008700,0.070846,0.484961) to (-0.091300,0.070846,0.484961):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.095513,0.054303,0.100663) to (-0.004487,0.054303,0.100663):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.186236,0.007617,0.153544) to (0.086236,0.007617,0.153544):
+		Updating particleInCell 1:
+		Changing its coords from (0.220218,0.055930,0.161165) to (0.120218,0.055930,0.161165):
+	Updating Particles positions in local cell 3:
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.342325,0.060967,0.087923) to (0.242325,0.060967,0.087923):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.426628,0.013305,0.428316) to (0.326628,0.013305,0.428316):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.067006,0.106500,0.365872) to (-0.032994,0.106500,0.365872):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.134506,0.156430,0.498144) to (0.034506,0.156430,0.498144):
+	Updating Particles positions in local cell 8:
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.311840,0.103240,0.917154) to (0.211840,0.103240,0.917154):
+		Updating particleInCell 1:
+		Changing its coords from (0.251311,0.140818,0.725730) to (0.151311,0.140818,0.725730):
+	Updating Particles positions in local cell 10:
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.417361,0.098022,0.469106) to (0.317361,0.098022,0.469106):
+		Updating particleInCell 1:
+		Changing its coords from (0.472422,0.091075,0.348450) to (0.372422,0.091075,0.348450):
+	Updating Particles positions in local cell 12:
+		Updating particleInCell 0:
+		Changing its coords from (0.037018,0.184061,0.063715) to (-0.062982,0.184061,0.063715):
+	Updating Particles positions in local cell 13:
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.188116,0.190569,0.789944) to (0.088116,0.190569,0.789944):
+		Updating particleInCell 1:
+		Changing its coords from (0.225617,0.215226,0.684585) to (0.125617,0.215226,0.684585):
+	Updating Particles positions in local cell 15:
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.351040,0.201550,0.412512) to (0.251040,0.201550,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.373597,0.228148,0.708363) to (0.273597,0.228148,0.708363):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.488268,0.177688,0.813771) to (0.388268,0.177688,0.813771):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.029246,0.311610,0.744761) to (-0.070754,0.311610,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.049212,0.283724,0.516097) to (-0.050788,0.283724,0.516097):
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.120799,0.278227,0.881840) to (0.020799,0.278227,0.881840):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.249385,0.262412,0.211121) to (0.149385,0.262412,0.211121):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.309731,0.252765,0.671870) to (0.209731,0.252765,0.671870):
+	Updating Particles positions in local cell 22:
+		Updating particleInCell 0:
+		Changing its coords from (0.377176,0.295573,0.392572) to (0.277176,0.295573,0.392572):
+	Updating Particles positions in local cell 23:
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.080429,0.371442,0.925924) to (-0.019571,0.371442,0.925924):
+	Updating Particles positions in local cell 25:
+		Updating particleInCell 0:
+		Changing its coords from (0.117008,0.400402,0.757598) to (0.017008,0.400402,0.757598):
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.207569,0.386903,0.185594) to (0.107569,0.386903,0.185594):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.306618,0.343580,0.669197) to (0.206618,0.343580,0.669197):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.382432,0.390663,0.379149) to (0.282432,0.390663,0.379149):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.479420,0.375913,0.558967) to (0.379420,0.375913,0.558967):
+	Updating Particles positions in local cell 30:
+		Updating particleInCell 0:
+		Changing its coords from (0.017248,0.490369,0.632784) to (-0.082752,0.490369,0.632784):
+		Updating particleInCell 1:
+		Changing its coords from (0.050534,0.425532,0.077820) to (-0.049466,0.425532,0.077820):
+	Updating Particles positions in local cell 31:
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.193245,0.464135,0.582185) to (0.093245,0.464135,0.582185):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.278434,0.484579,0.751425) to (0.178434,0.484579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.299936,0.463040,0.739388) to (0.199936,0.463040,0.739388):
+	Updating Particles positions in local cell 34:
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.441211,0.450583,0.382567) to (0.341211,0.450583,0.382567):
+	Updating Particles positions in local cell 36:
+		Updating particleInCell 0:
+		Changing its coords from (0.008758,0.546891,0.230269) to (-0.091242,0.546891,0.230269):
+		Updating particleInCell 1:
+		Changing its coords from (0.044624,0.503993,0.377044) to (-0.055376,0.503993,0.377044):
+	Updating Particles positions in local cell 37:
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.198848,0.555396,0.466709) to (0.098848,0.555396,0.466709):
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.265683,0.514829,0.736755) to (0.165683,0.514829,0.736755):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.336213,0.575754,0.451488) to (0.236213,0.575754,0.451488):
+		Updating particleInCell 1:
+		Changing its coords from (0.379352,0.529855,0.321813) to (0.279352,0.529855,0.321813):
+	Updating Particles positions in local cell 41:
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.031828,0.616802,0.032166) to (-0.068172,0.616802,0.032166):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.085139,0.607826,0.771763) to (-0.014861,0.607826,0.771763):
+		Updating particleInCell 1:
+		Changing its coords from (0.118318,0.590916,0.233312) to (0.018318,0.590916,0.233312):
+	Updating Particles positions in local cell 44:
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.316190,0.633054,0.774592) to (0.216190,0.633054,0.774592):
+		Updating particleInCell 1:
+		Changing its coords from (0.281050,0.617379,0.376295) to (0.181050,0.617379,0.376295):
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.413733,0.622575,0.408698) to (0.313733,0.622575,0.408698):
+	Updating Particles positions in local cell 47:
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.037709,0.702589,0.860921) to (-0.062291,0.702589,0.860921):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.158807,0.748913,0.711434) to (0.058807,0.748913,0.711434):
+	Updating Particles positions in local cell 50:
+		Updating particleInCell 0:
+		Changing its coords from (0.222725,0.695985,0.106081) to (0.122725,0.695985,0.106081):
+	Updating Particles positions in local cell 51:
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.357951,0.678929,0.126605) to (0.257951,0.678929,0.126605):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.437365,0.725691,0.316657) to (0.337365,0.725691,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.455175,0.729032,0.170111) to (0.355175,0.729032,0.170111):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.057797,0.751889,0.991404) to (-0.042203,0.751889,0.991404):
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.161117,0.751617,0.115447) to (0.061117,0.751617,0.115447):
+	Updating Particles positions in local cell 56:
+		Updating particleInCell 0:
+		Changing its coords from (0.205346,0.761198,0.516861) to (0.105346,0.761198,0.516861):
+	Updating Particles positions in local cell 57:
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.357111,0.821769,0.724586) to (0.257111,0.821769,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.376621,0.795172,0.483519) to (0.276621,0.795172,0.483519):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.492326,0.782070,0.929035) to (0.392326,0.782070,0.929035):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.025043,0.833508,0.137948) to (-0.074957,0.833508,0.137948):
+		Updating particleInCell 1:
+		Changing its coords from (0.074786,0.866016,0.534845) to (-0.025214,0.866016,0.534845):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.128320,0.851032,0.601838) to (0.028320,0.851032,0.601838):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.226061,0.839325,0.451692) to (0.126061,0.839325,0.451692):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.332779,0.868259,0.892297) to (0.232779,0.868259,0.892297):
+	Updating Particles positions in local cell 64:
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.435808,0.899393,0.081151) to (0.335808,0.899393,0.081151):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.005396,0.953880,0.262791) to (-0.094604,0.953880,0.262791):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.093736,0.946017,0.518640) to (-0.006264,0.946017,0.518640):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.207840,0.936869,0.543898) to (0.107840,0.936869,0.543898):
+		Updating particleInCell 1:
+		Changing its coords from (0.181395,0.969559,0.488147) to (0.081395,0.969559,0.488147):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.307648,0.994438,0.311891) to (0.207648,0.994438,0.311891):
+	Updating Particles positions in local cell 70:
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.446266,0.917322,0.071914) to (0.346266,0.917322,0.071914):
+
+Updating periodic BCs
+
+Starting timestep 5:
+	Updating Particles positions in local cell 0:
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.086236,0.007617,0.153544) to (-0.013764,0.007617,0.153544):
+		Updating particleInCell 1:
+		Changing its coords from (0.120218,0.055930,0.161165) to (0.020218,0.055930,0.161165):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.242325,0.060967,0.087923) to (0.142325,0.060967,0.087923):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.326628,0.013305,0.428316) to (0.226628,0.013305,0.428316):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.408700,0.070846,0.484961) to (0.308700,0.070846,0.484961):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.495513,0.054303,0.100663) to (0.395513,0.054303,0.100663):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.034506,0.156430,0.498144) to (-0.065494,0.156430,0.498144):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.151311,0.140818,0.725730) to (0.051311,0.140818,0.725730):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.211840,0.103240,0.917154) to (0.111840,0.103240,0.917154):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.317361,0.098022,0.469106) to (0.217361,0.098022,0.469106):
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.372422,0.091075,0.348450) to (0.272422,0.091075,0.348450):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.467006,0.106500,0.365872) to (0.367006,0.106500,0.365872):
+	Updating Particles positions in local cell 12:
+	Updating Particles positions in local cell 13:
+		Updating particleInCell 0:
+		Changing its coords from (0.088116,0.190569,0.789944) to (-0.011884,0.190569,0.789944):
+		Updating particleInCell 1:
+		Changing its coords from (0.125617,0.215226,0.684585) to (0.025617,0.215226,0.684585):
+	Updating Particles positions in local cell 14:
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.251040,0.201550,0.412512) to (0.151040,0.201550,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.273597,0.228148,0.708363) to (0.173597,0.228148,0.708363):
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.388268,0.177688,0.813771) to (0.288268,0.177688,0.813771):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.437018,0.184061,0.063715) to (0.337018,0.184061,0.063715):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.020799,0.278227,0.881840) to (-0.079201,0.278227,0.881840):
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.149385,0.262412,0.211121) to (0.049385,0.262412,0.211121):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.209731,0.252765,0.671870) to (0.109731,0.252765,0.671870):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.277176,0.295573,0.392572) to (0.177176,0.295573,0.392572):
+	Updating Particles positions in local cell 22:
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.429246,0.311610,0.744761) to (0.329246,0.311610,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.449212,0.283724,0.516097) to (0.349212,0.283724,0.516097):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.017008,0.400402,0.757598) to (-0.082992,0.400402,0.757598):
+	Updating Particles positions in local cell 25:
+		Updating particleInCell 0:
+		Changing its coords from (0.107569,0.386903,0.185594) to (0.007569,0.386903,0.185594):
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.206618,0.343580,0.669197) to (0.106618,0.343580,0.669197):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.282432,0.390663,0.379149) to (0.182432,0.390663,0.379149):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.379420,0.375913,0.558967) to (0.279420,0.375913,0.558967):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.480429,0.371442,0.925924) to (0.380429,0.371442,0.925924):
+	Updating Particles positions in local cell 30:
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.093245,0.464135,0.582185) to (-0.006755,0.464135,0.582185):
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.178434,0.484579,0.751425) to (0.078434,0.484579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.199936,0.463040,0.739388) to (0.099936,0.463040,0.739388):
+	Updating Particles positions in local cell 33:
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.341211,0.450583,0.382567) to (0.241211,0.450583,0.382567):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.417248,0.490369,0.632784) to (0.317248,0.490369,0.632784):
+		Updating particleInCell 1:
+		Changing its coords from (0.450534,0.425532,0.077820) to (0.350534,0.425532,0.077820):
+	Updating Particles positions in local cell 36:
+	Updating Particles positions in local cell 37:
+		Updating particleInCell 0:
+		Changing its coords from (0.098848,0.555396,0.466709) to (-0.001152,0.555396,0.466709):
+		Updating particleInCell 1:
+		Changing its coords from (0.165683,0.514829,0.736755) to (0.065683,0.514829,0.736755):
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.236213,0.575754,0.451488) to (0.136213,0.575754,0.451488):
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.279352,0.529855,0.321813) to (0.179352,0.529855,0.321813):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.408758,0.546891,0.230269) to (0.308758,0.546891,0.230269):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.444624,0.503993,0.377044) to (0.344624,0.503993,0.377044):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.018318,0.590916,0.233312) to (-0.081682,0.590916,0.233312):
+	Updating Particles positions in local cell 43:
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.216190,0.633054,0.774592) to (0.116190,0.633054,0.774592):
+		Updating particleInCell 1:
+		Changing its coords from (0.181050,0.617379,0.376295) to (0.081050,0.617379,0.376295):
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.313733,0.622575,0.408698) to (0.213733,0.622575,0.408698):
+	Updating Particles positions in local cell 46:
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.431828,0.616802,0.032166) to (0.331828,0.616802,0.032166):
+		Updating particleInCell 1:
+		Changing its coords from (0.485139,0.607826,0.771763) to (0.385139,0.607826,0.771763):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.058807,0.748913,0.711434) to (-0.041193,0.748913,0.711434):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.122725,0.695985,0.106081) to (0.022725,0.695985,0.106081):
+	Updating Particles positions in local cell 50:
+	Updating Particles positions in local cell 51:
+		Updating particleInCell 0:
+		Changing its coords from (0.257951,0.678929,0.126605) to (0.157951,0.678929,0.126605):
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.355175,0.729032,0.170111) to (0.255175,0.729032,0.170111):
+		Updating particleInCell 1:
+		Changing its coords from (0.337365,0.725691,0.316657) to (0.237365,0.725691,0.316657):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.437709,0.702589,0.860921) to (0.337709,0.702589,0.860921):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.061117,0.751617,0.115447) to (-0.038883,0.751617,0.115447):
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.105346,0.761198,0.516861) to (0.005346,0.761198,0.516861):
+	Updating Particles positions in local cell 56:
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.257111,0.821769,0.724586) to (0.157111,0.821769,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.276621,0.795172,0.483519) to (0.176621,0.795172,0.483519):
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.392326,0.782070,0.929035) to (0.292326,0.782070,0.929035):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.457797,0.751889,0.991404) to (0.357797,0.751889,0.991404):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.028320,0.851032,0.601838) to (-0.071680,0.851032,0.601838):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.126061,0.839325,0.451692) to (0.026061,0.839325,0.451692):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.232779,0.868259,0.892297) to (0.132779,0.868259,0.892297):
+	Updating Particles positions in local cell 63:
+	Updating Particles positions in local cell 64:
+		Updating particleInCell 0:
+		Changing its coords from (0.335808,0.899393,0.081151) to (0.235808,0.899393,0.081151):
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.425043,0.833508,0.137948) to (0.325043,0.833508,0.137948):
+		Updating particleInCell 1:
+		Changing its coords from (0.474786,0.866016,0.534845) to (0.374786,0.866016,0.534845):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.081395,0.969559,0.488147) to (-0.018605,0.969559,0.488147):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.107840,0.936869,0.543898) to (0.007840,0.936869,0.543898):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.207648,0.994438,0.311891) to (0.107648,0.994438,0.311891):
+	Updating Particles positions in local cell 69:
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.346266,0.917322,0.071914) to (0.246266,0.917322,0.071914):
+		Updating particleInCell 1:
+		Changing its coords from (0.405396,0.953880,0.262791) to (0.305396,0.953880,0.262791):
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.493736,0.946017,0.518640) to (0.393736,0.946017,0.518640):
+
+Updating periodic BCs
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testPeriodicBCs.1of2.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testPeriodicBCs.1of2.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,1535 @@
+StGermain Framework revision 4046. Copyright (C) 2003-2005 VPAC.
+StGermain Domain Library revision 4046. Copyright (C) 2003-2007 VPAC.
+StGermain Finite Element Framework revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Discretisation Framework revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain SLE Library revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain PETSc-LinearAlgebra Interface revision 793. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Assembly Library revision 793. Copyright (C) 2003-2005 VPAC.
+Watching rank: 1
+Swarm (ptr): 0x64cbc0
+Stg_Component (ptr): 0x64cbc0
+Stg_Object (ptr): 0x64cbc0
+	Stg_Class (ptr): 0x64cbc0
+		sizeOfSelf: 376
+		_deleteSelf: Yes
+		type: Swarm
+		_delete (func ptr): 0x2aaaab9cb3a0
+		_print (func ptr): 0x2aaaab9caf60
+		_copy (func ptr): 0x2aaaab9ca8c0
+	name: testSwarm
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0x2aaaab9cb920
+	_construct (func ptr): 0x2aaaab9cb6b0
+	_build (func ptr): 0x2aaaab9ca800
+	_initialise (func ptr): 0x2aaaab9ca5b0
+	_execute (func ptr): 0x2aaaab9c9290
+	_destroy (func ptr): 0x2aaaab9c92a0
+	isConstructed: True
+	isBuilt: True
+	isInitialised: True
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: testSwarm-Construct
+	build function name: testSwarm-Build
+	initialise function name: testSwarm-Initialise
+	execute function name: testSwarm-Execute
+	destroy function name: testSwarm-Destroy
+ElementCellLayout (ptr): 0x64bc80
+CellLayout (ptr): 0x64bc80
+Stg_Component (ptr): 0x64bc80
+Stg_Object (ptr): 0x64bc80
+	Stg_Class (ptr): 0x64bc80
+		sizeOfSelf: 248
+		_deleteSelf: Yes
+		type: ElementCellLayout
+		_delete (func ptr): 0x2aaaab9c0c20
+		_print (func ptr): 0x2aaaab9c0bc0
+		_copy (func ptr): 0x2aaaab9c0ae0
+	name: elementCellLayout
+	nameAllocationType: NON_GLOBAL
+	_defaultConstructor (func ptr): 0x2aaaab9c0f00
+	_construct (func ptr): 0x2aaaab9c0cc0
+	_build (func ptr): 0x2aaaab9c0ad0
+	_initialise (func ptr): 0x2aaaab9c0ac0
+	_execute (func ptr): 0x2aaaab9c0760
+	_destroy (func ptr): 0x2aaaab9c0770
+	isConstructed: True
+	isBuilt: True
+	isInitialised: True
+	hasExecuted: False
+	isDestroyed: False
+	constructor function name: elementCellLayout-Construct
+	build function name: elementCellLayout-Build
+	initialise function name: elementCellLayout-Initialise
+	execute function name: elementCellLayout-Execute
+	destroy function name: elementCellLayout-Destroy
+	_cellLocalCount (func ptr): 0x2aaaab9c0780
+	_cellShadowCount (func ptr): 0x2aaaab9c0790
+	_pointCount (func ptr): 0x2aaaab9c07a0
+	_initialisePoints (func ptr): 0x2aaaab9c07c0
+	_mapElementIdToCellId (func ptr): 0x2aaaab9c0810
+	_isInCell (func ptr): 0x2aaaab9c0970
+	_cellOf (func ptr): 0x2aaaab9c0830
+	_getShadowInfo (func ptr): 0x2aaaab9c0820
+	mesh (ptr): 0x64a570
+RandomParticleLayout (ptr): 0x64c490:
+PerCellParticleLayout (ptr): 0x64c490
+ParticleLayout (ptr): 0x64c490
+Stg_Class (ptr): 0x64c490
+	sizeOfSelf: 232
+	_deleteSelf: Yes
+	type: RandomParticleLayout
+	_delete (func ptr): 0x2aaaab9c7d80
+	_print (func ptr): 0x2aaaab9c7d10
+	_copy (func ptr): 0x2aaaab9c7ce0
+	_setInitialCounts (func ptr): 0x2aaaab9c72b0
+	_initialiseParticles (func ptr): 0x2aaaab9c7200
+	coordSystem: GlobalCoordSystem
+	weightsInitialisedAtStartup : False
+	_initialCount (func ptr): 0x2aaaab9c7c00
+	_initialiseParticlesOfCell (func ptr): 0x2aaaab9c7c10
+	cellParticleCount: 1
+	seed: 13
+	cellLocalCount: 72
+	cellDomainCount: 84
+	cellShadowCount: 12
+	cellPointCountTbl (ptr): 0x6550e0
+	cellPointCountTbl[0-84]: 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 008 
+	cellPointTbl (ptr): 0x657020
+	cellPointTbl[0-84]: {
+	cellPointTbl[0][0-8]: {0.5 0 0} {0.583 0 0} {0.583 0.0833 0} {0.5 0.0833 0} {0.5 0 1} {0.583 0 1} {0.583 0.0833 1} {0.5 0.0833 1} 
+	cellPointTbl[1][0-8]: {0.583 0 0} {0.667 0 0} {0.667 0.0833 0} {0.583 0.0833 0} {0.583 0 1} {0.667 0 1} {0.667 0.0833 1} {0.583 0.0833 1} 
+	cellPointTbl[2][0-8]: {0.667 0 0} {0.75 0 0} {0.75 0.0833 0} {0.667 0.0833 0} {0.667 0 1} {0.75 0 1} {0.75 0.0833 1} {0.667 0.0833 1} 
+	cellPointTbl[3][0-8]: {0.75 0 0} {0.833 0 0} {0.833 0.0833 0} {0.75 0.0833 0} {0.75 0 1} {0.833 0 1} {0.833 0.0833 1} {0.75 0.0833 1} 
+	cellPointTbl[4][0-8]: {0.833 0 0} {0.917 0 0} {0.917 0.0833 0} {0.833 0.0833 0} {0.833 0 1} {0.917 0 1} {0.917 0.0833 1} {0.833 0.0833 1} 
+	cellPointTbl[5][0-8]: {0.917 0 0} {1 0 0} {1 0.0833 0} {0.917 0.0833 0} {0.917 0 1} {1 0 1} {1 0.0833 1} {0.917 0.0833 1} 
+	cellPointTbl[6][0-8]: {0.5 0.0833 0} {0.583 0.0833 0} {0.583 0.167 0} {0.5 0.167 0} {0.5 0.0833 1} {0.583 0.0833 1} {0.583 0.167 1} {0.5 0.167 1} 
+	cellPointTbl[7][0-8]: {0.583 0.0833 0} {0.667 0.0833 0} {0.667 0.167 0} {0.583 0.167 0} {0.583 0.0833 1} {0.667 0.0833 1} {0.667 0.167 1} {0.583 0.167 1} 
+	cellPointTbl[8][0-8]: {0.667 0.0833 0} {0.75 0.0833 0} {0.75 0.167 0} {0.667 0.167 0} {0.667 0.0833 1} {0.75 0.0833 1} {0.75 0.167 1} {0.667 0.167 1} 
+	cellPointTbl[9][0-8]: {0.75 0.0833 0} {0.833 0.0833 0} {0.833 0.167 0} {0.75 0.167 0} {0.75 0.0833 1} {0.833 0.0833 1} {0.833 0.167 1} {0.75 0.167 1} 
+	cellPointTbl[10][0-8]: {0.833 0.0833 0} {0.917 0.0833 0} {0.917 0.167 0} {0.833 0.167 0} {0.833 0.0833 1} {0.917 0.0833 1} {0.917 0.167 1} {0.833 0.167 1} 
+	cellPointTbl[11][0-8]: {0.917 0.0833 0} {1 0.0833 0} {1 0.167 0} {0.917 0.167 0} {0.917 0.0833 1} {1 0.0833 1} {1 0.167 1} {0.917 0.167 1} 
+	cellPointTbl[12][0-8]: {0.5 0.167 0} {0.583 0.167 0} {0.583 0.25 0} {0.5 0.25 0} {0.5 0.167 1} {0.583 0.167 1} {0.583 0.25 1} {0.5 0.25 1} 
+	cellPointTbl[13][0-8]: {0.583 0.167 0} {0.667 0.167 0} {0.667 0.25 0} {0.583 0.25 0} {0.583 0.167 1} {0.667 0.167 1} {0.667 0.25 1} {0.583 0.25 1} 
+	cellPointTbl[14][0-8]: {0.667 0.167 0} {0.75 0.167 0} {0.75 0.25 0} {0.667 0.25 0} {0.667 0.167 1} {0.75 0.167 1} {0.75 0.25 1} {0.667 0.25 1} 
+	cellPointTbl[15][0-8]: {0.75 0.167 0} {0.833 0.167 0} {0.833 0.25 0} {0.75 0.25 0} {0.75 0.167 1} {0.833 0.167 1} {0.833 0.25 1} {0.75 0.25 1} 
+	cellPointTbl[16][0-8]: {0.833 0.167 0} {0.917 0.167 0} {0.917 0.25 0} {0.833 0.25 0} {0.833 0.167 1} {0.917 0.167 1} {0.917 0.25 1} {0.833 0.25 1} 
+	cellPointTbl[17][0-8]: {0.917 0.167 0} {1 0.167 0} {1 0.25 0} {0.917 0.25 0} {0.917 0.167 1} {1 0.167 1} {1 0.25 1} {0.917 0.25 1} 
+	cellPointTbl[18][0-8]: {0.5 0.25 0} {0.583 0.25 0} {0.583 0.333 0} {0.5 0.333 0} {0.5 0.25 1} {0.583 0.25 1} {0.583 0.333 1} {0.5 0.333 1} 
+	cellPointTbl[19][0-8]: {0.583 0.25 0} {0.667 0.25 0} {0.667 0.333 0} {0.583 0.333 0} {0.583 0.25 1} {0.667 0.25 1} {0.667 0.333 1} {0.583 0.333 1} 
+	cellPointTbl[20][0-8]: {0.667 0.25 0} {0.75 0.25 0} {0.75 0.333 0} {0.667 0.333 0} {0.667 0.25 1} {0.75 0.25 1} {0.75 0.333 1} {0.667 0.333 1} 
+	cellPointTbl[21][0-8]: {0.75 0.25 0} {0.833 0.25 0} {0.833 0.333 0} {0.75 0.333 0} {0.75 0.25 1} {0.833 0.25 1} {0.833 0.333 1} {0.75 0.333 1} 
+	cellPointTbl[22][0-8]: {0.833 0.25 0} {0.917 0.25 0} {0.917 0.333 0} {0.833 0.333 0} {0.833 0.25 1} {0.917 0.25 1} {0.917 0.333 1} {0.833 0.333 1} 
+	cellPointTbl[23][0-8]: {0.917 0.25 0} {1 0.25 0} {1 0.333 0} {0.917 0.333 0} {0.917 0.25 1} {1 0.25 1} {1 0.333 1} {0.917 0.333 1} 
+	cellPointTbl[24][0-8]: {0.5 0.333 0} {0.583 0.333 0} {0.583 0.417 0} {0.5 0.417 0} {0.5 0.333 1} {0.583 0.333 1} {0.583 0.417 1} {0.5 0.417 1} 
+	cellPointTbl[25][0-8]: {0.583 0.333 0} {0.667 0.333 0} {0.667 0.417 0} {0.583 0.417 0} {0.583 0.333 1} {0.667 0.333 1} {0.667 0.417 1} {0.583 0.417 1} 
+	cellPointTbl[26][0-8]: {0.667 0.333 0} {0.75 0.333 0} {0.75 0.417 0} {0.667 0.417 0} {0.667 0.333 1} {0.75 0.333 1} {0.75 0.417 1} {0.667 0.417 1} 
+	cellPointTbl[27][0-8]: {0.75 0.333 0} {0.833 0.333 0} {0.833 0.417 0} {0.75 0.417 0} {0.75 0.333 1} {0.833 0.333 1} {0.833 0.417 1} {0.75 0.417 1} 
+	cellPointTbl[28][0-8]: {0.833 0.333 0} {0.917 0.333 0} {0.917 0.417 0} {0.833 0.417 0} {0.833 0.333 1} {0.917 0.333 1} {0.917 0.417 1} {0.833 0.417 1} 
+	cellPointTbl[29][0-8]: {0.917 0.333 0} {1 0.333 0} {1 0.417 0} {0.917 0.417 0} {0.917 0.333 1} {1 0.333 1} {1 0.417 1} {0.917 0.417 1} 
+	cellPointTbl[30][0-8]: {0.5 0.417 0} {0.583 0.417 0} {0.583 0.5 0} {0.5 0.5 0} {0.5 0.417 1} {0.583 0.417 1} {0.583 0.5 1} {0.5 0.5 1} 
+	cellPointTbl[31][0-8]: {0.583 0.417 0} {0.667 0.417 0} {0.667 0.5 0} {0.583 0.5 0} {0.583 0.417 1} {0.667 0.417 1} {0.667 0.5 1} {0.583 0.5 1} 
+	cellPointTbl[32][0-8]: {0.667 0.417 0} {0.75 0.417 0} {0.75 0.5 0} {0.667 0.5 0} {0.667 0.417 1} {0.75 0.417 1} {0.75 0.5 1} {0.667 0.5 1} 
+	cellPointTbl[33][0-8]: {0.75 0.417 0} {0.833 0.417 0} {0.833 0.5 0} {0.75 0.5 0} {0.75 0.417 1} {0.833 0.417 1} {0.833 0.5 1} {0.75 0.5 1} 
+	cellPointTbl[34][0-8]: {0.833 0.417 0} {0.917 0.417 0} {0.917 0.5 0} {0.833 0.5 0} {0.833 0.417 1} {0.917 0.417 1} {0.917 0.5 1} {0.833 0.5 1} 
+	cellPointTbl[35][0-8]: {0.917 0.417 0} {1 0.417 0} {1 0.5 0} {0.917 0.5 0} {0.917 0.417 1} {1 0.417 1} {1 0.5 1} {0.917 0.5 1} 
+	cellPointTbl[36][0-8]: {0.5 0.5 0} {0.583 0.5 0} {0.583 0.583 0} {0.5 0.583 0} {0.5 0.5 1} {0.583 0.5 1} {0.583 0.583 1} {0.5 0.583 1} 
+	cellPointTbl[37][0-8]: {0.583 0.5 0} {0.667 0.5 0} {0.667 0.583 0} {0.583 0.583 0} {0.583 0.5 1} {0.667 0.5 1} {0.667 0.583 1} {0.583 0.583 1} 
+	cellPointTbl[38][0-8]: {0.667 0.5 0} {0.75 0.5 0} {0.75 0.583 0} {0.667 0.583 0} {0.667 0.5 1} {0.75 0.5 1} {0.75 0.583 1} {0.667 0.583 1} 
+	cellPointTbl[39][0-8]: {0.75 0.5 0} {0.833 0.5 0} {0.833 0.583 0} {0.75 0.583 0} {0.75 0.5 1} {0.833 0.5 1} {0.833 0.583 1} {0.75 0.583 1} 
+	cellPointTbl[40][0-8]: {0.833 0.5 0} {0.917 0.5 0} {0.917 0.583 0} {0.833 0.583 0} {0.833 0.5 1} {0.917 0.5 1} {0.917 0.583 1} {0.833 0.583 1} 
+	cellPointTbl[41][0-8]: {0.917 0.5 0} {1 0.5 0} {1 0.583 0} {0.917 0.583 0} {0.917 0.5 1} {1 0.5 1} {1 0.583 1} {0.917 0.583 1} 
+	cellPointTbl[42][0-8]: {0.5 0.583 0} {0.583 0.583 0} {0.583 0.667 0} {0.5 0.667 0} {0.5 0.583 1} {0.583 0.583 1} {0.583 0.667 1} {0.5 0.667 1} 
+	cellPointTbl[43][0-8]: {0.583 0.583 0} {0.667 0.583 0} {0.667 0.667 0} {0.583 0.667 0} {0.583 0.583 1} {0.667 0.583 1} {0.667 0.667 1} {0.583 0.667 1} 
+	cellPointTbl[44][0-8]: {0.667 0.583 0} {0.75 0.583 0} {0.75 0.667 0} {0.667 0.667 0} {0.667 0.583 1} {0.75 0.583 1} {0.75 0.667 1} {0.667 0.667 1} 
+	cellPointTbl[45][0-8]: {0.75 0.583 0} {0.833 0.583 0} {0.833 0.667 0} {0.75 0.667 0} {0.75 0.583 1} {0.833 0.583 1} {0.833 0.667 1} {0.75 0.667 1} 
+	cellPointTbl[46][0-8]: {0.833 0.583 0} {0.917 0.583 0} {0.917 0.667 0} {0.833 0.667 0} {0.833 0.583 1} {0.917 0.583 1} {0.917 0.667 1} {0.833 0.667 1} 
+	cellPointTbl[47][0-8]: {0.917 0.583 0} {1 0.583 0} {1 0.667 0} {0.917 0.667 0} {0.917 0.583 1} {1 0.583 1} {1 0.667 1} {0.917 0.667 1} 
+	cellPointTbl[48][0-8]: {0.5 0.667 0} {0.583 0.667 0} {0.583 0.75 0} {0.5 0.75 0} {0.5 0.667 1} {0.583 0.667 1} {0.583 0.75 1} {0.5 0.75 1} 
+	cellPointTbl[49][0-8]: {0.583 0.667 0} {0.667 0.667 0} {0.667 0.75 0} {0.583 0.75 0} {0.583 0.667 1} {0.667 0.667 1} {0.667 0.75 1} {0.583 0.75 1} 
+	cellPointTbl[50][0-8]: {0.667 0.667 0} {0.75 0.667 0} {0.75 0.75 0} {0.667 0.75 0} {0.667 0.667 1} {0.75 0.667 1} {0.75 0.75 1} {0.667 0.75 1} 
+	cellPointTbl[51][0-8]: {0.75 0.667 0} {0.833 0.667 0} {0.833 0.75 0} {0.75 0.75 0} {0.75 0.667 1} {0.833 0.667 1} {0.833 0.75 1} {0.75 0.75 1} 
+	cellPointTbl[52][0-8]: {0.833 0.667 0} {0.917 0.667 0} {0.917 0.75 0} {0.833 0.75 0} {0.833 0.667 1} {0.917 0.667 1} {0.917 0.75 1} {0.833 0.75 1} 
+	cellPointTbl[53][0-8]: {0.917 0.667 0} {1 0.667 0} {1 0.75 0} {0.917 0.75 0} {0.917 0.667 1} {1 0.667 1} {1 0.75 1} {0.917 0.75 1} 
+	cellPointTbl[54][0-8]: {0.5 0.75 0} {0.583 0.75 0} {0.583 0.833 0} {0.5 0.833 0} {0.5 0.75 1} {0.583 0.75 1} {0.583 0.833 1} {0.5 0.833 1} 
+	cellPointTbl[55][0-8]: {0.583 0.75 0} {0.667 0.75 0} {0.667 0.833 0} {0.583 0.833 0} {0.583 0.75 1} {0.667 0.75 1} {0.667 0.833 1} {0.583 0.833 1} 
+	cellPointTbl[56][0-8]: {0.667 0.75 0} {0.75 0.75 0} {0.75 0.833 0} {0.667 0.833 0} {0.667 0.75 1} {0.75 0.75 1} {0.75 0.833 1} {0.667 0.833 1} 
+	cellPointTbl[57][0-8]: {0.75 0.75 0} {0.833 0.75 0} {0.833 0.833 0} {0.75 0.833 0} {0.75 0.75 1} {0.833 0.75 1} {0.833 0.833 1} {0.75 0.833 1} 
+	cellPointTbl[58][0-8]: {0.833 0.75 0} {0.917 0.75 0} {0.917 0.833 0} {0.833 0.833 0} {0.833 0.75 1} {0.917 0.75 1} {0.917 0.833 1} {0.833 0.833 1} 
+	cellPointTbl[59][0-8]: {0.917 0.75 0} {1 0.75 0} {1 0.833 0} {0.917 0.833 0} {0.917 0.75 1} {1 0.75 1} {1 0.833 1} {0.917 0.833 1} 
+	cellPointTbl[60][0-8]: {0.5 0.833 0} {0.583 0.833 0} {0.583 0.917 0} {0.5 0.917 0} {0.5 0.833 1} {0.583 0.833 1} {0.583 0.917 1} {0.5 0.917 1} 
+	cellPointTbl[61][0-8]: {0.583 0.833 0} {0.667 0.833 0} {0.667 0.917 0} {0.583 0.917 0} {0.583 0.833 1} {0.667 0.833 1} {0.667 0.917 1} {0.583 0.917 1} 
+	cellPointTbl[62][0-8]: {0.667 0.833 0} {0.75 0.833 0} {0.75 0.917 0} {0.667 0.917 0} {0.667 0.833 1} {0.75 0.833 1} {0.75 0.917 1} {0.667 0.917 1} 
+	cellPointTbl[63][0-8]: {0.75 0.833 0} {0.833 0.833 0} {0.833 0.917 0} {0.75 0.917 0} {0.75 0.833 1} {0.833 0.833 1} {0.833 0.917 1} {0.75 0.917 1} 
+	cellPointTbl[64][0-8]: {0.833 0.833 0} {0.917 0.833 0} {0.917 0.917 0} {0.833 0.917 0} {0.833 0.833 1} {0.917 0.833 1} {0.917 0.917 1} {0.833 0.917 1} 
+	cellPointTbl[65][0-8]: {0.917 0.833 0} {1 0.833 0} {1 0.917 0} {0.917 0.917 0} {0.917 0.833 1} {1 0.833 1} {1 0.917 1} {0.917 0.917 1} 
+	cellPointTbl[66][0-8]: {0.5 0.917 0} {0.583 0.917 0} {0.583 1 0} {0.5 1 0} {0.5 0.917 1} {0.583 0.917 1} {0.583 1 1} {0.5 1 1} 
+	cellPointTbl[67][0-8]: {0.583 0.917 0} {0.667 0.917 0} {0.667 1 0} {0.583 1 0} {0.583 0.917 1} {0.667 0.917 1} {0.667 1 1} {0.583 1 1} 
+	cellPointTbl[68][0-8]: {0.667 0.917 0} {0.75 0.917 0} {0.75 1 0} {0.667 1 0} {0.667 0.917 1} {0.75 0.917 1} {0.75 1 1} {0.667 1 1} 
+	cellPointTbl[69][0-8]: {0.75 0.917 0} {0.833 0.917 0} {0.833 1 0} {0.75 1 0} {0.75 0.917 1} {0.833 0.917 1} {0.833 1 1} {0.75 1 1} 
+	cellPointTbl[70][0-8]: {0.833 0.917 0} {0.917 0.917 0} {0.917 1 0} {0.833 1 0} {0.833 0.917 1} {0.917 0.917 1} {0.917 1 1} {0.833 1 1} 
+	cellPointTbl[71][0-8]: {0.917 0.917 0} {1 0.917 0} {1 1 0} {0.917 1 0} {0.917 0.917 1} {1 0.917 1} {1 1 1} {0.917 1 1} 
+	cellPointTbl[72][0-8]: {0.417 0 0} {0.5 0 0} {0.5 0.0833 0} {0.417 0.0833 0} {0.417 0 1} {0.5 0 1} {0.5 0.0833 1} {0.417 0.0833 1} 
+	cellPointTbl[73][0-8]: {0.417 0.0833 0} {0.5 0.0833 0} {0.5 0.167 0} {0.417 0.167 0} {0.417 0.0833 1} {0.5 0.0833 1} {0.5 0.167 1} {0.417 0.167 1} 
+	cellPointTbl[74][0-8]: {0.417 0.167 0} {0.5 0.167 0} {0.5 0.25 0} {0.417 0.25 0} {0.417 0.167 1} {0.5 0.167 1} {0.5 0.25 1} {0.417 0.25 1} 
+	cellPointTbl[75][0-8]: {0.417 0.25 0} {0.5 0.25 0} {0.5 0.333 0} {0.417 0.333 0} {0.417 0.25 1} {0.5 0.25 1} {0.5 0.333 1} {0.417 0.333 1} 
+	cellPointTbl[76][0-8]: {0.417 0.333 0} {0.5 0.333 0} {0.5 0.417 0} {0.417 0.417 0} {0.417 0.333 1} {0.5 0.333 1} {0.5 0.417 1} {0.417 0.417 1} 
+	cellPointTbl[77][0-8]: {0.417 0.417 0} {0.5 0.417 0} {0.5 0.5 0} {0.417 0.5 0} {0.417 0.417 1} {0.5 0.417 1} {0.5 0.5 1} {0.417 0.5 1} 
+	cellPointTbl[78][0-8]: {0.417 0.5 0} {0.5 0.5 0} {0.5 0.583 0} {0.417 0.583 0} {0.417 0.5 1} {0.5 0.5 1} {0.5 0.583 1} {0.417 0.583 1} 
+	cellPointTbl[79][0-8]: {0.417 0.583 0} {0.5 0.583 0} {0.5 0.667 0} {0.417 0.667 0} {0.417 0.583 1} {0.5 0.583 1} {0.5 0.667 1} {0.417 0.667 1} 
+	cellPointTbl[80][0-8]: {0.417 0.667 0} {0.5 0.667 0} {0.5 0.75 0} {0.417 0.75 0} {0.417 0.667 1} {0.5 0.667 1} {0.5 0.75 1} {0.417 0.75 1} 
+	cellPointTbl[81][0-8]: {0.417 0.75 0} {0.5 0.75 0} {0.5 0.833 0} {0.417 0.833 0} {0.417 0.75 1} {0.5 0.75 1} {0.5 0.833 1} {0.417 0.833 1} 
+	cellPointTbl[82][0-8]: {0.417 0.833 0} {0.5 0.833 0} {0.5 0.917 0} {0.417 0.917 0} {0.417 0.833 1} {0.5 0.833 1} {0.5 0.917 1} {0.417 0.917 1} 
+	cellPointTbl[83][0-8]: {0.417 0.917 0} {0.5 0.917 0} {0.5 1 0} {0.417 1 0} {0.417 0.917 1} {0.5 0.917 1} {0.5 1 1} {0.417 1 1} 
+}
+
+	cellParticleCountTbl (ptr): 0x6587e0
+	cellParticleCountTbl[0-84]: 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 000 000 000 000 000 000 000 000 000 000 000 000 
+	cellParticleSizeTbl (ptr): 0x658950
+	cellParticleSizeTbl[0-84]: 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 001 000 000 000 000 000 000 000 000 000 000 000 000 
+	cellParticleTbl (ptr): 0x658ac0
+	cellParticleTbl [0-84]: {
+		cellParticleTbl[0][0-1]:
+			(part. index) 0
+
+		cellParticleTbl[1][0-1]:
+			(part. index) 1
+
+		cellParticleTbl[2][0-1]:
+			(part. index) 2
+
+		cellParticleTbl[3][0-1]:
+			(part. index) 3
+
+		cellParticleTbl[4][0-1]:
+			(part. index) 4
+
+		cellParticleTbl[5][0-1]:
+			(part. index) 5
+
+		cellParticleTbl[6][0-1]:
+			(part. index) 6
+
+		cellParticleTbl[7][0-1]:
+			(part. index) 7
+
+		cellParticleTbl[8][0-1]:
+			(part. index) 8
+
+		cellParticleTbl[9][0-1]:
+			(part. index) 9
+
+		cellParticleTbl[10][0-1]:
+			(part. index) 10
+
+		cellParticleTbl[11][0-1]:
+			(part. index) 11
+
+		cellParticleTbl[12][0-1]:
+			(part. index) 12
+
+		cellParticleTbl[13][0-1]:
+			(part. index) 13
+
+		cellParticleTbl[14][0-1]:
+			(part. index) 14
+
+		cellParticleTbl[15][0-1]:
+			(part. index) 15
+
+		cellParticleTbl[16][0-1]:
+			(part. index) 16
+
+		cellParticleTbl[17][0-1]:
+			(part. index) 17
+
+		cellParticleTbl[18][0-1]:
+			(part. index) 18
+
+		cellParticleTbl[19][0-1]:
+			(part. index) 19
+
+		cellParticleTbl[20][0-1]:
+			(part. index) 20
+
+		cellParticleTbl[21][0-1]:
+			(part. index) 21
+
+		cellParticleTbl[22][0-1]:
+			(part. index) 22
+
+		cellParticleTbl[23][0-1]:
+			(part. index) 23
+
+		cellParticleTbl[24][0-1]:
+			(part. index) 24
+
+		cellParticleTbl[25][0-1]:
+			(part. index) 25
+
+		cellParticleTbl[26][0-1]:
+			(part. index) 26
+
+		cellParticleTbl[27][0-1]:
+			(part. index) 27
+
+		cellParticleTbl[28][0-1]:
+			(part. index) 28
+
+		cellParticleTbl[29][0-1]:
+			(part. index) 29
+
+		cellParticleTbl[30][0-1]:
+			(part. index) 30
+
+		cellParticleTbl[31][0-1]:
+			(part. index) 31
+
+		cellParticleTbl[32][0-1]:
+			(part. index) 32
+
+		cellParticleTbl[33][0-1]:
+			(part. index) 33
+
+		cellParticleTbl[34][0-1]:
+			(part. index) 34
+
+		cellParticleTbl[35][0-1]:
+			(part. index) 35
+
+		cellParticleTbl[36][0-1]:
+			(part. index) 36
+
+		cellParticleTbl[37][0-1]:
+			(part. index) 37
+
+		cellParticleTbl[38][0-1]:
+			(part. index) 38
+
+		cellParticleTbl[39][0-1]:
+			(part. index) 39
+
+		cellParticleTbl[40][0-1]:
+			(part. index) 40
+
+		cellParticleTbl[41][0-1]:
+			(part. index) 41
+
+		cellParticleTbl[42][0-1]:
+			(part. index) 42
+
+		cellParticleTbl[43][0-1]:
+			(part. index) 43
+
+		cellParticleTbl[44][0-1]:
+			(part. index) 44
+
+		cellParticleTbl[45][0-1]:
+			(part. index) 45
+
+		cellParticleTbl[46][0-1]:
+			(part. index) 46
+
+		cellParticleTbl[47][0-1]:
+			(part. index) 47
+
+		cellParticleTbl[48][0-1]:
+			(part. index) 48
+
+		cellParticleTbl[49][0-1]:
+			(part. index) 49
+
+		cellParticleTbl[50][0-1]:
+			(part. index) 50
+
+		cellParticleTbl[51][0-1]:
+			(part. index) 51
+
+		cellParticleTbl[52][0-1]:
+			(part. index) 52
+
+		cellParticleTbl[53][0-1]:
+			(part. index) 53
+
+		cellParticleTbl[54][0-1]:
+			(part. index) 54
+
+		cellParticleTbl[55][0-1]:
+			(part. index) 55
+
+		cellParticleTbl[56][0-1]:
+			(part. index) 56
+
+		cellParticleTbl[57][0-1]:
+			(part. index) 57
+
+		cellParticleTbl[58][0-1]:
+			(part. index) 58
+
+		cellParticleTbl[59][0-1]:
+			(part. index) 59
+
+		cellParticleTbl[60][0-1]:
+			(part. index) 60
+
+		cellParticleTbl[61][0-1]:
+			(part. index) 61
+
+		cellParticleTbl[62][0-1]:
+			(part. index) 62
+
+		cellParticleTbl[63][0-1]:
+			(part. index) 63
+
+		cellParticleTbl[64][0-1]:
+			(part. index) 64
+
+		cellParticleTbl[65][0-1]:
+			(part. index) 65
+
+		cellParticleTbl[66][0-1]:
+			(part. index) 66
+
+		cellParticleTbl[67][0-1]:
+			(part. index) 67
+
+		cellParticleTbl[68][0-1]:
+			(part. index) 68
+
+		cellParticleTbl[69][0-1]:
+			(part. index) 69
+
+		cellParticleTbl[70][0-1]:
+			(part. index) 70
+
+		cellParticleTbl[71][0-1]:
+			(part. index) 71
+
+		cellParticleTbl[72][0-0]:
+
+		cellParticleTbl[73][0-0]:
+
+		cellParticleTbl[74][0-0]:
+
+		cellParticleTbl[75][0-0]:
+
+		cellParticleTbl[76][0-0]:
+
+		cellParticleTbl[77][0-0]:
+
+		cellParticleTbl[78][0-0]:
+
+		cellParticleTbl[79][0-0]:
+
+		cellParticleTbl[80][0-0]:
+
+		cellParticleTbl[81][0-0]:
+
+		cellParticleTbl[82][0-0]:
+
+		cellParticleTbl[83][0-0]:
+
+	}
+	particlesArraySize: 75
+	particlesArrayDelta: 3
+	extraParticlesFactor: 0.05
+
+Starting timestep 1:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.520218,0.055930,0.161165) to (0.420218,0.055930,0.161165):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.642325,0.060967,0.087923) to (0.542325,0.060967,0.087923):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.726628,0.013305,0.428316) to (0.626628,0.013305,0.428316):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.808700,0.070846,0.484961) to (0.708700,0.070846,0.484961):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.895513,0.054303,0.100663) to (0.795513,0.054303,0.100663):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.986236,0.007617,0.153544) to (0.886236,0.007617,0.153544):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.551311,0.140818,0.725730) to (0.451311,0.140818,0.725730):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.611840,0.103240,0.917154) to (0.511840,0.103240,0.917154):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.717361,0.098022,0.469106) to (0.617361,0.098022,0.469106):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.772422,0.091075,0.348450) to (0.672422,0.091075,0.348450):
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.867006,0.106500,0.365872) to (0.767006,0.106500,0.365872):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.934506,0.156430,0.498144) to (0.834506,0.156430,0.498144):
+	Updating Particles positions in local cell 12:
+		Updating particleInCell 0:
+		Changing its coords from (0.525617,0.215226,0.684585) to (0.425617,0.215226,0.684585):
+	Updating Particles positions in local cell 13:
+		Updating particleInCell 0:
+		Changing its coords from (0.651040,0.201550,0.412512) to (0.551040,0.201550,0.412512):
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.673597,0.228148,0.708363) to (0.573597,0.228148,0.708363):
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.788268,0.177688,0.813771) to (0.688268,0.177688,0.813771):
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.837018,0.184061,0.063715) to (0.737018,0.184061,0.063715):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.988116,0.190569,0.789944) to (0.888116,0.190569,0.789944):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.549385,0.262412,0.211121) to (0.449385,0.262412,0.211121):
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.609731,0.252765,0.671870) to (0.509731,0.252765,0.671870):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.677176,0.295573,0.392572) to (0.577176,0.295573,0.392572):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.829246,0.311610,0.744761) to (0.729246,0.311610,0.744761):
+	Updating Particles positions in local cell 22:
+		Updating particleInCell 0:
+		Changing its coords from (0.849212,0.283724,0.516097) to (0.749212,0.283724,0.516097):
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.920799,0.278227,0.881840) to (0.820799,0.278227,0.881840):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.507569,0.386903,0.185594) to (0.407569,0.386903,0.185594):
+	Updating Particles positions in local cell 25:
+		Updating particleInCell 0:
+		Changing its coords from (0.606618,0.343580,0.669197) to (0.506618,0.343580,0.669197):
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.682432,0.390663,0.379149) to (0.582432,0.390663,0.379149):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.779420,0.375913,0.558967) to (0.679420,0.375913,0.558967):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.880429,0.371442,0.925924) to (0.780429,0.371442,0.925924):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.917008,0.400402,0.757598) to (0.817008,0.400402,0.757598):
+	Updating Particles positions in local cell 30:
+		Updating particleInCell 0:
+		Changing its coords from (0.578434,0.484579,0.751425) to (0.478434,0.484579,0.751425):
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.599936,0.463040,0.739388) to (0.499936,0.463040,0.739388):
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.741211,0.450583,0.382567) to (0.641211,0.450583,0.382567):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.817248,0.490369,0.632784) to (0.717248,0.490369,0.632784):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.850534,0.425532,0.077820) to (0.750534,0.425532,0.077820):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.993245,0.464135,0.582185) to (0.893245,0.464135,0.582185):
+	Updating Particles positions in local cell 36:
+		Updating particleInCell 0:
+		Changing its coords from (0.565683,0.514829,0.736755) to (0.465683,0.514829,0.736755):
+	Updating Particles positions in local cell 37:
+		Updating particleInCell 0:
+		Changing its coords from (0.636213,0.575754,0.451488) to (0.536213,0.575754,0.451488):
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.679352,0.529855,0.321813) to (0.579352,0.529855,0.321813):
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.808758,0.546891,0.230269) to (0.708758,0.546891,0.230269):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.844624,0.503993,0.377044) to (0.744624,0.503993,0.377044):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.998848,0.555396,0.466709) to (0.898848,0.555396,0.466709):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.581050,0.617379,0.376295) to (0.481050,0.617379,0.376295):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.616190,0.633054,0.774592) to (0.516190,0.633054,0.774592):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.713733,0.622575,0.408698) to (0.613733,0.622575,0.408698):
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.831828,0.616802,0.032166) to (0.731828,0.616802,0.032166):
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.885139,0.607826,0.771763) to (0.785139,0.607826,0.771763):
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.918318,0.590916,0.233312) to (0.818318,0.590916,0.233312):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.522725,0.695985,0.106081) to (0.422725,0.695985,0.106081):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.657951,0.678929,0.126605) to (0.557951,0.678929,0.126605):
+	Updating Particles positions in local cell 50:
+		Updating particleInCell 0:
+		Changing its coords from (0.737365,0.725691,0.316657) to (0.637365,0.725691,0.316657):
+	Updating Particles positions in local cell 51:
+		Updating particleInCell 0:
+		Changing its coords from (0.755175,0.729032,0.170111) to (0.655175,0.729032,0.170111):
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.837709,0.702589,0.860921) to (0.737709,0.702589,0.860921):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.958807,0.748913,0.711434) to (0.858807,0.748913,0.711434):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.505346,0.761198,0.516861) to (0.405346,0.761198,0.516861):
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.657111,0.821769,0.724586) to (0.557111,0.821769,0.724586):
+	Updating Particles positions in local cell 56:
+		Updating particleInCell 0:
+		Changing its coords from (0.676621,0.795172,0.483519) to (0.576621,0.795172,0.483519):
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.792326,0.782070,0.929035) to (0.692326,0.782070,0.929035):
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.857797,0.751889,0.991404) to (0.757797,0.751889,0.991404):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.961117,0.751617,0.115447) to (0.861117,0.751617,0.115447):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.526061,0.839325,0.451692) to (0.426061,0.839325,0.451692):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.632779,0.868259,0.892297) to (0.532779,0.868259,0.892297):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.735808,0.899393,0.081151) to (0.635808,0.899393,0.081151):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.825043,0.833508,0.137948) to (0.725043,0.833508,0.137948):
+	Updating Particles positions in local cell 64:
+		Updating particleInCell 0:
+		Changing its coords from (0.874786,0.866016,0.534845) to (0.774786,0.866016,0.534845):
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.928320,0.851032,0.601838) to (0.828320,0.851032,0.601838):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.507840,0.936869,0.543898) to (0.407840,0.936869,0.543898):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.607648,0.994438,0.311891) to (0.507648,0.994438,0.311891):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.746266,0.917322,0.071914) to (0.646266,0.917322,0.071914):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.805396,0.953880,0.262791) to (0.705396,0.953880,0.262791):
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.893736,0.946017,0.518640) to (0.793736,0.946017,0.518640):
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.981395,0.969559,0.488147) to (0.881395,0.969559,0.488147):
+
+Updating periodic BCs
+
+Starting timestep 2:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.542325,0.060967,0.087923) to (0.442325,0.060967,0.087923):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.626628,0.013305,0.428316) to (0.526628,0.013305,0.428316):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.708700,0.070846,0.484961) to (0.608700,0.070846,0.484961):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.795513,0.054303,0.100663) to (0.695513,0.054303,0.100663):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.886236,0.007617,0.153544) to (0.786236,0.007617,0.153544):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.920218,0.055930,0.161165) to (0.820218,0.055930,0.161165):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.511840,0.103240,0.917154) to (0.411840,0.103240,0.917154):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.617361,0.098022,0.469106) to (0.517361,0.098022,0.469106):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.672422,0.091075,0.348450) to (0.572422,0.091075,0.348450):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.767006,0.106500,0.365872) to (0.667006,0.106500,0.365872):
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.834506,0.156430,0.498144) to (0.734506,0.156430,0.498144):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.951311,0.140818,0.725730) to (0.851311,0.140818,0.725730):
+	Updating Particles positions in local cell 12:
+		Updating particleInCell 0:
+		Changing its coords from (0.551040,0.201550,0.412512) to (0.451040,0.201550,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.573597,0.228148,0.708363) to (0.473597,0.228148,0.708363):
+	Updating Particles positions in local cell 13:
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.688268,0.177688,0.813771) to (0.588268,0.177688,0.813771):
+		Updating particleInCell 1:
+		Changing its coords from (0.737018,0.184061,0.063715) to (0.637018,0.184061,0.063715):
+	Updating Particles positions in local cell 15:
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.888116,0.190569,0.789944) to (0.788116,0.190569,0.789944):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.925617,0.215226,0.684585) to (0.825617,0.215226,0.684585):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.509731,0.252765,0.671870) to (0.409731,0.252765,0.671870):
+		Updating particleInCell 1:
+		Changing its coords from (0.577176,0.295573,0.392572) to (0.477176,0.295573,0.392572):
+	Updating Particles positions in local cell 19:
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.729246,0.311610,0.744761) to (0.629246,0.311610,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.749212,0.283724,0.516097) to (0.649212,0.283724,0.516097):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.820799,0.278227,0.881840) to (0.720799,0.278227,0.881840):
+	Updating Particles positions in local cell 22:
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.949385,0.262412,0.211121) to (0.849385,0.262412,0.211121):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.506618,0.343580,0.669197) to (0.406618,0.343580,0.669197):
+		Updating particleInCell 1:
+		Changing its coords from (0.582432,0.390663,0.379149) to (0.482432,0.390663,0.379149):
+	Updating Particles positions in local cell 25:
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.679420,0.375913,0.558967) to (0.579420,0.375913,0.558967):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.780429,0.371442,0.925924) to (0.680429,0.371442,0.925924):
+		Updating particleInCell 1:
+		Changing its coords from (0.817008,0.400402,0.757598) to (0.717008,0.400402,0.757598):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.907569,0.386903,0.185594) to (0.807569,0.386903,0.185594):
+	Updating Particles positions in local cell 29:
+	Updating Particles positions in local cell 30:
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.641211,0.450583,0.382567) to (0.541211,0.450583,0.382567):
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.717248,0.490369,0.632784) to (0.617248,0.490369,0.632784):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.750534,0.425532,0.077820) to (0.650534,0.425532,0.077820):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.893245,0.464135,0.582185) to (0.793245,0.464135,0.582185):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.978434,0.484579,0.751425) to (0.878434,0.484579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.999936,0.463040,0.739388) to (0.899936,0.463040,0.739388):
+	Updating Particles positions in local cell 36:
+		Updating particleInCell 0:
+		Changing its coords from (0.536213,0.575754,0.451488) to (0.436213,0.575754,0.451488):
+		Updating particleInCell 1:
+		Changing its coords from (0.579352,0.529855,0.321813) to (0.479352,0.529855,0.321813):
+	Updating Particles positions in local cell 37:
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.708758,0.546891,0.230269) to (0.608758,0.546891,0.230269):
+		Updating particleInCell 1:
+		Changing its coords from (0.744624,0.503993,0.377044) to (0.644624,0.503993,0.377044):
+	Updating Particles positions in local cell 39:
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.898848,0.555396,0.466709) to (0.798848,0.555396,0.466709):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.965683,0.514829,0.736755) to (0.865683,0.514829,0.736755):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.516190,0.633054,0.774592) to (0.416190,0.633054,0.774592):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.613733,0.622575,0.408698) to (0.513733,0.622575,0.408698):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.731828,0.616802,0.032166) to (0.631828,0.616802,0.032166):
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.785139,0.607826,0.771763) to (0.685139,0.607826,0.771763):
+		Updating particleInCell 1:
+		Changing its coords from (0.818318,0.590916,0.233312) to (0.718318,0.590916,0.233312):
+	Updating Particles positions in local cell 46:
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.981050,0.617379,0.376295) to (0.881050,0.617379,0.376295):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.557951,0.678929,0.126605) to (0.457951,0.678929,0.126605):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.637365,0.725691,0.316657) to (0.537365,0.725691,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.655175,0.729032,0.170111) to (0.555175,0.729032,0.170111):
+	Updating Particles positions in local cell 50:
+		Updating particleInCell 0:
+		Changing its coords from (0.737709,0.702589,0.860921) to (0.637709,0.702589,0.860921):
+	Updating Particles positions in local cell 51:
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.858807,0.748913,0.711434) to (0.758807,0.748913,0.711434):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.922725,0.695985,0.106081) to (0.822725,0.695985,0.106081):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.557111,0.821769,0.724586) to (0.457111,0.821769,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.576621,0.795172,0.483519) to (0.476621,0.795172,0.483519):
+	Updating Particles positions in local cell 55:
+	Updating Particles positions in local cell 56:
+		Updating particleInCell 0:
+		Changing its coords from (0.692326,0.782070,0.929035) to (0.592326,0.782070,0.929035):
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.757797,0.751889,0.991404) to (0.657797,0.751889,0.991404):
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.861117,0.751617,0.115447) to (0.761117,0.751617,0.115447):
+		Updating particleInCell 1:
+		Changing its coords from (0.905346,0.761198,0.516861) to (0.805346,0.761198,0.516861):
+	Updating Particles positions in local cell 59:
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.532779,0.868259,0.892297) to (0.432779,0.868259,0.892297):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.635808,0.899393,0.081151) to (0.535808,0.899393,0.081151):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.725043,0.833508,0.137948) to (0.625043,0.833508,0.137948):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.774786,0.866016,0.534845) to (0.674786,0.866016,0.534845):
+		Updating particleInCell 1:
+		Changing its coords from (0.828320,0.851032,0.601838) to (0.728320,0.851032,0.601838):
+	Updating Particles positions in local cell 64:
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.926061,0.839325,0.451692) to (0.826061,0.839325,0.451692):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.507648,0.994438,0.311891) to (0.407648,0.994438,0.311891):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.646266,0.917322,0.071914) to (0.546266,0.917322,0.071914):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.705396,0.953880,0.262791) to (0.605396,0.953880,0.262791):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.793736,0.946017,0.518640) to (0.693736,0.946017,0.518640):
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.881395,0.969559,0.488147) to (0.781395,0.969559,0.488147):
+		Updating particleInCell 1:
+		Changing its coords from (0.907840,0.936869,0.543898) to (0.807840,0.936869,0.543898):
+	Updating Particles positions in local cell 71:
+
+Updating periodic BCs
+
+Starting timestep 3:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.526628,0.013305,0.428316) to (0.426628,0.013305,0.428316):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.608700,0.070846,0.484961) to (0.508700,0.070846,0.484961):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.695513,0.054303,0.100663) to (0.595513,0.054303,0.100663):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.820218,0.055930,0.161165) to (0.720218,0.055930,0.161165):
+		Updating particleInCell 1:
+		Changing its coords from (0.786236,0.007617,0.153544) to (0.686236,0.007617,0.153544):
+	Updating Particles positions in local cell 4:
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.942325,0.060967,0.087923) to (0.842325,0.060967,0.087923):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.517361,0.098022,0.469106) to (0.417361,0.098022,0.469106):
+		Updating particleInCell 1:
+		Changing its coords from (0.572422,0.091075,0.348450) to (0.472422,0.091075,0.348450):
+	Updating Particles positions in local cell 7:
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.667006,0.106500,0.365872) to (0.567006,0.106500,0.365872):
+		Updating particleInCell 1:
+		Changing its coords from (0.734506,0.156430,0.498144) to (0.634506,0.156430,0.498144):
+	Updating Particles positions in local cell 9:
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.851311,0.140818,0.725730) to (0.751311,0.140818,0.725730):
+		Updating particleInCell 1:
+		Changing its coords from (0.911840,0.103240,0.917154) to (0.811840,0.103240,0.917154):
+	Updating Particles positions in local cell 11:
+	Updating Particles positions in local cell 12:
+	Updating Particles positions in local cell 13:
+		Updating particleInCell 0:
+		Changing its coords from (0.588268,0.177688,0.813771) to (0.488268,0.177688,0.813771):
+		Updating particleInCell 1:
+		Changing its coords from (0.637018,0.184061,0.063715) to (0.537018,0.184061,0.063715):
+	Updating Particles positions in local cell 14:
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.825617,0.215226,0.684585) to (0.725617,0.215226,0.684585):
+		Updating particleInCell 1:
+		Changing its coords from (0.788116,0.190569,0.789944) to (0.688116,0.190569,0.789944):
+	Updating Particles positions in local cell 16:
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.951040,0.201550,0.412512) to (0.851040,0.201550,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.973597,0.228148,0.708363) to (0.873597,0.228148,0.708363):
+	Updating Particles positions in local cell 18:
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.629246,0.311610,0.744761) to (0.529246,0.311610,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.649212,0.283724,0.516097) to (0.549212,0.283724,0.516097):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.720799,0.278227,0.881840) to (0.620799,0.278227,0.881840):
+	Updating Particles positions in local cell 21:
+	Updating Particles positions in local cell 22:
+		Updating particleInCell 0:
+		Changing its coords from (0.849385,0.262412,0.211121) to (0.749385,0.262412,0.211121):
+		Updating particleInCell 1:
+		Changing its coords from (0.909731,0.252765,0.671870) to (0.809731,0.252765,0.671870):
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.977176,0.295573,0.392572) to (0.877176,0.295573,0.392572):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.579420,0.375913,0.558967) to (0.479420,0.375913,0.558967):
+	Updating Particles positions in local cell 25:
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.680429,0.371442,0.925924) to (0.580429,0.371442,0.925924):
+		Updating particleInCell 1:
+		Changing its coords from (0.717008,0.400402,0.757598) to (0.617008,0.400402,0.757598):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.807569,0.386903,0.185594) to (0.707569,0.386903,0.185594):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.906618,0.343580,0.669197) to (0.806618,0.343580,0.669197):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.982432,0.390663,0.379149) to (0.882432,0.390663,0.379149):
+	Updating Particles positions in local cell 30:
+		Updating particleInCell 0:
+		Changing its coords from (0.541211,0.450583,0.382567) to (0.441211,0.450583,0.382567):
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.617248,0.490369,0.632784) to (0.517248,0.490369,0.632784):
+		Updating particleInCell 1:
+		Changing its coords from (0.650534,0.425532,0.077820) to (0.550534,0.425532,0.077820):
+	Updating Particles positions in local cell 32:
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.793245,0.464135,0.582185) to (0.693245,0.464135,0.582185):
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.878434,0.484579,0.751425) to (0.778434,0.484579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.899936,0.463040,0.739388) to (0.799936,0.463040,0.739388):
+	Updating Particles positions in local cell 35:
+	Updating Particles positions in local cell 36:
+	Updating Particles positions in local cell 37:
+		Updating particleInCell 0:
+		Changing its coords from (0.608758,0.546891,0.230269) to (0.508758,0.546891,0.230269):
+		Updating particleInCell 1:
+		Changing its coords from (0.644624,0.503993,0.377044) to (0.544624,0.503993,0.377044):
+	Updating Particles positions in local cell 38:
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.798848,0.555396,0.466709) to (0.698848,0.555396,0.466709):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.865683,0.514829,0.736755) to (0.765683,0.514829,0.736755):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.936213,0.575754,0.451488) to (0.836213,0.575754,0.451488):
+		Updating particleInCell 1:
+		Changing its coords from (0.979352,0.529855,0.321813) to (0.879352,0.529855,0.321813):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.513733,0.622575,0.408698) to (0.413733,0.622575,0.408698):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.631828,0.616802,0.032166) to (0.531828,0.616802,0.032166):
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.685139,0.607826,0.771763) to (0.585139,0.607826,0.771763):
+		Updating particleInCell 1:
+		Changing its coords from (0.718318,0.590916,0.233312) to (0.618318,0.590916,0.233312):
+	Updating Particles positions in local cell 45:
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.881050,0.617379,0.376295) to (0.781050,0.617379,0.376295):
+		Updating particleInCell 1:
+		Changing its coords from (0.916190,0.633054,0.774592) to (0.816190,0.633054,0.774592):
+	Updating Particles positions in local cell 47:
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.537365,0.725691,0.316657) to (0.437365,0.725691,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.555175,0.729032,0.170111) to (0.455175,0.729032,0.170111):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.637709,0.702589,0.860921) to (0.537709,0.702589,0.860921):
+	Updating Particles positions in local cell 50:
+	Updating Particles positions in local cell 51:
+		Updating particleInCell 0:
+		Changing its coords from (0.758807,0.748913,0.711434) to (0.658807,0.748913,0.711434):
+		Updating particleInCell 1:
+		Changing its coords from (0.822725,0.695985,0.106081) to (0.722725,0.695985,0.106081):
+	Updating Particles positions in local cell 52:
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.957951,0.678929,0.126605) to (0.857951,0.678929,0.126605):
+	Updating Particles positions in local cell 54:
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.592326,0.782070,0.929035) to (0.492326,0.782070,0.929035):
+		Updating particleInCell 1:
+		Changing its coords from (0.657797,0.751889,0.991404) to (0.557797,0.751889,0.991404):
+	Updating Particles positions in local cell 56:
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.805346,0.761198,0.516861) to (0.705346,0.761198,0.516861):
+		Updating particleInCell 1:
+		Changing its coords from (0.761117,0.751617,0.115447) to (0.661117,0.751617,0.115447):
+	Updating Particles positions in local cell 58:
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.957111,0.821769,0.724586) to (0.857111,0.821769,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.976621,0.795172,0.483519) to (0.876621,0.795172,0.483519):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.535808,0.899393,0.081151) to (0.435808,0.899393,0.081151):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.625043,0.833508,0.137948) to (0.525043,0.833508,0.137948):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.674786,0.866016,0.534845) to (0.574786,0.866016,0.534845):
+		Updating particleInCell 1:
+		Changing its coords from (0.728320,0.851032,0.601838) to (0.628320,0.851032,0.601838):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.826061,0.839325,0.451692) to (0.726061,0.839325,0.451692):
+	Updating Particles positions in local cell 64:
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.932779,0.868259,0.892297) to (0.832779,0.868259,0.892297):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.546266,0.917322,0.071914) to (0.446266,0.917322,0.071914):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.605396,0.953880,0.262791) to (0.505396,0.953880,0.262791):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.693736,0.946017,0.518640) to (0.593736,0.946017,0.518640):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.807840,0.936869,0.543898) to (0.707840,0.936869,0.543898):
+		Updating particleInCell 1:
+		Changing its coords from (0.781395,0.969559,0.488147) to (0.681395,0.969559,0.488147):
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.907648,0.994438,0.311891) to (0.807648,0.994438,0.311891):
+	Updating Particles positions in local cell 71:
+
+Updating periodic BCs
+
+Starting timestep 4:
+	Updating Particles positions in local cell 0:
+		Updating particleInCell 0:
+		Changing its coords from (0.508700,0.070846,0.484961) to (0.408700,0.070846,0.484961):
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.595513,0.054303,0.100663) to (0.495513,0.054303,0.100663):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.720218,0.055930,0.161165) to (0.620218,0.055930,0.161165):
+		Updating particleInCell 1:
+		Changing its coords from (0.686236,0.007617,0.153544) to (0.586236,0.007617,0.153544):
+	Updating Particles positions in local cell 3:
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.842325,0.060967,0.087923) to (0.742325,0.060967,0.087923):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.926628,0.013305,0.428316) to (0.826628,0.013305,0.428316):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.567006,0.106500,0.365872) to (0.467006,0.106500,0.365872):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.634506,0.156430,0.498144) to (0.534506,0.156430,0.498144):
+	Updating Particles positions in local cell 8:
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.751311,0.140818,0.725730) to (0.651311,0.140818,0.725730):
+		Updating particleInCell 1:
+		Changing its coords from (0.811840,0.103240,0.917154) to (0.711840,0.103240,0.917154):
+	Updating Particles positions in local cell 10:
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.917361,0.098022,0.469106) to (0.817361,0.098022,0.469106):
+		Updating particleInCell 1:
+		Changing its coords from (0.972422,0.091075,0.348450) to (0.872422,0.091075,0.348450):
+	Updating Particles positions in local cell 12:
+		Updating particleInCell 0:
+		Changing its coords from (0.537018,0.184061,0.063715) to (0.437018,0.184061,0.063715):
+	Updating Particles positions in local cell 13:
+	Updating Particles positions in local cell 14:
+		Updating particleInCell 0:
+		Changing its coords from (0.725617,0.215226,0.684585) to (0.625617,0.215226,0.684585):
+		Updating particleInCell 1:
+		Changing its coords from (0.688116,0.190569,0.789944) to (0.588116,0.190569,0.789944):
+	Updating Particles positions in local cell 15:
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.851040,0.201550,0.412512) to (0.751040,0.201550,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.873597,0.228148,0.708363) to (0.773597,0.228148,0.708363):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.988268,0.177688,0.813771) to (0.888268,0.177688,0.813771):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.529246,0.311610,0.744761) to (0.429246,0.311610,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.549212,0.283724,0.516097) to (0.449212,0.283724,0.516097):
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.620799,0.278227,0.881840) to (0.520799,0.278227,0.881840):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.749385,0.262412,0.211121) to (0.649385,0.262412,0.211121):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.809731,0.252765,0.671870) to (0.709731,0.252765,0.671870):
+	Updating Particles positions in local cell 22:
+		Updating particleInCell 0:
+		Changing its coords from (0.877176,0.295573,0.392572) to (0.777176,0.295573,0.392572):
+	Updating Particles positions in local cell 23:
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.580429,0.371442,0.925924) to (0.480429,0.371442,0.925924):
+	Updating Particles positions in local cell 25:
+		Updating particleInCell 0:
+		Changing its coords from (0.617008,0.400402,0.757598) to (0.517008,0.400402,0.757598):
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.707569,0.386903,0.185594) to (0.607569,0.386903,0.185594):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.806618,0.343580,0.669197) to (0.706618,0.343580,0.669197):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.882432,0.390663,0.379149) to (0.782432,0.390663,0.379149):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.979420,0.375913,0.558967) to (0.879420,0.375913,0.558967):
+	Updating Particles positions in local cell 30:
+		Updating particleInCell 0:
+		Changing its coords from (0.517248,0.490369,0.632784) to (0.417248,0.490369,0.632784):
+		Updating particleInCell 1:
+		Changing its coords from (0.550534,0.425532,0.077820) to (0.450534,0.425532,0.077820):
+	Updating Particles positions in local cell 31:
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.693245,0.464135,0.582185) to (0.593245,0.464135,0.582185):
+	Updating Particles positions in local cell 33:
+		Updating particleInCell 0:
+		Changing its coords from (0.778434,0.484579,0.751425) to (0.678434,0.484579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.799936,0.463040,0.739388) to (0.699936,0.463040,0.739388):
+	Updating Particles positions in local cell 34:
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.941211,0.450583,0.382567) to (0.841211,0.450583,0.382567):
+	Updating Particles positions in local cell 36:
+		Updating particleInCell 0:
+		Changing its coords from (0.508758,0.546891,0.230269) to (0.408758,0.546891,0.230269):
+		Updating particleInCell 1:
+		Changing its coords from (0.544624,0.503993,0.377044) to (0.444624,0.503993,0.377044):
+	Updating Particles positions in local cell 37:
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.698848,0.555396,0.466709) to (0.598848,0.555396,0.466709):
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.765683,0.514829,0.736755) to (0.665683,0.514829,0.736755):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.836213,0.575754,0.451488) to (0.736213,0.575754,0.451488):
+		Updating particleInCell 1:
+		Changing its coords from (0.879352,0.529855,0.321813) to (0.779352,0.529855,0.321813):
+	Updating Particles positions in local cell 41:
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.531828,0.616802,0.032166) to (0.431828,0.616802,0.032166):
+	Updating Particles positions in local cell 43:
+		Updating particleInCell 0:
+		Changing its coords from (0.585139,0.607826,0.771763) to (0.485139,0.607826,0.771763):
+		Updating particleInCell 1:
+		Changing its coords from (0.618318,0.590916,0.233312) to (0.518318,0.590916,0.233312):
+	Updating Particles positions in local cell 44:
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.781050,0.617379,0.376295) to (0.681050,0.617379,0.376295):
+		Updating particleInCell 1:
+		Changing its coords from (0.816190,0.633054,0.774592) to (0.716190,0.633054,0.774592):
+	Updating Particles positions in local cell 46:
+		Updating particleInCell 0:
+		Changing its coords from (0.913733,0.622575,0.408698) to (0.813733,0.622575,0.408698):
+	Updating Particles positions in local cell 47:
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.537709,0.702589,0.860921) to (0.437709,0.702589,0.860921):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.658807,0.748913,0.711434) to (0.558807,0.748913,0.711434):
+	Updating Particles positions in local cell 50:
+		Updating particleInCell 0:
+		Changing its coords from (0.722725,0.695985,0.106081) to (0.622725,0.695985,0.106081):
+	Updating Particles positions in local cell 51:
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.857951,0.678929,0.126605) to (0.757951,0.678929,0.126605):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.937365,0.725691,0.316657) to (0.837365,0.725691,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.955175,0.729032,0.170111) to (0.855175,0.729032,0.170111):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.557797,0.751889,0.991404) to (0.457797,0.751889,0.991404):
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.661117,0.751617,0.115447) to (0.561117,0.751617,0.115447):
+	Updating Particles positions in local cell 56:
+		Updating particleInCell 0:
+		Changing its coords from (0.705346,0.761198,0.516861) to (0.605346,0.761198,0.516861):
+	Updating Particles positions in local cell 57:
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.857111,0.821769,0.724586) to (0.757111,0.821769,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.876621,0.795172,0.483519) to (0.776621,0.795172,0.483519):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.992326,0.782070,0.929035) to (0.892326,0.782070,0.929035):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.525043,0.833508,0.137948) to (0.425043,0.833508,0.137948):
+		Updating particleInCell 1:
+		Changing its coords from (0.574786,0.866016,0.534845) to (0.474786,0.866016,0.534845):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.628320,0.851032,0.601838) to (0.528320,0.851032,0.601838):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.726061,0.839325,0.451692) to (0.626061,0.839325,0.451692):
+	Updating Particles positions in local cell 63:
+		Updating particleInCell 0:
+		Changing its coords from (0.832779,0.868259,0.892297) to (0.732779,0.868259,0.892297):
+	Updating Particles positions in local cell 64:
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.935808,0.899393,0.081151) to (0.835808,0.899393,0.081151):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.505396,0.953880,0.262791) to (0.405396,0.953880,0.262791):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.593736,0.946017,0.518640) to (0.493736,0.946017,0.518640):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.707840,0.936869,0.543898) to (0.607840,0.936869,0.543898):
+		Updating particleInCell 1:
+		Changing its coords from (0.681395,0.969559,0.488147) to (0.581395,0.969559,0.488147):
+	Updating Particles positions in local cell 69:
+		Updating particleInCell 0:
+		Changing its coords from (0.807648,0.994438,0.311891) to (0.707648,0.994438,0.311891):
+	Updating Particles positions in local cell 70:
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.946266,0.917322,0.071914) to (0.846266,0.917322,0.071914):
+
+Updating periodic BCs
+
+Starting timestep 5:
+	Updating Particles positions in local cell 0:
+	Updating Particles positions in local cell 1:
+		Updating particleInCell 0:
+		Changing its coords from (0.620218,0.055930,0.161165) to (0.520218,0.055930,0.161165):
+		Updating particleInCell 1:
+		Changing its coords from (0.586236,0.007617,0.153544) to (0.486236,0.007617,0.153544):
+	Updating Particles positions in local cell 2:
+		Updating particleInCell 0:
+		Changing its coords from (0.742325,0.060967,0.087923) to (0.642325,0.060967,0.087923):
+	Updating Particles positions in local cell 3:
+		Updating particleInCell 0:
+		Changing its coords from (0.826628,0.013305,0.428316) to (0.726628,0.013305,0.428316):
+	Updating Particles positions in local cell 4:
+		Updating particleInCell 0:
+		Changing its coords from (0.908700,0.070846,0.484961) to (0.808700,0.070846,0.484961):
+	Updating Particles positions in local cell 5:
+		Updating particleInCell 0:
+		Changing its coords from (0.995513,0.054303,0.100663) to (0.895513,0.054303,0.100663):
+	Updating Particles positions in local cell 6:
+		Updating particleInCell 0:
+		Changing its coords from (0.534506,0.156430,0.498144) to (0.434506,0.156430,0.498144):
+	Updating Particles positions in local cell 7:
+		Updating particleInCell 0:
+		Changing its coords from (0.651311,0.140818,0.725730) to (0.551311,0.140818,0.725730):
+	Updating Particles positions in local cell 8:
+		Updating particleInCell 0:
+		Changing its coords from (0.711840,0.103240,0.917154) to (0.611840,0.103240,0.917154):
+	Updating Particles positions in local cell 9:
+		Updating particleInCell 0:
+		Changing its coords from (0.817361,0.098022,0.469106) to (0.717361,0.098022,0.469106):
+	Updating Particles positions in local cell 10:
+		Updating particleInCell 0:
+		Changing its coords from (0.872422,0.091075,0.348450) to (0.772422,0.091075,0.348450):
+	Updating Particles positions in local cell 11:
+		Updating particleInCell 0:
+		Changing its coords from (0.967006,0.106500,0.365872) to (0.867006,0.106500,0.365872):
+	Updating Particles positions in local cell 12:
+	Updating Particles positions in local cell 13:
+		Updating particleInCell 0:
+		Changing its coords from (0.625617,0.215226,0.684585) to (0.525617,0.215226,0.684585):
+		Updating particleInCell 1:
+		Changing its coords from (0.588116,0.190569,0.789944) to (0.488116,0.190569,0.789944):
+	Updating Particles positions in local cell 14:
+	Updating Particles positions in local cell 15:
+		Updating particleInCell 0:
+		Changing its coords from (0.751040,0.201550,0.412512) to (0.651040,0.201550,0.412512):
+		Updating particleInCell 1:
+		Changing its coords from (0.773597,0.228148,0.708363) to (0.673597,0.228148,0.708363):
+	Updating Particles positions in local cell 16:
+		Updating particleInCell 0:
+		Changing its coords from (0.888268,0.177688,0.813771) to (0.788268,0.177688,0.813771):
+	Updating Particles positions in local cell 17:
+		Updating particleInCell 0:
+		Changing its coords from (0.937018,0.184061,0.063715) to (0.837018,0.184061,0.063715):
+	Updating Particles positions in local cell 18:
+		Updating particleInCell 0:
+		Changing its coords from (0.520799,0.278227,0.881840) to (0.420799,0.278227,0.881840):
+	Updating Particles positions in local cell 19:
+		Updating particleInCell 0:
+		Changing its coords from (0.649385,0.262412,0.211121) to (0.549385,0.262412,0.211121):
+	Updating Particles positions in local cell 20:
+		Updating particleInCell 0:
+		Changing its coords from (0.709731,0.252765,0.671870) to (0.609731,0.252765,0.671870):
+	Updating Particles positions in local cell 21:
+		Updating particleInCell 0:
+		Changing its coords from (0.777176,0.295573,0.392572) to (0.677176,0.295573,0.392572):
+	Updating Particles positions in local cell 22:
+	Updating Particles positions in local cell 23:
+		Updating particleInCell 0:
+		Changing its coords from (0.929246,0.311610,0.744761) to (0.829246,0.311610,0.744761):
+		Updating particleInCell 1:
+		Changing its coords from (0.949212,0.283724,0.516097) to (0.849212,0.283724,0.516097):
+	Updating Particles positions in local cell 24:
+		Updating particleInCell 0:
+		Changing its coords from (0.517008,0.400402,0.757598) to (0.417008,0.400402,0.757598):
+	Updating Particles positions in local cell 25:
+		Updating particleInCell 0:
+		Changing its coords from (0.607569,0.386903,0.185594) to (0.507569,0.386903,0.185594):
+	Updating Particles positions in local cell 26:
+		Updating particleInCell 0:
+		Changing its coords from (0.706618,0.343580,0.669197) to (0.606618,0.343580,0.669197):
+	Updating Particles positions in local cell 27:
+		Updating particleInCell 0:
+		Changing its coords from (0.782432,0.390663,0.379149) to (0.682432,0.390663,0.379149):
+	Updating Particles positions in local cell 28:
+		Updating particleInCell 0:
+		Changing its coords from (0.879420,0.375913,0.558967) to (0.779420,0.375913,0.558967):
+	Updating Particles positions in local cell 29:
+		Updating particleInCell 0:
+		Changing its coords from (0.980429,0.371442,0.925924) to (0.880429,0.371442,0.925924):
+	Updating Particles positions in local cell 30:
+	Updating Particles positions in local cell 31:
+		Updating particleInCell 0:
+		Changing its coords from (0.593245,0.464135,0.582185) to (0.493245,0.464135,0.582185):
+	Updating Particles positions in local cell 32:
+		Updating particleInCell 0:
+		Changing its coords from (0.678434,0.484579,0.751425) to (0.578434,0.484579,0.751425):
+		Updating particleInCell 1:
+		Changing its coords from (0.699936,0.463040,0.739388) to (0.599936,0.463040,0.739388):
+	Updating Particles positions in local cell 33:
+	Updating Particles positions in local cell 34:
+		Updating particleInCell 0:
+		Changing its coords from (0.841211,0.450583,0.382567) to (0.741211,0.450583,0.382567):
+	Updating Particles positions in local cell 35:
+		Updating particleInCell 0:
+		Changing its coords from (0.917248,0.490369,0.632784) to (0.817248,0.490369,0.632784):
+		Updating particleInCell 1:
+		Changing its coords from (0.950534,0.425532,0.077820) to (0.850534,0.425532,0.077820):
+	Updating Particles positions in local cell 36:
+	Updating Particles positions in local cell 37:
+		Updating particleInCell 0:
+		Changing its coords from (0.598848,0.555396,0.466709) to (0.498848,0.555396,0.466709):
+		Updating particleInCell 1:
+		Changing its coords from (0.665683,0.514829,0.736755) to (0.565683,0.514829,0.736755):
+	Updating Particles positions in local cell 38:
+		Updating particleInCell 0:
+		Changing its coords from (0.736213,0.575754,0.451488) to (0.636213,0.575754,0.451488):
+	Updating Particles positions in local cell 39:
+		Updating particleInCell 0:
+		Changing its coords from (0.779352,0.529855,0.321813) to (0.679352,0.529855,0.321813):
+	Updating Particles positions in local cell 40:
+		Updating particleInCell 0:
+		Changing its coords from (0.908758,0.546891,0.230269) to (0.808758,0.546891,0.230269):
+	Updating Particles positions in local cell 41:
+		Updating particleInCell 0:
+		Changing its coords from (0.944624,0.503993,0.377044) to (0.844624,0.503993,0.377044):
+	Updating Particles positions in local cell 42:
+		Updating particleInCell 0:
+		Changing its coords from (0.518318,0.590916,0.233312) to (0.418318,0.590916,0.233312):
+	Updating Particles positions in local cell 43:
+	Updating Particles positions in local cell 44:
+		Updating particleInCell 0:
+		Changing its coords from (0.681050,0.617379,0.376295) to (0.581050,0.617379,0.376295):
+		Updating particleInCell 1:
+		Changing its coords from (0.716190,0.633054,0.774592) to (0.616190,0.633054,0.774592):
+	Updating Particles positions in local cell 45:
+		Updating particleInCell 0:
+		Changing its coords from (0.813733,0.622575,0.408698) to (0.713733,0.622575,0.408698):
+	Updating Particles positions in local cell 46:
+	Updating Particles positions in local cell 47:
+		Updating particleInCell 0:
+		Changing its coords from (0.931828,0.616802,0.032166) to (0.831828,0.616802,0.032166):
+		Updating particleInCell 1:
+		Changing its coords from (0.985139,0.607826,0.771763) to (0.885139,0.607826,0.771763):
+	Updating Particles positions in local cell 48:
+		Updating particleInCell 0:
+		Changing its coords from (0.558807,0.748913,0.711434) to (0.458807,0.748913,0.711434):
+	Updating Particles positions in local cell 49:
+		Updating particleInCell 0:
+		Changing its coords from (0.622725,0.695985,0.106081) to (0.522725,0.695985,0.106081):
+	Updating Particles positions in local cell 50:
+	Updating Particles positions in local cell 51:
+		Updating particleInCell 0:
+		Changing its coords from (0.757951,0.678929,0.126605) to (0.657951,0.678929,0.126605):
+	Updating Particles positions in local cell 52:
+		Updating particleInCell 0:
+		Changing its coords from (0.837365,0.725691,0.316657) to (0.737365,0.725691,0.316657):
+		Updating particleInCell 1:
+		Changing its coords from (0.855175,0.729032,0.170111) to (0.755175,0.729032,0.170111):
+	Updating Particles positions in local cell 53:
+		Updating particleInCell 0:
+		Changing its coords from (0.937709,0.702589,0.860921) to (0.837709,0.702589,0.860921):
+	Updating Particles positions in local cell 54:
+		Updating particleInCell 0:
+		Changing its coords from (0.561117,0.751617,0.115447) to (0.461117,0.751617,0.115447):
+	Updating Particles positions in local cell 55:
+		Updating particleInCell 0:
+		Changing its coords from (0.605346,0.761198,0.516861) to (0.505346,0.761198,0.516861):
+	Updating Particles positions in local cell 56:
+	Updating Particles positions in local cell 57:
+		Updating particleInCell 0:
+		Changing its coords from (0.757111,0.821769,0.724586) to (0.657111,0.821769,0.724586):
+		Updating particleInCell 1:
+		Changing its coords from (0.776621,0.795172,0.483519) to (0.676621,0.795172,0.483519):
+	Updating Particles positions in local cell 58:
+		Updating particleInCell 0:
+		Changing its coords from (0.892326,0.782070,0.929035) to (0.792326,0.782070,0.929035):
+	Updating Particles positions in local cell 59:
+		Updating particleInCell 0:
+		Changing its coords from (0.957797,0.751889,0.991404) to (0.857797,0.751889,0.991404):
+	Updating Particles positions in local cell 60:
+		Updating particleInCell 0:
+		Changing its coords from (0.528320,0.851032,0.601838) to (0.428320,0.851032,0.601838):
+	Updating Particles positions in local cell 61:
+		Updating particleInCell 0:
+		Changing its coords from (0.626061,0.839325,0.451692) to (0.526061,0.839325,0.451692):
+	Updating Particles positions in local cell 62:
+		Updating particleInCell 0:
+		Changing its coords from (0.732779,0.868259,0.892297) to (0.632779,0.868259,0.892297):
+	Updating Particles positions in local cell 63:
+	Updating Particles positions in local cell 64:
+		Updating particleInCell 0:
+		Changing its coords from (0.835808,0.899393,0.081151) to (0.735808,0.899393,0.081151):
+	Updating Particles positions in local cell 65:
+		Updating particleInCell 0:
+		Changing its coords from (0.925043,0.833508,0.137948) to (0.825043,0.833508,0.137948):
+		Updating particleInCell 1:
+		Changing its coords from (0.974786,0.866016,0.534845) to (0.874786,0.866016,0.534845):
+	Updating Particles positions in local cell 66:
+		Updating particleInCell 0:
+		Changing its coords from (0.581395,0.969559,0.488147) to (0.481395,0.969559,0.488147):
+	Updating Particles positions in local cell 67:
+		Updating particleInCell 0:
+		Changing its coords from (0.607840,0.936869,0.543898) to (0.507840,0.936869,0.543898):
+	Updating Particles positions in local cell 68:
+		Updating particleInCell 0:
+		Changing its coords from (0.707648,0.994438,0.311891) to (0.607648,0.994438,0.311891):
+	Updating Particles positions in local cell 69:
+	Updating Particles positions in local cell 70:
+		Updating particleInCell 0:
+		Changing its coords from (0.846266,0.917322,0.071914) to (0.746266,0.917322,0.071914):
+		Updating particleInCell 1:
+		Changing its coords from (0.905396,0.953880,0.262791) to (0.805396,0.953880,0.262791):
+	Updating Particles positions in local cell 71:
+		Updating particleInCell 0:
+		Changing its coords from (0.993736,0.946017,0.518640) to (0.893736,0.946017,0.518640):
+
+Updating periodic BCs
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testRK2.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testRK2.0of1.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,40 @@
+Timestep = 1
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 2
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 3
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 4
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 5
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 6
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 7
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 8
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 9
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 10
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testRK2.0of2.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testRK2.0of2.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,40 @@
+Timestep = 1
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 2
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 3
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 4
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 5
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 6
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 7
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 8
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 9
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 10
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testRK4.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testRK4.0of1.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,40 @@
+Timestep = 1
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 2
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 3
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 4
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 5
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 6
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 7
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 8
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 9
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 10
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/expected/testRK4.0of2.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testRK4.0of2.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,40 @@
+Timestep = 1
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 2
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 3
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 4
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 5
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 6
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 7
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 8
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 9
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
+Timestep = 10
+Passed Depth Test
+Passed Radius Test
+Passed Theta Test
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/input/testAdvection.xml
--- a/MaterialPoints/tests/input/testAdvection.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-	
-	<include>StgFEM/LinearMesh.xml</include>
-	<include>StgFEM/VelocityField.xml</include>
-	<include>StgFEM/TimeIntegrator.xml</include>
-
-	<param name="timeIntegratorOrder">1</param>
-	
-	<struct name="components" mergeType="merge">
-		<struct name="everywhere">
-			<param name="Type">Everywhere</param>
-		</struct>
-		<struct name="genericMaterial">
-			<param name="Type">Material</param>
-			<param name="Shape">everywhere</param>
-		</struct>
-		<struct name="elementCellLayout">
-			<param name="Type">ElementCellLayout</param>
-			<param name="Mesh">linearMesh</param>
-		</struct>
-		<struct name="particleShape">
-			<param name="Type">Sphere</param>
-			<param name="radius">1.00</param> 
-			<param name="CentreX">0.0</param> 
-			<param name="CentreY">0.0</param> 
-			<param name="CentreZ">0.0</param> 
-		</struct>		
-		<struct name="particleLayout">
-			<param name="Type">WithinShapeParticleLayout</param>
-			<param name="shape">particleShape</param>
-			<param name="totalInitialParticles">4000</param>
-		</struct>
-		<struct name="weights">
-			<param name="Type">ConstantWeights</param>
-		</struct>	
-		<struct name="pMovementHandler"> 
-			<param name="Type">ParticleMovementHandler</param>
-		</struct>		
-		<struct name="materialPointsSwarm">
-			<param name="Type">MaterialPointsSwarm</param>
-			<param name="CellLayout">elementCellLayout</param>
-			<param name="ParticleLayout">particleLayout</param>
-			<param name="FeMesh">linearMesh</param>
-			<param name="WeightsCalculator">weights</param>
-			<param name="TimeIntegrator">timeIntegrator</param>
-			<list name="ParticleCommHandlers">
-				<param>pMovementHandler</param>
-			</list>
-
-		</struct>
-		<struct name="materialPointsAdvector">
-			<param name="Type">SwarmAdvector</param>
-			<param name="Swarm">materialPointsSwarm</param>
-			<param name="TimeIntegrator">timeIntegrator</param>
-			<param name="VelocityField">VelocityField</param>
-		</struct>		
-	</struct>
-
-	<list name="plugins" mergeType="merge">
-		<struct>
-			<param name="Type">StgFEM_StandardConditionFunctions</param>
-			<param name="Context">context</param>
-		</struct>
-	</list>
-	
-	<param name="journal.info.Context-verbose">f</param>
-	<param name="journal-level.info.Stg_ComponentFactory"> 0 </param>
-	<param name="journal.info.lucInfo">f</param>
-	<param name="journal-level.info.lucInfo"> 2 </param>
-	<param name="journal.debug">f</param>
-	<param name="journal-enable-branch.debug.StgFEM">f</param>
-	<param name="journal-level-branch.debug.StgFEM"> 0 </param>
-
-	<param name="maxTimeSteps"> 10 </param>
-	<param name="dumpEvery"> 1 </param>
-	<param name="outputPath"> ./output </param>
-	<param name="dim"> 2 </param>
-	
-	<!-- Mesh Stuff -->
-	<param name="elementResI"> 20 </param>
-	<param name="elementResJ"> 20 </param>
-	<param name="elementResK"> 1 </param>
-	
-	<param name="shadowDepth"> 1 </param>
-	<!-- Need to allow a little space for error, esp. in the euler case -->
-	<param name="minX"> -1.1 </param>
-	<param name="minY"> -1.1 </param>
-	<param name="minZ"> -1.1 </param>
-	<param name="maxX"> 1.1 </param>
-	<param name="maxY"> 1.1 </param>
-	<param name="maxZ"> 1.1 </param>
-	<param name="allowUnbalancing"> True </param>
-	<param name="buildElementNodeTbl"> True </param>
-	
-	<struct name="velocityICs" mergeType="replace">
-		<param name="type">CompositeVC</param>
-		<list name="vcList">
-			<struct>
-				<param name="type"> AllNodesVC </param>
-				<list name="variables">
-					<struct>
-						<param name="name">velocity</param>
-						<param name="type">func</param>
-						<param name="value"> Velocity_SolidBodyRotation </param>
-					</struct>
-				</list>
-					
-			</struct>
-		</list>
-	</struct>
-
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/input/testEuler.xml
--- a/MaterialPoints/tests/input/testEuler.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-
-	<include>testAdvection.xml</include>
-	
-	<param name="timeIntegratorOrder">1</param>
-	<param name="depthErrorTolerance">1.0e-10</param>
-	<param name="radiusErrorTolerance">0.005</param>
-	<param name="thetaErrorTolerance">1.0e-5</param>
-
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/input/testMaterialFeVariable.xml
--- a/MaterialPoints/tests/input/testMaterialFeVariable.xml	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/tests/input/testMaterialFeVariable.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -2,23 +2,17 @@
 <!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
 
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
 	<list name="import" mergeType="merge">
 		<param>PICellerator</param>
 	</list>
+
 	<include>StgFEM/LinearMesh.xml</include>
 	<include>StgFEM/VelocityField.xml</include>
 	<include>StgFEM/GaussSwarm.xml</include>
 	<include>StgFEM/TimeIntegrator.xml</include>
-	<list name="plugins" mergeType="merge">
-		<struct>
-			<param name="Type">StgFEM_StandardConditionFunctions</param>
-			<param name="Context">context</param>
-		</struct>
-	</list>
+
 	<struct name="components" mergeType="merge">
-		<struct name="context">
-			<param name="Type">PICelleratorContext</param>
-		</struct>
 		<struct name="elementCellLayout">
 			<param name="Type">ElementCellLayout</param>
 			<param name="Mesh">elementMesh</param>
@@ -94,6 +88,10 @@
 		</struct>		
 	</struct>
 
+	<list name="plugins">
+		<param>StgFEM_StandardConditionFunctions</param>
+	</list>
+	
 	<param name="journal.info.Context-verbose">true</param>
 	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
 	<param name="journal.info.lucInfo">true</param>
@@ -131,4 +129,6 @@
 	<param name="gaussParticlesX"> 2 </param>
 	<param name="gaussParticlesY"> 2 </param>
 	<param name="gaussParticlesZ"> 2 </param>
+
+
 </StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/input/testPeriodicBoundariesManager.xml
--- a/MaterialPoints/tests/input/testPeriodicBoundariesManager.xml	Tue Feb 02 16:36:14 2010 +1100
+++ b/MaterialPoints/tests/input/testPeriodicBoundariesManager.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -10,10 +10,6 @@
 	<include>StgFEM/LinearMesh.xml</include>
 
 	<struct name="components" mergeType="merge">
-		<struct name="context">
-			<param name="Type">PICelleratorContext</param>
-		</struct>
-
 		<struct name="elementCellLayout">
 			<param name="Type">ElementCellLayout</param>
 			<param name="Mesh">elementMesh</param>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/input/testRK2.xml
--- a/MaterialPoints/tests/input/testRK2.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-	
-	<include>testAdvection.xml</include>
-	
-	<param name="timeIntegratorOrder">2</param>
-	<param name="depthErrorTolerance">1.0e-10</param>
-	<param name="radiusErrorTolerance">1.0e-7</param>
-	<param name="thetaErrorTolerance">1.0e-5</param>
-
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/input/testRK4.xml
--- a/MaterialPoints/tests/input/testRK4.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-	
-	<include>testAdvection.xml</include>
-	
-	<param name="timeIntegratorOrder">4</param>
-	<param name="depthErrorTolerance">1.0e-10</param>
-	<param name="radiusErrorTolerance">1.0e-10</param>
-	<param name="thetaErrorTolerance">1.0e-7</param>
-
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/plugins/testAdvection.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/plugins/testAdvection.c	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,189 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testAdvection.c 518 2007-10-11 08:07:50Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+ExtensionInfo_Index handle;
+
+const Type TestAdvection_Type = "TestAdvection";
+
+double dt( void* class, PICelleratorContext* context ) {
+	return Dictionary_GetDouble_WithDefault( context->dictionary, "dt", 0.01 );
+}
+
+void construct( PICelleratorContext* context ) {
+	MaterialPointsSwarm* materialPointsSwarm;
+
+	/* Add original pos to particle */
+	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, "materialPointsSwarm" );
+	handle = ExtensionManager_Add( materialPointsSwarm->particleExtensionMgr, CURR_MODULE_NAME, sizeof( Coord ) );
+}
+
+void storeOriginalPos( PICelleratorContext* context ) {
+	MaterialPointsSwarm*   materialPointsSwarm;
+	GlobalParticle*   particle;
+	double*           originalCoord;
+	Particle_Index    lParticle_I;
+
+	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, "materialPointsSwarm" );
+
+	for ( lParticle_I = 0 ; lParticle_I < materialPointsSwarm->particleLocalCount ; lParticle_I++ ) {
+		particle = (GlobalParticle*)Swarm_ParticleAt( materialPointsSwarm, lParticle_I );
+		originalCoord = ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr, particle, handle );
+
+		memcpy( originalCoord, particle->coord, sizeof(Coord) );
+	}
+}
+
+void check( PICelleratorContext* context ) {
+	MaterialPointsSwarm*   materialPointsSwarm;
+	GlobalParticle*   particle;
+	double*           originalCoord;
+	double*           coord;
+	Particle_Index    lParticle_I;
+	double            maxRadiusError       = 0.0;
+	double            maxThetaError        = 0.0;
+	double            maxDepthError        = 0.0;
+	double            maxRadiusErrorGlobal;
+	double            maxThetaErrorGlobal;
+	double            maxDepthErrorGlobal;
+	double            currentRadius;
+	double            originalRadius;
+	double            originalTheta;
+	Coord             analyticCoord;
+	double            time                 = context->currentTime + context->dt;
+	Dictionary*       dictionary           = context->dictionary;
+	Stream*           stream               = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	/* Add original pos to particle */
+	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, "materialPointsSwarm" );
+
+	for ( lParticle_I = 0 ; lParticle_I < materialPointsSwarm->particleLocalCount ; lParticle_I++ ) {
+		particle      = (GlobalParticle*)Swarm_ParticleAt( materialPointsSwarm, lParticle_I );
+		coord         = particle->coord;
+		originalCoord = ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr, particle, handle );
+
+		currentRadius  = StGermain_VectorMagnitude( coord, 2 );
+		originalRadius = StGermain_VectorMagnitude( originalCoord, 2 );
+		
+		/* if ( originalRadius >= 1.0 || currentRadius >= 1.0 ) */
+		/* 	continue; */
+
+		originalTheta = acos( originalCoord[ I_AXIS ]/originalRadius );
+		if ( originalCoord[ J_AXIS ] < 0.0 )
+			originalTheta = 2 * M_PI - originalTheta;
+
+		analyticCoord[ I_AXIS ] = originalRadius*cos( time + originalTheta );
+		analyticCoord[ J_AXIS ] = originalRadius*sin( time + originalTheta );
+		analyticCoord[ K_AXIS ] = originalCoord[ K_AXIS ];
+
+		maxDepthError  = MAX( maxDepthError,  fabs( originalCoord[ K_AXIS ] - coord[ K_AXIS ] ) );
+		maxRadiusError = MAX( maxRadiusError, fabs( currentRadius - originalRadius ) );
+		maxThetaError  = MAX( maxThetaError,  StGermain_AngleBetweenVectors( analyticCoord, coord, 2 ) );
+	}
+
+	MPI_Allreduce( &maxDepthError,  &maxDepthErrorGlobal,  1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
+	MPI_Allreduce( &maxRadiusError, &maxRadiusErrorGlobal, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
+	MPI_Allreduce( &maxThetaError,  &maxThetaErrorGlobal,  1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
+
+	Journal_Printf( stream, "Timestep = %u\n", context->timeStep );
+	Journal_Printf( stream, "%s Depth Test\n",
+			maxDepthErrorGlobal < Dictionary_GetDouble( dictionary, "depthErrorTolerance" ) ? "Passed" : "Failed" );
+	Journal_Printf( stream, "%s Radius Test\n",
+			maxRadiusErrorGlobal < Dictionary_GetDouble( dictionary, "radiusErrorTolerance" ) ? "Passed" : "Failed" );
+	Journal_Printf( stream, "%s Theta Test\n",
+			maxThetaErrorGlobal < Dictionary_GetDouble( dictionary, "thetaErrorTolerance" ) ? "Passed" : "Failed" );
+}
+
+
+void _testAdvection_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	DomainContext* context;
+	Stream*           stream               = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	context = (DomainContext*)Stg_ComponentFactory_ConstructByName( cf, "context", DomainContext, True, data ); 
+
+	ContextEP_Append( context, AbstractContext_EP_ConstructExtensions, construct );
+	ContextEP_Append( context, AbstractContext_EP_Initialise, storeOriginalPos );
+	ContextEP_Prepend( context, AbstractContext_EP_Step, check );
+	EP_AppendClassHook( Context_GetEntryPoint( context, FiniteElementContext_EP_CalcDt ), dt, context );
+
+	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "output.dat" );
+	Stream_SetPrintingRank( stream, 0 );
+}
+
+void* _testAdvection_DefaultNew( Name name ) {
+	return _Codelet_New(
+			sizeof( Codelet ),
+			TestAdvection_Type,
+			_Codelet_Delete,
+			_Codelet_Print,
+			_Codelet_Copy,
+			_testAdvection_DefaultNew,
+			_testAdvection_Construct,
+			_Codelet_Build,
+			_Codelet_Initialise,
+			_Codelet_Execute,
+			_Codelet_Destroy,
+			name );
+}
+
+
+Index testAdvection_Register( PluginsManager* pluginsManager ) {
+	Index result;
+
+	result = PluginsManager_Submit( pluginsManager, TestAdvection_Type, "0",
+		_testAdvection_DefaultNew );
+
+	return result;
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testAdvection.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testAdvection.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>StgFEM/LinearMesh.xml</include>
+	<include>StgFEM/VelocityField.xml</include>
+	<include>StgFEM/TimeIntegrator.xml</include>
+
+	<param name="timeIntegratorOrder">1</param>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="elementCellLayout">
+			<param name="Type">ElementCellLayout</param>
+			<param name="Mesh">linearMesh</param>
+		</struct>
+		<struct name="particleShape">
+			<param name="Type">Sphere</param>
+			<param name="radius">1.00</param> 
+			<param name="CentreX">0.0</param> 
+			<param name="CentreY">0.0</param> 
+			<param name="CentreZ">0.0</param> 
+		</struct>		
+		<struct name="particleLayout">
+			<param name="Type">WithinShapeParticleLayout</param>
+			<param name="shape">particleShape</param>
+			<param name="totalInitialParticles">4000</param>
+		</struct>
+		<struct name="weights">
+			<param name="Type">ConstantWeights</param>
+		</struct>	
+		<struct name="pMovementHandler"> 
+			<param name="Type">ParticleMovementHandler</param>
+		</struct>		
+		<struct name="materialPointsSwarm">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">particleLayout</param>
+			<param name="FeMesh">linearMesh</param>
+			<param name="WeightsCalculator">weights</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<list name="ParticleCommHandlers">
+				<param>pMovementHandler</param>
+			</list>
+
+		</struct>
+		<struct name="materialPointsAdvector">
+			<param name="Type">SwarmAdvector</param>
+			<param name="Swarm">materialPointsSwarm</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="VelocityField">VelocityField</param>
+		</struct>		
+	</struct>
+
+	<list name="plugins">
+		<param>testAdvection</param>
+		<param>StgFEM_StandardConditionFunctions</param>
+	</list>
+	
+	<param name="journal.info.Context-verbose">true</param>
+	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
+	<param name="journal.info.lucInfo">true</param>
+	<param name="journal-level.info.lucInfo"> 2 </param>
+	<param name="journal.debug">f</param>
+	<param name="journal-enable-branch.debug.StgFEM">f</param>
+	<param name="journal-level-branch.debug.StgFEM"> 2 </param>
+
+	<param name="maxTimeSteps"> 10 </param>
+	<param name="dumpEvery"> 1 </param>
+	<param name="outputPath"> ./output </param>
+	<param name="dim"> 2 </param>
+	
+	<!-- Mesh Stuff -->
+	<param name="elementResI"> 20 </param>
+	<param name="elementResJ"> 20 </param>
+	<param name="elementResK"> 1 </param>
+	
+	<param name="shadowDepth"> 1 </param>
+	<!-- Need to allow a little space for error, esp. in the euler case -->
+	<param name="minX"> -1.1 </param>
+	<param name="minY"> -1.1 </param>
+	<param name="minZ"> -1.1 </param>
+	<param name="maxX"> 1.1 </param>
+	<param name="maxY"> 1.1 </param>
+	<param name="maxZ"> 1.1 </param>
+	<param name="allowUnbalancing"> True </param>
+	<param name="buildElementNodeTbl"> True </param>
+	
+	<struct name="velocityICs" mergeType="replace">
+		<param name="type">CompositeVC</param>
+		<list name="vcList">
+			<struct>
+				<param name="type"> AllNodesVC </param>
+				<list name="variables">
+					<struct>
+						<param name="name">velocity</param>
+						<param name="type">func</param>
+						<param name="value"> Velocity_SolidBodyRotation </param>
+					</struct>
+				</list>
+					
+			</struct>
+		</list>
+	</struct>
+
+</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testEuler.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testEuler.0of1.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testEuler.0of1.sh 504 2007-08-05 09:48:58Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testEuler.xml" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testEuler.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testEuler.0of2.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testEuler.0of2.sh 504 2007-08-05 09:48:58Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testEuler.xml" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testEuler.0of3.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testEuler.0of3.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testEuler.0of3.sh 504 2007-08-05 09:48:58Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testEuler.xml" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testEuler.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testEuler.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<list name="import" mergeType="merge">
+		<param>PICellerator</param>
+	</list>
+
+	<include>testAdvection.xml</include>
+	
+	<param name="timeIntegratorOrder">1</param>
+	<param name="depthErrorTolerance">1.0e-10</param>
+	<param name="radiusErrorTolerance">0.005</param>
+	<param name="thetaErrorTolerance">1.0e-5</param>
+
+</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testRK2.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK2.0of1.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testRK2.0of1.sh 504 2007-08-05 09:48:58Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testRK2.xml" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testRK2.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK2.0of2.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testRK2.0of2.sh 504 2007-08-05 09:48:58Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testRK2.xml" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testRK2.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK2.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<list name="import" mergeType="merge">
+		<param>PICellerator</param>
+	</list>
+
+	<include>testAdvection.xml</include>
+	
+	<param name="timeIntegratorOrder">2</param>
+	<param name="depthErrorTolerance">1.0e-10</param>
+	<param name="radiusErrorTolerance">1.0e-7</param>
+	<param name="thetaErrorTolerance">1.0e-5</param>
+
+</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testRK4.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK4.0of1.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testRK4.0of1.sh 504 2007-08-05 09:48:58Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testRK4.xml" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testRK4.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK4.0of2.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testRK4.0of2.sh 504 2007-08-05 09:48:58Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testRK4.xml" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 MaterialPoints/tests/testRK4.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK4.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<list name="import" mergeType="merge">
+		<param>PICellerator</param>
+	</list>
+
+	<include>testAdvection.xml</include>
+	
+	<param name="timeIntegratorOrder">4</param>
+	<param name="depthErrorTolerance">1.0e-10</param>
+	<param name="radiusErrorTolerance">1.0e-10</param>
+	<param name="thetaErrorTolerance">1.0e-7</param>
+
+</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 PopulationControl/src/EscapedRoutine.c
--- a/PopulationControl/src/EscapedRoutine.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/PopulationControl/src/EscapedRoutine.c	Tue Feb 02 16:55:08 2010 +1100
@@ -60,18 +60,39 @@ const Type EscapedRoutine_Type = "Escape
 ** Constructors
 */
 
-EscapedRoutine* _EscapedRoutine_New(  ESCAPEDROUTINE_DEFARGS  )
+EscapedRoutine* _EscapedRoutine_New(
+		SizeT                                      _sizeOfSelf, 
+		Type                                       type,
+		Stg_Class_DeleteFunction*                  _delete,
+		Stg_Class_PrintFunction*                   _print,
+		Stg_Class_CopyFunction*                    _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*           _construct,
+		Stg_Component_BuildFunction*               _build,
+		Stg_Component_InitialiseFunction*          _initialise,
+		Stg_Component_ExecuteFunction*             _execute,
+		Stg_Component_DestroyFunction*             _destroy,		
+		EscapedRoutine_SelectFunction*     	   _select,
+		Name                                       name )
 {
 	EscapedRoutine* self;
 	
 	/* Allocate memory */
 	assert( _sizeOfSelf >= sizeof(EscapedRoutine) );
-	/* The following terms are parameters that have been passed into this function but are being set before being passed onto the parent */
-	/* This means that any values of these parameters that are passed into this function are not passed onto the parent function
-	   and so should be set to ZERO in any children of this class. */
-	nameAllocationType = NON_GLOBAL;
-
-	self = (EscapedRoutine*)_Stg_Component_New(  STG_COMPONENT_PASSARGS  );
+	self = (EscapedRoutine*)_Stg_Component_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			name ,
+			NON_GLOBAL );
 	
 	/* General info */
 
@@ -82,39 +103,32 @@ EscapedRoutine* _EscapedRoutine_New(  ES
 }
 
 void* _EscapedRoutine_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(EscapedRoutine);
-	Type                                                      type = EscapedRoutine_Type;
-	Stg_Class_DeleteFunction*                              _delete = _EscapedRoutine_Delete;
-	Stg_Class_PrintFunction*                                _print = _EscapedRoutine_Print;
-	Stg_Class_CopyFunction*                                  _copy = _EscapedRoutine_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _EscapedRoutine_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _EscapedRoutine_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _EscapedRoutine_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _EscapedRoutine_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _EscapedRoutine_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _EscapedRoutine_Destroy;
-	EscapedRoutine_SelectFunction*                         _select = _EscapedRoutine_Select;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return (void*) _EscapedRoutine_New(  ESCAPEDROUTINE_PASSARGS  );
+	return (void*) _EscapedRoutine_New(
+			sizeof(EscapedRoutine),
+			EscapedRoutine_Type,
+			_EscapedRoutine_Delete,
+			_EscapedRoutine_Print,
+			_EscapedRoutine_Copy,
+			_EscapedRoutine_DefaultNew,
+			_EscapedRoutine_Construct,
+			_EscapedRoutine_Build,
+			_EscapedRoutine_Initialise,
+			_EscapedRoutine_Execute,
+			_EscapedRoutine_Destroy,
+			_EscapedRoutine_Select, 
+			name );
 }
 
 void _EscapedRoutine_Init( 
-	void*					escapedRoutine, 
-	DomainContext*		context,
-	Dimension_Index	dim, 
-	Particle_Index		particlesToRemoveDelta )
+		EscapedRoutine*                            self, 
+		Dimension_Index                            dim, 
+		Particle_Index                             particlesToRemoveDelta )
 {
-	EscapedRoutine* self = (EscapedRoutine*)escapedRoutine;
-
-	self->context = context;
-	self->dim = dim;
+	self->isConstructed          = True;
+	self->dim                    = dim;
 	self->particlesToRemoveDelta = particlesToRemoveDelta;
 
-	self->debug = Journal_Register( Debug_Type, (Name)EscapedRoutine_Type ); /* TODO Register Child */
+	self->debug = Journal_Register( Debug_Type, EscapedRoutine_Type ); /* TODO Register Child */
 	self->particlesToRemoveCount = 0;
 	self->particlesToRemoveAlloced = 0;
 }
@@ -126,9 +140,12 @@ void _EscapedRoutine_Delete( void* escap
 void _EscapedRoutine_Delete( void* escapedRoutine ) {
 	EscapedRoutine* self = (EscapedRoutine*)escapedRoutine;
 	
+	Memory_Free( self->particlesToRemoveList );
+
 	/* Delete parent */
-	_Stg_Component_Delete( self  );
+	_Stg_Component_Delete( self );
 }
+
 
 void _EscapedRoutine_Print( void* escapedRoutine, Stream* stream ) {
 	EscapedRoutine* self = (EscapedRoutine*)escapedRoutine;
@@ -136,6 +153,7 @@ void _EscapedRoutine_Print( void* escape
 	/* Print parent */
 	_Stg_Component_Print( self, stream );
 }
+
 
 void* _EscapedRoutine_Copy( void* escapedRoutine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	EscapedRoutine*	self = (EscapedRoutine*)escapedRoutine;
@@ -146,42 +164,34 @@ void* _EscapedRoutine_Copy( void* escape
 	return (void*)newEscapedRoutine;
 }
 
-void _EscapedRoutine_AssignFromXML( void* escapedRoutine, Stg_ComponentFactory* cf, void* data ) {
-	EscapedRoutine*	self = (EscapedRoutine*) escapedRoutine;
-	Dimension_Index	dim;
-	Particle_Index		particlesToRemoveDelta;
-	DomainContext*		context;
+void _EscapedRoutine_Construct( void* escapedRoutine, Stg_ComponentFactory* cf, void* data ) {
+	EscapedRoutine*	     self          = (EscapedRoutine*) escapedRoutine;
+	Dimension_Index      dim;
+	Particle_Index       particlesToRemoveDelta;
 
-	context = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Context", DomainContext, False, data );
-	if( !context  ) 
-		context = Stg_ComponentFactory_ConstructByName( cf, (Name)"context", DomainContext, True, data  );
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+	particlesToRemoveDelta = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "particlesToRemoveDelta", 20 );
 
-	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, (Dictionary_Entry_Key)"dim", 0  );
-	particlesToRemoveDelta = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, (Dictionary_Entry_Key)"particlesToRemoveDelta", 20  );
-
-	_EscapedRoutine_Init( self, context, dim, particlesToRemoveDelta );
+	_EscapedRoutine_Init( self, dim, particlesToRemoveDelta );
 }
 
 void _EscapedRoutine_Build( void* escapedRoutine, void* data ) {
-	EscapedRoutine* self = (EscapedRoutine*) escapedRoutine;
+	EscapedRoutine*	     self          = (EscapedRoutine*) escapedRoutine;
 
 	self->particlesToRemoveAlloced = self->particlesToRemoveDelta * 10;
-	self->particlesToRemoveList = Memory_Alloc_Array( unsigned, self->particlesToRemoveAlloced, "particlesToRemoveList" );
+	self->particlesToRemoveList = Memory_Alloc_Array( unsigned, self->particlesToRemoveAlloced,
+		"particlesToRemoveList" );
 }
 
 void _EscapedRoutine_Initialise( void* escapedRoutine, void* data ) {
 }
-
 void _EscapedRoutine_Execute( void* escapedRoutine, void* data ) {
-	Swarm* swarm = Stg_CheckType( data, Swarm );
+	Swarm*               swarm = Stg_CheckType( data, Swarm );
 
 	EscapedRoutine_RemoveFromSwarm( escapedRoutine, swarm );
 }
 
 void _EscapedRoutine_Destroy( void* escapedRoutine, void* data ) {
-	EscapedRoutine* self = (EscapedRoutine*) escapedRoutine;
-
-	Memory_Free( self->particlesToRemoveList );
 }
 
 /*--------------------------------------------------------------------------------------------------------------------------
@@ -189,14 +199,15 @@ void _EscapedRoutine_Destroy( void* esca
 */
 
 void EscapedRoutine_Select( void* escapedRoutine, void* _swarm ) {
-	EscapedRoutine* self = (EscapedRoutine*) escapedRoutine;
+	EscapedRoutine*	 self          = (EscapedRoutine*) escapedRoutine;
 
 	self->_select( self, _swarm );
 }
 
+
 void _EscapedRoutine_Select( void* escapedRoutine, void* _swarm ) {
 	EscapedRoutine*	self = (EscapedRoutine*)escapedRoutine;
-	Swarm*				swarm = (Swarm*)_swarm;
+	Swarm*		swarm = (Swarm*)_swarm;
 	unsigned	p_i;
 
 	assert( self );
@@ -214,8 +225,8 @@ void _EscapedRoutine_Select( void* escap
 
 
 void EscapedRoutine_RemoveFromSwarm( void* escapedRoutine, void* _swarm ) {
-	EscapedRoutine*	self = (EscapedRoutine*) escapedRoutine;
-	Swarm*				swarm = (Swarm*) _swarm;
+	EscapedRoutine*	     self                = (EscapedRoutine*) escapedRoutine;
+	Swarm*               swarm               = (Swarm*) _swarm;
 	
 	EscapedRoutine_InitialiseParticleList( self );
 	
@@ -227,22 +238,24 @@ void EscapedRoutine_RemoveFromSwarm( voi
 }
 
 void EscapedRoutine_InitialiseParticleList( void* escapedRoutine ) {
-	EscapedRoutine* self = (EscapedRoutine*) escapedRoutine;
+	EscapedRoutine*	     self                = (EscapedRoutine*) escapedRoutine;
 
 	self->particlesToRemoveCount = 0;
 	memset( self->particlesToRemoveList, 0, sizeof(unsigned) * self->particlesToRemoveAlloced );
 }
 
 void EscapedRoutine_SetParticleToRemove( void* escapedRoutine, Swarm* swarm, Particle_Index lParticle_I ) {
-	EscapedRoutine* self = (EscapedRoutine*) escapedRoutine;
+	EscapedRoutine*	      self                = (EscapedRoutine*) escapedRoutine;
 
 	/* Check memory */
 	if ( self->particlesToRemoveCount >= self->particlesToRemoveAlloced ) {
 		self->particlesToRemoveAlloced += self->particlesToRemoveDelta;
-		self->particlesToRemoveList = Memory_Realloc_Array( self->particlesToRemoveList, unsigned, self->particlesToRemoveAlloced );
+		self->particlesToRemoveList = 
+			Memory_Realloc_Array( self->particlesToRemoveList, unsigned, self->particlesToRemoveAlloced );
 	}
 
 	self->particlesToRemoveList[ self->particlesToRemoveCount ] = lParticle_I;
+
 	self->particlesToRemoveCount++;
 }
 
@@ -254,11 +267,12 @@ void EscapedRoutine_SortParticleList( vo
 void EscapedRoutine_SortParticleList( void* escapedRoutine ) {
 	EscapedRoutine*	     self                = (EscapedRoutine*) escapedRoutine;
 
-	qsort( self->particlesToRemoveList, self->particlesToRemoveCount, sizeof(unsigned), _EscapedRoutine_CompareParticles );
+	qsort( self->particlesToRemoveList, self->particlesToRemoveCount, 
+			sizeof(unsigned), _EscapedRoutine_CompareParticles );
 }
 
 void EscapedRoutine_RemoveParticles( void* escapedRoutine, Swarm* swarm ) {
-	EscapedRoutine*		self = (EscapedRoutine*) escapedRoutine;
+	EscapedRoutine*	      self                = (EscapedRoutine*) escapedRoutine;
 	Index                 array_I;
 	StandardParticle*     particleToRemove;
 	Particle_Index        particleToRemove_I;
@@ -293,8 +307,8 @@ void EscapedRoutine_RemoveParticles( voi
 	#endif
 
 	for ( array_I = self->particlesToRemoveCount - 1 ; array_I < self->particlesToRemoveCount ; array_I-- ) {
-		particleToRemove_I = self->particlesToRemoveList[ array_I ];
-		particleToRemove = Swarm_ParticleAt( swarm, particleToRemove_I );
+		particleToRemove_I               = self->particlesToRemoveList[ array_I ];
+		particleToRemove                 = Swarm_ParticleAt( swarm, particleToRemove_I );
 
 		Journal_DPrintfL( self->debug, 2, "Removing particle %u\n", particleToRemove_I );
 		
@@ -324,5 +338,3 @@ void EscapedRoutine_RemoveParticles( voi
 
 	Swarm_Realloc( swarm );
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 PopulationControl/src/EscapedRoutine.h
--- a/PopulationControl/src/EscapedRoutine.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/PopulationControl/src/EscapedRoutine.h	Tue Feb 02 16:55:08 2010 +1100
@@ -45,7 +45,7 @@
 ** Assumptions:
 **
 ** Comments:
-*
+**
 ** $Id: EscapedRoutine.h 189 2005-10-20 00:39:29Z RobertTurnbull $
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -62,85 +62,66 @@
 	#define __EscapedRoutine \
 		/* General info */ \
 		__Stg_Component \
-		DomainContext*							context; \
 		/* Virtual Info */\
-		EscapedRoutine_SelectFunction*	_select; \
+		EscapedRoutine_SelectFunction*		_select; \
 		/* Other Info */\
-		Stream*									debug; \
-		Dimension_Index						dim; \
+		Stream*                                    debug;                    \
+		Dimension_Index                            dim;                      \
 		/* Removal Info */  \
-		Particle_Index							particlesToRemoveCount; \
-		Particle_Index							particlesToRemoveAlloced; \
-		Particle_Index							particlesToRemoveDelta; \
-		unsigned*								particlesToRemoveList;    
+		Particle_Index                             particlesToRemoveCount;   \
+		Particle_Index                             particlesToRemoveAlloced; \
+		Particle_Index                             particlesToRemoveDelta;   \
+		unsigned*				   particlesToRemoveList;    
 
 	struct EscapedRoutine { __EscapedRoutine };
 
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Constructors
 	*/
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define ESCAPEDROUTINE_DEFARGS \
-                STG_COMPONENT_DEFARGS, \
-                EscapedRoutine_SelectFunction*  _select
-
-	#define ESCAPEDROUTINE_PASSARGS \
-                STG_COMPONENT_PASSARGS, \
-	        _select
-
-	EscapedRoutine* _EscapedRoutine_New(  ESCAPEDROUTINE_DEFARGS  );
+	EscapedRoutine* _EscapedRoutine_New(
+		SizeT                                      _sizeOfSelf, 
+		Type                                       type,
+		Stg_Class_DeleteFunction*                  _delete,
+		Stg_Class_PrintFunction*                   _print,
+		Stg_Class_CopyFunction*                    _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*           _construct,
+		Stg_Component_BuildFunction*               _build,
+		Stg_Component_InitialiseFunction*          _initialise,
+		Stg_Component_ExecuteFunction*             _execute,
+		Stg_Component_DestroyFunction*             _destroy,		
+		EscapedRoutine_SelectFunction*     	   _select,
+		Name                                       name );
 
 	void* _EscapedRoutine_DefaultNew( Name name );
-
-	void _EscapedRoutine_Init(                                                                                            
-		void*             escapedRoutine,
-		DomainContext*    context,
-		Dimension_Index   dim,                                                                                             
-		Particle_Index    particlesToRemoveDelta );         
 	
 	/* Stg_Class_Delete EscapedRoutine implementation */
 	void _EscapedRoutine_Delete( void* escapedRoutine );
-
 	void _EscapedRoutine_Print( void* escapedRoutine, Stream* stream );
-
 	#define EscapedRoutine_Copy( self ) \
 		(EscapedRoutine*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define EscapedRoutine_DeepCopy( self ) \
 		(EscapedRoutine*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
 	void* _EscapedRoutine_Copy( void* escapedRoutine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-	void _EscapedRoutine_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data ); 
-
-	void _EscapedRoutine_Build( void* escapedRoutine, void* data );
-
-	void _EscapedRoutine_Initialise( void* escapedRoutine, void* data );
-
+	void _EscapedRoutine_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _EscapedRoutine_Build( void* escapedRoutine, void* data ) ;
+	void _EscapedRoutine_Initialise( void* escapedRoutine, void* data ) ;
 	void _EscapedRoutine_Execute( void* escapedRoutine, void* data );
-
-	void _EscapedRoutine_Destroy( void* escapedRoutine, void* data );
+	void _EscapedRoutine_Destroy( void* escapedRoutine, void* data ) ;
 	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Public member functions
 	*/
 
-	void EscapedRoutine_Select( void* escapedRoutine, void* _swarm );
+	void EscapedRoutine_Select( void* escapedRoutine, void* _swarm ) ;
+	void _EscapedRoutine_Select( void* escapedRoutine, void* _swarm );
+	void EscapedRoutine_RemoveFromSwarm( void* escapedRoutine, void* _swarm ) ;
 
-	void _EscapedRoutine_Select( void* escapedRoutine, void* _swarm );
+	void EscapedRoutine_InitialiseParticleList( void* escapedRoutine ) ;
+	void EscapedRoutine_SetParticleToRemove( void* escapedRoutine, Swarm* swarm, Particle_Index lParticle_I ) ;
 
-	void EscapedRoutine_RemoveFromSwarm( void* escapedRoutine, void* _swarm );
-
-	void EscapedRoutine_InitialiseParticleList( void* escapedRoutine );
-
-	void EscapedRoutine_SetParticleToRemove( void* escapedRoutine, Swarm* swarm, Particle_Index lParticle_I );
-
-	void EscapedRoutine_SortParticleList( void* escapedRoutine );
-
-	void EscapedRoutine_RemoveParticles( void* escapedRoutine, Swarm* swarm );
+	void EscapedRoutine_SortParticleList( void* escapedRoutine ) ;
+	void EscapedRoutine_RemoveParticles( void* escapedRoutine, Swarm* swarm ) ;
 
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 PopulationControl/src/Finalise.c
--- a/PopulationControl/src/Finalise.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/PopulationControl/src/Finalise.c	Tue Feb 02 16:55:08 2010 +1100
@@ -53,9 +53,7 @@
 #include <stdio.h>
 
 Bool PICellerator_PopulationControl_Finalise( void ) {
-	Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
 	
 	return True;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 PopulationControl/src/Init.c
--- a/PopulationControl/src/Init.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/PopulationControl/src/Init.c	Tue Feb 02 16:55:08 2010 +1100
@@ -54,12 +54,10 @@ Bool PICellerator_PopulationControl_Init
 Bool PICellerator_PopulationControl_Init( int* argc, char** argv[] ) {
 	Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
 
-	Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
 
-	Stg_ComponentRegister_Add( componentsRegister, EscapedRoutine_Type, (Name)"0", _EscapedRoutine_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, EscapedRoutine_Type,      	"0", _EscapedRoutine_DefaultNew );
 	RegisterParent( EscapedRoutine_Type,      	 Stg_Component_Type );
 
 	return True;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 PopulationControl/src/PopulationControl.h
--- a/PopulationControl/src/PopulationControl.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/PopulationControl/src/PopulationControl.h	Tue Feb 02 16:55:08 2010 +1100
@@ -50,8 +50,8 @@
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
-#ifndef __PICellerator_PopulationControl_PopulationControl_h__
-#define __PICellerator_PopulationControl_PopulationControl_h__
+#ifndef __PICellerator_PopulationControl_h__
+#define __PICellerator_PopulationControl_h__
 
 	#include "types.h"	
 	#include "Init.h"	
diff -r 4ca4356447d8 -r 42d3a58b6ff9 PopulationControl/tests/EscapedRoutineSuite.c
--- a/PopulationControl/tests/EscapedRoutineSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/PopulationControl/tests/EscapedRoutineSuite.c	Tue Feb 02 16:55:08 2010 +1100
@@ -37,6 +37,7 @@
 #include <StgDomain/StgDomain.h>
 #include <StgFEM/StgFEM.h>
 #include "PICellerator/PopulationControl/PopulationControl.h"
+#include "EscapedRoutineSuite.h"
 
 struct _Particle {
    __GlobalParticle
@@ -45,10 +46,9 @@ struct _Particle {
 
 
 typedef struct {
-   FiniteElementContext*	context;
-   Stg_ComponentFactory*	cf;
-   Swarm*						swarm;
-   EscapedRoutine*			escRoutine;
+   DomainContext*          context;
+   Swarm*                  swarm;
+   EscapedRoutine*         escRoutine;
 } EscapedRoutineSuiteData;
 
 void EscapedRoutineSuite_Setup( EscapedRoutineSuiteData* data ) {
@@ -56,20 +56,19 @@ void EscapedRoutineSuite_Setup( EscapedR
    Particle_Index    lParticle_I=0;
 
    pcu_filename_input( "EscapedRoutineSuite.xml", xmlInputFilename );
-   data->cf = stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD, NULL );
-   data->context = (FiniteElementContext*) LiveComponentRegister_Get( data->cf->LCRegister, (Name)"context" );
-   data->swarm = (Swarm* ) LiveComponentRegister_Get( data->context->CF->LCRegister, (Name)"swarm" );
-   data->escRoutine = (EscapedRoutine* ) LiveComponentRegister_Get( data->context->CF->LCRegister, (Name)"escapedRoutine" );
-	stgMainBuildAndInitialise( data->cf );
+   data->context = (DomainContext*)stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD );
+   data->swarm = (Swarm*) LiveComponentRegister_Get( data->context->CF->LCRegister, "swarm" );
+   data->escRoutine = (EscapedRoutine*) LiveComponentRegister_Get( data->context->CF->LCRegister, "escapedRoutine" );
 
    /* Use our test param to mark all the particles as not to be removed by default*/
    for ( lParticle_I=0; lParticle_I < data->swarm->particleLocalCount; lParticle_I++ ) {
-      ((Particle* )Swarm_ParticleAt( data->swarm, lParticle_I ))->toRemove = False;
+      ((Particle*)Swarm_ParticleAt( data->swarm, lParticle_I ))->toRemove = False;
    }
+   
 } 
 
 void EscapedRoutineSuite_Teardown( EscapedRoutineSuiteData* data ) {
-   stgMainDestroy( data->cf );
+   stgMainDestroy( (AbstractContext*)data->context );
 }
 
 
@@ -194,12 +193,14 @@ void EscapedRoutineSuite( pcu_suite_t* s
    pcu_suite_setData( suite, EscapedRoutineSuiteData );
    pcu_suite_setFixtures( suite, EscapedRoutineSuite_Setup, EscapedRoutineSuite_Teardown );
    pcu_suite_addTest( suite, EscapedRoutineSuite_TestSetParticleToRemove );
+/* TEMPORARILY disable multiple tests until Toolbox/Context issue sorted out (See tickets #70,#71
+ in StGermain trac) -- PatrickSunter, 19 Aug 2009 */
+#if 0
    pcu_suite_addTest( suite, EscapedRoutineSuite_TestSelect );
    pcu_suite_addTest( suite, EscapedRoutineSuite_TestInitialiseParticleList );
    pcu_suite_addTest( suite, EscapedRoutineSuite_TestCompareParticles );
    pcu_suite_addTest( suite, EscapedRoutineSuite_TestSortParticleList );
    pcu_suite_addTest( suite, EscapedRoutineSuite_TestRemoveParticles );
    pcu_suite_addTest( suite, EscapedRoutineSuite_TestExecuteBadInput );
+#endif
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 PopulationControl/tests/input/EscapedRoutineSuite.xml
--- a/PopulationControl/tests/input/EscapedRoutineSuite.xml	Tue Feb 02 16:36:14 2010 +1100
+++ b/PopulationControl/tests/input/EscapedRoutineSuite.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -2,13 +2,12 @@
 <!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
 
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
 	<list name="import" mergeType="merge">
 		<param>PICellerator</param>
 	</list>
+
    <struct name="components" mergeType="merge">
-      <struct name="context">
-          <param name="Type">PICelleratorContext</param>
-      </struct>
       <struct name="cellLayout">
          <param name="Type">SingleCellLayout</param>
       </struct>
@@ -26,13 +25,17 @@
          <param name="particlesToRemoveDelta">1</param>
       </struct>
    </struct>
+
 	<param name="dim">2</param>
+
 	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
 	<param name="journal.debug">f</param>
    <!-- for the purpose of testing, reduce output as much as possible. If the test fails,
     comment out the line below to help diagnose source of error -->
 	<param name="journal.info">f</param>
+
 	<param name="maxTimeSteps"> 1 </param>
 	<param name="dumpEvery"> 1 </param>
 	<param name="outputPath"> ./output </param>
+	
 </StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SConscript
--- a/SConscript	Tue Feb 02 16:36:14 2010 +1100
+++ b/SConscript	Tue Feb 02 16:55:08 2010 +1100
@@ -85,7 +85,7 @@ env.Install('include/PICellerator', Glob
 #
 
 dirs = Split('libPICellerator/Toolbox plugins/CalculateParticleDisplacement ' \
-             'plugins/Output/MaterialCentroid  SysTest/AnalyticPlugins/AnalyticPressure' )
+             'plugins/Output/MaterialCentroid')
 pl_objs = []
 pl_regs = []
 for d in dirs:
@@ -227,15 +227,10 @@ env.PCUTest('tests/testPICellerator', su
 env.PCUTest('tests/testPICellerator', suites,
             PCU_LIBHEADERS="#include <StGermain/StGermain.h>\n#include <StgDomain/StgDomain.h>\n" \
                 "#include <StgFEM/StgFEM.h>\n#include <PICellerator/PICellerator.h>",
-            PCU_SETUP="StGermain_Init(&argc, &argv);\nStgDomain_Init(&argc, &argv);\n" \
-                "StgFEM_Init(&argc, &argv);\nPICellerator_Init(&argc, &argv);\n\n" \
-                "#ifdef NOSHARED\n" \
-                "   picellerator_register_static_modules();\n" \
-                "   stgfem_register_static_modules();\n" \
-                "   stgdomain_register_static_modules();\n" \
-                "#endif",
-            PCU_TEARDOWN="PICellerator_Finalise();\nStgFEM_Finalise();\n" \
-                "StgDomain_Finalise();\nStGermain_Finalise();",
+            PCU_SETUP="StGermain_Init(&argc, &argv);StgDomain_Init(&argc, &argv);" \
+                "StgFEM_Init(&argc, &argv);PICellerator_Init(&argc, &argv);",
+            PCU_TEARDOWN="PICellerator_Finalise();StgFEM_Finalise();" \
+                "StgDomain_Finalise();StGermain_Finalise();",
             LIBS=libs,
             PCU_EXP=tst_exp,
             PCU_INPUT=tst_input,
@@ -246,5 +241,3 @@ env.PCUTest('tests/testPICellerator', su
 #
 
 env.Install('lib/StGermain/PICellerator', Glob('Apps/src/*.xml'))
-
-env.IntegrationTest('SysTest/RegressionTests/testAll.py')
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/AnalyticPlugins/AnalyticPressure/AnalyticPressure.c
--- a/SysTest/AnalyticPlugins/AnalyticPressure/AnalyticPressure.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-** Copyright (c) 2005, Monash Cluster Computing 
-** All rights reserved.
-** Redistribution and use in source and binary forms, with or without modification,
-** are permitted provided that the following conditions are met:
-**
-** 		* Redistributions of source code must retain the above copyright notice, 
-** 			this list of conditions and the following disclaimer.
-** 		* Redistributions in binary form must reproduce the above copyright 
-**			notice, this list of conditions and the following disclaimer in the 
-**			documentation and/or other materials provided with the distribution.
-** 		* Neither the name of the Monash University nor the names of its contributors 
-**			may be used to endorse or promote products derived from this software 
-**			without specific prior written permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
-** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
-** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
-** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
-** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
-** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
-** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
-** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
-** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-**
-**
-** Contact:
-*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
-*%
-** Contributors:
-*+		Julian Giordani
-*+		Mirko Velic
-*+		Robert Turnbull
-*+		Vincent Lemiale
-*+		Louis Moresi
-*+		David May
-*+		David Stegman
-*+		Patrick Sunter
-** $Id: solA.c 636 2006-09-08 03:07:06Z JulianGiordani $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include "AnalyticPressure.h"
-
-const Type AnalyticPressure_Type = "PICellerator_AnalyticPressure";
-
-void _PICellerator_AnalyticPressure_PressureFunction( void* _self, double* coord, double* pressure ) {
-  AnalyticPressure*  self    = (AnalyticPressure*)_self;
-  double             density = self->density;
-  double             gravity = self->gravity;
-  double             y;
-
-  /* Find coordinate of node */
-  y = -coord[ J_AXIS ] + (self->minY+self->maxY)/2.0;
-
-  *pressure = y * density * gravity;
-}
-
-void _AnalyticPressure_AssignFromXML( void* _self, Stg_ComponentFactory* cf, void* data ) {
-  AnalyticPressure* 		self = (AnalyticPressure*) _self;
-
-  /* Construct Parent */
-  _FieldTest_AssignFromXML( self, cf, data );
-
-    /* Create Analytic Fields */
-  self->density  = Stg_ComponentFactory_GetDouble( cf, "layer", (Dictionary_Entry_Key)"density", 0.0  );
-  self->gravity  = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"gravity", 0  );
-  self->maxY     = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"maxY", 0  );
-  self->minY     = Stg_ComponentFactory_GetRootDictDouble( cf, (Dictionary_Entry_Key)"minY", 0  );
-}
-
-void _AnalyticPressure_Build( void* _self, void* data ) {
-  AnalyticPressure* 		self = (AnalyticPressure*) _self;
-
-  _FieldTest_Build( self, data );
-
-  /* here we assign the memory and the func ptr for analytic sols */
-  self->_analyticSolutionList = Memory_Alloc_Array_Unnamed( FieldTest_AnalyticSolutionFunc*, 1 );
-  /* this order MUST be consistent with the xml file definition */
-  self->_analyticSolutionList[0] = _PICellerator_AnalyticPressure_PressureFunction;
-}
-
-void* _AnalyticPressure_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(AnalyticPressure);
-	Type                                                      type = AnalyticPressure_Type;
-	Stg_Class_DeleteFunction*                              _delete = _FieldTest_Delete;
-	Stg_Class_PrintFunction*                                _print = _FieldTest_Print;
-	Stg_Class_CopyFunction*                                  _copy = _FieldTest_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _AnalyticPressure_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _AnalyticPressure_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _AnalyticPressure_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _FieldTest_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _FieldTest_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _FieldTest_Destroy;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-  return _FieldTest_New(  FIELDTEST_PASSARGS  );
-}
-
-Index PICellerator_AnalyticPressure_Register( PluginsManager* pluginsManager ) {
-  return PluginsManager_Submit( pluginsManager, AnalyticPressure_Type, (Name)"0", _AnalyticPressure_DefaultNew  );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/AnalyticPlugins/AnalyticPressure/AnalyticPressure.h
--- a/SysTest/AnalyticPlugins/AnalyticPressure/AnalyticPressure.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#include <mpi.h>
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include <PICellerator/PICellerator.h>
-
-#ifndef __AnalyticPressure_h__
-#define __AnalyticPressure_h__
-
-	extern const Type AnalyticPressure_Type;
-
-	typedef struct {
-		__FieldTest
-		double density;
-		double gravity;
-		double maxY;
-		double minY;
-	} AnalyticPressure;
-
-	void AnalyticPressure_PressureFunction( void* _self, double* coord, double* pressure );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/PerformanceTests/BuoyancyExample.xml
--- a/SysTest/PerformanceTests/BuoyancyExample.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../../Apps/BuoyancyBenchmark/BuoyancyExample.xml
\ No newline at end of file
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/PerformanceTests/generate-convergence-rates.pl
--- a/SysTest/PerformanceTests/generate-convergence-rates.pl	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../../../script/generate-convergence-rates.pl
\ No newline at end of file
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/PerformanceTests/runAndTestConvergence.pl
--- a/SysTest/PerformanceTests/runAndTestConvergence.pl	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-../../../script/runAndTestConvergence.pl
\ No newline at end of file
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/AnalyticShearXZ.xml
--- a/SysTest/RegressionTests/AnalyticShearXZ.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
- 	
-	<list name="import" mergeType="merge">
-		<param>PICellerator</param>
-	</list>
-
-	<include>StgFEM/ConstantMesh.xml           </include>
-	<include>StgFEM/LinearMesh.xml             </include>
-	<include>StgFEM/VelocityField.xml          </include>
-	<include>StgFEM/PressureField.xml          </include>
-	<include>StgFEM/GaussSwarm.xml             </include>
-	<include>StgFEM/TimeIntegrator.xml         </include>
-	<include>PICellerator/MaterialPointSwarm.xml </include>
-	<include>PICellerator/StokesFlowUzawa.xml </include>
-	
-	<!-- Load the plugin that sets up the app, plus any others you require -->
-	<list name="plugins">
-		<!-- Output Plugins -->
-		<struct>
-			<param name="Type">StgFEM_FrequentOutput</param>	
-			<param name="Context">context</param>	
-		</struct>
-		<struct>
-			<param name="Type">StgFEM_CPUTime</param>	
-			<param name="Context">context</param>	
-		</struct>
-		<struct>
-			<param name="Type">StgFEM_StandardConditionFunctions</param>	
-			<param name="Context">context</param>	
-		</struct>
-	</list>
-	<struct name="components" mergeType="merge">
-	  <struct name="context">
-	    <param name="Type">PICelleratorContext</param>
-	  </struct>
-	</struct>
-	<struct name="pluginData">
-		<list name="NumericFields">
-			<param>VelocityField</param> <param>0</param>
-			<param>PressureField</param> <param>1</param>
-			<param>StrainRateField</param> <param>2</param>
-			<param>StrainRateInvariantField</param> <param>3</param>
-		</list> 
-		<param name="IntegrationSwarm">gaussSwarm</param>
-		<param name="ConstantMesh">constantMesh</param>
-		<param name="ElementMesh">linearMesh</param>
-		<param name="normaliseByAnalyticSolution">false</param>
-		<param name="useReferenceSolutionFromFile">false</param>
-		<param name="appendToAnalysisFile">true</param>
-		<param name="Context">context</param>
-	</struct>
-
-	<struct name="components" mergeType="merge">
-		<struct name="everywhereShape">
-			<param name="Type">Everywhere</param>
-		</struct>
-		<struct name="backgroundMaterial">
-			<param name="Type">Material</param>
-			<param name="Shape">everywhereShape</param>
-		</struct>
-	</struct>
-
-	<!-- general simulation parameters -->
-	<param name="maxTimeSteps"> 10 </param>
-	<param name="dumpEvery"> 1 </param>
-	<param name="outputPath"> output </param>
-
-	<!-- Journal Control -->
-	<param name="journal.info.Context-verbose"> t </param>
-	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
-	<param name="journal.debug">f</param>
-	<param name="journal-enable-branch.debug.StgFEM">t</param>
-	<param name="journal-level-branch.debug.StgFEM"> 1 </param>
-	<param name="journal-level.debug.PeriodicBoundariesManager"> 3 </param>
-
-	<!-- Geometry & mesh setup -->
-	<param name="dim"> 2 </param>
-	<!-- Remember in StGermain these currently refer to _node_ counts rather than elements... -->
-	<param name="elementResI"> 20 </param>
-	<param name="elementResJ"> 20 </param>
-	<param name="elementResK"> 7 </param>
-	<param name="shadowDepth"> 1 </param>
-	<param name="minX"> 0.0 </param>
-	<param name="minY"> 0.0 </param>
-	<param name="minZ"> 0.0 </param>
-	<param name="maxX"> 1.0 </param>
-	<param name="maxY"> 1.0 </param>
-	<param name="maxZ"> 1.0 </param>
-	<param name="allowUnbalancing"> True </param>
-
-	<!-- gauss integration point swarm parameters -->
-	<param name="gaussParticlesX"> 2 </param>
-	<param name="gaussParticlesY"> 2 </param>
-	<param name="gaussParticlesZ"> 2 </param>
-
-	<!-- PIC Swarm parameters -->
-	<param name="particlesPerCell"> 36 </param>
-	<param name="seed"> 13 </param>
-
-	<list name="plugins" mergeType="merge">
-	  <struct>
-	    <param name="Type">StgFEM_LinearVelocityAnalytic</param>
-	    <param name="Context">context</param>
-	  </struct>
-	</list>
-
-	<!-- Periodic boundary conditions -->
-	<include>StgFEM/PeriodicX.xml</include>
-	<include>StgFEM/PeriodicZ.xml</include>
-	
-	<!-- Velocity BCs -->
-	<struct name="velocityBCs" mergeType="replace">
-		<param name="type">CompositeVC</param>
-		<list name="vcList">
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> bottom </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">double</param>
-						<param name="value"> -1.0 </param>
-					</struct>
-					<struct>
-						<param name="name">vz</param>
-						<param name="type">double</param>
-						<param name="value"> 0.5 </param>
-					</struct>
-					<struct>
-						<param name="name">vy</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> top </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">double</param>
-						<param name="value"> 1.0 </param>
-					</struct>
-					<struct>
-						<param name="name">vz</param>
-						<param name="type">double</param>
-						<param name="value"> -0.5 </param>
-					</struct>
-					<struct>
-						<param name="name">vy</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-		</list>
-	</struct>
-	
-	<param name="dim">3</param>
-	<param name="elementResI">10</param>
-	<param name="elementResJ">10</param>
-	<param name="elementResK">10</param>
-	
-	<!-- I don't know why this should be less accurate than the 2D solution -->
-	<param name="VelocityField-Tolerance">1e-4</param>
-	<param name="PressureField-Tolerance">1e-2</param>
-	<param name="StrainRateField-Tolerance">1e-2</param>
-	<param name="StrainRateInvariantField-Tolerance">1e-2</param>
-
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/LidDrivenPIC2D.xml
--- a/SysTest/RegressionTests/LidDrivenPIC2D.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-<!-- Rayleigh-Taylor app input file -->
-
-<!-- DTD to validate against -->
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-
-	<list name="import" mergeType="merge">
-		<param>PICellerator</param>
-	</list>
-
-	<include>StgFEM/ConstantMesh.xml</include>
-	<include>StgFEM/LinearMesh.xml</include>
-	<include>StgFEM/VelocityField.xml</include>
-	<include>StgFEM/PressureField.xml</include>
-	<include>StgFEM/GaussSwarm.xml</include>
-	<include>StgFEM/TimeIntegrator.xml</include>
-	<include>PICellerator/MaterialPointSwarm.xml</include>
-	<include>PICellerator/StokesFlowUzawa.xml</include>
-	
-	<!-- Load the plugin that sets up the app, plus any others you require -->
-	<param name="lucPluginContext">context</param>
-	<list name="plugins">
-		<!-- Output Plugins -->
-		<struct>
-			<param name="Type">StgFEM_FrequentOutput</param>	
-			<param name="Context">context</param>
-		</struct>
-		<struct>
-			<param name="Type">StgFEM_CPUTime</param>
-			<param name="Context">context</param>
-		</struct>
-		<struct>
-			<param name="Type">StgFEM_StandardConditionFunctions</param>
-			<param name="Context">context</param>
-		</struct>
-		<struct>
-			<param name="Type">lucPlugin</param>
-			<param name="Context">lucPluginContext</param>
-		</struct>
-	</list>
-
-	<struct name="components" mergeType="merge">
-		<struct name="context">
-			<param name="Type">PICelleratorContext</param>
-		</struct>
-		<struct name="everywhereShape">
-			<param name="Type">Everywhere</param>
-		</struct>
-		<struct name="backgroundMaterial">
-			<param name="Type">Material</param>
-			<param name="Shape">everywhereShape</param>
-		</struct>
-	</struct>
-
-	<!-- general simulation parameters -->
-	<param name="maxTimeSteps"> 10 </param>
-	<param name="dumpEvery"> 1 </param>
-	<param name="outputPath"> output </param>
-
-	<!-- Journal Control -->
-	<param name="journal.info.Context-verbose"> t </param>
-	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
-	<param name="journal.debug">f</param>
-	<param name="journal-enable-branch.debug.StgFEM">t</param>
-	<param name="journal-level-branch.debug.StgFEM"> 1 </param>
-	<param name="journal-level.debug.PeriodicBoundariesManager"> 3 </param>
-
-	<!-- Geometry & mesh setup -->
-	<param name="dim"> 2 </param>
-	<!-- Remember in StGermain these currently refer to _node_ counts rather than elements... -->
-	<param name="elementResI"> 20 </param>
-	<param name="elementResJ"> 20 </param>
-	<param name="elementResK"> 7 </param>
-	<param name="shadowDepth"> 1 </param>
-	<param name="minX"> 0.0 </param>
-	<param name="minY"> 0.0 </param>
-	<param name="minZ"> 0.0 </param>
-	<param name="maxX"> 1.0 </param>
-	<param name="maxY"> 1.0 </param>
-	<param name="maxZ"> 1.0 </param>
-	<param name="allowUnbalancing"> True </param>
-
-	<!-- Ok, now setup the Boundary conditions -->
-	<include>lidDrivenVelocityBCs.xml</include>
-
-	<!-- gauss integration point swarm parameters -->
-	<param name="gaussParticlesX"> 2 </param>
-	<param name="gaussParticlesY"> 2 </param>
-	<param name="gaussParticlesZ"> 2 </param>
-
-	<!-- PIC Swarm parameters -->
-	<param name="particlesPerCell"> 36 </param>
-	<param name="seed"> 13 </param>
-
-</StGermainData>	
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/OFile.dat
--- a/SysTest/RegressionTests/OFile.dat	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-./lidDrivenAnalytic.xml --AnalyticVelocityWavenumber=1 --journal-level.info.StG_FEM_CompareFeVariables=1 --maxTimeSteps=2
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/analyticTest.pl
--- a/SysTest/RegressionTests/analyticTest.pl	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,365 +0,0 @@
-#!/usr/bin/perl -w
-#
-use strict;
-
-##### SUBROUTINES #####
-sub runTests;
-sub executeCommandline;
-sub testConvergence;
-sub generateConvergence;
-sub testNumbersAgainstExpected;
-sub readOptionsFile;
-
-
-##### GLOBAL VARS #####
-our $testReport = "[Bitten] purpose=test current numerical fields against previously checkpoint fields of this model\n";
-our $cvgFileName = "";
-our $helpStr = "To run checkpoint tests:
-
-./checkpointTest.pl <xmlFile> [ OPTIONS ]
-
-where OPTIONS:
-	-optionsFile <fileName>   : where <fileName> is the options file. Command line agruments in StGermain format.
-	-c                        : will \"create\" checkpointed data only. By default this flag in not set and the script only checks against previous checkpointed data.  
-	-n                        : the timestep checkpoint writing (if -c is defined) or checkpoint testing will occur on. By default this is timestep 10.  
-	-h                        : this help message
-
-EXAMPLE:
-  ./checkpointTest.pl testVelicSolS.xml -optionsFile OFile.dat
-		(Runs with option file OFile.dat and checks against the expected file)
-	
-";
-
-######  MAIN PROGRAM    ######
-
-# 1) Run the xml 
-$cvgFileName = &runTests();
-
-# 2) Check against expected, checkpoint files 
-exit &testConvergence( $cvgFileName );
-
-######  END MAIN  ######
-
-
-sub runTests {
-	my $res;
-	my $command;
-	my $createTest=0; #boolean to create an expected file, defaut 0
-
-	# read commandline args
-	my $arg;
-	my $ii = 0;
-	my $xmlFile = " ";
-	my $optFile = " ";
-	my $numberOfTimeSteps = 10; # testing Timestep is 10 by default
-	my @procs = (1,1,1,1);
-	my @commandLines = ""; #("--elementResI=32 --elementResJ=32 " );
-	my $outputPath = " ";
-												
-	# check if xml exists and options file is specified
-	foreach $arg (@ARGV) {
-		if( $arg =~ m/.*\.xml$/ ) { $xmlFile = $arg; }
-		elsif( $arg =~ m/\-optionsFile/ ) { $optFile = $ARGV[$ii+1]; $ii++; }
-		elsif( $arg =~ m/^\-h$/ ) { print $helpStr; exit }
-		elsif( $arg =~ m/^\-\-help$/ ) { print $helpStr; exit }
-		elsif( $arg =~ m/^\-c/ ) { $createTest=1; }
-		elsif( $arg =~ m/^\-n/ ) { $numberOfTimeSteps=$ARGV[$ii+1]; $ii++; }
-		$ii++;
-	}
-	if( $xmlFile eq " " ) { die "\n\n### ERROR ###\nNo xml file specified, stopped" ; }
-	if( !(-e $xmlFile) ) { die "\n\n### ERROR ###\nCannot find input file: $xmlFile, stopped" ; }
-
-	# check if options file is given, otherwise run default
-	if( $optFile ne " " ) {
-		if( !(-e $optFile) ) { die "\\n### ERROR ###\nnCannot find run options file $optFile, stopped"; }
-
-		# read in run options file
-		&readOptionsFile( $optFile, \@procs, \@commandLines );
-		print "\nUsing options file $optFile, specifed options are:\n-n $procs[0] "; foreach (@commandLines) { print "$_ "; }
-	}
-
-	my $exec = "udw"; # executable name
-	my $stdout;
-	my $stderr;
-
-	# create strings for 1) creating checkpoint data & 2) testing against checkpointed data
-	my $xmlSegmentCreateTest = "<StGermainData xmlns=\"http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003\">
-		<param name=\"checkpointEvery\" mergeType=\"replace\">10</param>
-		<param name=\"outputPath\" mergeType=\"replace\">./expected/$xmlFile</param>
-		<param name=\"maxTimeSteps\" mergeType=\"replace\">$numberOfTimeSteps</param>
-		<param name=\"dumpEvery\" mergeType=\"replace\">0</param>
-</StGermainData>";
-# 	my $xmlSegmentToTest = "<StGermainData xmlns=\"http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003\">
-# 	<struct name=\"components\" mergeType=\"merge\">
-# 		<struct name=\"tester\">
-# 			<param name=\"Type\">FieldTest</param>
-# 		</struct>	
-# 	</struct>
-
-# 	<param name=\"outputPath\" mergeType=\"replace\">./output/$xmlFile</param>
-# 	<param name=\"checkpointEvery\" mergeType=\"replace\">0</param>
-# 	<param name=\"dumpEvery\" mergeType=\"replace\">0</param>
-# 	<param name=\"maxTimeSteps\" mergeType=\"replace\">$numberOfTimeSteps</param>
-# 	<struct name=\"pluginData\" mergeType=\"replace\">
-# 		<list name=\"NumericFields\">
-# 			<param>VelocityField</param> <param>0</param>
-# 			<param>PressureField</param> <param>1</param>
-# 			<param>TemperatureField</param> <param>2</param>
-# 		</list> 
-# 		<param name=\"IntegrationSwarm\">gaussSwarm</param>
-# 		<param name=\"ConstantMesh\">constantMesh</param>
-# 		<param name=\"testTimestep\">$numberOfTimeSteps</param>
-# 		<param name=\"ElementMesh\">linearMesh</param>
-# 		<param name=\"normaliseByAnalyticSolution\">True</param>
-# 		<param name=\"context\">context</param>
-# 		<param name=\"appendToAnalysisFile\">True</param>
-# 		<!-- reference soln stuff -->
-# 		<param name=\"useReferenceSolutionFromFile\">true</param>
-# 		<param name=\"referenceSolutionFilePath\">./expected/$xmlFile</param>
-# 		<list name=\"ReferenceFields\">
-# 			<param>VelocityField</param>
-# 			<param>PressureField</param>
-# 			<param>TemperatureField</param>
-# 		</list> 
-# 	</struct> 
-# </StGermainData>";
-
-	my $xmlSegmentToTest = "<StGermainData xmlns=\"http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003\">
-	<param name=\"outputPath\" mergeType=\"replace\">./output/$xmlFile</param>
-</StGermainData>";
-
-	# Need to check for an executable
-	if( !(-e "./../../../build/bin/StGermain" ) ) {
-		die "\n\n### ERROR ###\nCan't find ./../../../build/bin/StGermain - the executable which runs the test, stopped";
-	}
-
-	if( $createTest ) {
-		print "\n--- Creating checkpoint files for $xmlFile at timestep $numberOfTimeSteps---\n";
-	} else {
-		print "\n--- Testing the $xmlFile ---\n";
-	}
-
-	# is the symbolic link there, if not create it
-	if( !(-e $exec) ) {
-		$command = "ln -s ../../../build/bin/StGermain $exec";
-		print "\n$command\n\n";
-		&executeCommandline( $command );
-	}	
-
-	# check if there's a log dir
-	if( !(-e "log/") ) {
-		$command = "mkdir log";
-		&executeCommandline( $command );
-	}
-
-	# declare stdout and stderr files, in log dir.
-	$stdout = "log/$xmlFile"."_runs.stdout";
-	$stderr = "log/$xmlFile"."_runs.stderr";
-
-	# remove old log file, if it exists
-	if( -e "$stdout" ) {
-		$command = "rm $stdout";
-		&executeCommandline( $command );
-	}
-
-	# remove old cvg file, if it exists 
-	if( scalar (glob "*.cvg") ) { 
-		$command = "rm *.cvg"; 
-		&executeCommandline( $command );
-	} 
-
-	# create help.xml for setting up test
-	if( $createTest ) {
-		$command = "echo \'$xmlSegmentCreateTest\' > help.xml ";
-	} else {
-		$command = "echo \'$xmlSegmentToTest\' > help.xml ";
-	}
-	&executeCommandline($command);
-
-	# run test case
-	$command = "mpiexec -n $procs[0] ./$exec $xmlFile help.xml $commandLines[0] --pluginData.appendToAnalysisFile=True >$stdout";
-	$command .= " 2>$stderr";
-	print "$command";
-	&executeCommandline( $command );
-
-	# check error stream for error result
-	open( ERROR, "<$stderr" );
-	my $line;
-	foreach $line (<ERROR>) {
-		if( $line =~ m/[E|e]rror/ ) {
-			close(ERROR); 
-			die ("\n\n### ERROR ###\nError in runtime: see $stderr or $stdout - stopped" ); 
-		}
-	}
-
-	# if no error close file and delete it
-	close(ERROR); 
-	$command = "rm $stderr"; &executeCommandline($command);
-
-	# removing help.xml
-	$command = "rm help.xml";
-	print "\n$command\n"; &executeCommandline($command);
-
-	# removing softlink
-	$command = "rm $exec";
-	print "$command\n"; &executeCommandline($command);
-
-	print "--- Finished  ---\n\n";
-
-	# if we're only creating checkpoint file, end program here
-	if( $createTest ) { exit(0); }
-
-	$testReport .= "[Bitten] proc=$procs[0]\n";
-
-	#search for resolution to report
-	my $resx;
-	my $resy;
-	my $resz;
-	open( FLATOUTPUT, "./output/$xmlFile/input.xml" )
-		or die ("\n\n### ERROR ###\n\t\tCouldn't open output file, ./output/$xmlFile/input.xml " );
-
-	my $resolution;
-	foreach $line (<FLATOUTPUT>) {
-		if( $line =~ m/\"elementResI\">(\d+)</ ) { $resx = $1; }
-		elsif( $line =~ m/\"elementResJ\">(\d+)</ ) { $resy = $1; }
-		elsif( $line =~ m/\"elementResK\">(\d+)</ ) { $resz = $1; }
-	}
-	close( FLATOUTPUT );
-
-	#get the total CPU time from plugin
-	my @labels;
-	my $label;
-	my $totalTime;
-	my $freqOutput = "./output/$xmlFile/FrequentOutput.dat";
-
-	if( !(-e $freqOutput) ) {
-		die("\n\n### ERROR ###\nCouldn't open $freqOutput");
-	}
-	$ii = 0;
-	$command = "head -n 1 $freqOutput";
-
-	@labels = split( /\s+/, &executeCommandline( $command ) );
-	foreach $label (@labels) {
-		if( $label =~ m/CPUTime/ ) { last; }
-		$ii++;
-	}
-	$command = "tail -n 1 $freqOutput";
-	@labels = split( /\s+/, &executeCommandline( $command ) );
-	$totalTime = $labels[$ii-1];
-	$testReport .= "[Bitten] time=$totalTime\n";
-
-	#append to report string
-	$testReport .= "[Bitten] resx=$resx\n";
-	$testReport .= "[Bitten] resy=$resy\n";
-	if ( defined $resz ) { $testReport .= "[Bitten] resz=$resz\n"; }
-	else { $testReport .= "[Bitten] resz=0\n"; }
-
-	# return convergence file name
-	$command = "ls *\.cvg 2>/dev/null";
-	my $cvg = &executeCommandline($command);
-	chomp( $cvg );
-	return $cvg;
-}
-
-sub readOptionsFile {
-	my ( $optFile, $procs, $commandLines ) = @_;
-	my $line;
-	# $line_I represents the number of tests to run
-	my $line_I = 0;
-	# open options file
-	open OPTFILE, "<$optFile" || die "Can't open options file $optFile, stopped" ;
-	foreach $line (<OPTFILE>) {
-		chomp $line;
-		# only process lines that start with np
-		if( $line =~ m/^np\s+(\d+)\s+(.*)/ ) {
-			$procs->[$line_I] = $1;
-			$commandLines->[$line_I] = $2;
-			$line_I++;
-		} else { next; }
-	}
-	return $line_I;
-}
-
-sub testConvergence {
- 	my $datFile = $_[0]; 
-	my @keys;
-	my $tolerance = 3e-2;
-	my @errors;
-	my $line;
-	my $nKeys;
-	my $nErrs;
-	my $report;
-	my $result;
-	my $command;
-	my $ii;
-	# test convergence numbers
-	open(INPUT, "<$datFile") || die "Can't open the expected file $datFile\n" ; 
-	while ($line = <INPUT>) {
-		chomp $line;
-		if ( $line =~ m/^\#Res\s.*/ ) {
-   		# parse for variable labels
-			@keys = split (/\s+/, $line );
-		}
-		else {
-			@errors = split(/\s+/, $line );
-		}
-	}
-
-	# ensure the number of keys and error measures agree
-	$nKeys = @keys;
-	$nErrs = @errors;
-	
-	if( $nKeys != $nErrs ) { die "The number of keys against the number of errors in file $datFile don't agreed\n"; }
-
-	$result = "Pass";
-	$report = "";
-
-	$testReport .= "[Bitten] tolerance=$tolerance\n";
-
-	# go through all  errors and check if they're within tolerance
-	for( $ii = 1 ; $ii < $nKeys ; $ii++ ) {
-		if( abs($errors[$ii]) > $tolerance ) {
-			$result = "Fail";
-			$report .= "***BAD NEWS*** ... $keys[$ii] differs by more than " . $tolerance*100 . "\% tolerance from expected file, error is $errors[$ii]\n";
-			$testReport .= "[Bitten] error in $keys[$ii]=$errors[$ii]\n";
-		} else {
-			$report .= "pass ... $keys[$ii] within a ". $tolerance*100 ."\% relative tolerance from expected file\n";
-			$testReport .= "[Bitten] error in $keys[$ii]=$errors[$ii]\n";
-		}
-	}
-
-	close( INPUT );
-
-	print "\n$report";
-	print "\nResult = $result\n";
-
-	$testReport .= "[Bitten] status=$result\n";
-
-	# remove the used data file
-	$command = "rm $datFile";
-	&executeCommandline($command);
-
-	open ( JERICO_FILE, "+>.jericoFile" );
-	print JERICO_FILE "$testReport\n";
-	close( JERICO_FILE );
-
-	if( $result eq "Pass" ) {
-		exit(0);
-	} else {
-		exit(1);
-	}
-}
-
-
-sub executeCommandline {
-# pass in single string to execute on the command
-	my $command = $_[0];
-
-  my $output = qx{$command};            # that's the new shell's $$
-	my $exitStatus = $? >> 8;
-
-	# check the exit status of the command
-	if( $exitStatus ne 0 ) { die "\n\n### ERROR ###\nCouldn't execute the command\n$command\n\n"; }
-
-	return $output;
-}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/FrequentOutput.dat
--- a/SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/FrequentOutput.dat	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#       Timestep            Time        CPU_Time
-               1               0        0.530543
-               2           0.025        0.816888
-               3            0.05          1.0977
-               4           0.075         1.37782
-               5             0.1         1.65233
-               6           0.125         1.94221
-               7            0.15         2.24482
-               8           0.175         2.54167
-               9             0.2         2.83727
-              10           0.225         3.13144
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/Mesh.00010.h5
Binary file SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/Mesh.00010.h5 has changed
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/PressureField.00010.h5
Binary file SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/PressureField.00010.h5 has changed
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/VelocityField.00010.h5
Binary file SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/VelocityField.00010.h5 has changed
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/materialSwarm.00010.h5
Binary file SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/materialSwarm.00010.h5 has changed
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/timeInfo.00010.h5
Binary file SysTest/RegressionTests/expected/LidDrivenPIC2D.xml/timeInfo.00010.h5 has changed
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/lidDrivenAnalytic.xml
--- a/SysTest/RegressionTests/lidDrivenAnalytic.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-<!-- A StGermain input file -->
-<!-- DTD to validate against -->
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-
-	<list name="plugins" mergeType="merge">
-		<struct>
-			<param name="Type">StgFEM_LidDrivenIsoviscousAnalytic</param>
-			<param name="Context">context</param>
-		</struct>
-	</list>
-
-	<struct name="pluginData">
-      <list name="NumericFields">
-         <param>VelocityField</param> <param>0</param>
-         <param>PressureField</param> <param>1</param>
-      </list>
-      <param name="IntegrationSwarm">gaussSwarm</param>
-      <param name="ConstantMesh">constantMesh</param>
-      <param name="ElementMesh">linearMesh</param>
-      <param name="normaliseByAnalyticSolution">true</param>
-      <param name="useReferenceSolutionFromFile">false</param>
-      <param name="appendToAnalysisFile">false</param>
-      <param name="Context">context</param>
-   </struct>
-
-	<param name="VelocityField-Tolerance">0.015</param>
-	<param name="PressureField-Tolerance">0.15</param>
-
-	<!-- Velocity BCs -->
-	<struct name="velocityBCs" mergeType="replace">
-		<param name="type">CompositeVC</param>
-		<list name="vcList">
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> bottom </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-					<struct>
-						<param name="name">vy</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> left </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> right </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> front </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vz</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> back </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vz</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> top </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">func</param>
-						<param name="value"> Velocity_SinusoidalLid </param>
-					</struct>
-					<struct>
-						<param name="name">vy</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-		</list>
-	</struct>
-
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/lidDrivenVelocityBCs.xml
--- a/SysTest/RegressionTests/lidDrivenVelocityBCs.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-<!-- A StGermain input file -->
-<!-- DTD to validate against -->
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-
-	<!-- Velocity BCs -->
-	<struct name="velocityBCs">
-		<param name="type">CompositeVC</param>
-		<list name="vcList">
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> bottom </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vy</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> left </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> right </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				
-				</list>
-			</struct>
-			<struct>
-				<param name="type"> WallVC </param>
-				<param name="wall"> top </param>
-				<list name="variables">
-					<struct>
-						<param name="name">vx</param>
-						<param name="type">func</param>
-						<param name="value"> Velocity_PartialLid_TopLayer </param>
-					</struct>
-					<struct>
-						<param name="name">vy</param>
-						<param name="type">double</param>
-						<param name="value"> 0 </param>
-					</struct>
-				</list>
-			</struct>
-		</list>
-	</struct>
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/np-1.dat
--- a/SysTest/RegressionTests/np-1.dat	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-# this line is a comment
-# np x, where x is the number of procs to run test
-# everything after will be passed as a command line arg
-np 1
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/np-2.dat
--- a/SysTest/RegressionTests/np-2.dat	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-np 2
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/np-4.dat
--- a/SysTest/RegressionTests/np-4.dat	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-# this line is a comment
-# np x, where x is the number of procs to run test
-# everything after will be passed as a command line arg
-np 4
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/np-8.dat
--- a/SysTest/RegressionTests/np-8.dat	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-# this line is a comment
-# np x, where x is the number of procs to run test
-# everything after will be passed as a command line arg
-np 8
diff -r 4ca4356447d8 -r 42d3a58b6ff9 SysTest/RegressionTests/testAll.py
--- a/SysTest/RegressionTests/testAll.py	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#! /usr/bin/env python
-
-import os
-import sys
-import subprocess
-
-def runTests():
-    
-    commands = ['./analyticTest.pl AnalyticShearXZ.xml -optionsFile np-1.dat', \
-                './analyticTest.pl AnalyticShearXZ.xml -optionsFile np-2.dat', \
-                './analyticTest.pl AnalyticShearXZ.xml -optionsFile np-4.dat', \
-                './analyticTest.pl AnalyticShearXZ.xml -optionsFile np-8.dat']
-
-    failed_commands = [] 
-    passed = 0
-    failed = 0
- 
-    for command in commands:
-        try:
-            retcode = subprocess.call( command+' -serial' , shell=True )
-            if retcode == 0:
-                 passed += 1
-            else:
-                 failed += 1
-                 failed_commands.append( command )
-        except OSError, e:
-            print >>sys.stderr, "Execution Failed:", e
-
-    filename = "../../../summary.dat"
-
-    if os.path.exists( filename ):
-        FILE = open( filename, "a" )
-    else:
-        FILE = open( filename, "w" )
-
-    message = ''
-    message += "--------------------------------------------------------\n" + \
-          "[SYS] PICellerator Normal-Res Integration Tests:\n" + \
-          "[SYS]      Total Passes: (" + str(passed) + "/" + str(len( commands )) + ")\n" \
-          "[SYS]      Failed Commands:\n"
-    for command in failed_commands:
-        message += "[SYS]            " + command + "\n"
-    message += "--------------------------------------------------------\n"
-    FILE.write( message )
-    print message
-    FILE.close()
-
-
-runTests()
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/BuoyancyForceTerm.c
--- a/Utils/src/BuoyancyForceTerm.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/BuoyancyForceTerm.c	Tue Feb 02 16:55:08 2010 +1100
@@ -57,43 +57,68 @@
 
 #include <assert.h>
 #include <string.h>
-#include <stddef.h>
 
 /* Textual name of this class */
 const Type BuoyancyForceTerm_Type = "BuoyancyForceTerm";
 
 BuoyancyForceTerm* BuoyancyForceTerm_New( 
-	Name							name,
-	FiniteElementContext*	context,
-	ForceVector*				forceVector,
-	Swarm*						integrationSwarm,
-	FeVariable*					temperatureField,
-	double						gravity,
-	Bool							adjust,
-	Materials_Register*		materials_Register )
+		Name                                                name,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              gravity,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register )
 {
 	BuoyancyForceTerm* self = (BuoyancyForceTerm*) _BuoyancyForceTerm_DefaultNew( name );
 
-	self->isConstructed = True;
-	_ForceTerm_Init( self, context, forceVector, integrationSwarm, NULL );
-	_BuoyancyForceTerm_Init( self, temperatureField, gravity, adjust, materials_Register );
+	BuoyancyForceTerm_InitAll( 
+			self,
+			forceVector,
+			integrationSwarm,
+			temperatureField,
+			gravity,
+			adjust,
+			materials_Register );
 
 	return self;
 }
 
 /* Creation implementation / Virtual constructor */
-BuoyancyForceTerm* _BuoyancyForceTerm_New(  BUOYANCYFORCETERM_DEFARGS  )
+BuoyancyForceTerm* _BuoyancyForceTerm_New( 
+		SizeT                                               sizeOfSelf,  
+		Type                                                type,
+		Stg_Class_DeleteFunction*                           _delete,
+		Stg_Class_PrintFunction*                            _print,
+		Stg_Class_CopyFunction*                             _copy, 
+		Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+		Stg_Component_ConstructFunction*                    _construct,
+		Stg_Component_BuildFunction*                        _build,
+		Stg_Component_InitialiseFunction*                   _initialise,
+		Stg_Component_ExecuteFunction*                      _execute,
+		Stg_Component_DestroyFunction*                      _destroy,
+		ForceTerm_AssembleElementFunction*                  _assembleElement,		
+		BuoyancyForceTerm_CalcGravityFunction*              _calcGravity,
+		Name                                                name )
 {
 	BuoyancyForceTerm* self;
 	
 	/* Allocate memory */
-	assert( _sizeOfSelf >= sizeof(BuoyancyForceTerm) );
-	/* The following terms are parameters that have been passed into this function but are being set before being passed onto the parent */
-	/* This means that any values of these parameters that are passed into this function are not passed onto the parent function
-	   and so should be set to ZERO in any children of this class. */
-	nameAllocationType = NON_GLOBAL;
-
-	self = (BuoyancyForceTerm*) _ForceTerm_New(  FORCETERM_PASSARGS  );
+	assert( sizeOfSelf >= sizeof(BuoyancyForceTerm) );
+	self = (BuoyancyForceTerm*) _ForceTerm_New( 
+		sizeOfSelf, 
+		type, 
+		_delete, 
+		_print, 
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build, 
+		_initialise,
+		_execute,
+		_destroy,
+		_assembleElement,
+		name );
 	
 	/* Virtual info */
 	self->_calcGravity = _calcGravity;
@@ -102,14 +127,12 @@ BuoyancyForceTerm* _BuoyancyForceTerm_Ne
 }
 
 void _BuoyancyForceTerm_Init( 
-	void*						forceTerm, 
-	FeVariable*				temperatureField,
-	double					gravity,
-	Bool						adjust,
-	Materials_Register*	materials_Register )
+		BuoyancyForceTerm*                                  self, 
+		FeVariable*                                         temperatureField,
+		double                                              gravity,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register )
 {
-	BuoyancyForceTerm* self = (BuoyancyForceTerm*)forceTerm;
-
 	self->temperatureField    = temperatureField;
 	self->gravity             = gravity;
 	self->gHat		  = NULL;
@@ -117,8 +140,32 @@ void _BuoyancyForceTerm_Init(
 	self->materials_Register  = materials_Register;
 }
 
+void BuoyancyForceTerm_InitAll( 
+		void*                                               forceTerm,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              gravity,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register )
+{
+	BuoyancyForceTerm* self = (BuoyancyForceTerm*) forceTerm;
+
+	ForceTerm_InitAll( self, forceVector, integrationSwarm, NULL );
+	_BuoyancyForceTerm_Init( self, temperatureField, gravity, adjust, materials_Register );
+}
+
 void _BuoyancyForceTerm_Delete( void* forceTerm ) {
 	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] );
+	}
+	Stg_Class_Delete( self->densitySwarmVariables );
+	Stg_Class_Delete( self->alphaSwarmVariables );
 
 	_ForceTerm_Delete( self );
 }
@@ -134,65 +181,57 @@ void _BuoyancyForceTerm_Print( void* for
 }
 
 void* _BuoyancyForceTerm_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(BuoyancyForceTerm);
-	Type                                                      type = BuoyancyForceTerm_Type;
-	Stg_Class_DeleteFunction*                              _delete = _BuoyancyForceTerm_Delete;
-	Stg_Class_PrintFunction*                                _print = _BuoyancyForceTerm_Print;
-	Stg_Class_CopyFunction*                                  _copy = NULL;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _BuoyancyForceTerm_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _BuoyancyForceTerm_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _BuoyancyForceTerm_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _BuoyancyForceTerm_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _BuoyancyForceTerm_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _BuoyancyForceTerm_Destroy;
-	ForceTerm_AssembleElementFunction*            _assembleElement = _BuoyancyForceTerm_AssembleElement;
-	BuoyancyForceTerm_CalcGravityFunction*            _calcGravity = _BuoyancyForceTerm_CalcGravity;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return (void*)_BuoyancyForceTerm_New(  BUOYANCYFORCETERM_PASSARGS  );
+	return (void*)_BuoyancyForceTerm_New( 
+		sizeof(BuoyancyForceTerm), 
+		BuoyancyForceTerm_Type,
+		_BuoyancyForceTerm_Delete,
+		_BuoyancyForceTerm_Print,
+		NULL,
+		_BuoyancyForceTerm_DefaultNew,
+		_BuoyancyForceTerm_Construct,
+		_BuoyancyForceTerm_Build,
+		_BuoyancyForceTerm_Initialise,
+		_BuoyancyForceTerm_Execute,
+		_BuoyancyForceTerm_Destroy,
+		_BuoyancyForceTerm_AssembleElement,
+		_BuoyancyForceTerm_CalcGravity,
+		name );
 }
 
-void _BuoyancyForceTerm_AssignFromXML( void* forceTerm, Stg_ComponentFactory* cf, void* data ) {
-	BuoyancyForceTerm*		self = (BuoyancyForceTerm*)forceTerm;
-	Dictionary*					dict;
+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;
-	PICelleratorContext*		context;
+	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_AssignFromXML( self, cf, data );
+	_ForceTerm_Construct( self, cf, data );
 
-	dict = Dictionary_Entry_Value_AsDictionary( Dictionary_Get( cf->componentDict, (Dictionary_Entry_Key)self->name )  );
-	temperatureField = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"TemperatureField", FeVariable, False, data  ) ;
-	gravity = Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"gravity", 0.0  );
-	adjust = Stg_ComponentFactory_GetBool( cf, self->name, (Dictionary_Entry_Key)"adjust", False  );
+	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, (Dictionary_Entry_Key)"gravityDirection" );
-
+	direcList = Dictionary_Get( dict, "gravityDirection" );
 	if( direcList ) {
-		nDims = Dictionary_Entry_Value_GetCount( 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( (char *)rootKey )  )
-				tmp = Dictionary_Get( cf->rootDict, (Dictionary_Entry_Key)rootKey );
+			if( !Stg_StringIsNumeric( rootKey ) )
+				tmp = Dictionary_Get( cf->rootDict, rootKey );
 			direc[d_i] = Dictionary_Entry_Value_AsDouble( tmp );
 		}
-		if( nDims == 2  )
+		if( nDims == 2 )
 			Vec_Norm2D( direc, direc );
 		else
 			Vec_Norm3D( direc, direc );
@@ -200,9 +239,7 @@ void _BuoyancyForceTerm_AssignFromXML( v
 	else
 		direc = NULL;
 
-	context = (PICelleratorContext*)self->context;
-	assert( Stg_CheckType( context, PICelleratorContext ) );
-	materials_Register = context->materials_Register;
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
 	assert( materials_Register );
 
 	_BuoyancyForceTerm_Init( self, temperatureField, gravity, adjust, materials_Register );
@@ -219,9 +256,14 @@ void _BuoyancyForceTerm_Build( void* for
 	MaterialPointsSwarm**            materialSwarms;
 	Index                            materialSwarm_I;
 	Name                             name;
+	AbstractContext*                 context;
 	Stg_ComponentFactory*            cf;
 
-	cf = self->context->CF;
+	/* Get Component Factory if we can */
+	if ( Stg_Class_IsInstance( data, AbstractContext_Type ) ) {
+		context = (AbstractContext*) data;
+		cf = context->CF;
+	}
 
 	_ForceTerm_Build( self, data );
 
@@ -237,8 +279,14 @@ void _BuoyancyForceTerm_Build( void* for
 		material = Materials_Register_GetByIndex( materials_Register, material_I );
 		materialExt = ExtensionManager_GetFunc( material->extensionMgr, material, self->materialExtHandle );
 
-		materialExt->density = Stg_ComponentFactory_GetDouble( cf, material->name, (Dictionary_Entry_Key)"density", 0.0  );
-		materialExt->alpha   = Stg_ComponentFactory_GetDouble( cf, material->name, (Dictionary_Entry_Key)"alpha", 0.0  );
+		if ( cf ) {
+			materialExt->density = Stg_ComponentFactory_GetDouble( cf, material->name, "density", 0.0 );
+			materialExt->alpha   = Stg_ComponentFactory_GetDouble( cf, material->name, "alpha",   0.0 );
+		}
+		else {
+			materialExt->density = Dictionary_GetDouble_WithDefault( material->dictionary, "density", 0.0 );
+			materialExt->alpha   = Dictionary_GetDouble_WithDefault( material->dictionary, "alpha",   0.0 );
+		}
 	}
 	
 	/* Create Swarm Variables of each material swarm this ip swarm is mapped against */
@@ -247,10 +295,9 @@ void _BuoyancyForceTerm_Build( void* for
 	self->alphaSwarmVariables   = Memory_Alloc_Array( MaterialSwarmVariable*, self->materialSwarmCount, "AlphaVariables" );
 	
 	for ( materialSwarm_I = 0; materialSwarm_I < self->materialSwarmCount; ++materialSwarm_I ) {
-		name = Stg_Object_AppendSuffix( materialSwarms[materialSwarm_I], (Name)"Density"  );
+		name = Stg_Object_AppendSuffix( materialSwarms[materialSwarm_I], "Density" );
 		self->densitySwarmVariables[materialSwarm_I] = MaterialSwarmVariable_New( 
-				name,
-				(AbstractContext*)self->context,
+				name, 
 				materialSwarms[materialSwarm_I], 
 				1, 
 				self->materials_Register, 
@@ -258,10 +305,9 @@ void _BuoyancyForceTerm_Build( void* for
 				GetOffsetOfMember( *materialExt, density ) );
 		Memory_Free( name );
 
-		name = Stg_Object_AppendSuffix( materialSwarms[materialSwarm_I], (Name)"Alpha"  );
+		name = Stg_Object_AppendSuffix( materialSwarms[materialSwarm_I], "Alpha" );
 		self->alphaSwarmVariables[materialSwarm_I] = MaterialSwarmVariable_New( 
-				name,
-				(AbstractContext*)self->context,
+				name, 
 				materialSwarms[materialSwarm_I], 
 				1, 
 				self->materials_Register, 
@@ -291,31 +337,18 @@ void _BuoyancyForceTerm_Initialise( void
 }
 
 void _BuoyancyForceTerm_Execute( void* forceTerm, void* data ) {
-	BuoyancyForceTerm* self = (BuoyancyForceTerm*)forceTerm;
-
-	_ForceTerm_Execute( self, data );
+	_ForceTerm_Execute( forceTerm, data );
 }
 
 void _BuoyancyForceTerm_Destroy( void* forceTerm, void* data ) {
-	BuoyancyForceTerm* self = (BuoyancyForceTerm*)forceTerm;
-	Index i;
-
-	for ( i = 0; i < self->materialSwarmCount; ++i ) {
-		_Stg_Component_Delete( self->densitySwarmVariables[i] );
-		_Stg_Component_Delete( self->alphaSwarmVariables[i] );
-	}
-
-	FreeArray( self->gHat );
-
-	Memory_Free( self->densitySwarmVariables );
-	Memory_Free( self->alphaSwarmVariables );
-
 	_ForceTerm_Destroy( forceTerm, data );
 }
+
 
 void _BuoyancyForceTerm_AssembleElement( void* forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVec ) {
 	BuoyancyForceTerm*               self               = (BuoyancyForceTerm*) forceTerm;
 	IntegrationPoint*                particle;
+	BuoyancyForceTerm_MaterialExt*   materialExt;
 	Particle_InCellIndex             cParticle_I;
 	Particle_InCellIndex             cellParticleCount;
 	Element_NodeIndex                elementNodeCount;
@@ -332,10 +365,7 @@ void _BuoyancyForceTerm_AssembleElement(
 	double                           Ni[27];
 	double                           force;
 	double*                          xi;
-#if 0
-	BuoyancyForceTerm_MaterialExt*   materialExt;
 	Material*                        material;
-#endif
 	FeVariable*                      temperatureField   = self->temperatureField;
 	double                           temperature        = 0.0;
 	double*				 gHat;
@@ -343,8 +373,6 @@ void _BuoyancyForceTerm_AssembleElement(
 
 	double totalWeight = 0.0;
 	double adjustFactor = 0.0;
-	double density;
-	double alpha;
 
 	elementType       = FeMesh_GetElementType( mesh, lElement_I );
 	elementNodeCount  = elementType->nodeCount;
@@ -382,22 +410,13 @@ void _BuoyancyForceTerm_AssembleElement(
 		/* Get parameters */
 		if ( temperatureField ) 
 			FeVariable_InterpolateFromMeshLocalCoord( temperatureField, mesh, lElement_I, xi, &temperature );
-
-		density = IntegrationPointMapper_GetDoubleFromMaterial(
-		    swarm->mapper, particle, self->materialExtHandle,
-		    offsetof(BuoyancyForceTerm_MaterialExt, density));
-		alpha = IntegrationPointMapper_GetDoubleFromMaterial(
-		    swarm->mapper, particle, self->materialExtHandle,
-		    offsetof(BuoyancyForceTerm_MaterialExt, alpha));
-
-/*
+	
 		material = IntegrationPointsSwarm_GetMaterialOn( (IntegrationPointsSwarm*) swarm, particle );
 		materialExt = ExtensionManager_Get( material->extensionMgr, material, self->materialExtHandle );
-*/
 
 		/* Calculate Force */
 		gravity = BuoyancyForceTerm_CalcGravity( self, (Swarm*)swarm, lElement_I, particle );
-		force = density * gravity * (1.0 - alpha * temperature);
+		force = materialExt->density * gravity * (1.0 - materialExt->alpha * temperature);
 		factor = detJac * particle->weight * adjustFactor * force;
 
 		/* Apply force in the correct direction */
@@ -420,5 +439,3 @@ double _BuoyancyForceTerm_CalcGravity( v
 
 	return self->gravity;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/BuoyancyForceTerm.h
--- a/Utils/src/BuoyancyForceTerm.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/BuoyancyForceTerm.h	Tue Feb 02 16:55:08 2010 +1100
@@ -44,7 +44,11 @@
 #ifndef __PICellerator_Utils_BuoyancyForceTerm_h__
 #define __PICellerator_Utils_BuoyancyForceTerm_h__
 
-	typedef double (BuoyancyForceTerm_CalcGravityFunction) ( void* forceTerm, Swarm* swarm, Element_LocalIndex lElement_I, void* particle );
+	typedef double (BuoyancyForceTerm_CalcGravityFunction) (
+				void* forceTerm, 
+				Swarm* swarm, 
+				Element_LocalIndex lElement_I, 
+				void* particle );
 
 	/** Textual name of this class */
 	extern const Type BuoyancyForceTerm_Type;
@@ -60,75 +64,69 @@
 		__ForceTerm \
 		\
 		/* Virtual info */ \
-		BuoyancyForceTerm_CalcGravityFunction*	_calcGravity; \
+		BuoyancyForceTerm_CalcGravityFunction*              _calcGravity;                          \
 		\
 		/* BuoyancyForceTerm info */ \
-		FeVariable*										temperatureField; \
-		double											gravity; \
-		double*											gHat; \
-		Bool												adjust; \
-		Materials_Register*							materials_Register; \
-		ExtensionInfo_Index							materialExtHandle; \
-		MaterialSwarmVariable**						densitySwarmVariables; \
-		MaterialSwarmVariable**						alphaSwarmVariables; \
-		Index												materialSwarmCount;
+		FeVariable*                                         temperatureField;                  \
+		double                                              gravity;                           \
+		double*						    gHat;			       \
+		Bool                                                adjust;                            \
+		Materials_Register*                                 materials_Register;                \
+		ExtensionInfo_Index                                 materialExtHandle;                 \
+		MaterialSwarmVariable**                             densitySwarmVariables;             \
+		MaterialSwarmVariable**                             alphaSwarmVariables;               \
+		Index                                               materialSwarmCount;
 
 	struct BuoyancyForceTerm { __BuoyancyForceTerm };
 
 	BuoyancyForceTerm* BuoyancyForceTerm_New( 
-		Name							name,
-		FiniteElementContext*	context,
-		ForceVector*				forceVector,
-		Swarm*						integrationSwarm,
-		FeVariable*					temperatureField,
-		double						gravity,
-		Bool							adjust,
-		Materials_Register*		materials_Register );
+		Name                                                name,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              gravity,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register );
 
+	BuoyancyForceTerm* _BuoyancyForceTerm_New( 
+		SizeT                                               sizeOfSelf,  
+		Type                                                type,
+		Stg_Class_DeleteFunction*                           _delete,
+		Stg_Class_PrintFunction*                            _print,
+		Stg_Class_CopyFunction*                             _copy, 
+		Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+		Stg_Component_ConstructFunction*                    _construct,
+		Stg_Component_BuildFunction*                        _build,
+		Stg_Component_InitialiseFunction*                   _initialise,
+		Stg_Component_ExecuteFunction*                      _execute,
+		Stg_Component_DestroyFunction*                      _destroy,
+		ForceTerm_AssembleElementFunction*                  _assembleElement,		
+		BuoyancyForceTerm_CalcGravityFunction*              _calcGravity,
+		Name                                                name );
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
+	void BuoyancyForceTerm_InitAll( 
+		void*                                               forceTerm,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              gravity,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register );
 
-	#define BUOYANCYFORCETERM_DEFARGS \
-                FORCETERM_DEFARGS, \
-                BuoyancyForceTerm_CalcGravityFunction*  _calcGravity
-
-	#define BUOYANCYFORCETERM_PASSARGS \
-                FORCETERM_PASSARGS, \
-	        _calcGravity
-
-	BuoyancyForceTerm* _BuoyancyForceTerm_New(  BUOYANCYFORCETERM_DEFARGS  );
-
-	void _BuoyancyForceTerm_Init(
-		void*                forceTerm,
-		FeVariable*          temperatureField,
-		double               gravity,
-		Bool                 adjust,
-		Materials_Register*  materials_Register );
-	
 	void _BuoyancyForceTerm_Delete( void* forceTerm );
-
 	void _BuoyancyForceTerm_Print( void* forceTerm, Stream* stream );
 
 	void* _BuoyancyForceTerm_DefaultNew( Name name ) ;
-
-	void _BuoyancyForceTerm_AssignFromXML( void* forceTerm, Stg_ComponentFactory* cf, void* data ) ;
-
+void _BuoyancyForceTerm_Construct( void* forceTerm, Stg_ComponentFactory* cf, void* data ) ;
 	void _BuoyancyForceTerm_Build( void* forceTerm, void* data ) ;
-
 	void _BuoyancyForceTerm_Initialise( void* forceTerm, void* data ) ;
-
 	void _BuoyancyForceTerm_Execute( void* forceTerm, void* data ) ;
-
 	void _BuoyancyForceTerm_Destroy( void* forceTerm, void* data ) ;
 
 	void _BuoyancyForceTerm_AssembleElement( void* forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVec ) ;
-
 	double _BuoyancyForceTerm_CalcGravity( void* forceTerm, Swarm* swarm, Element_LocalIndex lElement_I, void* particle ) ;
 
-	#define BuoyancyForceTerm_CalcGravity( forceTerm, swarm, lElement_I, particle ) \
+	#define BuoyancyForceTerm_CalcGravity( forceTerm, swarm, lElement_I, particle )\
 		(( (BuoyancyForceTerm*) forceTerm )->_calcGravity( forceTerm, swarm, lElement_I, particle ) )
 
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/BuoyancyForceTerm.meta
--- a/Utils/src/BuoyancyForceTerm.meta	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/BuoyancyForceTerm.meta	Tue Feb 02 16:55:08 2010 +1100
@@ -2,42 +2,43 @@
 <!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 
-	<param name="Name">BuoyancyForceTerm</param>
-	<param name="Author">...</param>
-	<param name="Organisation">VPAC and MCC</param>
-	<param name="Project">PICellerator</param>
-	<param name="Location">./PICellerator/Utils/src/</param>
-	<param name="Project Web">http://www.stgermainproject.org/PICellerator.html</param>
-	<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
-	<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
-	<param name="Parent">ForceTerm</param>
-	<param name="Reference">...</param>
-	<param name="Summary">...</param>
-	<param name="Description">This adds a force term for themo-chemical convection, where the fluid is driven my both the thermal expansivity ($\alpha$) as well as the density ($\rho$). Both 'alpha' and 'density' are required as parameters for each material.</param>
-	<param name="Equation">$\rho g \\left( 1 - \alpha T \right)$</param>
+<param name="Name">BuoyancyForceTerm</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Utils/src/</param>
+<param name="Project Web">http://www.stgermainproject.org/PICellerator.html</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">ForceTerm</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">This adds a force term for themo-chemical convection, where the fluid is driven my both the thermal expansivity ($\alpha$) as well as the density ($\rho$). Both 'alpha' and 'density' are required as parameters for each material.</param>
+<param name="Equation">$\rho g \left( 1 - \alpha T \right)$</param>
 
-	<!--Now the interesting stuff-->
+<!--Now the interesting stuff-->
 
-	<list name="Params">
-		<struct>
-			<param name="Name">gravity</param>
-			<param name="Type">Double</param>
-			<param name="Default">0.0</param>
-			<param name="Description">This corresponds to the $g$ in the equation above.</param>
-		</struct>
-	</list>
 
-	<list name="Dependencies">
-		<struct>
-			<param name="Essential">No</param>
-			<param name="Name">TemperatureField</param>
-			<param name="Type">FeVariable</param>
-			<param name="Description">This is the FeVariable from which the temperature, $T$, is calculated in the above calculation.</param>
-		</struct>
-	</list>
+<list name="Params">
+	<struct>
+		<param name="Name">gravity</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">This corresponds to the $g$ in the equation above.</param>
+	</struct>
 
-	<!-- Add an exmaple XML if possible -->
-	<param name="Example"><![CDATA[
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">TemperatureField</param>
+		<param name="Type">FeVariable</param>
+		<param name="Description">This is the FeVariable from which the temperature, $T$, is calculated in the above calculation.</param>
+	</struct>
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example"><![CDATA[
 		<struct name="buoyancyForceTerm">
 			<param name="Type">BuoyancyForceTerm</param>
 			<param name="ForceVector">mom_force</param>
@@ -45,6 +46,6 @@
 			<param name="Swarm">materialPoints</param>
 			<param name="gravity">1.0</param>
 		</struct>]]>
-	</param>
+</param>
 
 </StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/BuoyancyForceTermThermoChem.c
--- a/Utils/src/BuoyancyForceTermThermoChem.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/BuoyancyForceTermThermoChem.c	Tue Feb 02 16:55:08 2010 +1100
@@ -62,61 +62,66 @@ const Type BuoyancyForceTermThermoChem_T
 const Type BuoyancyForceTermThermoChem_Type = "BuoyancyForceTermThermoChem";
 
 BuoyancyForceTermThermoChem* BuoyancyForceTermThermoChem_New( 
-	Name							name,
-	FiniteElementContext*	context,
-	ForceVector*				forceVector,
-	Swarm*						integrationSwarm,
-	FeVariable*					temperatureField,
-	double						RaT,
-	double						RaC,
-	Bool							adjust,
-	Materials_Register*		materials_Register )
+		Name                                                name,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              RaT,
+		double                                              RaC,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register )
 {
 	BuoyancyForceTermThermoChem* self = (BuoyancyForceTermThermoChem*) _BuoyancyForceTermThermoChem_DefaultNew( name );
 
-	self->isConstructed = True;
-	_ForceTerm_Init( self, context, forceVector, integrationSwarm, NULL );
-	_BuoyancyForceTermThermoChem_Init( self, temperatureField, RaT, RaC, adjust, materials_Register );
+	BuoyancyForceTermThermoChem_InitAll( 
+			self,
+			forceVector,
+			integrationSwarm,
+			temperatureField,
+			RaT,
+			RaC,
+			adjust,
+			materials_Register );
 
 	return self;
 }
 
-void* _BuoyancyForceTermThermoChem_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                 _sizeOfSelf = sizeof(BuoyancyForceTermThermoChem);
-	Type                                                         type = BuoyancyForceTermThermoChem_Type;
-	Stg_Class_DeleteFunction*                                 _delete = _BuoyancyForceTermThermoChem_Delete;
-	Stg_Class_PrintFunction*                                   _print = _BuoyancyForceTermThermoChem_Print;
-	Stg_Class_CopyFunction*                                     _copy = NULL;
-	Stg_Component_DefaultConstructorFunction*     _defaultConstructor = _BuoyancyForceTermThermoChem_DefaultNew;
-	Stg_Component_ConstructFunction*                       _construct = _BuoyancyForceTermThermoChem_AssignFromXML;
-	Stg_Component_BuildFunction*                               _build = _BuoyancyForceTermThermoChem_Build;
-	Stg_Component_InitialiseFunction*                     _initialise = _BuoyancyForceTermThermoChem_Initialise;
-	Stg_Component_ExecuteFunction*                           _execute = _BuoyancyForceTermThermoChem_Execute;
-	Stg_Component_DestroyFunction*                           _destroy = _BuoyancyForceTermThermoChem_Destroy;
-	ForceTerm_AssembleElementFunction*               _assembleElement = _BuoyancyForceTermThermoChem_AssembleElement;
-	BuoyancyForceTermThermoChem_CalcRaTFunction*             _calcRaT = _BuoyancyForceTermThermoChem_CalcRaT;
-	BuoyancyForceTermThermoChem_CalcRaCFunction*             _calcRaC = _BuoyancyForceTermThermoChem_CalcRaC;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return (void*)_BuoyancyForceTermThermoChem_New(  BUOYANCYFORCETERMTHERMOCHEM_PASSARGS  );
-}
-
 /* Creation implementation / Virtual constructor */
-BuoyancyForceTermThermoChem* _BuoyancyForceTermThermoChem_New(  BUOYANCYFORCETERMTHERMOCHEM_DEFARGS  )
+BuoyancyForceTermThermoChem* _BuoyancyForceTermThermoChem_New( 
+		SizeT                                               sizeOfSelf,  
+		Type                                                type,
+		Stg_Class_DeleteFunction*                           _delete,
+		Stg_Class_PrintFunction*                            _print,
+		Stg_Class_CopyFunction*                             _copy, 
+		Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+		Stg_Component_ConstructFunction*                    _construct,
+		Stg_Component_BuildFunction*                        _build,
+		Stg_Component_InitialiseFunction*                   _initialise,
+		Stg_Component_ExecuteFunction*                      _execute,
+		Stg_Component_DestroyFunction*                      _destroy,
+		ForceTerm_AssembleElementFunction*                  _assembleElement,		
+		BuoyancyForceTermThermoChem_CalcRaTFunction*              _calcRaT,
+		BuoyancyForceTermThermoChem_CalcRaCFunction*              _calcRaC,
+		Name                                                name )
 {
 	BuoyancyForceTermThermoChem* self;
 	
 	/* Allocate memory */
-	assert( _sizeOfSelf >= sizeof(BuoyancyForceTermThermoChem) );
-	/* The following terms are parameters that have been passed into this function but are being set before being passed onto the parent */
-	/* This means that any values of these parameters that are passed into this function are not passed onto the parent function
-	   and so should be set to ZERO in any children of this class. */
-	nameAllocationType = NON_GLOBAL;
-
-	self = (BuoyancyForceTermThermoChem*) _ForceTerm_New(  FORCETERM_PASSARGS  );
+	assert( sizeOfSelf >= sizeof(BuoyancyForceTermThermoChem) );
+	self = (BuoyancyForceTermThermoChem*) _ForceTerm_New( 
+		sizeOfSelf, 
+		type, 
+		_delete, 
+		_print, 
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build, 
+		_initialise,
+		_execute,
+		_destroy,
+		_assembleElement,
+		name );
 	
 	/* Virtual info */
 	self->_calcRaT = _calcRaT;
@@ -126,24 +131,45 @@ BuoyancyForceTermThermoChem* _BuoyancyFo
 }
 
 void _BuoyancyForceTermThermoChem_Init( 
-	BuoyancyForceTermThermoChem*	self, 
-	FeVariable*							temperatureField,
-	double								RaT,
-	double								RaC,
-	Bool									adjust,
-	Materials_Register*				materials_Register )
+		BuoyancyForceTermThermoChem*                                  self, 
+		FeVariable*                                         temperatureField,
+		double                                              RaT,
+		double                                              RaC,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register )
 {
 	self->temperatureField    = temperatureField;
 	self->RaT                 = RaT;
 	self->RaC                 = RaC;
 	self->adjust              = adjust;
 	self->materials_Register  = materials_Register;
+
+}
+
+void BuoyancyForceTermThermoChem_InitAll( 
+		void*                                               forceTerm,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              RaT,
+		double                                              RaC,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register )
+{
+	BuoyancyForceTermThermoChem* self = (BuoyancyForceTermThermoChem*) forceTerm;
+
+	ForceTerm_InitAll( self, forceVector, integrationSwarm, NULL );
+	_BuoyancyForceTermThermoChem_Init( self, temperatureField, RaT, RaC, adjust, materials_Register );
 }
 
 void _BuoyancyForceTermThermoChem_Delete( void* forceTerm ) {
 	BuoyancyForceTermThermoChem* self = (BuoyancyForceTermThermoChem*)forceTerm;
+	Index i;
 
-   Memory_Free( self->densitySwarmVariables );
+	for ( i = 0; i < self->materialSwarmCount; ++i ) {
+		Stg_Class_Delete( self->densitySwarmVariables[i] );
+	}
+	Stg_Class_Delete( self->densitySwarmVariables );
 
 	_ForceTerm_Delete( self );
 }
@@ -159,26 +185,42 @@ void _BuoyancyForceTermThermoChem_Print(
 	Journal_PrintDouble( stream, self->RaC );
 }
 
-void _BuoyancyForceTermThermoChem_AssignFromXML( void* forceTerm, Stg_ComponentFactory* cf, void* data ) {
-	BuoyancyForceTermThermoChem*	self = (BuoyancyForceTermThermoChem*)forceTerm;
-	FeVariable*							temperatureField;
-	double								RaT;
-	double								RaC;
-	Bool									adjust;
-	Materials_Register*				materials_Register;
-	PICelleratorContext*				context;
+void* _BuoyancyForceTermThermoChem_DefaultNew( Name name ) {
+	return (void*)_BuoyancyForceTermThermoChem_New( 
+		sizeof(BuoyancyForceTermThermoChem), 
+		BuoyancyForceTermThermoChem_Type,
+		_BuoyancyForceTermThermoChem_Delete,
+		_BuoyancyForceTermThermoChem_Print,
+		NULL,
+		_BuoyancyForceTermThermoChem_DefaultNew,
+		_BuoyancyForceTermThermoChem_Construct,
+		_BuoyancyForceTermThermoChem_Build,
+		_BuoyancyForceTermThermoChem_Initialise,
+		_BuoyancyForceTermThermoChem_Execute,
+		_BuoyancyForceTermThermoChem_Destroy,
+		_BuoyancyForceTermThermoChem_AssembleElement,
+		_BuoyancyForceTermThermoChem_CalcRaT,
+		_BuoyancyForceTermThermoChem_CalcRaC,
+		name );
+}
+
+void _BuoyancyForceTermThermoChem_Construct( void* forceTerm, Stg_ComponentFactory* cf, void* data ) {
+	BuoyancyForceTermThermoChem*          self             = (BuoyancyForceTermThermoChem*)forceTerm;
+	FeVariable*                 temperatureField;
+	double                      RaT;
+	double                      RaC;
+	Bool                        adjust;
+	Materials_Register*         materials_Register;
 
 	/* Construct Parent */
-	_ForceTerm_AssignFromXML( self, cf, data );
+	_ForceTerm_Construct( self, cf, data );
 
-	temperatureField = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"TemperatureField", FeVariable, False, data  ) ;
-	RaT = Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"RaT", 0.0  );
-	RaC = Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"RaC", 0.0  );
-	adjust = Stg_ComponentFactory_GetBool( cf, self->name, (Dictionary_Entry_Key)"adjust", False );
+	temperatureField = Stg_ComponentFactory_ConstructByKey( cf, self->name, "TemperatureField", FeVariable, False, data ) ;
+	RaT              = Stg_ComponentFactory_GetDouble( cf, self->name, "RaT", 0.0 );
+	RaC              = Stg_ComponentFactory_GetDouble( cf, self->name, "RaC", 0.0 );
+	adjust           = Stg_ComponentFactory_GetBool( cf, self->name, "adjust", False );
 
-	context = (PICelleratorContext* )self->context;
-	assert( Stg_CheckType( context, PICelleratorContext ) );
-	materials_Register = context->materials_Register; 
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
 	assert( materials_Register );
 
 	_BuoyancyForceTermThermoChem_Init( self, temperatureField, RaT, RaC, adjust, materials_Register );
@@ -209,7 +251,7 @@ void _BuoyancyForceTermThermoChem_Build(
 		material = Materials_Register_GetByIndex( materials_Register, material_I );
 		materialExt = ExtensionManager_GetFunc( material->extensionMgr, material, self->materialExtHandle );
 
-		materialExt->density = Dictionary_GetDouble_WithDefault( material->dictionary, (Dictionary_Entry_Key)"density", 0.0  );
+		materialExt->density = Dictionary_GetDouble_WithDefault( material->dictionary, "density", 0.0 );
 	}
 	
 	/* Create Swarm Variables of each material swarm this ip swarm is mapped against */
@@ -217,10 +259,9 @@ void _BuoyancyForceTermThermoChem_Build(
 	self->densitySwarmVariables = Memory_Alloc_Array( MaterialSwarmVariable*, self->materialSwarmCount, "DensityVariables" );
 	
 	for ( materialSwarm_I = 0; materialSwarm_I < self->materialSwarmCount; ++materialSwarm_I ) {
-		name = Stg_Object_AppendSuffix( materialSwarms[materialSwarm_I], (Name)"Density"  );
+		name = Stg_Object_AppendSuffix( materialSwarms[materialSwarm_I], "Density" );
 		self->densitySwarmVariables[materialSwarm_I] = MaterialSwarmVariable_New( 
-				name,
-				(AbstractContext*) self->context,
+				name, 
 				materialSwarms[materialSwarm_I], 
 				1, 
 				self->materials_Register, 
@@ -254,17 +295,7 @@ void _BuoyancyForceTermThermoChem_Execut
 }
 
 void _BuoyancyForceTermThermoChem_Destroy( void* forceTerm, void* data ) {
-	BuoyancyForceTermThermoChem* self = (BuoyancyForceTermThermoChem*)forceTerm;
-	Index i;
-
-	for ( i = 0; i < self->materialSwarmCount; ++i ) {
-		Stg_Component_Destroy( self->densitySwarmVariables[i], data, False );
-	}
-
-	if ( self->temperatureField )
-		Stg_Component_Destroy( self->temperatureField, data, False );
-
-	_ForceTerm_Destroy( self, data );
+	_ForceTerm_Destroy( forceTerm, data );
 }
 
 
@@ -362,5 +393,3 @@ double _BuoyancyForceTermThermoChem_Calc
 
 	return self->RaC;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/BuoyancyForceTermThermoChem.h
--- a/Utils/src/BuoyancyForceTermThermoChem.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/BuoyancyForceTermThermoChem.h	Tue Feb 02 16:55:08 2010 +1100
@@ -45,16 +45,16 @@
 #define __PICellerator_Utils_BuoyancyForceTermThermoChem_h__
 
 	typedef double (BuoyancyForceTermThermoChem_CalcRaTFunction) (
-		void* forceTerm, 
-		Swarm* swarm, 
-		Element_LocalIndex lElement_I, 
-		void* particle );
+				void* forceTerm, 
+				Swarm* swarm, 
+				Element_LocalIndex lElement_I, 
+				void* particle );
 
 	typedef double (BuoyancyForceTermThermoChem_CalcRaCFunction) (
-		void* forceTerm, 
-		Swarm* swarm, 
-		Element_LocalIndex lElement_I, 
-		void* particle );
+				void* forceTerm, 
+				Swarm* swarm, 
+				Element_LocalIndex lElement_I, 
+				void* particle );
 
 	/** Textual name of this class */
 	extern const Type BuoyancyForceTermThermoChem_Type;
@@ -69,85 +69,77 @@
 		__ForceTerm \
 		\
 		/* Virtual info */ \
-		BuoyancyForceTermThermoChem_CalcRaTFunction* _calcRaT; \
+		BuoyancyForceTermThermoChem_CalcRaTFunction*              _calcRaT;                          \
 		\
-		BuoyancyForceTermThermoChem_CalcRaCFunction* _calcRaC; \
+		BuoyancyForceTermThermoChem_CalcRaCFunction*              _calcRaC;                          \
 		\
 		/* BuoyancyForceTermThermoChem info */ \
-		FeVariable*												temperatureField; \
-		double													RaT; \
-		double													RaC; \
-		Bool														adjust; \
-		Materials_Register*									materials_Register; \
-		ExtensionInfo_Index									materialExtHandle; \
-		MaterialSwarmVariable**								densitySwarmVariables; \
-		Index														materialSwarmCount;
+		FeVariable*                                         temperatureField;                  \
+		double                                              RaT;                           \
+		double                                              RaC;                           \
+		Bool                                                adjust;                            \
+		Materials_Register*                                 materials_Register;                \
+		ExtensionInfo_Index                                 materialExtHandle;                 \
+		MaterialSwarmVariable**                             densitySwarmVariables;             \
+		Index                                               materialSwarmCount;
 
 	struct BuoyancyForceTermThermoChem { __BuoyancyForceTermThermoChem };
 
 	BuoyancyForceTermThermoChem* BuoyancyForceTermThermoChem_New( 
-		Name							name,
-		FiniteElementContext*	context,
-		ForceVector*				forceVector,
-		Swarm*						integrationSwarm,
-		FeVariable*					temperatureField,
-		double						RaT,
-		double						RaC,
-		Bool							adjust,
-		Materials_Register*		materials_Register );
+		Name                                                name,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              RaT,
+		double                                              RaC,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register );
 
+	BuoyancyForceTermThermoChem* _BuoyancyForceTermThermoChem_New( 
+		SizeT                                               sizeOfSelf,  
+		Type                                                type,
+		Stg_Class_DeleteFunction*                           _delete,
+		Stg_Class_PrintFunction*                            _print,
+		Stg_Class_CopyFunction*                             _copy, 
+		Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+		Stg_Component_ConstructFunction*                    _construct,
+		Stg_Component_BuildFunction*                        _build,
+		Stg_Component_InitialiseFunction*                   _initialise,
+		Stg_Component_ExecuteFunction*                      _execute,
+		Stg_Component_DestroyFunction*                      _destroy,
+		ForceTerm_AssembleElementFunction*                  _assembleElement,		
+		BuoyancyForceTermThermoChem_CalcRaTFunction*              _calcRaT,
+		BuoyancyForceTermThermoChem_CalcRaCFunction*              _calcRaC,
+		Name                                                name );
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
+	void BuoyancyForceTermThermoChem_InitAll( 
+		void*                                               forceTerm,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              RaT,
+		double                                              RaC,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register );
 
-	#define BUOYANCYFORCETERMTHERMOCHEM_DEFARGS \
-                FORCETERM_DEFARGS, \
-                BuoyancyForceTermThermoChem_CalcRaTFunction*  _calcRaT, \
-                BuoyancyForceTermThermoChem_CalcRaCFunction*  _calcRaC
-
-	#define BUOYANCYFORCETERMTHERMOCHEM_PASSARGS \
-                FORCETERM_PASSARGS, \
-	        _calcRaT, \
-	        _calcRaC
-
-	BuoyancyForceTermThermoChem* _BuoyancyForceTermThermoChem_New(  BUOYANCYFORCETERMTHERMOCHEM_DEFARGS  );
-
-	void _BuoyancyForceTermThermoChem_Init(
-		BuoyancyForceTermThermoChem*  self, 
-		FeVariable*                   temperatureField,
-		double                        RaT,
-		double                        RaC,
-		Bool                          adjust,
-		Materials_Register*           materials_Register );
-	
 	void _BuoyancyForceTermThermoChem_Delete( void* forceTerm );
-
 	void _BuoyancyForceTermThermoChem_Print( void* forceTerm, Stream* stream );
 
-	void* _BuoyancyForceTermThermoChem_DefaultNew( Name name );
+	void* _BuoyancyForceTermThermoChem_DefaultNew( Name name ) ;
+void _BuoyancyForceTermThermoChem_Construct( void* forceTerm, Stg_ComponentFactory* cf, void* data ) ;
+	void _BuoyancyForceTermThermoChem_Build( void* forceTerm, void* data ) ;
+	void _BuoyancyForceTermThermoChem_Initialise( void* forceTerm, void* data ) ;
+	void _BuoyancyForceTermThermoChem_Execute( void* forceTerm, void* data ) ;
+	void _BuoyancyForceTermThermoChem_Destroy( void* forceTerm, void* data ) ;
 
-	void _BuoyancyForceTermThermoChem_AssignFromXML( void* forceTerm, Stg_ComponentFactory* cf, void* data );
-
-	void _BuoyancyForceTermThermoChem_Build( void* forceTerm, void* data );
-
-	void _BuoyancyForceTermThermoChem_Initialise( void* forceTerm, void* data );
-
-	void _BuoyancyForceTermThermoChem_Execute( void* forceTerm, void* data );
-
-	void _BuoyancyForceTermThermoChem_Destroy( void* forceTerm, void* data );
-
-	void _BuoyancyForceTermThermoChem_AssembleElement( void* forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVec );
-
-	double _BuoyancyForceTermThermoChem_CalcRaT( void* forceTerm, Swarm* swarm, Element_LocalIndex lElement_I, void* particle );
-
+	void _BuoyancyForceTermThermoChem_AssembleElement( void* forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVec ) ;
+	double _BuoyancyForceTermThermoChem_CalcRaT( void* forceTerm, Swarm* swarm, Element_LocalIndex lElement_I, void* particle ) ;
 	#define BuoyancyForceTermThermoChem_CalcRaT( forceTerm, swarm, lElement_I, particle )\
 		(( (BuoyancyForceTermThermoChem*) forceTerm )->_calcRaT( forceTerm, swarm, lElement_I, particle ) )
 
-	double _BuoyancyForceTermThermoChem_CalcRaC( void* forceTerm, Swarm* swarm, Element_LocalIndex lElement_I, void* particle );
+	double _BuoyancyForceTermThermoChem_CalcRaC( void* forceTerm, Swarm* swarm, Element_LocalIndex lElement_I, void* particle ) ;
 
 	#define BuoyancyForceTermThermoChem_CalcRaC( forceTerm, swarm, lElement_I, particle )\
 		(( (BuoyancyForceTermThermoChem*) forceTerm )->_calcRaC( forceTerm, swarm, lElement_I, particle ) )
 
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/DiffusionSMT.c
--- a/Utils/src/DiffusionSMT.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/DiffusionSMT.c	Tue Feb 02 16:55:08 2010 +1100
@@ -59,37 +59,73 @@ const Type DiffusionSMT_Type = "Diffusio
 
 DiffusionSMT* DiffusionSMT_New( 
     Name                                                name,
-    FiniteElementContext*				                    context,
     StiffnessMatrix*                                    stiffnessMatrix,
     Swarm*                                              integrationSwarm )
 {
     DiffusionSMT* self = (DiffusionSMT*) _DiffusionSMT_DefaultNew( name );
 
-	self->isConstructed = True;
-	_StiffnessMatrixTerm_Init( self, context, stiffnessMatrix, integrationSwarm, NULL );
-	_DiffusionSMT_Init( self );
+    DiffusionSMT_InitAll( 
+	self,
+	stiffnessMatrix,
+	integrationSwarm );
 
-	return self;
+    return self;
 }
 
 /* Creation implementation / Virtual constructor */
-DiffusionSMT* _DiffusionSMT_New(  DIFFUSIONSMT_DEFARGS  )
+DiffusionSMT* _DiffusionSMT_New( 
+    SizeT                                               sizeOfSelf,  
+    Type                                                type,
+    Stg_Class_DeleteFunction*                           _delete,
+    Stg_Class_PrintFunction*                            _print,
+    Stg_Class_CopyFunction*                             _copy, 
+    Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+    Stg_Component_ConstructFunction*                    _construct,
+    Stg_Component_BuildFunction*                        _build,
+    Stg_Component_InitialiseFunction*                   _initialise,
+    Stg_Component_ExecuteFunction*                      _execute,
+    Stg_Component_DestroyFunction*                      _destroy,
+    StiffnessMatrixTerm_AssembleElementFunction*        _assembleElement,
+    Name                                                name )
 {
     DiffusionSMT* self;
 	
     /* Allocate memory */
-    assert( _sizeOfSelf >= sizeof(DiffusionSMT) );
-    self = (DiffusionSMT*) _StiffnessMatrixTerm_New(  STIFFNESSMATRIXTERM_PASSARGS  );
+    assert( sizeOfSelf >= sizeof(DiffusionSMT) );
+    self = (DiffusionSMT*) _StiffnessMatrixTerm_New( 
+	sizeOfSelf, 
+	type, 
+	_delete, 
+	_print, 
+	_copy,
+	_defaultConstructor,
+	_construct,
+	_build, 
+	_initialise,
+	_execute,
+	_destroy,
+	_assembleElement,
+	name );
 	
     /* Virtual info */
 	
     return self;
 }
 
-void _DiffusionSMT_Init( void* matrixTerm ) {
-	DiffusionSMT* self;
+void _DiffusionSMT_Init( 
+    DiffusionSMT*                                    self )
+{
+}
 
-	self = (DiffusionSMT*)matrixTerm;
+void DiffusionSMT_InitAll( 
+    void*                                               matrixTerm,
+    StiffnessMatrix*                                    stiffnessMatrix,
+    Swarm*                                              integrationSwarm )
+{
+    DiffusionSMT* self = (DiffusionSMT*) matrixTerm;
+
+    StiffnessMatrixTerm_InitAll( self, stiffnessMatrix, integrationSwarm, NULL );
+    _DiffusionSMT_Init( self );
 }
 
 void _DiffusionSMT_Delete( void* matrixTerm ) {
@@ -111,38 +147,31 @@ void _DiffusionSMT_Print( void* matrixTe
 }
 
 void* _DiffusionSMT_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                 _sizeOfSelf = sizeof(DiffusionSMT);
-	Type                                                         type = DiffusionSMT_Type;
-	Stg_Class_DeleteFunction*                                 _delete = _DiffusionSMT_Delete;
-	Stg_Class_PrintFunction*                                   _print = _DiffusionSMT_Print;
-	Stg_Class_CopyFunction*                                     _copy = NULL;
-	Stg_Component_DefaultConstructorFunction*     _defaultConstructor = _DiffusionSMT_DefaultNew;
-	Stg_Component_ConstructFunction*                       _construct = _DiffusionSMT_AssignFromXML;
-	Stg_Component_BuildFunction*                               _build = _DiffusionSMT_Build;
-	Stg_Component_InitialiseFunction*                     _initialise = _DiffusionSMT_Initialise;
-	Stg_Component_ExecuteFunction*                           _execute = _DiffusionSMT_Execute;
-	Stg_Component_DestroyFunction*                           _destroy = _DiffusionSMT_Destroy;
-	StiffnessMatrixTerm_AssembleElementFunction*     _assembleElement = _DiffusionSMT_AssembleElement;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-    return (void*)_DiffusionSMT_New(  DIFFUSIONSMT_PASSARGS  );
+    return (void*)_DiffusionSMT_New( 
+	sizeof(DiffusionSMT), 
+	DiffusionSMT_Type,
+	_DiffusionSMT_Delete,
+	_DiffusionSMT_Print,
+	NULL,
+	_DiffusionSMT_DefaultNew,
+	_DiffusionSMT_Construct,
+	_DiffusionSMT_Build,
+	_DiffusionSMT_Initialise,
+	_DiffusionSMT_Execute,
+	_DiffusionSMT_Destroy,
+	_DiffusionSMT_AssembleElement,
+	name );
 }
 
-void _DiffusionSMT_AssignFromXML( void* matrixTerm, Stg_ComponentFactory* cf, void* data ) {
+void _DiffusionSMT_Construct( void* matrixTerm, Stg_ComponentFactory* cf, void* data ) {
     DiffusionSMT*            self             = (DiffusionSMT*)matrixTerm;
-    PICelleratorContext*     context;
 
     /* Construct Parent */
-    _StiffnessMatrixTerm_AssignFromXML( self, cf, data );
-    context = (PICelleratorContext*)self->context;
+    _StiffnessMatrixTerm_Construct( self, cf, data );
 
     _DiffusionSMT_Init( self );
 
-    assert( Stg_CheckType( context, PICelleratorContext ) );
-    self->materials_Register = context->materials_Register;
+    self->materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
 }
 
 void _DiffusionSMT_Build( void* matrixTerm, void* data ) {
@@ -160,8 +189,10 @@ void _DiffusionSMT_Build( void* matrixTe
     _StiffnessMatrixTerm_Build( self, data );
 
     /* Get Component Factory if we can */
-    context = self->context;
-    cf = context->CF;
+    if ( Stg_Class_IsInstance( data, AbstractContext_Type ) ) {
+	context = (AbstractContext*) data;
+	cf = context->CF;
+    }
 
     /* Sort out material extension stuff */
     self->materialExtHandle = Materials_Register_AddMaterialExtension(
@@ -175,10 +206,12 @@ void _DiffusionSMT_Build( void* matrixTe
 						self->materialExtHandle );
 
 	if ( cf ) {
-	    materialExt->diffusion = Stg_ComponentFactory_GetDouble( cf, material->name, (Dictionary_Entry_Key)"diffusivity", 0.0  );
+	    materialExt->diffusion = Stg_ComponentFactory_GetDouble(
+		cf, material->name, "diffusivity", 0.0 );
 	}
 	else {
-	    materialExt->diffusion = Dictionary_GetDouble_WithDefault( material->dictionary, (Dictionary_Entry_Key)"diffusivity", 0.0  );
+	    materialExt->diffusion = Dictionary_GetDouble_WithDefault(
+		material->dictionary, "diffusivity", 0.0 );
 	}
     }
 
@@ -189,10 +222,9 @@ void _DiffusionSMT_Build( void* matrixTe
 	MaterialSwarmVariable*, self->materialSwarmCount, "DiffusionVariables");
 
     for ( ii = 0; ii < self->materialSwarmCount; ++ii ) {
-	name = Stg_Object_AppendSuffix( materialSwarms[ii], (Name)"diffusivity"  );
+	name = Stg_Object_AppendSuffix( materialSwarms[ii], "diffusivity" );
 	self->diffusionSwarmVariables[ii] = MaterialSwarmVariable_New( 
 	    name, 
-	    (AbstractContext*) self->context, 
 	    materialSwarms[ii], 
 	    1, 
 	    self->materials_Register, 
@@ -220,11 +252,7 @@ void _DiffusionSMT_Execute( void* matrix
 }
 
 void _DiffusionSMT_Destroy( void* matrixTerm, void* data ) {
-    DiffusionSMT*             self             = (DiffusionSMT*)matrixTerm;
-    int ii;
     _StiffnessMatrixTerm_Destroy( matrixTerm, data );
-    for ( ii = 0; ii < self->materialSwarmCount; ++ii )
-      Stg_Component_Destroy( self->diffusionSwarmVariables[ii], data, False );
 }
 
 
@@ -260,7 +288,7 @@ void _DiffusionSMT_AssembleElement(
     nodesPerEl = elementType->nodeCount;
 	
     /* allocate */
-    GNx = Memory_Alloc_2DArray( double, dim, nodesPerEl, (Name)"GNx"  );
+    GNx = Memory_Alloc_2DArray( double, dim, nodesPerEl, "GNx" );
 	
     cell_I = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
     cellParticleCount = swarm->cellParticleCountTbl[ cell_I ];
@@ -297,5 +325,3 @@ void _DiffusionSMT_AssembleElement(
 	
     Memory_Free(GNx); 
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/DiffusionSMT.h
--- a/Utils/src/DiffusionSMT.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/DiffusionSMT.h	Tue Feb 02 16:55:08 2010 +1100
@@ -44,70 +44,67 @@
 /** Textual name of this class */
 extern const Type DiffusionSMT_Type;
 
-	typedef struct {
-		double diffusion;
-	} DiffusionSMT_MaterialExt;
+typedef struct {
+    double diffusion;
+} DiffusionSMT_MaterialExt;
 
-	/** DiffusionSMT class contents */
-	#define __DiffusionSMT \
-		/* General info */ \
-		__StiffnessMatrixTerm \
-		\
-		/* Virtual info */ \
-		\
-		/* DiffusionSMT info */ \
-		\
-		Materials_Register*		materials_Register; \
-		ExtensionInfo_Index		materialExtHandle; \
-		MaterialSwarmVariable**	diffusionSwarmVariables; \
-		Index							materialSwarmCount;
+/** DiffusionSMT class contents */
+#define __DiffusionSMT							\
+    /* General info */							\
+    __StiffnessMatrixTerm						\
+									\
+    /* Virtual info */							\
+									\
+    /* DiffusionSMT info */						\
+									\
+    Materials_Register*                                 materials_Register; \
+    ExtensionInfo_Index                                 materialExtHandle; \
+    MaterialSwarmVariable**                             diffusionSwarmVariables; \
+    Index                                               materialSwarmCount;
 
-	struct DiffusionSMT { __DiffusionSMT };
+struct DiffusionSMT { __DiffusionSMT };
 
-	DiffusionSMT* DiffusionSMT_New( 
-		Name							name,
-		FiniteElementContext*	context,
-		StiffnessMatrix*			stiffnessMatrix,
-		Swarm*						integrationSwarm );
+DiffusionSMT* DiffusionSMT_New( 
+    Name                                                name,
+    StiffnessMatrix*                                    stiffnessMatrix,
+    Swarm*                                              integrationSwarm );
 
+DiffusionSMT* _DiffusionSMT_New( 
+    SizeT                                               sizeOfSelf,  
+    Type                                                type,
+    Stg_Class_DeleteFunction*                           _delete,
+    Stg_Class_PrintFunction*                            _print,
+    Stg_Class_CopyFunction*                             _copy, 
+    Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+    Stg_Component_ConstructFunction*                    _construct,
+    Stg_Component_BuildFunction*                        _build,
+    Stg_Component_InitialiseFunction*                   _initialise,
+    Stg_Component_ExecuteFunction*                      _execute,
+    Stg_Component_DestroyFunction*                      _destroy,
+    StiffnessMatrixTerm_AssembleElementFunction*        _assembleElement,		
+    Name                                                name );
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
+void DiffusionSMT_InitAll( 
+    void*                                               matrixTerm,
+    StiffnessMatrix*                                    stiffnessMatrix,
+    Swarm*                                              integrationSwarm );
 
-	#define DIFFUSIONSMT_DEFARGS \
-                STIFFNESSMATRIXTERM_DEFARGS
+void _DiffusionSMT_Delete( void* matrixTerm );
+void _DiffusionSMT_Print( void* matrixTerm, Stream* stream );
 
-	#define DIFFUSIONSMT_PASSARGS \
-                STIFFNESSMATRIXTERM_PASSARGS
+void* _DiffusionSMT_DefaultNew( Name name ) ;
+void _DiffusionSMT_Construct( void* matrixTerm, Stg_ComponentFactory* cf, void* data ) ;
+void _DiffusionSMT_Build( void* matrixTerm, void* data ) ;
+void _DiffusionSMT_Initialise( void* matrixTerm, void* data ) ;
+void _DiffusionSMT_Execute( void* matrixTerm, void* data ) ;
+void _DiffusionSMT_Destroy( void* matrixTerm, void* data ) ;
 
-	DiffusionSMT* _DiffusionSMT_New(  DIFFUSIONSMT_DEFARGS  );
-
-	void _DiffusionSMT_Init( void* matrixTerm );
-	
-	void _DiffusionSMT_Delete( void* matrixTerm );
-
-	void _DiffusionSMT_Print( void* matrixTerm, Stream* stream );
-
-	void* _DiffusionSMT_DefaultNew( Name name );
-
-	void _DiffusionSMT_AssignFromXML( void* matrixTerm, Stg_ComponentFactory* cf, void* data );
-
-	void _DiffusionSMT_Build( void* matrixTerm, void* data );
-
-	void _DiffusionSMT_Initialise( void* matrixTerm, void* data );
-
-	void _DiffusionSMT_Execute( void* matrixTerm, void* data );
-
-	void _DiffusionSMT_Destroy( void* matrixTerm, void* data );
-	
-	void _DiffusionSMT_AssembleElement( 
-		void*							matrixTerm,
-		StiffnessMatrix*			stiffnessMatrix, 
-		Element_LocalIndex		lElement_I, 
-		SystemLinearEquations*	sle,
-		FiniteElementContext*	context,
-		double**						elStiffMat ) ;
+void _DiffusionSMT_AssembleElement( 
+    void*                                              matrixTerm,
+    StiffnessMatrix*                                   stiffnessMatrix, 
+    Element_LocalIndex                                 lElement_I, 
+    SystemLinearEquations*                             sle,
+    FiniteElementContext*                              context,
+    double**                                           elStiffMat ) ;
 
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/DiffusionSMT.meta
--- a/Utils/src/DiffusionSMT.meta	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/DiffusionSMT.meta	Tue Feb 02 16:55:08 2010 +1100
@@ -6,7 +6,7 @@
 <param name="Author">...</param>
 <param name="Organisation">VPAC</param>
 <param name="Project">StgFEM</param>
-<param name="Location">./PICellerator/Utils/src/</param>
+<param name="Location">./StgFEM/Assembly/src/</param>
 <param name="Project Web">http://www.stgermainproject.org/StgFEM.html</param>
 <param name="Copyright">Copyright (C) 2004-2005 VPAC.</param>
 <param name="License">The Gnu Lesser General Public License v2.1 - http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html</param>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/Finalise.c
--- a/Utils/src/Finalise.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/Finalise.c	Tue Feb 02 16:55:08 2010 +1100
@@ -53,9 +53,7 @@
 #include <stdio.h>
 
 Bool PICellerator_Utils_Finalise( void ) {
-	Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
 	
 	return True;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/Init.c
--- a/Utils/src/Init.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/Init.c	Tue Feb 02 16:55:08 2010 +1100
@@ -56,12 +56,12 @@ Bool PICellerator_Utils_Init( int* argc,
 Bool PICellerator_Utils_Init( int* argc, char** argv[] ) {
 	Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
 
-	Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
 	
-        Stg_ComponentRegister_Add( componentsRegister, PCDVC_Type, (Name)"0", _PCDVC_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, BuoyancyForceTerm_Type, (Name)"0", _BuoyancyForceTerm_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, BuoyancyForceTermThermoChem_Type, (Name)"0", _BuoyancyForceTermThermoChem_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, DiffusionSMT_Type, (Name)"0", _DiffusionSMT_DefaultNew  );
+        Stg_ComponentRegister_Add( componentsRegister, PCDVC_Type,                    "0", _PCDVC_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, BuoyancyForceTerm_Type,            "0", _BuoyancyForceTerm_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, BuoyancyForceTermThermoChem_Type,            "0", _BuoyancyForceTermThermoChem_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, DiffusionSMT_Type,            "0", _DiffusionSMT_DefaultNew );
 
 	RegisterParent( BuoyancyForceTerm_Type,     ForceTerm_Type );
 	RegisterParent( BuoyancyForceTermThermoChem_Type,     ForceTerm_Type );
@@ -70,5 +70,3 @@ Bool PICellerator_Utils_Init( int* argc,
 	RegisterParent( PCDVC_Type,                 DVCWeights_Type );
 	return True;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/MaterialSwarmVariable.c
--- a/Utils/src/MaterialSwarmVariable.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/MaterialSwarmVariable.c	Tue Feb 02 16:55:08 2010 +1100
@@ -61,70 +61,95 @@ const Type MaterialSwarmVariable_Type = 
 const Type MaterialSwarmVariable_Type = "MaterialSwarmVariable";
 
 MaterialSwarmVariable* MaterialSwarmVariable_New( 
-	Name						name,
-	AbstractContext*		context,
-	MaterialPointsSwarm*	swarm,
-	Index						dofCount,
-	Materials_Register*	materials_Register,
-	ExtensionInfo_Index	materialExtensionHandle,
-	SizeT						offset )
+		Name                                                name,
+		MaterialPointsSwarm*                                swarm,
+		Index                                               dofCount,
+		Materials_Register*                                 materials_Register,
+		ExtensionInfo_Index                                 materialExtensionHandle,
+		SizeT                                               offset )
 {
 	MaterialSwarmVariable* self = (MaterialSwarmVariable*) _MaterialSwarmVariable_DefaultNew( name );
 
-	self->isConstructed = True;
-	_SwarmVariable_Init( (SwarmVariable*)self, context, (Swarm*)swarm, NULL, dofCount );
-	_MaterialSwarmVariable_Init( self, materials_Register, materialExtensionHandle, offset );
+	MaterialSwarmVariable_InitAll( 
+			self,
+			swarm,
+			dofCount,
+			materials_Register,
+			materialExtensionHandle,
+			offset );
 
 	return self;
 }
 
-void* _MaterialSwarmVariable_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                 _sizeOfSelf = sizeof(MaterialSwarmVariable);
-	Type                                                         type = MaterialSwarmVariable_Type;
-	Stg_Class_DeleteFunction*                                 _delete = _MaterialSwarmVariable_Delete;
-	Stg_Class_PrintFunction*                                   _print = _MaterialSwarmVariable_Print;
-	Stg_Class_CopyFunction*                                     _copy = NULL;
-	Stg_Component_DefaultConstructorFunction*     _defaultConstructor = _MaterialSwarmVariable_DefaultNew;
-	Stg_Component_ConstructFunction*                       _construct = _MaterialSwarmVariable_AssignFromXML;
-	Stg_Component_BuildFunction*                               _build = _MaterialSwarmVariable_Build;
-	Stg_Component_InitialiseFunction*                     _initialise = _MaterialSwarmVariable_Initialise;
-	Stg_Component_ExecuteFunction*                           _execute = _MaterialSwarmVariable_Execute;
-	Stg_Component_DestroyFunction*                           _destroy = _MaterialSwarmVariable_Destroy;
-	AllocationType                                 nameAllocationType = NON_GLOBAL;
-	SwarmVariable_ValueAtFunction*                           _valueAt = _MaterialSwarmVariable_ValueAt;
-	SwarmVariable_GetGlobalValueFunction*      _getMinGlobalMagnitude = _MaterialSwarmVariable_GetMinGlobalMagnitude;
-	SwarmVariable_GetGlobalValueFunction*      _getMaxGlobalMagnitude = _MaterialSwarmVariable_GetMaxGlobalMagnitude;
-
-	return (void*)_MaterialSwarmVariable_New(  MATERIALSWARMVARIABLE_PASSARGS  );
-}
-
 /* Creation implementation / Virtual constructor */
-MaterialSwarmVariable* _MaterialSwarmVariable_New(  MATERIALSWARMVARIABLE_DEFARGS  ) {
+MaterialSwarmVariable* _MaterialSwarmVariable_New( 
+		SizeT                                               sizeOfSelf,  
+		Type                                                type,
+		Stg_Class_DeleteFunction*                           _delete,
+		Stg_Class_PrintFunction*                            _print,
+		Stg_Class_CopyFunction*                             _copy, 
+		Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+		Stg_Component_ConstructFunction*                    _construct,
+		Stg_Component_BuildFunction*                        _build,
+		Stg_Component_InitialiseFunction*                   _initialise,
+		Stg_Component_ExecuteFunction*                      _execute,
+		Stg_Component_DestroyFunction*                      _destroy,
+		SwarmVariable_ValueAtFunction*                      _valueAt,
+		SwarmVariable_GetGlobalValueFunction*               _getMinGlobalMagnitude,
+		SwarmVariable_GetGlobalValueFunction*               _getMaxGlobalMagnitude,
+		Name                                                name )
+{
 	MaterialSwarmVariable* self;
 	
 	/* Allocate memory */
-	assert( _sizeOfSelf >= sizeof(MaterialSwarmVariable) );
-	self = (MaterialSwarmVariable*) _SwarmVariable_New(  SWARMVARIABLE_PASSARGS  );
+	assert( sizeOfSelf >= sizeof(MaterialSwarmVariable) );
+	self = (MaterialSwarmVariable*) _SwarmVariable_New( 
+		sizeOfSelf, 
+		type, 
+		_delete, 
+		_print, 
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build, 
+		_initialise,
+		_execute,
+		_destroy,
+		_valueAt,
+		_getMinGlobalMagnitude,
+		_getMaxGlobalMagnitude,
+		name );
 	
 	/* Virtual info */
 	
 	return self;
 }
 
-void _MaterialSwarmVariable_Init(
-	void*						swarmVariable,
-	Materials_Register*	materials_Register,
-	ExtensionInfo_Index	materialExtensionHandle,
-	SizeT						offset )
+void _MaterialSwarmVariable_Init( 
+		MaterialSwarmVariable*                              self, 
+		Materials_Register*                                 materials_Register,
+		ExtensionInfo_Index                                 materialExtensionHandle,
+		SizeT                                               offset )
 {
-	MaterialSwarmVariable* self = (MaterialSwarmVariable*)swarmVariable;
-
 	self->materials_Register        = materials_Register;
 	self->materialExtensionHandle   = materialExtensionHandle;
 	self->offset                    = offset;
    /* variable does not store data, so is not checkpointed */
    self->isCheckpointedAndReloaded = False;
+}
+
+void MaterialSwarmVariable_InitAll( 
+		void*                                               swarmVariable,
+		MaterialPointsSwarm*                                swarm,
+		Index                                               dofCount,
+		Materials_Register*                                 materials_Register,
+		ExtensionInfo_Index                                 materialExtensionHandle,
+		SizeT                                               offset )
+{
+	MaterialSwarmVariable* self = (MaterialSwarmVariable*) swarmVariable;
+
+	SwarmVariable_InitAll( self, (Swarm*)swarm, NULL, dofCount );
+	_MaterialSwarmVariable_Init( self, materials_Register, materialExtensionHandle, offset );
 }
 
 void _MaterialSwarmVariable_Delete( void* swarmVariable ) {
@@ -144,16 +169,33 @@ void _MaterialSwarmVariable_Print( void*
 	Journal_PrintValue( stream, self->offset );
 }
 
-void _MaterialSwarmVariable_AssignFromXML( void* swarmVariable, Stg_ComponentFactory* cf, void* data ) {
-	MaterialSwarmVariable*	self = (MaterialSwarmVariable*)swarmVariable;
-	Materials_Register*		materials_Register;
-	PICelleratorContext*		context = (PICelleratorContext*)self->context;
+void* _MaterialSwarmVariable_DefaultNew( Name name ) {
+	return (void*)_MaterialSwarmVariable_New( 
+		sizeof(MaterialSwarmVariable), 
+		MaterialSwarmVariable_Type,
+		_MaterialSwarmVariable_Delete,
+		_MaterialSwarmVariable_Print,
+		NULL,
+		_MaterialSwarmVariable_DefaultNew,
+		_MaterialSwarmVariable_Construct,
+		_MaterialSwarmVariable_Build,
+		_MaterialSwarmVariable_Initialise,
+		_MaterialSwarmVariable_Execute,
+		_MaterialSwarmVariable_Destroy,
+		_MaterialSwarmVariable_ValueAt,
+		_MaterialSwarmVariable_GetMinGlobalMagnitude,
+		_MaterialSwarmVariable_GetMaxGlobalMagnitude,
+		name );
+}
+
+void _MaterialSwarmVariable_Construct( void* swarmVariable, Stg_ComponentFactory* cf, void* data ) {
+	MaterialSwarmVariable*      self             = (MaterialSwarmVariable*)swarmVariable;
+	Materials_Register*         materials_Register;
 
 	/* Construct Parent */
-	_SwarmVariable_AssignFromXML( self, cf, data );
+	_SwarmVariable_Construct( self, cf, data );
 
-	assert( Stg_CheckType( context, PICelleratorContext ) );
-	materials_Register = context->materials_Register;
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
 	assert( materials_Register );
 
 	abort( );
@@ -161,7 +203,7 @@ void _MaterialSwarmVariable_AssignFromXM
 }
 
 void _MaterialSwarmVariable_Build( void* swarmVariable, void* data ) {
-	MaterialSwarmVariable* self = (MaterialSwarmVariable*)swarmVariable;
+	MaterialSwarmVariable*               self               = (MaterialSwarmVariable*)swarmVariable;
 
 	_SwarmVariable_Build( self, data );
 }
@@ -175,14 +217,12 @@ void _MaterialSwarmVariable_Execute( voi
 }
 
 void _MaterialSwarmVariable_Destroy( void* swarmVariable, void* data ) {
-	MaterialSwarmVariable*  self = (MaterialSwarmVariable*) swarmVariable;
-
-	_SwarmVariable_Destroy( self, data );
+	_SwarmVariable_Destroy( swarmVariable, data );
 }
 
 void _MaterialSwarmVariable_ValueAt( void* swarmVariable, Particle_Index lParticle_I, double* value ) {
-	MaterialSwarmVariable*  self = (MaterialSwarmVariable*) swarmVariable;
-	MaterialPointsSwarm*    swarm = (MaterialPointsSwarm*)self->swarm;
+	MaterialSwarmVariable*  self            = (MaterialSwarmVariable*) swarmVariable;
+	MaterialPointsSwarm*    swarm           = (MaterialPointsSwarm*)self->swarm;
 	Material*               material;
 	ArithPointer            materialExt;
 
@@ -204,5 +244,3 @@ double _MaterialSwarmVariable_GetMaxGlob
 }
 	
 	
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/MaterialSwarmVariable.h
--- a/Utils/src/MaterialSwarmVariable.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/MaterialSwarmVariable.h	Tue Feb 02 16:55:08 2010 +1100
@@ -53,63 +53,57 @@
 		__SwarmVariable \
 		/* Virtual info */ \
 		/* MaterialSwarmVariable info */ \
-		Materials_Register*	materials_Register; \
-		ExtensionInfo_Index	materialExtensionHandle; \
-		SizeT						offset;
+		Materials_Register*                                 materials_Register;                \
+		ExtensionInfo_Index                                 materialExtensionHandle;           \
+		SizeT                                               offset;
 
 	struct MaterialSwarmVariable { __MaterialSwarmVariable };
 
+	MaterialSwarmVariable* MaterialSwarmVariable_New( 
+		Name                                                name,
+		MaterialPointsSwarm*                                swarm,
+		Index                                               dofCount,
+		Materials_Register*                                 materials_Register,
+		ExtensionInfo_Index                                 materialExtensionHandle,
+		SizeT                                               offset );
 
-
-	MaterialSwarmVariable* MaterialSwarmVariable_New( 
-		Name						name,
-		AbstractContext*		context,
-		MaterialPointsSwarm*	swarm,
-		Index						dofCount,
-		Materials_Register*	materials_Register,
-		ExtensionInfo_Index	materialExtensionHandle,
-		SizeT						offset );
-
+	MaterialSwarmVariable* _MaterialSwarmVariable_New( 
+		SizeT                                               sizeOfSelf,  
+		Type                                                type,
+		Stg_Class_DeleteFunction*                           _delete,
+		Stg_Class_PrintFunction*                            _print,
+		Stg_Class_CopyFunction*                             _copy, 
+		Stg_Component_DefaultConstructorFunction*           _defaultConstructor,
+		Stg_Component_ConstructFunction*                    _construct,
+		Stg_Component_BuildFunction*                        _build,
+		Stg_Component_InitialiseFunction*                   _initialise,
+		Stg_Component_ExecuteFunction*                      _execute,
+		Stg_Component_DestroyFunction*                      _destroy,
+		SwarmVariable_ValueAtFunction*                      _valueAt,
+		SwarmVariable_GetGlobalValueFunction*               _getMinGlobalMagnitude,
+		SwarmVariable_GetGlobalValueFunction*               _getMaxGlobalMagnitude,
+		Name                                                name );
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define MATERIALSWARMVARIABLE_DEFARGS \
-                SWARMVARIABLE_DEFARGS
-
-	#define MATERIALSWARMVARIABLE_PASSARGS \
-                SWARMVARIABLE_PASSARGS
-
-	MaterialSwarmVariable* _MaterialSwarmVariable_New(  MATERIALSWARMVARIABLE_DEFARGS  );
-	
-	void _MaterialSwarmVariable_Init(
-		void*                swarmVariable,
-		Materials_Register*  materials_Register,
-		ExtensionInfo_Index  materialExtensionHandle,
-		SizeT                offset );
+	void MaterialSwarmVariable_InitAll( 
+		void*                                               swarmVariable,
+		MaterialPointsSwarm*                                swarm,
+		Index                                               dofCount,
+		Materials_Register*                                 materials_Register,
+		ExtensionInfo_Index                                 materialExtensionHandle,
+		SizeT                                               offset );
 
 	void _MaterialSwarmVariable_Delete( void* swarmVariable );
-
 	void _MaterialSwarmVariable_Print( void* swarmVariable, Stream* stream );
 
-	void* _MaterialSwarmVariable_DefaultNew( Name name );
+	void* _MaterialSwarmVariable_DefaultNew( Name name ) ;
+void _MaterialSwarmVariable_Construct( void* swarmVariable, Stg_ComponentFactory* cf, void* data ) ;
+	void _MaterialSwarmVariable_Build( void* swarmVariable, void* data ) ;
+	void _MaterialSwarmVariable_Initialise( void* swarmVariable, void* data ) ;
+	void _MaterialSwarmVariable_Execute( void* swarmVariable, void* data ) ;
+	void _MaterialSwarmVariable_Destroy( void* swarmVariable, void* data ) ;
 
-	void _MaterialSwarmVariable_AssignFromXML( void* swarmVariable, Stg_ComponentFactory* cf, void* data );
-
-	void _MaterialSwarmVariable_Build( void* swarmVariable, void* data );
-
-	void _MaterialSwarmVariable_Initialise( void* swarmVariable, void* data );
-
-	void _MaterialSwarmVariable_Execute( void* swarmVariable, void* data );
-
-	void _MaterialSwarmVariable_Destroy( void* swarmVariable, void* data );
-
-	void _MaterialSwarmVariable_ValueAt( void* swarmVariable, Particle_Index lParticle_I, double* value );
-
-	double _MaterialSwarmVariable_GetMinGlobalMagnitude( void* swarmVariable );
-
-	double _MaterialSwarmVariable_GetMaxGlobalMagnitude( void* swarmVariable );
+	void _MaterialSwarmVariable_ValueAt( void* swarmVariable, Particle_Index lParticle_I, double* value ) ;
+	double _MaterialSwarmVariable_GetMinGlobalMagnitude( void* swarmVariable ) ;
+	double _MaterialSwarmVariable_GetMaxGlobalMagnitude( void* swarmVariable ) ;
 
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/PCDVC.c
--- a/Utils/src/PCDVC.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/PCDVC.c	Tue Feb 02 16:55:08 2010 +1100
@@ -50,33 +50,33 @@
 **         in them). Splitting is optional. This may be inadequate. We may need to do some handling of the neighbours
 **         to interface cells as well, in order to preserve particle density about an interface.
 
-How to use this:
-You may place the following in a top-level xml file to change the parameters:
-This assumes a lower level xml file is not using a weights calculator other than PCDVC.
+       How to use this:
+	   You may place the following in a top-level xml file to change the parameters:
+	   This assumes a lower level xml file is not using a weights calculator other than PCDVC.
 	   
-<struct name="weights" mergeType="replace">
-<param name="Type">PCDVC</param>
-<param name="resolutionX">10</param>
-<param name="resolutionY">10</param>
-<param name="resolutionZ">10</param>
-<param name="lowerT">0.25</param>  <!-- lower % threshold volume for deletion of particles. i.e if a particle volume < 0.25% of total then delete it -->
-<param name="upperT">15</param>    <!-- upper % threshold volume for deletion of particles. i.e if a particle volume > 15% of total then split it -->
-<param name="maxDeletions">5</param>
-<param name="maxSplits">10</param>
-<param name="MaterialPointsSwarm">materialSwarm</param>
-</struct>
-<struct name="weights" mergeType="merge">
-<param name="Inflow">True</param>  <!-- switches the Inflow flag on -->
-<param name="Threshold">0.8</param> <!-- Threshold for cell population in an inflow problem: If a cell has less than 80% of its assigned particles then we re-populate -->
-<param name="CentPosRatio">0.01</param> <!-- Threshold for cell population in an inflow problem: If a cell's centroid is more than sqrt(0.01) of the width of an FEM cell away from the particle position then we re-populate -->
-</struct>
+		<struct name="weights" mergeType="replace">
+                   <param name="Type">PCDVC</param>
+                   <param name="resolutionX">10</param>
+                   <param name="resolutionY">10</param>
+                   <param name="resolutionZ">10</param>
+                   <param name="lowerT">0.25</param>  <!-- lower % threshold volume for deletion of particles. i.e if a particle volume < 0.25% of total then delete it -->
+                   <param name="upperT">15</param>    <!-- upper % threshold volume for deletion of particles. i.e if a particle volume > 15% of total then split it -->
+                   <param name="maxDeletions">5</param>
+                   <param name="maxSplits">10</param>
+                   <param name="MaterialPointsSwarm">materialSwarm</param>
+                </struct>
+		<struct name="weights" mergeType="merge">
+			<param name="Inflow">True</param>  <!-- switches the Inflow flag on -->
+			<param name="Threshold">0.8</param> <!-- Threshold for cell population in an inflow problem: If a cell has less than 80% of its assigned particles then we re-populate -->
+			<param name="CentPosRatio">0.01</param> <!-- Threshold for cell population in an inflow problem: If a cell's centroid is more than sqrt(0.01) of the width of an FEM cell away from the particle position then we re-populate -->
+		</struct>
 		
-Note that you can use the Inflow flags for non-inflow problems. Might be OK for paranoid people or weird situations.
-There is a slight performance hit having the Inflow flag enabled.
+	    Note that you can use the Inflow flags for non-inflow problems. Might be OK for paranoid people or weird situations.
+	    There is a slight performance hit having the Inflow flag enabled.
 	    
-This code is a bit messy and needs some tidying up and more comments. But for now, the inflow stuff seems to work OK.
-Tested in 3D with as few as 15 particles per cell for 50 time-steps with an Inflow problem.
-Tested in 2D with as few as 10 particles per cell for 150 time-steps with an Inflow problem.
+	    This code is a bit messy and needs some tidying up and more comments. But for now, the inflow stuff seems to work OK.
+	    Tested in 3D with as few as 15 particles per cell for 50 time-steps with an Inflow problem.
+	    Tested in 2D with as few as 10 particles per cell for 150 time-steps with an Inflow problem.
 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -120,67 +120,77 @@ const Type PCDVC_Type = "PCDVC";
 /*----------------------------------------------------------------------------------------------------------------------------------
 ** Constructors
 */
+PCDVC* PCDVC_New( Name name, Dimension_Index dim ) {
+	PCDVC* self = (PCDVC*) _PCDVC_DefaultNew( name );
 
-PCDVC* PCDVC_New(
-	Name						name,
-	Dimension_Index		dim,
-	int*						res,
- 	MaterialPointsSwarm*	mps,
-	double					upT,
-	double					lowT,
-	int						maxDeletions,
-	int						maxSplits,
-	Bool						splitInInterfaceCells,
- 	Bool						deleteInInterfaceCells,
-	Bool						Inflow,
-	double					CentPosRatio,
-	int						ParticlesPerCell,
-	double					Threshold )
-{
-    PCDVC *self = _PCDVC_DefaultNew( name );
-
-    self->isConstructed = True;
-    _WeightsCalculator_Init( self, dim );
-    _DVCWeights_Init( self, res );
-    _PCDVC_Init( self, mps, upT, lowT, maxDeletions, maxSplits, splitInInterfaceCells, deleteInInterfaceCells, Inflow, CentPosRatio, ParticlesPerCell, Threshold );
-
+	PCDVC_InitAll( self, dim );
 	return self;
 }
 
-PCDVC* _PCDVC_New(  PCDVC_DEFARGS  ) {
-    PCDVC* self;
+PCDVC* _PCDVC_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name )
+{
+	PCDVC* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(PCDVC) );
+	/* Initialise the parent class. Every class has a parent, bar Stg_Component, which needs to be called */
+	self = (PCDVC*)_DVCWeights_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			name );
 
-    /* Allocate memory */
-    assert( _sizeOfSelf >= sizeof(PCDVC) );
+	
+	/* General info */
 
-    /* Initialise the parent class. Every class has a parent, bar Stg_Component, which needs to be called */
-    self = (PCDVC*)_DVCWeights_New(  DVCWEIGHTS_PASSARGS  );
-
-    /* General info */
-
-    /* Virtual Info */
-
-    return self;
+	/* Virtual Info */
+	return self;
 }
 
-void _PCDVC_Init( void* pcdvc, MaterialPointsSwarm* mps, double upT, double lowT,
-                  int maxDeletions, int maxSplits, Bool splitInInterfaceCells,
-                  Bool deleteInInterfaceCells, Bool Inflow, double CentPosRatio,
-                  int ParticlesPerCell, double Threshold )
-{
-    PCDVC* self = (PCDVC*)pcdvc;
+void _PCDVC_Init( void* pcdvc, MaterialPointsSwarm* mps,  double upT, double lowT, int maxDeletions, int maxSplits, Bool splitInInterfaceCells, Bool deleteInInterfaceCells, int *res, Bool Inflow, double CentPosRatio, int ParticlesPerCell, double Thresh ) {
+	PCDVC* self = (PCDVC*)pcdvc;
 	
-    self->materialPointsSwarm = mps;
-    self->upperT = upT;
-    self->lowerT = lowT;
-    self->maxDeletions = self->maxDeletions_orig = maxDeletions;
-    self->maxSplits    = self->maxSplits_orig    = maxSplits;
-    self->Inflow       = self->Inflow_orig       = Inflow;
-    self->splitInInterfaceCells = self->splitInInterfaceCells_orig = splitInInterfaceCells;
-    self->deleteInInterfaceCells = self->deleteInInterfaceCells_orig = deleteInInterfaceCells;
-    self->Threshold = Threshold;
-    self->CentPosRatio = CentPosRatio;
-    self->ParticlesPerCell = ParticlesPerCell;
+	self->materialPointsSwarm = mps;
+	self->upperT = upT;
+	self->lowerT = lowT;
+	self->maxDeletions = self->maxDeletions_orig = maxDeletions;
+	self->maxSplits    = self->maxSplits_orig    = maxSplits;
+	self->Inflow       = self->Inflow_orig       = Inflow;
+	self->resX = res[I_AXIS];
+	self->resY = res[J_AXIS];
+	self->resZ = res[K_AXIS];
+	self->splitInInterfaceCells = self->splitInInterfaceCells_orig = splitInInterfaceCells;
+   self->deleteInInterfaceCells = self->deleteInInterfaceCells_orig = deleteInInterfaceCells;
+	self->Threshold = Thresh;
+	self->CentPosRatio = CentPosRatio;
+	self->ParticlesPerCell = ParticlesPerCell;
+}
+
+void PCDVC_InitAll( void* pcdvc, Dimension_Index dim ) {
+	PCDVC* self = (PCDVC*)pcdvc;
+	WeightsCalculator_InitAll( self, dim );
 }
 
 /*------------------------------------------------------------------------------------------------------------------------
@@ -188,123 +198,123 @@ void _PCDVC_Init( void* pcdvc, MaterialP
 */
 
 void _PCDVC_Delete( void* pcdvc ) {
-    PCDVC* self = (PCDVC*)pcdvc;
-    /* Delete parent */
-    _DVCWeights_Delete( self );
+	PCDVC* self = (PCDVC*)pcdvc;
+	/* Delete parent */
+	_DVCWeights_Delete( self );
 }
 
 
 void _PCDVC_Print( void* pcdvc, Stream* stream ) {
-    PCDVC* self = (PCDVC*)pcdvc;
-    /* Print parent */
-    _DVCWeights_Print( self, stream );
+	PCDVC* self = (PCDVC*)pcdvc;
+	/* Print parent */
+	_DVCWeights_Print( self, stream );
 }
 
 
 
 void* _PCDVC_Copy( void* pcdvc, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    PCDVC*	self = (PCDVC*)pcdvc;
-    PCDVC*	newPCDVC;
+	PCDVC*	self = (PCDVC*)pcdvc;
+	PCDVC*	newPCDVC;
 	
-    newPCDVC = (PCDVC*)_DVCWeights_Copy( self, dest, deep, nameExt, ptrMap );
-    return (void*)newPCDVC;
+	newPCDVC = (PCDVC*)_DVCWeights_Copy( self, dest, deep, nameExt, ptrMap );
+	return (void*)newPCDVC;
 }
 
 void* _PCDVC_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                                 _sizeOfSelf = sizeof(PCDVC);
-	Type                                                         type = PCDVC_Type;
-	Stg_Class_DeleteFunction*                                 _delete = _PCDVC_Delete;
-	Stg_Class_PrintFunction*                                   _print = _PCDVC_Print;
-	Stg_Class_CopyFunction*                                     _copy = _PCDVC_Copy;
-	Stg_Component_DefaultConstructorFunction*     _defaultConstructor = _PCDVC_DefaultNew;
-	Stg_Component_ConstructFunction*                       _construct = _PCDVC_AssignFromXML;
-	Stg_Component_BuildFunction*                               _build = _PCDVC_Build;
-	Stg_Component_InitialiseFunction*                     _initialise = _PCDVC_Initialise;
-	Stg_Component_ExecuteFunction*                           _execute = _PCDVC_Execute;
-	Stg_Component_DestroyFunction*                           _destroy = _PCDVC_Destroy;
-	AllocationType                                 nameAllocationType = NON_GLOBAL;
-	WeightsCalculator_CalculateFunction*                   _calculate = _PCDVC_Calculate;
-
-    return (void*) _PCDVC_New(  PCDVC_PASSARGS  );
+	return (void*) _PCDVC_New(
+			sizeof(PCDVC),
+			PCDVC_Type,
+			_PCDVC_Delete,
+			_PCDVC_Print,
+			_PCDVC_Copy,
+			_PCDVC_DefaultNew,
+			_PCDVC_Construct,
+			_PCDVC_Build,
+			_PCDVC_Initialise,
+			_PCDVC_Execute,
+			_PCDVC_Destroy,
+			_PCDVC_Calculate,
+			name );
 }
 
 
-void _PCDVC_AssignFromXML( void* pcdvc, Stg_ComponentFactory* cf, void *data ) {
+void _PCDVC_Construct( void* pcdvc, Stg_ComponentFactory* cf, void *data ) {
 
-    PCDVC*	     self          = (PCDVC*) pcdvc;
-    MaterialPointsSwarm*       materialPointsSwarm;
-    double upT, lowT;
-    int maxD, maxS;
-    Bool splitInInterfaceCells;
-    Bool deleteInInterfaceCells;
-    Bool Inflow;
-    double CentPosRatio;
-    int ParticlesPerCell;
-    double Thresh;
+	PCDVC*	     self          = (PCDVC*) pcdvc;
+	MaterialPointsSwarm*       materialPointsSwarm;
+	double upT, lowT;
+	int defaultResolution;
+	int resolution[3];
+	int maxD, maxS;
+	Bool splitInInterfaceCells;
+   Bool deleteInInterfaceCells;
+	Bool Inflow;
+	double CentPosRatio;
+	int ParticlesPerCell;
+	double Thresh;
 
-    _DVCWeights_AssignFromXML( self, cf, data );
-
-    materialPointsSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"MaterialPointsSwarm", MaterialPointsSwarm, True, data  );
-    Stream*  stream = Journal_Register( Info_Type, (Name)materialPointsSwarm->type  );
+	_DVCWeights_Construct( self, cf, data );
+	materialPointsSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "MaterialPointsSwarm", MaterialPointsSwarm, True, data );
+	Stream*  stream = Journal_Register( Info_Type, materialPointsSwarm->type );
 	
 
-    stream = Journal_Register( Info_Type, (Name)materialPointsSwarm->type  );
-    upT = Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"upperT", 25  );
-    lowT = Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"lowerT", 0.6  );
-    maxD = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, (Dictionary_Entry_Key)"maxDeletions", 2 );
-    maxS = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, (Dictionary_Entry_Key)"maxSplits", 3 );
-    splitInInterfaceCells  = Stg_ComponentFactory_GetBool( cf, self->name, (Dictionary_Entry_Key)"splitInInterfaceCells", False );
-    deleteInInterfaceCells = Stg_ComponentFactory_GetBool( cf, self->name, (Dictionary_Entry_Key)"deleteInInterfaceCells", False );
-    Inflow =  Stg_ComponentFactory_GetBool( cf, self->name, (Dictionary_Entry_Key)"Inflow", False );
-    Thresh = Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"Threshold", 0.8  );
-    //CentPosRatio is ratio of allowable distance of a centroid from generating particle to distance across a FEM cell.
-    // I think the centroid distance idea is not ideal in the end...can create some weirdness...even thought the code "works"
-    // after a while one can get wiggly lines in the cells...the centriods are close to the particles but its all
-    // centred in the FEM cell.
-    CentPosRatio =  Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"CentPosRatio", 0.01  );
-    // just getting the initial PPC for now...maybe could make this a separate parameter yet if needed.
-    ParticlesPerCell = cf->getRootDictUnsignedInt( cf, "particlesPerCell", 25);
-    if(upT < lowT){
-        lowT = 0.6;
-        upT = 25;
-        Journal_Printf( stream,"On Proc %d: In func %s(): WARNING!! lowT and upT have been reset to some more reasonable values. (lowT = 0.6, upT = 25) now!",materialPointsSwarm->myRank, __func__);
-    }
+	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);
+	maxS = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "maxSplits", 3);
+	splitInInterfaceCells  = Stg_ComponentFactory_GetBool( cf, self->name, "splitInInterfaceCells", False);
+   deleteInInterfaceCells = Stg_ComponentFactory_GetBool( cf, self->name, "deleteInInterfaceCells", False);
+	defaultResolution = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolution", 10 );
+	resolution[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionX", defaultResolution );
+	resolution[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionY", defaultResolution );
+	resolution[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionZ", defaultResolution );
+	Inflow =  Stg_ComponentFactory_GetBool( cf, self->name, "Inflow", False);
+	Thresh = Stg_ComponentFactory_GetDouble( cf, self->name, "Threshold", 0.8 );
+	//CentPosRatio is ratio of allowable distance of a centroid from generating particle to distance across a FEM cell.
+	// I think the centroid distance idea is not ideal in the end...can create some weirdness...even thought the code "works"
+	// after a while one can get wiggly lines in the cells...the centriods are close to the particles but its all
+	// centred in the FEM cell.
+	CentPosRatio =  Stg_ComponentFactory_GetDouble( cf, self->name, "CentPosRatio", 0.01 );
+	// just getting the initial PPC for now...maybe could make this a separate parameter yet if needed.
+	ParticlesPerCell = cf->getRootDictUnsignedInt( cf, "particlesPerCell", 25);
+	if(upT < lowT){
+	      lowT = 0.6;
+	      upT = 25;
+	      Journal_Printf( stream,"On Proc %d: In func %s(): WARNING!! lowT and upT have been reset to some more reasonable values. (lowT = 0.6, upT = 25) now!",materialPointsSwarm->myRank, __func__);
+	}
 
-    _PCDVC_Init( self, materialPointsSwarm,  upT, lowT, maxD, maxS, splitInInterfaceCells,
-                 deleteInInterfaceCells, Inflow, CentPosRatio, ParticlesPerCell, Thresh );
+	_PCDVC_Init( self, materialPointsSwarm,  upT, lowT, maxD, maxS, splitInInterfaceCells, deleteInInterfaceCells, resolution, Inflow, CentPosRatio, ParticlesPerCell, Thresh );
 }
 
 void _PCDVC_Build( void* pcdvc, void* data ) {
-    PCDVC*	self = (PCDVC*)pcdvc;
-    _DVCWeights_Build( self, data );
-    Stg_Component_Build( self->materialPointsSwarm, data, False );
+	PCDVC*	self = (PCDVC*)pcdvc;
+	_DVCWeights_Build( self, data );
+}
+void _PCDVC_Initialise( void* pcdvc, void* data ) {
+	PCDVC*	self = (PCDVC*)pcdvc;
+	AbstractContext* context = (AbstractContext*)data;
+   /** for interpolation restart, we need to set these values high to ensure correct population of */
+   /** integration point swarms                                                                    */
+   /** these parameters will be reset to correct values after first timestep                       */
+   if ( context && (True == context->loadFromCheckPoint) && (True == context->interpolateRestart) ){
+      self->maxDeletions           = 999999;
+      self->maxSplits              = 999999;
+      self->Inflow                 = True;
+      self->splitInInterfaceCells  = True;
+      self->deleteInInterfaceCells = True;
+   }
+   
+	_DVCWeights_Initialise( self, data );
+}
+void _PCDVC_Execute( void* pcdvc, void* data ) {
+	PCDVC*	self = (PCDVC*)pcdvc;
+	_DVCWeights_Execute( self, data );
 }
 void _PCDVC_Destroy( void* pcdvc, void* data ) {
-    PCDVC*	self = (PCDVC*)pcdvc;
-    _DVCWeights_Destroy( self, data );
-    Stg_Component_Destroy( self->materialPointsSwarm, data, False );
+	PCDVC*	self = (PCDVC*)pcdvc;
+	_DVCWeights_Destroy( self, data );
 }
-void _PCDVC_Initialise( void* pcdvc, void* data ) {
-    PCDVC*	self = (PCDVC*)pcdvc;
-    /** for interpolation restart, we need to set these values high to ensure correct population of */
-    /** integration point swarms                                                                    */
-    /** these parameters will be reset to correct values after first timestep                       */
-    if ( (True == self->context->loadSwarmsFromCheckpoint) && (True == self->context->interpolateRestart) ){
-        self->maxDeletions           = 999999;
-        self->maxSplits              = 999999;
-        self->Inflow                 = True;
-        self->splitInInterfaceCells  = True;
-        self->deleteInInterfaceCells = True;
-    }
-    Stg_Component_Initialise( self->materialPointsSwarm, data, False );
-    _DVCWeights_Initialise( self, data );
-}
-void _PCDVC_Execute( void* pcdvc, void* data ) {
-    PCDVC*	self = (PCDVC*)pcdvc;
-    _DVCWeights_Execute( self, data );
-}
-
 
 /*-------------------------------------------------------------------------------------------------------------------------
 ** Private Functions
@@ -314,21 +324,21 @@ void _PCDVC_Execute( void* pcdvc, void* 
    particle DOES NOT point to the last material point particle, as it should.
    If this function is being called ever, then some other module/component somewhere has messed up the mapping between the integration Swarm and the material Swarm*/
 MaterialPointRef* getIntParticleMaterialRef_PointingToMaterialParticle( IntegrationPointsSwarm*  intSwarm, Particle_Index matLastParticle_IndexOnCPU ){
-    IntegrationPoint* intTestParticle;
-    MaterialPointRef*       ref;
-    int i;
-    Stream*  stream = Journal_Register( Info_Type, (Name)intSwarm->type  );
-    Journal_Printf( stream,"\n\n\e[31m\nOn Proc %d: In func %s(): WARNING!! If this function is being called, then some other module/component, somewhere, has messed up the mapping between the integration Swarm and the material Swarm\n\n", intSwarm->myRank, __func__);
-    Journal_Printf( stream,"This function is potentially slow. Someone should fix the offending module so that it doesn not mess up the ordering\n\n");
-    Journal_Printf( stream,"\e[0;32m");
-    for(i=0;i<intSwarm->particleLocalCount;i++){
-        intTestParticle =  (IntegrationPoint*)Swarm_ParticleAt( intSwarm, i);
-        ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intTestParticle);
-        if(ref->particle_I == matLastParticle_IndexOnCPU){
-            break;
-        }
-    }
-    return ref;
+      IntegrationPoint* intTestParticle;
+      MaterialPointRef*       ref;
+      int i;
+      Stream*  stream = Journal_Register( Info_Type, intSwarm->type );
+      Journal_Printf( stream,"\n\n\e[31m\nOn Proc %d: In func %s(): WARNING!! If this function is being called, then some other module/component, somewhere, has messed up the mapping between the integration Swarm and the material Swarm\n\n", intSwarm->myRank, __func__);
+      Journal_Printf( stream,"This function is potentially slow. Someone should fix the offending module so that it doesn not mess up the ordering\n\n");
+      Journal_Printf( stream,"\e[0;32m");
+      for(i=0;i<intSwarm->particleLocalCount;i++){
+	    intTestParticle =  (IntegrationPoint*)Swarm_ParticleAt( intSwarm, i);
+	    ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intTestParticle);
+	    if(ref->particle_I == matLastParticle_IndexOnCPU){
+		  break;
+	    }
+      }
+      return ref;
 }
 /****************************************************************************************************
  This function deletes integration particle number intParticleToRemove_IndexWithinCell in lCell_I
@@ -337,100 +347,100 @@ MaterialPointRef* getIntParticleMaterial
  there is one material point and vice versa.
 ******************************************************************************************************/
 void deleteIntParticleByIndexWithinCell( IntegrationPointsSwarm*  intSwarm, MaterialPointsSwarm* matSwarm, Cell_LocalIndex lCell_I, Particle_Index intParticleToRemove_IndexWithinCell ) {
-    MaterialPointRef*       ref;
-    MaterialPointRef*       refTestLastParticle;
-    MaterialPointRef*       ref_moved_particle;
-    MaterialPointRef*   refToLastMatParticle;
-    int refToLastMatParticleFlag = 0;
-    Particle_Index    intParticleToRemove_IndexOnCPU;/* the particle number within the swarm on the local CPU */
-    Particle_Index    matParticleToRemove_IndexOnCPU;
-    IntegrationPoint* intParticleToRemove;
-    MaterialPoint*    matParticleToRemove;
-    //Particle_Index    intParticleToRemove_IndexWithinCell;/* the number of the particle within the cell */
-    Particle_Index    matParticleToRemove_IndexWithinCell;
-    IntegrationPoint* intSwarmLastParticle; /* The last particle in the swarm on the local CPU */
-    MaterialPoint*    matSwarmLastParticle;
-    Particle_Index    intLastParticle_IndexOnCPU;
-    Particle_Index    matLastParticle_IndexOnCPU;
-    Particle_Index    intLastParticle_IndexWithinCell;
-    Particle_Index    matLastParticle_IndexWithinCell;
+      MaterialPointRef*       ref;
+      MaterialPointRef*       refTestLastParticle;
+      MaterialPointRef*       ref_moved_particle;
+      MaterialPointRef*   refToLastMatParticle;
+      int refToLastMatParticleFlag = 0;
+      Particle_Index    intParticleToRemove_IndexOnCPU;/* the particle number within the swarm on the local CPU */
+      Particle_Index    matParticleToRemove_IndexOnCPU;
+      IntegrationPoint* intParticleToRemove;
+      MaterialPoint*    matParticleToRemove;
+      //Particle_Index    intParticleToRemove_IndexWithinCell;/* the number of the particle within the cell */
+      Particle_Index    matParticleToRemove_IndexWithinCell;
+      IntegrationPoint* intSwarmLastParticle; /* The last particle in the swarm on the local CPU */
+      MaterialPoint*    matSwarmLastParticle;
+      Particle_Index    intLastParticle_IndexOnCPU;
+      Particle_Index    matLastParticle_IndexOnCPU;
+      Particle_Index    intLastParticle_IndexWithinCell;
+      Particle_Index    matLastParticle_IndexWithinCell;
 
-    SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
-    SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
+      SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
+      SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
 
 
-    intParticleToRemove_IndexOnCPU  = intSwarm->cellParticleTbl[ lCell_I ][ intParticleToRemove_IndexWithinCell ];
-    intParticleToRemove =  (IntegrationPoint*)Swarm_ParticleAt( intSwarm, intParticleToRemove_IndexOnCPU);
-    ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToRemove); /* so we can get the material point */
-    matParticleToRemove_IndexOnCPU = ref->particle_I;
-    matParticleToRemove =  (MaterialPoint*)Swarm_ParticleAt( matSwarm, matParticleToRemove_IndexOnCPU);
-    matParticleToRemove_IndexWithinCell = Swarm_GetParticleIndexWithinCell( matSwarm, matParticleToRemove->owningCell, matParticleToRemove_IndexOnCPU);
+      intParticleToRemove_IndexOnCPU  = intSwarm->cellParticleTbl[ lCell_I ][ intParticleToRemove_IndexWithinCell ];
+      intParticleToRemove =  (IntegrationPoint*)Swarm_ParticleAt( intSwarm, intParticleToRemove_IndexOnCPU);
+      ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToRemove); /* so we can get the material point */
+      matParticleToRemove_IndexOnCPU = ref->particle_I;
+      matParticleToRemove =  (MaterialPoint*)Swarm_ParticleAt( matSwarm, matParticleToRemove_IndexOnCPU);
+      matParticleToRemove_IndexWithinCell = Swarm_GetParticleIndexWithinCell( matSwarm, matParticleToRemove->owningCell, matParticleToRemove_IndexOnCPU);
 
-    /* The particles are homeless after these function-calls and for this reason alone must be destroyed */
-    Swarm_RemoveParticleFromCell( intSwarm, lCell_I, intParticleToRemove_IndexWithinCell );
-    Swarm_RemoveParticleFromCell( matSwarm, matParticleToRemove->owningCell, matParticleToRemove_IndexWithinCell );
+      /* The particles are homeless after these function-calls and for this reason alone must be destroyed */
+      Swarm_RemoveParticleFromCell( intSwarm, lCell_I, intParticleToRemove_IndexWithinCell );
+      Swarm_RemoveParticleFromCell( matSwarm, matParticleToRemove->owningCell, matParticleToRemove_IndexWithinCell );
 
-    /* Copy over particle to remove with the last particle in the particle array - as long as it isn't the last one  */
-    intLastParticle_IndexOnCPU = intSwarm->particleLocalCount - 1; /* lastParticle_I is the last particle in the array of particles residing on the current CPU */
-    matLastParticle_IndexOnCPU = matSwarm->particleLocalCount - 1; /* lastParticle_I is the last particle in the array of particles residing on the current CPU */
+      /* Copy over particle to remove with the last particle in the particle array - as long as it isn't the last one  */
+      intLastParticle_IndexOnCPU = intSwarm->particleLocalCount - 1; /* lastParticle_I is the last particle in the array of particles residing on the current CPU */
+      matLastParticle_IndexOnCPU = matSwarm->particleLocalCount - 1; /* lastParticle_I is the last particle in the array of particles residing on the current CPU */
 
-    /* we are switching places between the particle we are deleting and the last particle in the array
-       then actually deleting the last particle in the array */
-    intSwarmLastParticle = (IntegrationPoint*)Swarm_ParticleAt( intSwarm, intLastParticle_IndexOnCPU );
-    matSwarmLastParticle = (MaterialPoint*)Swarm_ParticleAt( matSwarm, matLastParticle_IndexOnCPU );
-    /* we have the last particles of both swarms now..
-       if the intSwarmLastParticle material ref does NOT point to the matSwarmLastParticle
-       then we might be in trouble...so test for this here */
-    refTestLastParticle = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intSwarmLastParticle); /* so we can get the material point */
-    //refToLastMatParticleFlag = 0;
-    if(refTestLastParticle->particle_I != matLastParticle_IndexOnCPU){
-        printf("\e[31mThe last int particle does NOT point to the last mat particle..we need to handle this\n\n");
-        printf("\e[0;32m");
-        refToLastMatParticle = getIntParticleMaterialRef_PointingToMaterialParticle( intSwarm, matLastParticle_IndexOnCPU );
-        refToLastMatParticle->particle_I = matParticleToRemove_IndexOnCPU;
-        refToLastMatParticleFlag = 1;
-        exit(0);
-        /* if the test here is true then that means that some other int particle points to the last material particle
-           and therefore *its* material ref needs to be updated when we move the last material particle.
-           It also means that we do not update the ref for the last int particle as that must be pointing somewhere
-           other than the last material particle and the mat particle that is somewhere else is not being moved.
-        */
-    }
-    if ( intParticleToRemove_IndexOnCPU != intLastParticle_IndexOnCPU ) {                                                                                                                       
-        //printf("Deleting int particle number %d from cell %d local cell particle num = %d\n\n", intParticleToRemove_IndexOnCPU ,lCell_I, intParticleToRemove_IndexWithinCell);                    
+      /* we are switching places between the particle we are deleting and the last particle in the array
+	 then actually deleting the last particle in the array */
+      intSwarmLastParticle = (IntegrationPoint*)Swarm_ParticleAt( intSwarm, intLastParticle_IndexOnCPU );
+      matSwarmLastParticle = (MaterialPoint*)Swarm_ParticleAt( matSwarm, matLastParticle_IndexOnCPU );
+      /* we have the last particles of both swarms now..
+	 if the intSwarmLastParticle material ref does NOT point to the matSwarmLastParticle
+	 then we might be in trouble...so test for this here */
+      refTestLastParticle = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intSwarmLastParticle); /* so we can get the material point */
+      //refToLastMatParticleFlag = 0;
+      if(refTestLastParticle->particle_I != matLastParticle_IndexOnCPU){
+	    printf("\e[31mThe last int particle does NOT point to the last mat particle..we need to handle this\n\n");
+	    printf("\e[0;32m");
+	    refToLastMatParticle = getIntParticleMaterialRef_PointingToMaterialParticle( intSwarm, matLastParticle_IndexOnCPU );
+	    refToLastMatParticle->particle_I = matParticleToRemove_IndexOnCPU;
+	    refToLastMatParticleFlag = 1;
+	    exit(0);
+	    /* if the test here is true then that means that some other int particle points to the last material particle
+               and therefore *its* material ref needs to be updated when we move the last material particle.
+	       It also means that we do not update the ref for the last int particle as that must be pointing somewhere
+	       other than the last material particle and the mat particle that is somewhere else is not being moved.
+	    */
+      }
+      if ( intParticleToRemove_IndexOnCPU != intLastParticle_IndexOnCPU ) {                                                                                                                       
+	    //printf("Deleting int particle number %d from cell %d local cell particle num = %d\n\n", intParticleToRemove_IndexOnCPU ,lCell_I, intParticleToRemove_IndexWithinCell);                    
                                                                                                                                                                                                 
-        intLastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intSwarmLastParticle->owningCell, intLastParticle_IndexOnCPU);                                              
+	    intLastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intSwarmLastParticle->owningCell, intLastParticle_IndexOnCPU);                                              
                                                                                                                                                                                                 
-        /* particleToRemove gets over-written by lastParticle  void *memcpy(void *dest, const void *src, size_t n); */                                                              
-        memcpy( intParticleToRemove, intSwarmLastParticle, intparticleSize );                                                                                                       
+	    /* particleToRemove gets over-written by lastParticle  void *memcpy(void *dest, const void *src, size_t n); */                                                              
+	    memcpy( intParticleToRemove, intSwarmLastParticle, intparticleSize );                                                                                                       
                                                                                                                                                                                                 
-        /* Change value in cell particle table to point to new index in localCPU particle array.                                                                                    
-           ok.. lastParticle_I is a global index of the last particle...we no longer have that many particles                                                                       
-           so give it a new index in the swarm...it has now assumed the identity of the particle that got removed...complete identity theft*/                                       
-        intSwarm->cellParticleTbl[ intSwarmLastParticle->owningCell ] [intLastParticle_IndexWithinCell ] = intParticleToRemove_IndexOnCPU;
-        if(!refToLastMatParticleFlag){                                                         
-            ref_moved_particle = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToRemove); /* so we can get the material point */
-            ref_moved_particle->particle_I = matParticleToRemove_IndexOnCPU;
-        }
-    }                                                                                                                                                                                 
-    intSwarm->particleLocalCount--; 
-    //Swarm_Realloc( intSwarm ); /* do I really want to do this EVERY time I delete a particle? No I don't hmmm*/
-    if ( matParticleToRemove_IndexOnCPU != matLastParticle_IndexOnCPU ) {                                                                                                                       
-        //printf("Deleting mat particle number %d from cell %d local cell particle num = %d\n\n", matParticleToRemove_IndexOnCPU, matParticleToRemove->owningCell, matParticleToRemove_IndexWithinCell);                    
+	    /* Change value in cell particle table to point to new index in localCPU particle array.                                                                                    
+	       ok.. lastParticle_I is a global index of the last particle...we no longer have that many particles                                                                       
+	       so give it a new index in the swarm...it has now assumed the identity of the particle that got removed...complete identity theft*/                                       
+	    intSwarm->cellParticleTbl[ intSwarmLastParticle->owningCell ] [intLastParticle_IndexWithinCell ] = intParticleToRemove_IndexOnCPU;
+	    if(!refToLastMatParticleFlag){                                                         
+		  ref_moved_particle = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToRemove); /* so we can get the material point */
+		  ref_moved_particle->particle_I = matParticleToRemove_IndexOnCPU;
+	    }
+      }                                                                                                                                                                                 
+      intSwarm->particleLocalCount--; 
+      //Swarm_Realloc( intSwarm ); /* do I really want to do this EVERY time I delete a particle? No I don't hmmm*/
+      if ( matParticleToRemove_IndexOnCPU != matLastParticle_IndexOnCPU ) {                                                                                                                       
+	    //printf("Deleting mat particle number %d from cell %d local cell particle num = %d\n\n", matParticleToRemove_IndexOnCPU, matParticleToRemove->owningCell, matParticleToRemove_IndexWithinCell);                    
                                                                                                                                                                                                 
-        matLastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( matSwarm, matSwarmLastParticle->owningCell, matLastParticle_IndexOnCPU);                                              
+	    matLastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( matSwarm, matSwarmLastParticle->owningCell, matLastParticle_IndexOnCPU);                                              
                                                                                                                                                                                                 
-        /* particleToRemove gets over-written by lastParticle  void *memcpy(void *dest, const void *src, size_t n); */                                                              
-        memcpy( matParticleToRemove, matSwarmLastParticle, matparticleSize );                                                                                                       
+	    /* particleToRemove gets over-written by lastParticle  void *memcpy(void *dest, const void *src, size_t n); */                                                              
+	    memcpy( matParticleToRemove, matSwarmLastParticle, matparticleSize );                                                                                                       
                                                                                                                                                                                                 
-        /* Change value in cell particle table to point to new index in localCPU particle array.                                                                                    
-           ok.. lastParticle_I is a global index of the last particle...we no longer have that many particles                                                                       
-           so give it a new index in the swarm...it has now assumed the identity of the particle that got removed...complete identity theft*/                                       
-        matSwarm->cellParticleTbl[ matSwarmLastParticle->owningCell][matLastParticle_IndexWithinCell ] = matParticleToRemove_IndexOnCPU;                                                          
+	    /* Change value in cell particle table to point to new index in localCPU particle array.                                                                                    
+	       ok.. lastParticle_I is a global index of the last particle...we no longer have that many particles                                                                       
+	       so give it a new index in the swarm...it has now assumed the identity of the particle that got removed...complete identity theft*/                                       
+	    matSwarm->cellParticleTbl[ matSwarmLastParticle->owningCell][matLastParticle_IndexWithinCell ] = matParticleToRemove_IndexOnCPU;                                                          
                                                                                                                                                                                                 
-    }                                                                                                                                                                                 
-    matSwarm->particleLocalCount--; 
-    //Swarm_Realloc( intSwarm ); /* do I really want to do this EVERY time I delete a particle? No I don't hmmm*/
+      }                                                                                                                                                                                 
+      matSwarm->particleLocalCount--; 
+      //Swarm_Realloc( intSwarm ); /* do I really want to do this EVERY time I delete a particle? No I don't hmmm*/
 	      
 }
 /****************************************************************************************************
@@ -440,1185 +450,1175 @@ void deleteIntParticleByIndexWithinCell(
  there is one material point and vice versa.
 ******************************************************************************************************/
 void deleteIntParticleByIndexOnCPU( IntegrationPointsSwarm*  intSwarm, MaterialPointsSwarm* matSwarm, Particle_Index intParticleToRemove_IndexOnCPU ) {
-    MaterialPointRef*       ref;
-    MaterialPointRef*       refTestLastParticle;
-    MaterialPointRef*       ref_moved_particle;
-    MaterialPointRef*   refToLastMatParticle;
-    int refToLastMatParticleFlag = 0;
-    //Particle_Index    intParticleToRemove_IndexOnCPU;/* the particle number within the swarm on the local CPU */
-    Particle_Index    matParticleToRemove_IndexOnCPU;
-    IntegrationPoint* intParticleToRemove;
-    MaterialPoint*    matParticleToRemove;
-    Particle_Index    intParticleToRemove_IndexWithinCell;/* the number of the particle within the cell */
-    Particle_Index    matParticleToRemove_IndexWithinCell;
-    IntegrationPoint* intSwarmLastParticle; /* The last particle in the swarm on the local CPU */
-    MaterialPoint*    matSwarmLastParticle;
-    Particle_Index    intLastParticle_IndexOnCPU;
-    Particle_Index    matLastParticle_IndexOnCPU;
-    Particle_Index    intLastParticle_IndexWithinCell;
-    Particle_Index    matLastParticle_IndexWithinCell;
-    Cell_LocalIndex lCell_I;
+      MaterialPointRef*       ref;
+      MaterialPointRef*       refTestLastParticle;
+      MaterialPointRef*       ref_moved_particle;
+      MaterialPointRef*   refToLastMatParticle;
+      int refToLastMatParticleFlag = 0;
+      //Particle_Index    intParticleToRemove_IndexOnCPU;/* the particle number within the swarm on the local CPU */
+      Particle_Index    matParticleToRemove_IndexOnCPU;
+      IntegrationPoint* intParticleToRemove;
+      MaterialPoint*    matParticleToRemove;
+      Particle_Index    intParticleToRemove_IndexWithinCell;/* the number of the particle within the cell */
+      Particle_Index    matParticleToRemove_IndexWithinCell;
+      IntegrationPoint* intSwarmLastParticle; /* The last particle in the swarm on the local CPU */
+      MaterialPoint*    matSwarmLastParticle;
+      Particle_Index    intLastParticle_IndexOnCPU;
+      Particle_Index    matLastParticle_IndexOnCPU;
+      Particle_Index    intLastParticle_IndexWithinCell;
+      Particle_Index    matLastParticle_IndexWithinCell;
+      Cell_LocalIndex lCell_I;
 
 
-    SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
-    SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
+      SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
+      SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
 
-    //intParticleToRemove_IndexOnCPU  = intSwarm->cellParticleTbl[ lCell_I ][ intParticleToRemove_IndexWithinCell ];
-    intParticleToRemove =  (IntegrationPoint*)Swarm_ParticleAt( intSwarm, intParticleToRemove_IndexOnCPU);
+      //intParticleToRemove_IndexOnCPU  = intSwarm->cellParticleTbl[ lCell_I ][ intParticleToRemove_IndexWithinCell ];
+      intParticleToRemove =  (IntegrationPoint*)Swarm_ParticleAt( intSwarm, intParticleToRemove_IndexOnCPU);
 
-    intParticleToRemove_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intParticleToRemove->owningCell, intParticleToRemove_IndexOnCPU);
+      intParticleToRemove_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intParticleToRemove->owningCell, intParticleToRemove_IndexOnCPU);
 
-    lCell_I = intParticleToRemove->owningCell;
+      lCell_I = intParticleToRemove->owningCell;
 
-    ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToRemove); /* so we can get the material point */
-    matParticleToRemove_IndexOnCPU = ref->particle_I;
-    matParticleToRemove =  (MaterialPoint*)Swarm_ParticleAt( matSwarm, matParticleToRemove_IndexOnCPU);
-    matParticleToRemove_IndexWithinCell = Swarm_GetParticleIndexWithinCell( matSwarm, matParticleToRemove->owningCell, matParticleToRemove_IndexOnCPU);
+      ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToRemove); /* so we can get the material point */
+      matParticleToRemove_IndexOnCPU = ref->particle_I;
+      matParticleToRemove =  (MaterialPoint*)Swarm_ParticleAt( matSwarm, matParticleToRemove_IndexOnCPU);
+      matParticleToRemove_IndexWithinCell = Swarm_GetParticleIndexWithinCell( matSwarm, matParticleToRemove->owningCell, matParticleToRemove_IndexOnCPU);
 
-    /* The particles are homeless after these function-calls and for this reason alone must be destroyed */
-    Swarm_RemoveParticleFromCell( intSwarm, lCell_I, intParticleToRemove_IndexWithinCell );
-    Swarm_RemoveParticleFromCell( matSwarm, matParticleToRemove->owningCell, matParticleToRemove_IndexWithinCell );
+      /* The particles are homeless after these function-calls and for this reason alone must be destroyed */
+      Swarm_RemoveParticleFromCell( intSwarm, lCell_I, intParticleToRemove_IndexWithinCell );
+      Swarm_RemoveParticleFromCell( matSwarm, matParticleToRemove->owningCell, matParticleToRemove_IndexWithinCell );
 
-    /* Copy over particle to remove with the last particle in the particle array - as long as it isn't the last one  */
-    intLastParticle_IndexOnCPU = intSwarm->particleLocalCount - 1; /* lastParticle_I is the last particle in the array of particles residing on the current CPU */
-    matLastParticle_IndexOnCPU = matSwarm->particleLocalCount - 1; /* lastParticle_I is the last particle in the array of particles residing on the current CPU */
+      /* Copy over particle to remove with the last particle in the particle array - as long as it isn't the last one  */
+      intLastParticle_IndexOnCPU = intSwarm->particleLocalCount - 1; /* lastParticle_I is the last particle in the array of particles residing on the current CPU */
+      matLastParticle_IndexOnCPU = matSwarm->particleLocalCount - 1; /* lastParticle_I is the last particle in the array of particles residing on the current CPU */
 
-    /* we are switching places between the particle we are deleting and the last particle in the array
-       then actually deleting the last particle in the array */
-    intSwarmLastParticle = (IntegrationPoint*)Swarm_ParticleAt( intSwarm, intLastParticle_IndexOnCPU );
-    matSwarmLastParticle = (MaterialPoint*)Swarm_ParticleAt( matSwarm, matLastParticle_IndexOnCPU );
-    /* we have the last particles of both swarms now..
-       if the intSwarmLastParticle material ref does NOT point to the matSwarmLastParticle
-       then we might be in trouble...so test for this here */
-    refTestLastParticle = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intSwarmLastParticle); /* so we can get the material point */
-    //refToLastMatParticleFlag = 0;
-    if(refTestLastParticle->particle_I != matLastParticle_IndexOnCPU){
-        printf("\e[31mThe last int particle does NOT point to the last mat particle..we need to handle this\n\n");
-        printf("\e[0;32m");
-        refToLastMatParticle = getIntParticleMaterialRef_PointingToMaterialParticle( intSwarm, matLastParticle_IndexOnCPU );
-        refToLastMatParticle->particle_I = matParticleToRemove_IndexOnCPU;
-        refToLastMatParticleFlag = 1;
-        exit(0);
-        /* if the test here is true then that means that some other int particle points to the last material particle
-           and therefore *its* material ref needs to be updated when we move the last material particle.
-           It also means that we do not update the ref for the last int particle as that must be pointing somewhere
-           other than the last material particle and the mat particle that is somewhere else is not being moved.
-        */
-    }
+      /* we are switching places between the particle we are deleting and the last particle in the array
+	 then actually deleting the last particle in the array */
+      intSwarmLastParticle = (IntegrationPoint*)Swarm_ParticleAt( intSwarm, intLastParticle_IndexOnCPU );
+      matSwarmLastParticle = (MaterialPoint*)Swarm_ParticleAt( matSwarm, matLastParticle_IndexOnCPU );
+      /* we have the last particles of both swarms now..
+	 if the intSwarmLastParticle material ref does NOT point to the matSwarmLastParticle
+	 then we might be in trouble...so test for this here */
+      refTestLastParticle = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intSwarmLastParticle); /* so we can get the material point */
+      //refToLastMatParticleFlag = 0;
+      if(refTestLastParticle->particle_I != matLastParticle_IndexOnCPU){
+	    printf("\e[31mThe last int particle does NOT point to the last mat particle..we need to handle this\n\n");
+	    printf("\e[0;32m");
+	    refToLastMatParticle = getIntParticleMaterialRef_PointingToMaterialParticle( intSwarm, matLastParticle_IndexOnCPU );
+	    refToLastMatParticle->particle_I = matParticleToRemove_IndexOnCPU;
+	    refToLastMatParticleFlag = 1;
+	    exit(0);
+	    /* if the test here is true then that means that some other int particle points to the last material particle
+               and therefore *its* material ref needs to be updated when we move the last material particle.
+	       It also means that we do not update the ref for the last int particle as that must be pointing somewhere
+	       other than the last material particle and the mat particle that is somewhere else is not being moved.
+	    */
+      }
 
-    if ( intParticleToRemove_IndexOnCPU != intLastParticle_IndexOnCPU ) {
-        //printf("Deleting int particle number %d from cell %d local cell particle num = %d\n\n", intParticleToRemove_IndexOnCPU ,lCell_I, intParticleToRemove_IndexWithinCell);
+      if ( intParticleToRemove_IndexOnCPU != intLastParticle_IndexOnCPU ) {
+	    //printf("Deleting int particle number %d from cell %d local cell particle num = %d\n\n", intParticleToRemove_IndexOnCPU ,lCell_I, intParticleToRemove_IndexWithinCell);
 
-        intLastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intSwarmLastParticle->owningCell, intLastParticle_IndexOnCPU);
+	    intLastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intSwarmLastParticle->owningCell, intLastParticle_IndexOnCPU);
       
-        /* particleToRemove gets over-written by lastParticle  void *memcpy(void *dest, const void *src, size_t n); */                                                              
-        memcpy( intParticleToRemove, intSwarmLastParticle, intparticleSize );
+	    /* particleToRemove gets over-written by lastParticle  void *memcpy(void *dest, const void *src, size_t n); */                                                              
+	    memcpy( intParticleToRemove, intSwarmLastParticle, intparticleSize );
 
-        /* Change value in cell particle table to point to new index in localCPU particle array.
-           ok.. lastParticle_I is a global index of the last particle...we no longer have that many particles                                                                       
-           so give it a new index in the swarm...it has now assumed the identity of the particle that got removed...complete identity theft*/                                       
-        intSwarm->cellParticleTbl[ intSwarmLastParticle->owningCell ] [intLastParticle_IndexWithinCell ] = intParticleToRemove_IndexOnCPU;
-        if(!refToLastMatParticleFlag){
-            ref_moved_particle = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToRemove); /* so we can get the material point */
-            ref_moved_particle->particle_I = matParticleToRemove_IndexOnCPU;
-        }
-    }
+	    /* Change value in cell particle table to point to new index in localCPU particle array.
+	       ok.. lastParticle_I is a global index of the last particle...we no longer have that many particles                                                                       
+	       so give it a new index in the swarm...it has now assumed the identity of the particle that got removed...complete identity theft*/                                       
+	    intSwarm->cellParticleTbl[ intSwarmLastParticle->owningCell ] [intLastParticle_IndexWithinCell ] = intParticleToRemove_IndexOnCPU;
+	    if(!refToLastMatParticleFlag){
+		  ref_moved_particle = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToRemove); /* so we can get the material point */
+		  ref_moved_particle->particle_I = matParticleToRemove_IndexOnCPU;
+	    }
+      }
 
-    intSwarm->particleLocalCount--; 
-    //Swarm_Realloc( intSwarm ); /* do I really want to do this EVERY time I delete a particle? No I don't hmmm*/
-    if ( matParticleToRemove_IndexOnCPU != matLastParticle_IndexOnCPU ) {                                                                                                                       
-        //printf("Deleting mat particle number %d from cell %d local cell particle num = %d\n\n", matParticleToRemove_IndexOnCPU, matParticleToRemove->owningCell, matParticleToRemove_IndexWithinCell);                    
+      intSwarm->particleLocalCount--; 
+      //Swarm_Realloc( intSwarm ); /* do I really want to do this EVERY time I delete a particle? No I don't hmmm*/
+      if ( matParticleToRemove_IndexOnCPU != matLastParticle_IndexOnCPU ) {                                                                                                                       
+	    //printf("Deleting mat particle number %d from cell %d local cell particle num = %d\n\n", matParticleToRemove_IndexOnCPU, matParticleToRemove->owningCell, matParticleToRemove_IndexWithinCell);                    
                                                                                                                                                                                                 
-        matLastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( matSwarm, matSwarmLastParticle->owningCell, matLastParticle_IndexOnCPU);                                              
+	    matLastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( matSwarm, matSwarmLastParticle->owningCell, matLastParticle_IndexOnCPU);                                              
                                                                                                                                                                                                 
-        /* particleToRemove gets over-written by lastParticle  void *memcpy(void *dest, const void *src, size_t n); */                                                              
-        memcpy( matParticleToRemove, matSwarmLastParticle, matparticleSize );                                                                                                       
+	    /* particleToRemove gets over-written by lastParticle  void *memcpy(void *dest, const void *src, size_t n); */                                                              
+	    memcpy( matParticleToRemove, matSwarmLastParticle, matparticleSize );                                                                                                       
                                                                                                                                                                                                 
-        /* Change value in cell particle table to point to new index in localCPU particle array.                                                                                    
-           ok.. lastParticle_I is a global index of the last particle...we no longer have that many particles                                                                       
-           so give it a new index in the swarm...it has now assumed the identity of the particle that got removed...complete identity theft*/                                       
-        matSwarm->cellParticleTbl[ matSwarmLastParticle->owningCell][matLastParticle_IndexWithinCell ] = matParticleToRemove_IndexOnCPU;                                                          
+	    /* Change value in cell particle table to point to new index in localCPU particle array.                                                                                    
+	       ok.. lastParticle_I is a global index of the last particle...we no longer have that many particles                                                                       
+	       so give it a new index in the swarm...it has now assumed the identity of the particle that got removed...complete identity theft*/                                       
+	    matSwarm->cellParticleTbl[ matSwarmLastParticle->owningCell][matLastParticle_IndexWithinCell ] = matParticleToRemove_IndexOnCPU;                                                          
                                                                                                                                                                                                 
-    }                                                                                                                                                                                 
-    matSwarm->particleLocalCount--; 
-    //Swarm_Realloc( intSwarm ); /* do I really want to do this EVERY time I delete a particle? No I don't hmmm*/
+      }                                                                                                                                                                                 
+      matSwarm->particleLocalCount--; 
+      //Swarm_Realloc( intSwarm ); /* do I really want to do this EVERY time I delete a particle? No I don't hmmm*/
 	      
 }
 void splitIntParticleByIndexWithinCell( IntegrationPointsSwarm*  intSwarm, MaterialPointsSwarm* matSwarm, Cell_LocalIndex lCell_I, Particle_Index intParticleToSplit_IndexWithinCell, Coord xi ) {
-    MaterialPointRef*       ref;
-    Particle_Index    intNewParticle_IndexOnCPU;/* the particle number within the swarm on the local CPU */
-    Particle_Index    matNewParticle_IndexOnCPU;
-    IntegrationPoint* intNewParticle;
-    MaterialPoint*    matNewParticle;
-    Particle_Index    intNewParticle_IndexWithinCell;/* the number of the particle within the cell */
-    //Particle_Index    matNewParticle_IndexWithinCell;
-    IntegrationPoint* intParticleToSplit;
-    MaterialPoint*    matParticleToSplit;
-    //Particle_Index    intParticleToSplit_IndexWithinCell;
-    //Particle_Index    matParticleToSplit_IndexWithinCell;
-    Particle_Index    matParticleToSplit_IndexOnCPU;
+      MaterialPointRef*       ref;
+      Particle_Index    intNewParticle_IndexOnCPU;/* the particle number within the swarm on the local CPU */
+      Particle_Index    matNewParticle_IndexOnCPU;
+      IntegrationPoint* intNewParticle;
+      MaterialPoint*    matNewParticle;
+      Particle_Index    intNewParticle_IndexWithinCell;/* the number of the particle within the cell */
+      //Particle_Index    matNewParticle_IndexWithinCell;
+      IntegrationPoint* intParticleToSplit;
+      MaterialPoint*    matParticleToSplit;
+      //Particle_Index    intParticleToSplit_IndexWithinCell;
+      //Particle_Index    matParticleToSplit_IndexWithinCell;
+      Particle_Index    matParticleToSplit_IndexOnCPU;
 //      SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
 //      SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
-    Coord                   newCoord;
+      Coord                   newCoord;
 //      Coord                   xi;
 
-    FeMesh*     mesh              = (FeMesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
+      FeMesh*     mesh              = (FeMesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
 
 	      
-    //intParticleToSplit_IndexWithinCell = maxI;
+      //intParticleToSplit_IndexWithinCell = maxI;
 
-    /* Add a new particle to end the end of each swarm */
-    /* this calls Swarm_Realloc -- don't like reallocing every time we create a particle
-       need to do this differently */
-    intNewParticle     = (IntegrationPoint*) Swarm_CreateNewParticle( intSwarm, &intNewParticle_IndexOnCPU );
-    matNewParticle     = (MaterialPoint*) Swarm_CreateNewParticle( matSwarm, &matNewParticle_IndexOnCPU );
+      /* Add a new particle to end the end of each swarm */
+      /* this calls Swarm_Realloc -- don't like reallocing every time we create a particle
+	 need to do this differently */
+      intNewParticle     = (IntegrationPoint*) Swarm_CreateNewParticle( intSwarm, &intNewParticle_IndexOnCPU );
+      matNewParticle     = (MaterialPoint*) Swarm_CreateNewParticle( matSwarm, &matNewParticle_IndexOnCPU );
 	      
-    /* Copy particle information */
-    intParticleToSplit = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, intParticleToSplit_IndexWithinCell );
-    memcpy( intNewParticle, intParticleToSplit, intSwarm->particleExtensionMgr->finalSize );
-    Swarm_AddParticleToCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU );
-    ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intNewParticle); /* so we can set the reference to the material point */
-    ref->particle_I = matNewParticle_IndexOnCPU; /* now the ref for the new int particle points to the new material particle -- the swarm id should be correct because we memcpy'd from the original */
+      /* Copy particle information */
+      intParticleToSplit = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, intParticleToSplit_IndexWithinCell );
+      memcpy( intNewParticle, intParticleToSplit, intSwarm->particleExtensionMgr->finalSize );
+      Swarm_AddParticleToCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU );
+      ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intNewParticle); /* so we can set the reference to the material point */
+      ref->particle_I = matNewParticle_IndexOnCPU; /* now the ref for the new int particle points to the new material particle -- the swarm id should be correct because we memcpy'd from the original */
 
-    /* Now get the material point corresponding to the int point being split so that
-       we can copy the material properties to the newly created material particle */
-    ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToSplit);
-    matParticleToSplit_IndexOnCPU = ref->particle_I;
-    matParticleToSplit  =  (MaterialPoint*)Swarm_ParticleAt( matSwarm, matParticleToSplit_IndexOnCPU );
-    memcpy( matNewParticle, matParticleToSplit, matSwarm->particleExtensionMgr->finalSize );
-    Swarm_AddParticleToCell( matSwarm, matNewParticle->owningCell, matNewParticle_IndexOnCPU );
+      /* Now get the material point corresponding to the int point being split so that
+	 we can copy the material properties to the newly created material particle */
+      ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToSplit);
+      matParticleToSplit_IndexOnCPU = ref->particle_I;
+      matParticleToSplit  =  (MaterialPoint*)Swarm_ParticleAt( matSwarm, matParticleToSplit_IndexOnCPU );
+      memcpy( matNewParticle, matParticleToSplit, matSwarm->particleExtensionMgr->finalSize );
+      Swarm_AddParticleToCell( matSwarm, matNewParticle->owningCell, matNewParticle_IndexOnCPU );
 
-    /* Copy new local position to xi on new int particle */
-    memcpy( intNewParticle->xi, xi, sizeof(Coord) );
+      /* Copy new local position to xi on new int particle */
+      memcpy( intNewParticle->xi, xi, sizeof(Coord) );
 	      
-    /* Get new Global Coordinates from the Local Coordinates */
-    FeMesh_CoordLocalToGlobal( mesh, lCell_I, xi, newCoord );
+      /* Get new Global Coordinates from the Local Coordinates */
+      FeMesh_CoordLocalToGlobal( mesh, lCell_I, xi, newCoord );
 
-    /* Copy new global position to coord on new mat particle */
-    memcpy( matNewParticle->coord, newCoord, sizeof(Coord) );
+      /* Copy new global position to coord on new mat particle */
+      memcpy( matNewParticle->coord, newCoord, sizeof(Coord) );
 	      
-    intNewParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU);
-    /*
-      printf("\e[1;33m");
-      printf("Creating int particle number %d from cell %d local within cell particle num = %d\n\n", intNewParticle_IndexOnCPU ,lCell_I, intNewParticle_IndexWithinCell);
-      printf("matSwarm particle count is now : %d\n",matSwarm->cellParticleCountTbl[lCell_I]);
-      printf("intSwarm particle count is now : %d\n",intSwarm->cellParticleCountTbl[lCell_I]);
-      printf("Original Population was %d\n",nump-1);
-      printf("\e[0;32m");
-    */
+      intNewParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU);
+      /*
+	printf("\e[1;33m");
+	printf("Creating int particle number %d from cell %d local within cell particle num = %d\n\n", intNewParticle_IndexOnCPU ,lCell_I, intNewParticle_IndexWithinCell);
+	printf("matSwarm particle count is now : %d\n",matSwarm->cellParticleCountTbl[lCell_I]);
+	printf("intSwarm particle count is now : %d\n",intSwarm->cellParticleCountTbl[lCell_I]);
+	printf("Original Population was %d\n",nump-1);
+	printf("\e[0;32m");
+      */
 
 }
 void splitIntParticleByIndexOnCPU( IntegrationPointsSwarm*  intSwarm, MaterialPointsSwarm* matSwarm, Particle_Index intParticleToSplit_IndexOnCPU, Coord xi ) {
-    MaterialPointRef*       ref;
-    Particle_Index    intNewParticle_IndexOnCPU;/* the particle number within the swarm on the local CPU */
-    Particle_Index    matNewParticle_IndexOnCPU;
-    IntegrationPoint* intNewParticle;
-    MaterialPoint*    matNewParticle;
-    Particle_Index    intNewParticle_IndexWithinCell;/* the number of the particle within the cell */
-    //Particle_Index    matNewParticle_IndexWithinCell;
-    IntegrationPoint* intParticleToSplit;
-    MaterialPoint*    matParticleToSplit;
-    Particle_Index    intParticleToSplit_IndexWithinCell;
-    //Particle_Index    matParticleToSplit_IndexWithinCell;
-    Particle_Index    matParticleToSplit_IndexOnCPU;
+      MaterialPointRef*       ref;
+      Particle_Index    intNewParticle_IndexOnCPU;/* the particle number within the swarm on the local CPU */
+      Particle_Index    matNewParticle_IndexOnCPU;
+      IntegrationPoint* intNewParticle;
+      MaterialPoint*    matNewParticle;
+      Particle_Index    intNewParticle_IndexWithinCell;/* the number of the particle within the cell */
+      //Particle_Index    matNewParticle_IndexWithinCell;
+      IntegrationPoint* intParticleToSplit;
+      MaterialPoint*    matParticleToSplit;
+      Particle_Index    intParticleToSplit_IndexWithinCell;
+      //Particle_Index    matParticleToSplit_IndexWithinCell;
+      Particle_Index    matParticleToSplit_IndexOnCPU;
 //      SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
 //      SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
-    Coord                   newCoord;
+      Coord                   newCoord;
 //      Coord                   xi;
 
-    Cell_LocalIndex lCell_I;
+      Cell_LocalIndex lCell_I;
 
-    FeMesh*     mesh              = (FeMesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
+      FeMesh*     mesh              = (FeMesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
 
 	      
-    //intParticleToSplit_IndexWithinCell = maxI;
+      //intParticleToSplit_IndexWithinCell = maxI;
 
-    /* Add a new particle to end the end of each swarm */
-    /* this calls Swarm_Realloc -- don't like reallocing every time we create a particle
-       need to do this differently */
-    intNewParticle     = (IntegrationPoint*) Swarm_CreateNewParticle( intSwarm, &intNewParticle_IndexOnCPU );
-    matNewParticle     = (MaterialPoint*) Swarm_CreateNewParticle( matSwarm, &matNewParticle_IndexOnCPU );
+      /* Add a new particle to end the end of each swarm */
+      /* this calls Swarm_Realloc -- don't like reallocing every time we create a particle
+	 need to do this differently */
+      intNewParticle     = (IntegrationPoint*) Swarm_CreateNewParticle( intSwarm, &intNewParticle_IndexOnCPU );
+      matNewParticle     = (MaterialPoint*) Swarm_CreateNewParticle( matSwarm, &matNewParticle_IndexOnCPU );
 	      
 
 
-    /* Copy particle information */
-    intParticleToSplit_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intParticleToSplit->owningCell, intParticleToSplit_IndexOnCPU);
+      /* Copy particle information */
+      intParticleToSplit_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intParticleToSplit->owningCell, intParticleToSplit_IndexOnCPU);
 
-    intParticleToSplit = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, intParticleToSplit_IndexWithinCell );
+      intParticleToSplit = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, intParticleToSplit_IndexWithinCell );
 
 
-    lCell_I = intParticleToSplit->owningCell;
+      lCell_I = intParticleToSplit->owningCell;
 
 
-    memcpy( intNewParticle, intParticleToSplit, intSwarm->particleExtensionMgr->finalSize );
-    Swarm_AddParticleToCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU );
-    ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intNewParticle); /* so we can set the reference to the material point */
-    ref->particle_I = matNewParticle_IndexOnCPU; /* now the ref for the new int particle points to the new material particle -- the swarm id should be correct because we memcpy'd from the original */
+      memcpy( intNewParticle, intParticleToSplit, intSwarm->particleExtensionMgr->finalSize );
+      Swarm_AddParticleToCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU );
+      ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intNewParticle); /* so we can set the reference to the material point */
+      ref->particle_I = matNewParticle_IndexOnCPU; /* now the ref for the new int particle points to the new material particle -- the swarm id should be correct because we memcpy'd from the original */
 
-    /* Now get the material point corresponding to the int point being split so that
-       we can copy the material properties to the newly created material particle */
-    ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToSplit);
-    matParticleToSplit_IndexOnCPU = ref->particle_I;
-    matParticleToSplit  =  (MaterialPoint*)Swarm_ParticleAt( matSwarm, matParticleToSplit_IndexOnCPU );
-    memcpy( matNewParticle, matParticleToSplit, matSwarm->particleExtensionMgr->finalSize );
-    Swarm_AddParticleToCell( matSwarm, matNewParticle->owningCell, matNewParticle_IndexOnCPU );
+      /* Now get the material point corresponding to the int point being split so that
+	 we can copy the material properties to the newly created material particle */
+      ref = OneToOneMapper_GetMaterialRef(intSwarm->mapper, intParticleToSplit);
+      matParticleToSplit_IndexOnCPU = ref->particle_I;
+      matParticleToSplit  =  (MaterialPoint*)Swarm_ParticleAt( matSwarm, matParticleToSplit_IndexOnCPU );
+      memcpy( matNewParticle, matParticleToSplit, matSwarm->particleExtensionMgr->finalSize );
+      Swarm_AddParticleToCell( matSwarm, matNewParticle->owningCell, matNewParticle_IndexOnCPU );
 
-    /* Copy new local position to xi on new int particle */
-    memcpy( intNewParticle->xi, xi, sizeof(Coord) );
+      /* Copy new local position to xi on new int particle */
+      memcpy( intNewParticle->xi, xi, sizeof(Coord) );
 	      
-    /* Get new Global Coordinates from the Local Coordinates */
-    FeMesh_CoordLocalToGlobal( mesh, lCell_I, xi, newCoord );
+      /* Get new Global Coordinates from the Local Coordinates */
+      FeMesh_CoordLocalToGlobal( mesh, lCell_I, xi, newCoord );
 
-    /* Copy new global position to coord on new mat particle */
-    memcpy( matNewParticle->coord, newCoord, sizeof(Coord) );
+      /* Copy new global position to coord on new mat particle */
+      memcpy( matNewParticle->coord, newCoord, sizeof(Coord) );
 	      
-    intNewParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU);
-    /*
-      printf("\e[1;33m");
-      printf("Creating int particle number %d from cell %d local within cell particle num = %d\n\n", intNewParticle_IndexOnCPU ,lCell_I, intNewParticle_IndexWithinCell);
-      printf("matSwarm particle count is now : %d\n",matSwarm->cellParticleCountTbl[lCell_I]);
-      printf("intSwarm particle count is now : %d\n",intSwarm->cellParticleCountTbl[lCell_I]);
-      printf("Original Population was %d\n",nump-1);
-      printf("\e[0;32m");
-    */
+      intNewParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, lCell_I, intNewParticle_IndexOnCPU);
+      /*
+	printf("\e[1;33m");
+	printf("Creating int particle number %d from cell %d local within cell particle num = %d\n\n", intNewParticle_IndexOnCPU ,lCell_I, intNewParticle_IndexWithinCell);
+	printf("matSwarm particle count is now : %d\n",matSwarm->cellParticleCountTbl[lCell_I]);
+	printf("intSwarm particle count is now : %d\n",intSwarm->cellParticleCountTbl[lCell_I]);
+	printf("Original Population was %d\n",nump-1);
+	printf("\e[0;32m");
+      */
 
 }
 /* sort indexOnCPU in reverse order */
 int compare_indexOnCPU(const void * _particleA, const void * _particleB){
-    struct deleteParticle * particleA = (struct deleteParticle *) _particleA;
-    struct deleteParticle * particleB = (struct deleteParticle *) _particleB;
+      struct deleteParticle * particleA = (struct deleteParticle *) _particleA;
+      struct deleteParticle * particleB = (struct deleteParticle *) _particleB;
       
-    if(particleA->indexOnCPU < particleB->indexOnCPU)
-        return 1;
-    else
-        return -1;
+      if(particleA->indexOnCPU < particleB->indexOnCPU)
+	    return 1;
+      else
+	    return -1;
 
 }
 int compare_ints(const void * _A, const void * _B){
-    int *A = (int *) _A;
-    int *B = (int *) _B;
-    if(*A > *B) return 1; else return -1;
+      int *A = (int *) _A;
+      int *B = (int *) _B;
+      if(*A > *B) return 1; else return -1;
 }
 #if 0
 void buildPVCList(int **particleVornoiCellList, struct particle2d *pList, struct cell2d *cells, int *VCsize, double da, int nump, int XY, int dim){
-    int oneOda = (int)(1.0/da + 0.5);
-    int i,j;
-    int *count = (int)malloc(nump*sizeof(int));
+      int oneOda = (int)(1.0/da + 0.5);
+      int i,j;
+      int *count = (int)malloc(nump*sizeof(int));
       
-    for(i=0;i<nump;i++){ 
-        count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
-        VCsize[i] = count[i];
-        //countSum += count[i];//for debugging
-        //wSum += pList[i].w;//for debugging
-        particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
-    }
-    for(i=0;i<XY;i++){// traverse the grid
-        /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
-            internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
-        //if(VCsize[cells[i].p] != 0){// in case a particle is unresolved
-        if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
-            particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
-            count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
-            //countSum++;
-        }
-        //}
-    }
-    free(count);
+      for(i=0;i<nump;i++){ 
+	    count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
+	    VCsize[i] = count[i];
+	    //countSum += count[i];//for debugging
+	    //wSum += pList[i].w;//for debugging
+	    particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
+      }
+      for(i=0;i<XY;i++){// traverse the grid
+	    /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
+		internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
+	    //if(VCsize[cells[i].p] != 0){// in case a particle is unresolved
+	    if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
+		  particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
+		  count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
+		  //countSum++;
+	    }
+	    //}
+      }
+      free(count);
 }
 #endif
 /* Calculate the integration weights for each particle by contructing
    a voronoi diagram in an element in 3D*/
 void _PCDVC_Calculate3D( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I ) {
-    PCDVC*             self            = (PCDVC*)  pcdvc;
-    IntegrationPointsSwarm*  intSwarm  = (IntegrationPointsSwarm*) _swarm;
-    MaterialPointsSwarm* matSwarm =	(MaterialPointsSwarm*) self->materialPointsSwarm;
-    /* CoincidentMapper is a special case of the one to one mapper */
-    //CoincidentMapper* mapper  = (CoincidentMapper*)(intSwarm->mapper); /* need the mapper after-all to update the material ref */
-    Particle_InCellIndex         cParticleCount;
-    IntegrationPoint**           particle;
-    static int visited = 0 ;
-    //static int deleted = 0 ;
-    double dx,dy,dz,da;
-    static struct cell *cells;// the connected grid
-    struct particle *pList;// particle List
-    struct chain *bchain;//boundary chain
-    int nump_orig,nump,numx,numy,numz;
-    double BBXMIN = -1.0; // the ranges of the local coordinates of a FEM cell.
-    double BBXMAX = 1.0;
-    double BBYMIN = -1.0;
-    double BBYMAX = 1.0;
-    double BBZMIN = -1.0;
-    double BBZMAX = 1.0;
-    int i,k;
+	PCDVC*             self            = (PCDVC*)  pcdvc;
+	IntegrationPointsSwarm*  intSwarm  = (IntegrationPointsSwarm*) _swarm;
+        MaterialPointsSwarm* matSwarm =	(MaterialPointsSwarm*) self->materialPointsSwarm;
+	/* CoincidentMapper is a special case of the one to one mapper */
+	//CoincidentMapper* mapper  = (CoincidentMapper*)(intSwarm->mapper); /* need the mapper after-all to update the material ref */
+	Particle_InCellIndex         cParticleCount;
+	IntegrationPoint**           particle;
+	static int visited = 0 ;
+	//static int deleted = 0 ;
+	double dx,dy,dz,da;
+	static struct cell *cells;// the connected grid
+	struct particle *pList;// particle List
+	struct chain *bchain;//boundary chain
+	int nump_orig,nump,numx,numy,numz;
+	double BBXMIN = -1.0; // the ranges of the local coordinates of a FEM cell.
+	double BBXMAX = 1.0;
+	double BBYMIN = -1.0;
+	double BBYMAX = 1.0;
+	double BBZMIN = -1.0;
+	double BBZMAX = 1.0;
+	int i,k;
 
-    /*************************************/
-    /* stuff for particle removal/adding */
-    struct deleteParticle* deleteList;
-    double maxW,minW;
-    int maxI, minI;
-    double lowT = self->lowerT;
-    double upT = self->upperT;
-    int delete_flag, split_flag;
-    Particle_Index  *splitList;
+	/*************************************/
+	/* stuff for particle removal/adding */
+	struct deleteParticle* deleteList;
+	double maxW,minW;
+	int maxI, minI;
+	double lowT = self->lowerT;
+	double upT = self->upperT;
+	int delete_flag, split_flag;
+	Particle_Index  *splitList;
 //	int deleteListStackPtr = -1;/* use a number to tell me how many particles we are going to delete: saves doing it some other less efficient way */
 //	int splitListStackPtr = -1;
-    int maxDeletions = self->maxDeletions;/* hard setting this till I get stuff from xml file */
-    int maxSplits = self->maxSplits;
-    int splitCount;
-    int deleteCount;
-    int Count;
-    int matTypeFirst;
-    int matType;
-    Bool splitInInterfaceCells  = self->splitInInterfaceCells;
-    Bool deleteInInterfaceCells = self->deleteInInterfaceCells;
-    Bool Inflow = self->Inflow;
-    double Thresh = self->Threshold;
-    int ParticlesPerCell = self->ParticlesPerCell;
-    double CentPosRatio = self->CentPosRatio;
+	int maxDeletions = self->maxDeletions;/* hard setting this till I get stuff from xml file */
+	int maxSplits = self->maxSplits;
+	int splitCount;
+	int deleteCount;
+	int Count;
+	int matTypeFirst;
+	int matType;
+	Bool splitInInterfaceCells  = self->splitInInterfaceCells;
+   Bool deleteInInterfaceCells = self->deleteInInterfaceCells;
+	Bool Inflow = self->Inflow;
+	double Thresh = self->Threshold;
+	int ParticlesPerCell = self->ParticlesPerCell;
+	double CentPosRatio = self->CentPosRatio;
 //	SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
 //	SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
 //	Coord                   newCoord;
-    Coord                   xi;
+	Coord                   xi;
 
 //	FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
 
-    /* end decs needed for particle control */
-    /*************************************/
+	/* end decs needed for particle control */
+	/*************************************/
 	
 
 
-    numx = self->resX;
-    numy = self->resY;
-    numz = self->resZ;
+	numx = self->resX;
+	numy = self->resY;
+	numz = self->resZ;
 
-    nump_orig = nump = cParticleCount = intSwarm->cellParticleCountTbl[lCell_I];
+	nump_orig = nump = cParticleCount = intSwarm->cellParticleCountTbl[lCell_I];
 
-    Journal_Firewall( nump , Journal_Register( Error_Type, (Name)"PCDVC" ), "Error in %s: Problem has an under resolved cell (Cell Id = %d), add more particles to your model\n", __func__, lCell_I );
+	Journal_Firewall( nump , Journal_Register(Error_Type, "PCDVC"), "Error in %s: Problem has an under resolved cell (Cell Id = %d), add more particles to your model\n", __func__, lCell_I );
 
-    dx = (BBXMAX - BBXMIN)/numx;
-    dy = (BBYMAX - BBYMIN)/numy;
-    dz = (BBZMAX - BBZMIN)/numz;
-    da = dx*dy*dz;
+	dx = (BBXMAX - BBXMIN)/numx;
+	dy = (BBYMAX - BBYMIN)/numy;
+	dz = (BBZMAX - BBZMIN)/numz;
+	da = dx*dy*dz;
 	
-    // Construct the grid for the Voronoi cells only once.
-    // If we wanted to call this function again during a job with a different resolution
-    // then we should destroy the grid once we have looped through the whole mesh.
-    // I am assuming we are not going to do that for now.
-    // Easy to implement this anyway, if needed.
-    if(!visited){
-        /* The PCDVC class should really be a class the next level up here */
-        /* We should be able to swap out the WeightsCalculator_CalculateAll instead of just setting
-           a pointer inside that function */
-        visited++;
-        _DVCWeights_ConstructGrid(&cells,numz,numy,numx,BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);
-    }
+	// Construct the grid for the Voronoi cells only once.
+	// If we wanted to call this function again during a job with a different resolution
+	// then we should destroy the grid once we have looped through the whole mesh.
+	// I am assuming we are not going to do that for now.
+	// Easy to implement this anyway, if needed.
+	if(!visited){
+	      /* The PCDVC class should really be a class the next level up here */
+	      /* We should be able to swap out the WeightsCalculator_CalculateAll instead of just setting
+                 a pointer inside that function */
+	      visited++;
+	      _DVCWeights_ConstructGrid(&cells,numz,numy,numx,BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);
+	}
 	
-    // init the data structures
-    _DVCWeights_InitialiseStructs( &bchain, &pList, nump);
-    _DVCWeights_ResetGrid(&cells,numz*numy*numx);
+	// init the data structures
+	_DVCWeights_InitialiseStructs( &bchain, &pList, nump);
+	_DVCWeights_ResetGrid(&cells,numz*numy*numx);
 	
-    particle = (IntegrationPoint**)malloc( (nump)*sizeof(IntegrationPoint*));
+	particle = (IntegrationPoint**)malloc( (nump)*sizeof(IntegrationPoint*));
 	
-    // initialize the particle positions to be the local coordinates of the material swarm particles
-    // I am assuming the xi's (local coords) are precalculated somewhere and get reset based on material
-    // positions each time step.
-    for(i=0;i<nump;i++){
+        // initialize the particle positions to be the local coordinates of the material swarm particles
+	// I am assuming the xi's (local coords) are precalculated somewhere and get reset based on material
+	// positions each time step.
+	for(i=0;i<nump;i++){
 	      
-        particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
-        pList[i].x = particle[i]->xi[0];
-        pList[i].y = particle[i]->xi[1];
-        pList[i].z = particle[i]->xi[2];
+	      particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
+	      pList[i].x = particle[i]->xi[0];
+	      pList[i].y = particle[i]->xi[1];
+	      pList[i].z = particle[i]->xi[2];
 	      
-    }
-    _DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
-    _DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
+	}
+	_DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+	_DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
 
-    /************************************/
-    /************************************/
-    /*    Start 3D Population Control   */
-    /************************************/
-    /************************************/
-    /* todo: put print statements into Journal statements */
-    /*********************************/
+	/************************************/
+	/************************************/
+	/*    Start 3D Population Control   */
+	/************************************/
+	/************************************/
+	/* todo: put print statements into Journal statements */
+	/*********************************/
 
-    /** want to do something special for inflow problems **/
-    /** we need to be a lot more aggressive with adding particles in this case **/
-    /************************************/
-    /************************************/
-    /*      Start 3D Inflow Control     */
-    /************************************/
-    /************************************/
+	/** want to do something special for inflow problems **/
+	/** we need to be a lot more aggressive with adding particles in this case **/
+	/************************************/
+	/************************************/
+	/*      Start 3D Inflow Control     */
+	/************************************/
+	/************************************/
 
-    int *VCsize;
-    int **particleVoronoiCellList;
-    int *count; // count of how many cells each particle owns in the Voronoi diagram.
-    int flag =0;
-    double FEMCEllspan = BBXMAX - BBXMIN;
-    double dist;
-    if(Inflow){
-        for(i=0;i<nump_orig;i++){
-            dist = (pList[i].cx - pList[i].x)*(pList[i].cx - pList[i].x) + (pList[i].cy - pList[i].y)*(pList[i].cy - pList[i].y) + (pList[i].cz - pList[i].z)*(pList[i].cz - pList[i].z);
-        }
-        if(dist > CentPosRatio*FEMCEllspan){flag = 1;}
+	int *VCsize;
+	int **particleVoronoiCellList;
+	int *count; // count of how many cells each particle owns in the Voronoi diagram.
+	int flag =0;
+	double FEMCEllspan = BBXMAX - BBXMIN;
+	double dist;
+	if(Inflow){
+	      for(i=0;i<nump_orig;i++){
+		    dist = (pList[i].cx - pList[i].x)*(pList[i].cx - pList[i].x) + (pList[i].cy - pList[i].y)*(pList[i].cy - pList[i].y) + (pList[i].cz - pList[i].z)*(pList[i].cz - pList[i].z);
+	      }
+	      if(dist > CentPosRatio*FEMCEllspan){flag = 1;}
 	      
-    }
-    if(Inflow && (  ((1.0*nump_orig)/ParticlesPerCell < Thresh) || flag  ) ){
-        int oneOda = (int)(1.0/da + 0.5);
-        int *VCsize=(int *)malloc(sizeof(int)*nump);
+	}
+	if(Inflow && (  ((1.0*nump_orig)/ParticlesPerCell < Thresh) || flag  ) ){
+	      int oneOda = (int)(1.0/da + 0.5);
+	      double dist;
+	      int numberofnewpoints, *VCsize=(int *)malloc(sizeof(int)*nump);
+	      int newpindex;
+	      int j;
+	      int delNum;
+	      VCsize=(int *)malloc(sizeof(int)*nump_orig);
+	      count=(int *)malloc(sizeof(int)*nump_orig);
+	      splitCount = 0;
+	      particleVoronoiCellList = (int **)malloc(nump_orig * sizeof(int *));// [i][j] is jth cell owned by particle i
+	      for(i=0;i<nump_orig;i++){ 
+		    count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
+		    VCsize[i] = count[i];
+		    particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
+	      }
+	      for(i=0;i<numx*numy*numz;i++){// traverse the grid
+		    //count[ cells[i].p ]++;
+                    /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
+			internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
+		    if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
+			  particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
+			  count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
+			  //countSum++;
+		    }
+	      }
+	      // we now have a list of cells from the grid belonging to each particle that make up each Voronoi cell in the Voronoi diagram
+	      // next lets compare how far our centroids are from the particle positions.
+	      // this is my criteria for a voronoi cell having a weird shape...too stretched out for example.
+	      // this is exactly what happens in inflow situations.  
+	      // Add a random number of new particles...
+	      // But Need to add them where they are needed. 
+	      for(i=0;i<ParticlesPerCell;i++){
+		    j  =  (int) ( numx*numy*numz * (rand() / (RAND_MAX + 1.0)));
+		    xi[0] = cells[ j ].x;
+		    xi[1] = cells[ j ].y;
+		    xi[2] = cells[ j ].z;
+		    splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, cells[j].p, xi );
+		    nump++; splitCount++;
+	      }
+	      for(i=0;i<nump_orig;i++){
+		    free(particleVoronoiCellList[i]);
+	      }
+	      free(particleVoronoiCellList);
+	      free(VCsize); free(count);
+	      //if(splitCount) printf("\n\e[32mnump is now %d splitCount = %d\n",nump,splitCount);
+	      delNum = nump - ParticlesPerCell;
+	      if(delNum > 5){
+		    for(i=0;i<delNum;i++){
+			  j =  (int) (nump * (rand() / (RAND_MAX + 1.0)));
+			  deleteIntParticleByIndexWithinCell( intSwarm,  matSwarm, lCell_I, j );
+			  nump--;
+			  splitCount++;
+		    }
+	      }
 #if 0
-        double dist;
-        int numberofnewpoints;
-        int newpindex;
+	      for(i=0;i<nump;i++){
+		    if(0 != VCsize[i]){
+			  dist = (pList[i].cx - pList[i].x)*(pList[i].cx - pList[i].x) + (pList[i].cy - pList[i].y)*(pList[i].cy - pList[i].y) + (pList[i].cz - pList[i].z)*(pList[i].cz - pList[i].z);
+			  if(dist > CentPosRatio*FEMCEllspan){
+				// Then populate this Voronoi cell with more particles.
+				// A working number might be based on the initial population per FEM cell, i.e. restore the density.
+				// which I can't be bothered trying to figure out how to extract right this minute.
+				// So, for now, I will just go with say..30? or could pass in via xml?
+				numberofnewpoints = ParticlesPerCell*pList[i].w/8; // 8 is total volume of a local element.
+				for(j=0;j<numberofnewpoints;j++){
+				      newpindex = rand()%VCsize[i];
+				      // we going to split particle[i] numberofnewpoints times and each time give the new particle the coordinates
+				      // of the cell we are planting it in.
+				      // it should not matter if we put newly created particles on top of each other accidentally.
+				      xi[0] = cells[ particleVoronoiCellList[i][newpindex] ].x;
+				      xi[1] = cells[ particleVoronoiCellList[i][newpindex] ].y;
+				      xi[2] = cells[ particleVoronoiCellList[i][newpindex] ].z;
+				      nump++;
+				      splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, i, xi );
+				      splitCount++;
+				}
+			  }//if
+		    }//if
+	      }//for i=0:nump
 #endif
-        int j;
-        int delNum;
-        VCsize=(int *)malloc(sizeof(int)*nump_orig);
-        count=(int *)malloc(sizeof(int)*nump_orig);
-        splitCount = 0;
-        particleVoronoiCellList = (int **)malloc(nump_orig * sizeof(int *));// [i][j] is jth cell owned by particle i
-        for(i=0;i<nump_orig;i++){ 
-            count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
-            VCsize[i] = count[i];
-            particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
-        }
-        for(i=0;i<numx*numy*numz;i++){// traverse the grid
-            //count[ cells[i].p ]++;
-            /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
-                internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
-            if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
-                particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
-                count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
-                //countSum++;
-            }
-        }
-        // we now have a list of cells from the grid belonging to each particle that make up each Voronoi cell in the Voronoi diagram
-        // next lets compare how far our centroids are from the particle positions.
-        // this is my criteria for a voronoi cell having a weird shape...too stretched out for example.
-        // this is exactly what happens in inflow situations.  
-        // Add a random number of new particles...
-        // But Need to add them where they are needed. 
-        for(i=0;i<ParticlesPerCell;i++){
-            j  =  (int) ( numx*numy*numz * (rand() / (RAND_MAX + 1.0)));
-            xi[0] = cells[ j ].x;
-            xi[1] = cells[ j ].y;
-            xi[2] = cells[ j ].z;
-            splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, cells[j].p, xi );
-            nump++; splitCount++;
-        }
-        for(i=0;i<nump_orig;i++){
-            free(particleVoronoiCellList[i]);
-        }
-        free(particleVoronoiCellList);
-        free(VCsize); free(count);
-        //if(splitCount) printf("\n\e[32mnump is now %d splitCount = %d\n",nump,splitCount);
-        delNum = nump - ParticlesPerCell;
-        if(delNum > 5){
-            for(i=0;i<delNum;i++){
-                j =  (int) (nump * (rand() / (RAND_MAX + 1.0)));
-                deleteIntParticleByIndexWithinCell( intSwarm,  matSwarm, lCell_I, j );
-                nump--;
-                splitCount++;
-            }
-        }
-#if 0
-        for(i=0;i<nump;i++){
-            if(0 != VCsize[i]){
-                dist = (pList[i].cx - pList[i].x)*(pList[i].cx - pList[i].x) + (pList[i].cy - pList[i].y)*(pList[i].cy - pList[i].y) + (pList[i].cz - pList[i].z)*(pList[i].cz - pList[i].z);
-                if(dist > CentPosRatio*FEMCEllspan){
-                    // Then populate this Voronoi cell with more particles.
-                    // A working number might be based on the initial population per FEM cell, i.e. restore the density.
-                    // which I can't be bothered trying to figure out how to extract right this minute.
-                    // So, for now, I will just go with say..30? or could pass in via xml?
-                    numberofnewpoints = ParticlesPerCell*pList[i].w/8; // 8 is total volume of a local element.
-                    for(j=0;j<numberofnewpoints;j++){
-                        newpindex = rand()%VCsize[i];
-                        // we going to split particle[i] numberofnewpoints times and each time give the new particle the coordinates
-                        // of the cell we are planting it in.
-                        // it should not matter if we put newly created particles on top of each other accidentally.
-                        xi[0] = cells[ particleVoronoiCellList[i][newpindex] ].x;
-                        xi[1] = cells[ particleVoronoiCellList[i][newpindex] ].y;
-                        xi[2] = cells[ particleVoronoiCellList[i][newpindex] ].z;
-                        nump++;
-                        splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, i, xi );
-                        splitCount++;
-                    }
-                }//if
-            }//if
-        }//for i=0:nump
-#endif
-        if(splitCount){// then redo Voronoi diagram.
-            for(k=0;k<nump_orig;k++){
-                free(bchain[k].new_claimed_cells);
-                free(bchain[k].new_bound_cells);
-            }
-            free(particle);
-            free(bchain);
-            free(pList);
-            if(nump < 3){
-                Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"PCDVC" ), "Something went horribly wrong in %s: Problem has an under resolved cell (Cell Id = %d), check or tune your population control parameters\n", __func__, lCell_I );
-            }
-            // init the data structures
-            _DVCWeights_InitialiseStructs( &bchain, &pList, nump);
+	      if(splitCount){// then redo Voronoi diagram.
+		    for(k=0;k<nump_orig;k++){
+			  free(bchain[k].new_claimed_cells);
+			  free(bchain[k].new_bound_cells);
+		    }
+		    free(particle);
+		    free(bchain);
+		    free(pList);
+		    if(nump < 3){
+			  Journal_Firewall( 0 , Journal_Register(Error_Type, "PCDVC"), "Something went horribly wrong in %s: Problem has an under resolved cell (Cell Id = %d), check or tune your population control parameters\n", __func__, lCell_I );
+		    }
+		    // init the data structures
+		    _DVCWeights_InitialiseStructs( &bchain, &pList, nump);
 	      
-            particle = (IntegrationPoint**)malloc( (nump)*sizeof(IntegrationPoint*));
+		    particle = (IntegrationPoint**)malloc( (nump)*sizeof(IntegrationPoint*));
 	
-            // re-initialize the particle positions to be the local coordinates of the material swarm particles
-            // could do better here..instead of completely destroying these lists I could append to them I suppose.
-            for(i=0;i<nump;i++){
+		    // re-initialize the particle positions to be the local coordinates of the material swarm particles
+		    // could do better here..instead of completely destroying these lists I could append to them I suppose.
+		    for(i=0;i<nump;i++){
 		    
-                particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
-                pList[i].x = particle[i]->xi[0];
-                pList[i].y = particle[i]->xi[1];
-                pList[i].z = particle[i]->xi[2];
+			  particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
+			  pList[i].x = particle[i]->xi[0];
+			  pList[i].y = particle[i]->xi[1];
+			  pList[i].z = particle[i]->xi[2];
 		    
-            }
-            _DVCWeights_ResetGrid(&cells,numz*numy*numx);
-            _DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
-            _DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
+		    }
+		    _DVCWeights_ResetGrid(&cells,numz*numy*numx);
+		    _DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+		    _DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
 
-        }
-        nump_orig = nump;
-    }// if Inflow && ...
-    if(Inflow){
-        int oneOda = (int)(1.0/da + 0.5);
-        //recreate the lists.
-        particleVoronoiCellList = (int **)malloc(nump * sizeof(int *));// [i][j] is jth cell owned by particle i
-        //VCsize = (int*)realloc(VCsize,nump_orig);
-        //count = (int*)realloc(count,nump_orig);
-        VCsize=(int *)malloc(sizeof(int)*nump);
-        count=(int *)malloc(sizeof(int)*nump); 
+	      }
+	      nump_orig = nump;
+	}// if Inflow && ...
+	if(Inflow){
+	      int oneOda = (int)(1.0/da + 0.5);
+	      int sumc = 0;
+	      int j;
+              //recreate the lists.
+	      particleVoronoiCellList = (int **)malloc(nump * sizeof(int *));// [i][j] is jth cell owned by particle i
+	      //VCsize = (int*)realloc(VCsize,nump_orig);
+	      //count = (int*)realloc(count,nump_orig);
+	      VCsize=(int *)malloc(sizeof(int)*nump);
+	      count=(int *)malloc(sizeof(int)*nump); 
 	
-        for(i=0;i<nump;i++){ 
-            count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
-            VCsize[i] = count[i];
-            particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
-        }
-        for(i=0;i<numx*numy*numz;i++){// traverse the grid
-            //count[ cells[i].p ]++;
-            /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
-                internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
-            //if(VCsize[cells[i].p] != 0){// in case a particle is unresolved
-            if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
-                particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
-                count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
-                //countSum++;
-            }
-            //}
-        }
-    }//if Inflow
-    /**************************************/
-    /**************************************/
-    /*        End 3D Inflow Control       */
-    /**************************************/
-    /**************************************/
-    split_flag = 0;
-    delete_flag = 0;
+	      for(i=0;i<nump;i++){ 
+		    count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
+		    VCsize[i] = count[i];
+		    particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
+	      }
+	      for(i=0;i<numx*numy*numz;i++){// traverse the grid
+		    //count[ cells[i].p ]++;
+                    /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
+			internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
+		    //if(VCsize[cells[i].p] != 0){// in case a particle is unresolved
+		    if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
+			  particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
+			  count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
+			  //countSum++;
+		    }
+		    //}
+	      }
+	}//if Inflow
+	/**************************************/
+	/**************************************/
+	/*        End 3D Inflow Control       */
+	/**************************************/
+	/**************************************/
+	split_flag = 0;
+	delete_flag = 0;
 //	maxW = 0.0;
 //	minW = 8.0;
-    splitCount = 0;
-    deleteCount = 0;
-    /* shouldn't need maxI and minI now */
-    maxW = upT*8/100.0;
-    minW = lowT*8/100.0;
-    /* check to see if we are in an interface cell.
-       We never want to delete particles in an interface cell */
-    matTypeFirst = IntegrationPointMapper_GetMaterialIndexAt(intSwarm->mapper,intSwarm->cellParticleTbl[ lCell_I ][ 0 ]);
-    for(i=0;i<nump;i++){
-        matType = IntegrationPointMapper_GetMaterialIndexAt(intSwarm->mapper,intSwarm->cellParticleTbl[ lCell_I ][ i ]);
-        if(matType != matTypeFirst){
-            if(!deleteInInterfaceCells) maxDeletions = 0; /* no deletions in an interface cell */
-            /* this may be inadequate...we may need to do something in the neighbouring cells to interface cells as well */
-            if(!splitInInterfaceCells)  maxSplits    = 0;
-            break;
-        }
-    }
-    /* need a struct for the deletList because we must sort it by indexOnCPU and delete in reverse order
-       so we don't have the potential problem of  deleting a particle from the list that points to the last particle on the swarm */
-    deleteList = (struct deleteParticle*)malloc(nump*sizeof(struct deleteParticle));/* I don't think I am going to let you delete more than half the particles in a given cell */
-    splitList  = (Particle_Index*)malloc(nump*sizeof(Particle_Index));
-    for(i=0;i<nump;i++){
-        if(pList[i].w > maxW){ /* maxW = pList[i].w; maxI = i;*/ splitList[splitCount] = i; splitCount++;}
-        if(pList[i].w < minW){
-            /* minW = pList[i].w; minI = i; */
-            deleteList[deleteCount].indexWithinCell = i;
-            deleteList[deleteCount].indexOnCPU  = intSwarm->cellParticleTbl[ lCell_I ][ i ];		    
-            deleteCount++;
-        }
-    }
-    /* sort the deleteList by indexOnCPU so we can delete the list in reverse order */
-    qsort(deleteList, (deleteCount), sizeof(struct deleteParticle),compare_indexOnCPU);
-    //deleteCount--; /* is going to be one size too large after the loop */
-    /*
-      for(i=0;i<deleteCount;i++){
-      printf("deleteCount = %d\n",deleteCount);
-      printf("indices are indexWithinCell %d indexOnCPU %d\n",deleteList[i].indexWithinCell,deleteList[i].indexOnCPU);
-      }
-    */
-    if(maxDeletions > nump-4){ maxDeletions = nump/2;}
+	splitCount = 0;
+	deleteCount = 0;
+	/* shouldn't need maxI and minI now */
+	maxW = upT*8/100.0;
+	minW = lowT*8/100.0;
+	/* check to see if we are in an interface cell.
+           We never want to delete particles in an interface cell */
+	matTypeFirst = IntegrationPointMapper_GetMaterialIndexAt(intSwarm->mapper,intSwarm->cellParticleTbl[ lCell_I ][ 0 ]);
+	for(i=0;i<nump;i++){
+	      matType = IntegrationPointMapper_GetMaterialIndexAt(intSwarm->mapper,intSwarm->cellParticleTbl[ lCell_I ][ i ]);
+	      if(matType != matTypeFirst){
+		    if(!deleteInInterfaceCells) maxDeletions = 0; /* no deletions in an interface cell */
+		    /* this may be inadequate...we may need to do something in the neighbouring cells to interface cells as well */
+		    if(!splitInInterfaceCells)  maxSplits    = 0;
+		    break;
+	      }
+	}
+	/* need a struct for the deletList because we must sort it by indexOnCPU and delete in reverse order
+           so we don't have the potential problem of  deleting a particle from the list that points to the last particle on the swarm */
+	deleteList = (struct deleteParticle*)malloc(nump*sizeof(struct deleteParticle));/* I don't think I am going to let you delete more than half the particles in a given cell */
+	splitList  = (Particle_Index*)malloc(nump*sizeof(Particle_Index));
+	for(i=0;i<nump;i++){
+	      if(pList[i].w > maxW){ /* maxW = pList[i].w; maxI = i;*/ splitList[splitCount] = i; splitCount++;}
+	      if(pList[i].w < minW){
+		    /* minW = pList[i].w; minI = i; */
+		    deleteList[deleteCount].indexWithinCell = i;
+		    deleteList[deleteCount].indexOnCPU  = intSwarm->cellParticleTbl[ lCell_I ][ i ];		    
+		    deleteCount++;
+	      }
+	}
+	/* sort the deleteList by indexOnCPU so we can delete the list in reverse order */
+	qsort(deleteList, (deleteCount), sizeof(struct deleteParticle),compare_indexOnCPU);
+	//deleteCount--; /* is going to be one size too large after the loop */
+	/*
+	for(i=0;i<deleteCount;i++){
+	      printf("deleteCount = %d\n",deleteCount);
+	      printf("indices are indexWithinCell %d indexOnCPU %d\n",deleteList[i].indexWithinCell,deleteList[i].indexOnCPU);
+	}
+	*/
+	if(maxDeletions > nump-4){ maxDeletions = nump/2;}
 
-    /* we now have our lists of particles to delete and split */
+	/* we now have our lists of particles to delete and split */
 
 //	if(pList[maxI].w > upT*8/100.0){
-    Count = maxSplits > splitCount ? splitCount : maxSplits;
-    for(i=0;i<Count;i++){
-        int j;
-        maxI = splitList[i];
-        if(!Inflow){
-            /* now get local coords from centroid of the cell that particleToSplit lives in */
-            xi[0] = pList[maxI].cx;
-            xi[1] = pList[maxI].cy;
-            xi[2] = pList[maxI].cz;
-        }
-        else{
-            /* lets do something different now..because am getting lines formed on inflow probs */
-            j =  (int) (VCsize[maxI] * (rand() / (RAND_MAX + 1.0)));
-            xi[0] = cells[ particleVoronoiCellList[maxI][j] ].x;
-            xi[1] = cells[ particleVoronoiCellList[maxI][j] ].y;
-            xi[2] = cells[ particleVoronoiCellList[maxI][j] ].z;
-        }
-        split_flag = 1;
-        nump++;
-        splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, maxI, xi );
-    }
+	Count = maxSplits > splitCount ? splitCount : maxSplits;
+	for(i=0;i<Count;i++){
+	      int j;
+	      maxI = splitList[i];
+	      if(!Inflow){
+		    /* now get local coords from centroid of the cell that particleToSplit lives in */
+		    xi[0] = pList[maxI].cx;
+		    xi[1] = pList[maxI].cy;
+		    xi[2] = pList[maxI].cz;
+	      }
+	      else{
+                    /* lets do something different now..because am getting lines formed on inflow probs */
+		    j =  (int) (VCsize[maxI] * (rand() / (RAND_MAX + 1.0)));
+		    xi[0] = cells[ particleVoronoiCellList[maxI][j] ].x;
+		    xi[1] = cells[ particleVoronoiCellList[maxI][j] ].y;
+		    xi[2] = cells[ particleVoronoiCellList[maxI][j] ].z;
+	      }
+	      split_flag = 1;
+	      nump++;
+	      splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, maxI, xi );
+	}
 
-    if(Inflow){
-        for(i=0;i<nump_orig;i++){
-            free(particleVoronoiCellList[i]);
-        }
-        free(particleVoronoiCellList);
-        free(VCsize);
-        free(count);
-    }
-    Count = maxDeletions > deleteCount ? deleteCount : maxDeletions;
-    for(i=0;i<Count;i++){
-        minI = deleteList[i].indexOnCPU;
-        deleteIntParticleByIndexOnCPU( intSwarm,  matSwarm, minI );
-        delete_flag = 1;
-        nump--;
-    }
+	if(Inflow){
+	      for(i=0;i<nump_orig;i++){
+		    free(particleVoronoiCellList[i]);
+	      }
+	      free(particleVoronoiCellList);
+	      free(VCsize);
+	      free(count);
+	}
+	Count = maxDeletions > deleteCount ? deleteCount : maxDeletions;
+	for(i=0;i<Count;i++){
+	      minI = deleteList[i].indexOnCPU;
+	      deleteIntParticleByIndexOnCPU( intSwarm,  matSwarm, minI );
+	      delete_flag = 1;
+	      nump--;
+	}
 
-    if(delete_flag || split_flag ){/* then we need to redo the Voronoi diagram */
-        for(k=0;k<nump_orig;k++){
-            free(bchain[k].new_claimed_cells);
-            free(bchain[k].new_bound_cells);
-        }
-        free(particle);
-        free(bchain);
-        free(pList);
-        if(nump < 3){
-            Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"PCDVC" ), "Something went horribly wrong in %s: Problem has an under resolved cell (Cell Id = %d), check or tune your population control parameters\n", __func__, lCell_I );
-        }
-        // init the data structures
-        _DVCWeights_InitialiseStructs( &bchain, &pList, nump);
-        //_DVCWeights_ResetGrid(&cells,numz*numy*numx);
+	if(delete_flag || split_flag ){/* then we need to redo the Voronoi diagram */
+	      for(k=0;k<nump_orig;k++){
+		    free(bchain[k].new_claimed_cells);
+		    free(bchain[k].new_bound_cells);
+	      }
+	      free(particle);
+	      free(bchain);
+	      free(pList);
+	      if(nump < 3){
+		    Journal_Firewall( 0 , Journal_Register(Error_Type, "PCDVC"), "Something went horribly wrong in %s: Problem has an under resolved cell (Cell Id = %d), check or tune your population control parameters\n", __func__, lCell_I );
+	      }
+	      // init the data structures
+	      _DVCWeights_InitialiseStructs( &bchain, &pList, nump);
+	      //_DVCWeights_ResetGrid(&cells,numz*numy*numx);
 	      
-        particle = (IntegrationPoint**)malloc( (nump)*sizeof(IntegrationPoint*));
+	      particle = (IntegrationPoint**)malloc( (nump)*sizeof(IntegrationPoint*));
 	
-        // re-initialize the particle positions to be the local coordinates of the material swarm particles
-        for(i=0;i<nump;i++){
+	      // re-initialize the particle positions to be the local coordinates of the material swarm particles
+	      for(i=0;i<nump;i++){
 		    
-            particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
-            pList[i].x = particle[i]->xi[0];
-            pList[i].y = particle[i]->xi[1];
-            pList[i].z = particle[i]->xi[2];
-            //pList[i].index = i; // to track which particle numbers we have after sorting this list */
+		    particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
+		    pList[i].x = particle[i]->xi[0];
+		    pList[i].y = particle[i]->xi[1];
+		    pList[i].z = particle[i]->xi[2];
+		    //pList[i].index = i; // to track which particle numbers we have after sorting this list */
 		    
-        }
-        //printf("Population of matSwarm is %d\n",matSwarm->particleLocalCount);
-        //printf("Population of intSwarm is %d\n",intSwarm->particleLocalCount);
-        _DVCWeights_ResetGrid(&cells,numz*numy*numx);
-        //reset_grid(&cells,numz*numy*numx);/* adding this line fixed memory leak probs */
-        //create_voronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
-        //get_centroids( cells, pList,numz,numy,numx,nump,da);
-        _DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
-        _DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
+	      }
+	      //printf("Population of matSwarm is %d\n",matSwarm->particleLocalCount);
+	      //printf("Population of intSwarm is %d\n",intSwarm->particleLocalCount);
+	      _DVCWeights_ResetGrid(&cells,numz*numy*numx);
+	      //reset_grid(&cells,numz*numy*numx);/* adding this line fixed memory leak probs */
+	      //create_voronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+	      //get_centroids( cells, pList,numz,numy,numx,nump,da);
+	      _DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+	      _DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
 
-    }/* if delete_flag */
-    /******************************************/
-    /******************************************/
-    /*        End 3D Population Control       */
-    /******************************************/
-    /******************************************/
+	}/* if delete_flag */
+	/******************************************/
+	/******************************************/
+	/*        End 3D Population Control       */
+	/******************************************/
+	/******************************************/
 
-    // We are setting the integration points to be the centroids of the Voronoi regions here and
-    // the weight is the volume of each Voronoi region.
-    for(i=0;i<nump;i++){
+	// We are setting the integration points to be the centroids of the Voronoi regions here and
+	// the weight is the volume of each Voronoi region.
+	for(i=0;i<nump;i++){
 
-        particle[i]->xi[0] = pList[i].cx;
-        particle[i]->xi[1] = pList[i].cy;
-        particle[i]->xi[2] = pList[i].cz;
-        particle[i]->weight = pList[i].w;
+	      particle[i]->xi[0] = pList[i].cx;
+	      particle[i]->xi[1] = pList[i].cy;
+	      particle[i]->xi[2] = pList[i].cz;
+	      particle[i]->weight = pList[i].w;
 
-    }	
-    for(k=0;k<nump;k++){
-        free(bchain[k].new_claimed_cells);
-        free(bchain[k].new_bound_cells);
-    }
-    free(particle);
-    free(bchain);
-    free(pList);
-    free(deleteList);
-    free(splitList);
+	}	
+	for(k=0;k<nump;k++){
+	      free(bchain[k].new_claimed_cells);
+	      free(bchain[k].new_bound_cells);
+	}
+	free(particle);
+	free(bchain);
+	free(pList);
+	free(deleteList);
+	free(splitList);
 
 }
 
 /* Calculate the integration weighting for each particle by contructing
-   a voronoi diagram in an element in 2D*/
+a voronoi diagram in an element in 2D*/
 void _PCDVC_Calculate2D( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I ) {
-    PCDVC*             self            = (PCDVC*)  pcdvc;
-    IntegrationPointsSwarm*  intSwarm  = (IntegrationPointsSwarm*) _swarm;
-    MaterialPointsSwarm* matSwarm =	(MaterialPointsSwarm*) self->materialPointsSwarm;
-    /* CoincidentMapper is a special case of the one to one mapper */
-    //CoincidentMapper* mapper  = (CoincidentMapper*)(intSwarm->mapper); /* need the mapper after-all to update the material ref */
-    Particle_InCellIndex         cParticleCount;
-    IntegrationPoint**           particle;
-    static int visited = 0 ;
-    //static int deleted = 0 ;
+	PCDVC*             self            = (PCDVC*)  pcdvc;
+	IntegrationPointsSwarm*  intSwarm  = (IntegrationPointsSwarm*) _swarm;
+        MaterialPointsSwarm* matSwarm =	(MaterialPointsSwarm*) self->materialPointsSwarm;
+	/* CoincidentMapper is a special case of the one to one mapper */
+	//CoincidentMapper* mapper  = (CoincidentMapper*)(intSwarm->mapper); /* need the mapper after-all to update the material ref */
+	Particle_InCellIndex         cParticleCount;
+	IntegrationPoint**           particle;
+	static int visited = 0 ;
+	//static int deleted = 0 ;
 
-    double dx,dy,da;
-    static struct cell2d *cells;// the connected grid
-    struct particle2d *pList;// particle List
-    struct chain *bchain;//boundary chain
-    int nump_orig,nump,numx,numy;
-    double BBXMIN = -1.0; // the ranges of the local coordinates of a FEM cell.
-    double BBXMAX = 1.0;
-    double BBYMIN = -1.0;
-    double BBYMAX = 1.0;
-    int i,k;
+	double dx,dy,da;
+	static struct cell2d *cells;// the connected grid
+	struct particle2d *pList;// particle List
+	struct chain *bchain;//boundary chain
+	int nump_orig,nump,numx,numy;
+	double BBXMIN = -1.0; // the ranges of the local coordinates of a FEM cell.
+	double BBXMAX = 1.0;
+	double BBYMIN = -1.0;
+	double BBYMAX = 1.0;
+	int i,k;
 
-    /*************************************/
-    /* stuff for particle removal/adding */
-    double maxW,minW;
-    int maxI, minI;
-    double lowT = self->lowerT;
-    double upT = self->upperT;
-    int delete_flag, split_flag;
-    struct deleteParticle* deleteList;
-    Particle_Index  *splitList;
-    int splitCount;
-    int deleteCount;
-    int maxDeletions = self->maxDeletions;/* hard setting this till I get stuff from xml file */
-    int maxSplits = self->maxSplits;
-    int Count;
-    int matTypeFirst;
-    int matType;
-    Bool splitInInterfaceCells  = self->splitInInterfaceCells;
-    Bool deleteInInterfaceCells = self->deleteInInterfaceCells;
-    Bool Inflow = self->Inflow;
-    double Thresh = self->Threshold;
-    int ParticlesPerCell = self->ParticlesPerCell;
-    double CentPosRatio = self->CentPosRatio;
-    //time_t tm;
+	/*************************************/
+	/* stuff for particle removal/adding */
+	double maxW,minW;
+	int maxI, minI;
+	double lowT = self->lowerT;
+	double upT = self->upperT;
+	int delete_flag, split_flag;
+	struct deleteParticle* deleteList;
+	Particle_Index  *splitList;
+	int splitCount;
+	int deleteCount;
+	int maxDeletions = self->maxDeletions;/* hard setting this till I get stuff from xml file */
+	int maxSplits = self->maxSplits;
+	int Count;
+	int matTypeFirst;
+	int matType;
+	Bool splitInInterfaceCells  = self->splitInInterfaceCells;
+   Bool deleteInInterfaceCells = self->deleteInInterfaceCells;
+	Bool Inflow = self->Inflow;
+	double Thresh = self->Threshold;
+	int ParticlesPerCell = self->ParticlesPerCell;
+	double CentPosRatio = self->CentPosRatio;
+	time_t tm;
 	
 
 //	SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
 //	SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
 
 //	Coord                   newCoord;
-    Coord                   xi;
+	Coord                   xi;
 
 //	FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
 
-    /* end decs needed for particle control */
-    /*************************************/
+	/* end decs needed for particle control */
+	/*************************************/
 	
 
-    numx = self->resX;
-    numy = self->resY;
+	numx = self->resX;
+	numy = self->resY;
 
-    nump_orig = nump = cParticleCount = intSwarm->cellParticleCountTbl[lCell_I];
+	nump_orig = nump = cParticleCount = intSwarm->cellParticleCountTbl[lCell_I];
 
-    Journal_Firewall( nump , Journal_Register( Error_Type, (Name)"PCDVC" ), "Error in %s: Problem has an under resolved cell (Cell Id = %d), add more particles to your model\n", __func__, lCell_I );
+	Journal_Firewall( nump , Journal_Register(Error_Type, "PCDVC"), "Error in %s: Problem has an under resolved cell (Cell Id = %d), add more particles to your model\n", __func__, lCell_I );
 
-    dx = (BBXMAX - BBXMIN)/numx;
-    dy = (BBYMAX - BBYMIN)/numy;
-    da = dx*dy;
+	dx = (BBXMAX - BBXMIN)/numx;
+	dy = (BBYMAX - BBYMIN)/numy;
+	da = dx*dy;
 	
-    // Construct the grid for the Voronoi cells only once.
-    // If we wanted to call this function again during a job with a different resolution
-    // then we should destroy the grid once we have looped through the whole mesh.
-    // I am assuming we are not going to do that for now.
-    // Easy to implement this anyway, if needed.
-    if(!visited){
-        /* The PCDVC class should really be a class the next level up here */
-        /* We should be able to swap out the WeightsCalculator_CalculateAll instead of just setting
-           a pointer inside that function */
-        visited++;
-        _DVCWeights_ConstructGrid2D(&cells,numy,numx,BBXMIN,BBYMIN,BBXMAX,BBYMAX);
+	// Construct the grid for the Voronoi cells only once.
+	// If we wanted to call this function again during a job with a different resolution
+	// then we should destroy the grid once we have looped through the whole mesh.
+	// I am assuming we are not going to do that for now.
+	// Easy to implement this anyway, if needed.
+	if(!visited){
+	      /* The PCDVC class should really be a class the next level up here */
+	      /* We should be able to swap out the WeightsCalculator_CalculateAll instead of just setting
+                 a pointer inside that function */
+	      visited++;
+	      _DVCWeights_ConstructGrid2D(&cells,numy,numx,BBXMIN,BBYMIN,BBXMAX,BBYMAX);
 //	      time(&tm);
 //	      srand( (long) tm);
-    }
+	}
 	
 	
-    // init the data structures
-    _DVCWeights_InitialiseStructs2D( &bchain, &pList, nump);
-    _DVCWeights_ResetGrid2D(&cells,numy*numx);
+	// init the data structures
+	_DVCWeights_InitialiseStructs2D( &bchain, &pList, nump);
+	_DVCWeights_ResetGrid2D(&cells,numy*numx);
 	
-    particle = (IntegrationPoint**)malloc((nump)*sizeof(IntegrationPoint*));
+	particle = (IntegrationPoint**)malloc((nump)*sizeof(IntegrationPoint*));
 	
-    // initialize the particle positions to be the local coordinates of the material swarm particles
-    // I am assuming the xi's (local coords) are precalculated somewhere and get reset based on material
-    // positions each time step.
-    for(i=0;i<nump;i++){
+        // initialize the particle positions to be the local coordinates of the material swarm particles
+	// I am assuming the xi's (local coords) are precalculated somewhere and get reset based on material
+	// positions each time step.
+	for(i=0;i<nump;i++){
 	      
-        particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
-        pList[i].x = particle[i]->xi[0];
-        pList[i].y = particle[i]->xi[1];
+	      particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
+	      pList[i].x = particle[i]->xi[0];
+	      pList[i].y = particle[i]->xi[1];
 	      
-    }
-    _DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
-    _DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
-/*     for(k=0;k<nump;k++){ */
-/* 	  printf("In %s O(%10.7lf %10.7lf) C(%10.7lf %10.7lf) W(%.4lf)\n", __func__, pList[k].x, pList[k].y, pList[k].cx, pList[k].cy, pList[k].w); */
-/*     } */
-      
-    /************************************/
-    /************************************/
-    /*    Start 2D Population Control   */
-    /************************************/
-    /** want to do something special for inflow problems **/
-    /** we need to be a lot more aggressive with adding particles in this case **/
-    /************************************/
-    /************************************/
-    /*      Start 2D Inflow Control     */
-    /************************************/
-    /************************************/
+	}
+	_DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
+	_DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
+
+	/************************************/
+	/************************************/
+	/*    Start 2D Population Control   */
+	/************************************/
+	/** want to do something special for inflow problems **/
+	/** we need to be a lot more aggressive with adding particles in this case **/
+	/************************************/
+	/************************************/
+	/*      Start 2D Inflow Control     */
+	/************************************/
+	/************************************/
 //	if(0){
-    int *VCsize;
-    int **particleVoronoiCellList;
-    int *count; // count of how many cells each particle owns in the Voronoi diagram.
-    int flag =0;
-    double FEMCEllspan = BBXMAX - BBXMIN;
-    double dist;
-    if(Inflow){
-        for(i=0;i<nump_orig;i++){
-            dist = (pList[i].x-pList[i].cx)*(pList[i].x-pList[i].cx)+(pList[i].y-pList[i].cy)*(pList[i].y-pList[i].cy);;
-        }
-        if(dist > CentPosRatio*FEMCEllspan){flag = 1;}
+	int *VCsize;
+	int **particleVoronoiCellList;
+	int *count; // count of how many cells each particle owns in the Voronoi diagram.
+	int flag =0;
+	double FEMCEllspan = BBXMAX - BBXMIN;
+	double dist;
+	if(Inflow){
+	      for(i=0;i<nump_orig;i++){
+		    dist = (pList[i].x-pList[i].cx)*(pList[i].x-pList[i].cx)+(pList[i].y-pList[i].cy)*(pList[i].y-pList[i].cy);;
+	      }
+	      if(dist > CentPosRatio*FEMCEllspan){flag = 1;}
 	      
-    }
-    if(Inflow && (  ((1.0*nump_orig)/ParticlesPerCell < Thresh) || flag  ) ){
-        int oneOda = (int)(1.0/da + 0.5);
-        /*double dist; */
-        /*int numberofnewpoints;*/
-        /*int newpindex;*/
-        int j;
-		  /*int countSum;*/
-        /*double wSum;*/
-        /*int *temparray;*/
-        int delNum;
-        VCsize=(int *)malloc(sizeof(int)*nump_orig);
-        count=(int *)malloc(sizeof(int)*nump_orig);
-        //wSum = 0.0;
-        //countSum = 0;
-        splitCount = 0;
-        particleVoronoiCellList = (int **)malloc(nump_orig * sizeof(int *));// [i][j] is jth cell owned by particle i
-        for(i=0;i<nump_orig;i++){ 
-            count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
-            VCsize[i] = count[i];
-            particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
-        }
-        for(i=0;i<numx*numy;i++){// traverse the grid
-            //count[ cells[i].p ]++;
-            /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
-                internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
-            if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
-                particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
-                count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
-                //countSum++;
-            }
-        }
-        //printf("countSum = %d\n",countSum);
-        // we now have a list of cells from the grid belonging to each particle that make up each Voronoi cell in the Voronoi diagram
-        // next lets compare how far our centroids are from the particle positions.
-        // this is my criteria for a voronoi cell having a weird shape...too stretched out for example.
-        // this is exactly what happens in inflow situations.
-        // Add a random number of new particles...
-        // But Need to add them where they are needed.
-        for(i=0;i<ParticlesPerCell;i++){
-            j  =  (int) ( numx*numy * (rand() / (RAND_MAX + 1.0)));
-            xi[0] = cells[ j ].x;
-            xi[1] = cells[ j ].y;
-            splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, cells[j].p, xi );
-            nump++; splitCount++;
-        }
-        for(i=0;i<nump_orig;i++){
-            free(particleVoronoiCellList[i]);
-        }
-        free(particleVoronoiCellList);
-        free(VCsize); free(count);
-        //if(splitCount) printf("\n\e[32mnump is now %d splitCount = %d\n",nump,splitCount);
-        delNum = nump - ParticlesPerCell;
-        if(delNum > 5){
-            for(i=0;i<delNum;i++){
-                j =  (int) (nump * (rand() / (RAND_MAX + 1.0)));
-                deleteIntParticleByIndexWithinCell( intSwarm,  matSwarm, lCell_I, j );
-                nump--;
-                splitCount++;
-            }
-        }
-        //if(splitCount) printf("\e[34mnump is now %d splitCount = %d\n",nump,splitCount);;printf("\e[0;37m");
-        //printf("\n\n");
-        if(splitCount){// then redo Voronoi diagram.
-            for(k=0;k<nump_orig;k++){
-                free(bchain[k].new_claimed_cells);
-                free(bchain[k].new_bound_cells);
-            }
-            free(particle);
-            free(bchain);
-            free(pList);
-            //printf("\e[33mnump is now %d splitCount = %d\n",nump,splitCount);printf("\e[0;37m");
-            if(nump < 3){
-                Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"PCDVC" ), "Something went horribly wrong in %s: Problem has an under resolved cell (Cell Id = %d), check or tune your population control parameters\n", __func__, lCell_I );
-            }
-            // init the data structures
-            _DVCWeights_InitialiseStructs2D( &bchain, &pList, nump);		    	      
-            particle = (IntegrationPoint**)malloc( (nump)*sizeof(IntegrationPoint*));	
-            // re-initialize the particle positions to be the local coordinates of the material swarm particles
-            // could do better here..instead of completely destroying these lists I could append to them I suppose.
-            for(i=0;i<nump;i++){		    
-                particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
-                pList[i].x = particle[i]->xi[0];
-                pList[i].y = particle[i]->xi[1];		    
-            }
-            _DVCWeights_ResetGrid2D(&cells,numy*numx);
-            _DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
-            _DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
-        }
-        nump_orig = nump;
-    }// if Inflow && ...
-    if(Inflow){
-        int oneOda = (int)(1.0/da + 0.5);
-        //int sumc = 0;
-        //int j;
-        //recreate the lists.
-        particleVoronoiCellList = (int **)malloc(nump * sizeof(int *));// [i][j] is jth cell owned by particle i
-        //VCsize = (int*)realloc(VCsize,nump_orig);
-        //count = (int*)realloc(count,nump_orig);
-        VCsize=(int *)malloc(sizeof(int)*nump);
-        count=(int *)malloc(sizeof(int)*nump); 
+	}
+	if(Inflow && (  ((1.0*nump_orig)/ParticlesPerCell < Thresh) || flag  ) ){
+	      int oneOda = (int)(1.0/da + 0.5);
+	      double dist;
+	      int numberofnewpoints;
+	      int newpindex;
+	      int j,countSum;
+	      double wSum;
+	      int *temparray;
+	      int delNum;
+	      VCsize=(int *)malloc(sizeof(int)*nump_orig);
+	      count=(int *)malloc(sizeof(int)*nump_orig);
+	      //wSum = 0.0;
+	      //countSum = 0;
+	      splitCount = 0;
+	      particleVoronoiCellList = (int **)malloc(nump_orig * sizeof(int *));// [i][j] is jth cell owned by particle i
+	      for(i=0;i<nump_orig;i++){ 
+		    count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
+		    VCsize[i] = count[i];
+		    particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
+	      }
+	      for(i=0;i<numx*numy;i++){// traverse the grid
+		    //count[ cells[i].p ]++;
+                    /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
+			internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
+		    if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
+			  particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
+			  count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
+			  //countSum++;
+		    }
+	      }
+	      //printf("countSum = %d\n",countSum);
+	      // we now have a list of cells from the grid belonging to each particle that make up each Voronoi cell in the Voronoi diagram
+	      // next lets compare how far our centroids are from the particle positions.
+	      // this is my criteria for a voronoi cell having a weird shape...too stretched out for example.
+	      // this is exactly what happens in inflow situations.
+	      // Add a random number of new particles...
+	      // But Need to add them where they are needed.
+	      for(i=0;i<ParticlesPerCell;i++){
+		    j  =  (int) ( numx*numy * (rand() / (RAND_MAX + 1.0)));
+		    xi[0] = cells[ j ].x;
+		    xi[1] = cells[ j ].y;
+		    splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, cells[j].p, xi );
+		    nump++; splitCount++;
+	      }
+	      for(i=0;i<nump_orig;i++){
+		    free(particleVoronoiCellList[i]);
+	      }
+	      free(particleVoronoiCellList);
+	      free(VCsize); free(count);
+	      //if(splitCount) printf("\n\e[32mnump is now %d splitCount = %d\n",nump,splitCount);
+	      delNum = nump - ParticlesPerCell;
+	      if(delNum > 5){
+		    for(i=0;i<delNum;i++){
+			  j =  (int) (nump * (rand() / (RAND_MAX + 1.0)));
+			  deleteIntParticleByIndexWithinCell( intSwarm,  matSwarm, lCell_I, j );
+			  nump--;
+			  splitCount++;
+		    }
+	      }
+	      //if(splitCount) printf("\e[34mnump is now %d splitCount = %d\n",nump,splitCount);;printf("\e[0;37m");
+	      //printf("\n\n");
+	      if(splitCount){// then redo Voronoi diagram.
+		    for(k=0;k<nump_orig;k++){
+			  free(bchain[k].new_claimed_cells);
+			  free(bchain[k].new_bound_cells);
+		    }
+		    free(particle);
+		    free(bchain);
+		    free(pList);
+		    //printf("\e[33mnump is now %d splitCount = %d\n",nump,splitCount);printf("\e[0;37m");
+		    if(nump < 3){
+			  Journal_Firewall( 0 , Journal_Register(Error_Type, "PCDVC"), "Something went horribly wrong in %s: Problem has an under resolved cell (Cell Id = %d), check or tune your population control parameters\n", __func__, lCell_I );
+		    }
+		    // init the data structures
+		    _DVCWeights_InitialiseStructs2D( &bchain, &pList, nump);		    	      
+		    particle = (IntegrationPoint**)malloc( (nump)*sizeof(IntegrationPoint*));	
+		    // re-initialize the particle positions to be the local coordinates of the material swarm particles
+		    // could do better here..instead of completely destroying these lists I could append to them I suppose.
+		    for(i=0;i<nump;i++){		    
+			  particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
+			  pList[i].x = particle[i]->xi[0];
+			  pList[i].y = particle[i]->xi[1];		    
+		    }
+		    _DVCWeights_ResetGrid2D(&cells,numy*numx);
+		    _DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
+		    _DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
+	      }
+	      nump_orig = nump;
+	}// if Inflow && ...
+	if(Inflow){
+	      int oneOda = (int)(1.0/da + 0.5);
+	      int sumc = 0;
+	      int j;
+              //recreate the lists.
+	      particleVoronoiCellList = (int **)malloc(nump * sizeof(int *));// [i][j] is jth cell owned by particle i
+	      //VCsize = (int*)realloc(VCsize,nump_orig);
+	      //count = (int*)realloc(count,nump_orig);
+	      VCsize=(int *)malloc(sizeof(int)*nump);
+	      count=(int *)malloc(sizeof(int)*nump); 
 	
-        for(i=0;i<nump;i++){ 
-            count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
-            VCsize[i] = count[i];
-            particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
-        }
-        for(i=0;i<numx*numy;i++){// traverse the grid
-            //count[ cells[i].p ]++;
-            /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
-                internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
-            //if(VCsize[cells[i].p] != 0){// in case a particle is unresolved
-            if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
-                particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
-                count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
-                //countSum++;
-            }
-            //}
-        }
-        /*
-          for(i=0;i<nump;i++){
-          for(j=0;j<VCsize[i];j++){
-          sumc +=  1;
-          }
-          }
-        */
-        //printf("sumc = %d cell = %d\n",sumc,lCell_I);
-    }//if Inflow
-    /************************************/
-    /************************************/
-    /*        End 2D Inflow Control     */
-    /************************************/
-    /************************************/
-    split_flag = 0;
-    delete_flag = 0;
-    splitCount = 0;
-    deleteCount = 0;
-    /* shouldn't need maxI and minI now */
-    maxW = upT*4/100.0;
-    minW = lowT*4/100.0;
-    /* check to see if we are in an interface cell.
-       We never want to delete particles in an interface cell */
-    matTypeFirst = IntegrationPointMapper_GetMaterialIndexAt(intSwarm->mapper,intSwarm->cellParticleTbl[ lCell_I ][ 0 ]);
-    for(i=0;i<nump;i++){
-        matType = IntegrationPointMapper_GetMaterialIndexAt(intSwarm->mapper,intSwarm->cellParticleTbl[ lCell_I ][ i ]);
-        if(matType != matTypeFirst){
-            if(!deleteInInterfaceCells) maxDeletions = 0; /* no deletions in an interface cell */
-            /* this may be inadequate...we may need to do something in the neighbouring cells to interface cells as well */
-            if(!splitInInterfaceCells)  maxSplits    = 0;
-            //printf("------- FOUND an Interface Cell!! --------------\n");
-            break;
-        }
-    }
-    /* need a struct for the deletList because we must sort it bu indexOnCPU and delete in reverse order
-       so we don't have the potential problem of  deleting a particle from the list that points to the last particle on the swarm */
-    splitList  = (Particle_Index*)malloc(nump*sizeof(Particle_Index));	
-    deleteList = (struct deleteParticle*)malloc(nump*sizeof(struct deleteParticle));/* I don't think I am going to let you delete more than half the particles in a given cell */	
-    for(i=0;i<nump;i++){
-        if(pList[i].w > maxW){ /* maxW = pList[i].w; maxI = i;*/ splitList[splitCount] = i; splitCount++;}
-        if(pList[i].w < minW){
-            /* minW = pList[i].w; minI = i; */
-            deleteList[deleteCount].indexWithinCell = i;
-            deleteList[deleteCount].indexOnCPU  = intSwarm->cellParticleTbl[ lCell_I ][ i ];		    
-            deleteCount++;
-        }
-    }
-    /* sort the deleteList by indexOnCPU so we can delete the list in reverse order */
-    qsort(deleteList, (deleteCount), sizeof(struct deleteParticle),compare_indexOnCPU);
-    //deleteCount--; /* is going to be one size too large after the loop */
-    /*
-      for(i=0;i<deleteCount;i++){
-      printf("deleteCount = %d\n",deleteCount);
-      printf("indices are indexWithinCell %d indexOnCPU %d\n",deleteList[i].indexWithinCell,deleteList[i].indexOnCPU);
-      }
-    */
+	      for(i=0;i<nump;i++){ 
+		    count[i] = (int)( pList[i].w*oneOda +0.5 ); // add the 0.5 so we don't lose anything from rounding down accidentally
+		    VCsize[i] = count[i];
+		    particleVoronoiCellList[i] = (int *)malloc( ( 1 + count[i] ) * sizeof(int));
+	      }
+	      for(i=0;i<numx*numy;i++){// traverse the grid
+		    //count[ cells[i].p ]++;
+                    /** for total volume of a cell i.e. how many cells a particle owns .. this is actually calculated
+			internally in the Centroids function and could be also accessed by dividing the weight of a particle by 'da'. **/
+		    //if(VCsize[cells[i].p] != 0){// in case a particle is unresolved
+		    if( count[cells[i].p] > 0 ){// it's possible for the total count to be a little off...this can cause a negative index
+			  particleVoronoiCellList[ cells[i].p ][ count[cells[i].p]-1 ] = i;
+			  count[cells[i].p] = count[cells[i].p] - 1;//decrement the count to insert i value into correct slot.
+			  //countSum++;
+		    }
+		    //}
+	      }
+	      /*
+	      for(i=0;i<nump;i++){
+		    for(j=0;j<VCsize[i];j++){
+			  sumc +=  1;
+		    }
+	      }
+	      */
+	      //printf("sumc = %d cell = %d\n",sumc,lCell_I);
+	}//if Inflow
+	/************************************/
+	/************************************/
+	/*        End 2D Inflow Control     */
+	/************************************/
+	/************************************/
+	split_flag = 0;
+	delete_flag = 0;
+	splitCount = 0;
+	deleteCount = 0;
+	/* shouldn't need maxI and minI now */
+	maxW = upT*4/100.0;
+	minW = lowT*4/100.0;
+	/* check to see if we are in an interface cell.
+           We never want to delete particles in an interface cell */
+	matTypeFirst = IntegrationPointMapper_GetMaterialIndexAt(intSwarm->mapper,intSwarm->cellParticleTbl[ lCell_I ][ 0 ]);
+	for(i=0;i<nump;i++){
+	      matType = IntegrationPointMapper_GetMaterialIndexAt(intSwarm->mapper,intSwarm->cellParticleTbl[ lCell_I ][ i ]);
+	      if(matType != matTypeFirst){
+		    if(!deleteInInterfaceCells) maxDeletions = 0; /* no deletions in an interface cell */
+		    /* this may be inadequate...we may need to do something in the neighbouring cells to interface cells as well */
+		    if(!splitInInterfaceCells)  maxSplits    = 0;
+		    //printf("------- FOUND an Interface Cell!! --------------\n");
+		    break;
+	      }
+	}
+	/* need a struct for the deletList because we must sort it bu indexOnCPU and delete in reverse order
+           so we don't have the potential problem of  deleting a particle from the list that points to the last particle on the swarm */
+	splitList  = (Particle_Index*)malloc(nump*sizeof(Particle_Index));	
+	deleteList = (struct deleteParticle*)malloc(nump*sizeof(struct deleteParticle));/* I don't think I am going to let you delete more than half the particles in a given cell */	
+	for(i=0;i<nump;i++){
+	      if(pList[i].w > maxW){ /* maxW = pList[i].w; maxI = i;*/ splitList[splitCount] = i; splitCount++;}
+	      if(pList[i].w < minW){
+		    /* minW = pList[i].w; minI = i; */
+		    deleteList[deleteCount].indexWithinCell = i;
+		    deleteList[deleteCount].indexOnCPU  = intSwarm->cellParticleTbl[ lCell_I ][ i ];		    
+		    deleteCount++;
+	      }
+	}
+	/* sort the deleteList by indexOnCPU so we can delete the list in reverse order */
+	qsort(deleteList, (deleteCount), sizeof(struct deleteParticle),compare_indexOnCPU);
+	//deleteCount--; /* is going to be one size too large after the loop */
+	/*
+	for(i=0;i<deleteCount;i++){
+	      printf("deleteCount = %d\n",deleteCount);
+	      printf("indices are indexWithinCell %d indexOnCPU %d\n",deleteList[i].indexWithinCell,deleteList[i].indexOnCPU);
+	}
+*/
 
-    if(maxDeletions > nump-4){ maxDeletions = Inflow ? nump - 4 : nump/2;}
+   if(maxDeletions > nump-4){ maxDeletions = Inflow ? nump - 4 : nump/2;}
 
-    /* we now have our lists of particles to delete and split */
-    Count = maxSplits > splitCount ? splitCount : maxSplits;
-    /* lets do something different now..because am getting lines formed on inflow probs */
-    //if(Inflow){ Count = 0;} //turn off ordinary splitting if inflow is on for moment      
-    for(i=0;i<Count;i++){
-        int j;
-        maxI = splitList[i];
-        if(!Inflow){
-            /* now get local coords from centroid of the cell that particleToSplit lives in */
-            xi[0] = pList[maxI].cx;
-            xi[1] = pList[maxI].cy;
-        }
-        else{
-            /* lets do something different now..because am getting lines formed on inflow probs */
-            j =  (int) (VCsize[maxI] * (rand() / (RAND_MAX + 1.0)));
-            xi[0] = cells[ particleVoronoiCellList[maxI][j] ].x;
-            xi[1] = cells[ particleVoronoiCellList[maxI][j] ].y;
-        }     
-        split_flag = 1;
-        nump++;
-        splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, maxI, xi );
-    }
+	/* we now have our lists of particles to delete and split */
+	Count = maxSplits > splitCount ? splitCount : maxSplits;
+	/* lets do something different now..because am getting lines formed on inflow probs */
+	//if(Inflow){ Count = 0;} //turn off ordinary splitting if inflow is on for moment      
+	for(i=0;i<Count;i++){
+	      int j;
+	      maxI = splitList[i];
+	      if(!Inflow){
+		    /* now get local coords from centroid of the cell that particleToSplit lives in */
+		    xi[0] = pList[maxI].cx;
+		    xi[1] = pList[maxI].cy;
+	      }
+	      else{
+                    /* lets do something different now..because am getting lines formed on inflow probs */
+		    j =  (int) (VCsize[maxI] * (rand() / (RAND_MAX + 1.0)));
+		    xi[0] = cells[ particleVoronoiCellList[maxI][j] ].x;
+		    xi[1] = cells[ particleVoronoiCellList[maxI][j] ].y;
+	      }     
+	      split_flag = 1;
+	      nump++;
+	      splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, maxI, xi );
+	}
 
-    if(Inflow){
-        for(i=0;i<nump_orig;i++){
-            free(particleVoronoiCellList[i]);
-        }
-        free(particleVoronoiCellList);
-        free(VCsize);
-        free(count);
-    }
+	if(Inflow){
+	      for(i=0;i<nump_orig;i++){
+		    free(particleVoronoiCellList[i]);
+	      }
+	      free(particleVoronoiCellList);
+	      free(VCsize);
+	      free(count);
+	}
 
-    Count = maxDeletions > deleteCount ? deleteCount : maxDeletions;
-    for(i=0;i<Count;i++){
-        minI = deleteList[i].indexOnCPU;
-        deleteIntParticleByIndexOnCPU( intSwarm,  matSwarm, minI );
-        delete_flag = 1;
-        nump--;
-    }
-    //printf("pList[maxI].w = %lf particle num = %d : %d\n", pList[maxI].w, pList[maxI].index,maxI);
-    //printf("pList[minI].w = %lf particle num = %d : %d\n", pList[minI].w, pList[minI].index,minI);
-    if(delete_flag || split_flag ){/* then we need to redo the Voronoi diagram */
-        for(k=0;k<nump_orig;k++){
-            free(bchain[k].new_claimed_cells);
-            free(bchain[k].new_bound_cells);
-        }
-        free(particle);
-        free(bchain);
-        free(pList);
-        if(nump < 3){
-            Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"PCDVC" ), "Something went horribly wrong in %s: Problem has an under resolved cell (Cell Id = %d), check or tune your population control parameters\n", __func__, lCell_I );
-        }
-        particle = (IntegrationPoint**)malloc((nump)*sizeof(IntegrationPoint*));
-        // init the data structures
-        _DVCWeights_InitialiseStructs2D( &bchain, &pList, nump);
-        // re-initialize the particle positions to be the local coordinates of the material swarm particles
-        for(i=0;i<nump;i++){
+	Count = maxDeletions > deleteCount ? deleteCount : maxDeletions;
+	for(i=0;i<Count;i++){
+	      minI = deleteList[i].indexOnCPU;
+	      deleteIntParticleByIndexOnCPU( intSwarm,  matSwarm, minI );
+	      delete_flag = 1;
+	      nump--;
+	}
+	//printf("pList[maxI].w = %lf particle num = %d : %d\n", pList[maxI].w, pList[maxI].index,maxI);
+	//printf("pList[minI].w = %lf particle num = %d : %d\n", pList[minI].w, pList[minI].index,minI);
+	if(delete_flag || split_flag ){/* then we need to redo the Voronoi diagram */
+	      for(k=0;k<nump_orig;k++){
+		    free(bchain[k].new_claimed_cells);
+		    free(bchain[k].new_bound_cells);
+	      }
+	      free(particle);
+	      free(bchain);
+	      free(pList);
+	      if(nump < 3){
+		    Journal_Firewall( 0 , Journal_Register(Error_Type, "PCDVC"), "Something went horribly wrong in %s: Problem has an under resolved cell (Cell Id = %d), check or tune your population control parameters\n", __func__, lCell_I );
+	      }
+	      particle = (IntegrationPoint**)malloc((nump)*sizeof(IntegrationPoint*));
+              // init the data structures
+	      _DVCWeights_InitialiseStructs2D( &bchain, &pList, nump);
+	      // re-initialize the particle positions to be the local coordinates of the material swarm particles
+	      for(i=0;i<nump;i++){
 		    
-            particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
-            pList[i].x = particle[i]->xi[0];
-            pList[i].y = particle[i]->xi[1];
-            //pList[i].index = i; // to track which particle numbers we have after sorting this list */
+		    particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, i );
+		    pList[i].x = particle[i]->xi[0];
+		    pList[i].y = particle[i]->xi[1];
+		    //pList[i].index = i; // to track which particle numbers we have after sorting this list */
 		    
-        }
-        //printf("Population of matSwarm is %d\n",matSwarm->particleLocalCount);
-        //printf("Population of intSwarm is %d\n",intSwarm->particleLocalCount);
+	      }
+	      //printf("Population of matSwarm is %d\n",matSwarm->particleLocalCount);
+	      //printf("Population of intSwarm is %d\n",intSwarm->particleLocalCount);
 
-        _DVCWeights_ResetGrid2D(&cells,numy*numx);
-        //reset_grid(&cells,numz*numy*numx);/* adding this line fixed memory leak probs */
-        _DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
-        _DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
+	      _DVCWeights_ResetGrid2D(&cells,numy*numx);
+	      //reset_grid(&cells,numz*numy*numx);/* adding this line fixed memory leak probs */
+	      _DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
+	      _DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
 
-    }/* if delete_flag */
-    /**************************************/
-    /**************************************/
-    /*      End 2D Population Control     */
-    /**************************************/
-    /**************************************/
+	}/* if delete_flag */
+	/**************************************/
+	/**************************************/
+	/*      End 2D Population Control     */
+	/**************************************/
+	/**************************************/
 
 
-    // We are setting the integration points to be the centroids of the Voronoi regions here and
-    // the weight is the volume of each Voronoi region.
-    for(i=0;i<nump;i++){
+	// We are setting the integration points to be the centroids of the Voronoi regions here and
+	// the weight is the volume of each Voronoi region.
+	for(i=0;i<nump;i++){
 
-        particle[i]->xi[0] = pList[i].cx;
-        particle[i]->xi[1] = pList[i].cy;
-        particle[i]->weight = pList[i].w;
+	      particle[i]->xi[0] = pList[i].cx;
+	      particle[i]->xi[1] = pList[i].cy;
+	      particle[i]->weight = pList[i].w;
 
-    }	
-    /* for(k=0;k<nump;k++){ */
-/* 	  printf("::In %s O(%10.7lf %10.7lf) C(%10.7lf %10.7lf) W(%.4lf)\n", __func__, pList[k].x, pList[k].y, pList[k].cx, pList[k].cy, pList[k].w); */
-/*     } */
-    for(k=0;k<nump;k++){
-        free(bchain[k].new_claimed_cells);
-        free(bchain[k].new_bound_cells);
-    }
-    free(particle);
-    free(bchain);
-    free(pList);
-    free(deleteList);
-    free(splitList);
-    /*
-      FILE *fp;
-      fp=fopen("nump.txt","a");
-      if(lCell_I< 33){
-      fprintf(fp,"nump = %d cell = %d\n",nump,lCell_I);
-      }
-      fclose(fp);
-    */
+	}	
+	for(k=0;k<nump;k++){
+	      free(bchain[k].new_claimed_cells);
+	      free(bchain[k].new_bound_cells);
+	}
+	free(particle);
+	free(bchain);
+	free(pList);
+	free(deleteList);
+	free(splitList);
+	/*
+	FILE *fp;
+	fp=fopen("nump.txt","a");
+	if(lCell_I< 33){
+	      fprintf(fp,"nump = %d cell = %d\n",nump,lCell_I);
+	}
+	fclose(fp);
+	*/
 }
 
 void _PCDVC_Calculate( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I ){
-    Swarm* swarm = (Swarm*) _swarm;
-    Dimension_Index dim = swarm->dim;
-    /* Stream*  stream = Journal_Register( Info_Type, (Name)swarm->type ); */
-    PCDVC*             self            = (PCDVC*)  pcdvc;
-    /* MaterialPointsSwarm* matSwarm =	(MaterialPointsSwarm*) self->materialPointsSwarm; */
-    /* it might be nice to report the total deletions and splits as well as the final population here */
-    /* One could set the parameters to be too aggressive and cause "swarm thrashing" where many particles
-       are being created and destroyed while maintaining some population that it has converged on */
+      Swarm* swarm = (Swarm*) _swarm;
+      Dimension_Index dim = swarm->dim;
+      Stream*  stream = Journal_Register( Info_Type, swarm->type );
+      PCDVC*             self            = (PCDVC*)  pcdvc;
+      MaterialPointsSwarm* matSwarm =	(MaterialPointsSwarm*) self->materialPointsSwarm;
+      /* it might be nice to report the total deletions and splits as well as the final population here */
+      /* One could set the parameters to be too aggressive and cause "swarm thrashing" where many particles
+         are being created and destroyed while maintaining some population that it has converged on */
 
 /*
-  if(lCell_I == 0 ){
-  Journal_Printf( stream, "\nOn Proc %d: In func %s(): for swarm \"%s\" Population is %d\n", swarm->myRank, __func__, swarm->name, swarm->particleLocalCount );
-  Journal_Printf( stream, "On Proc %d: In func %s(): for swarm \"%s\" Population is %d\n\n", matSwarm->myRank,__func__, matSwarm->name, matSwarm->particleLocalCount );
-  }      
+      if(lCell_I == 0){
+         Journal_Printf( stream, "\nOn Proc %d: In func %s(): for swarm \"%s\" Population is %d\n", swarm->myRank, __func__, swarm->name, swarm->particleLocalCount );
+         Journal_Printf( stream, "On Proc %d: In func %s(): for swarm \"%s\" Population is %d\n\n", matSwarm->myRank,__func__, matSwarm->name, matSwarm->particleLocalCount );
+      }      
 */
-    if(dim == 3)
-        _PCDVC_Calculate3D( pcdvc, _swarm, lCell_I);
-    else
-        _PCDVC_Calculate2D( pcdvc, _swarm, lCell_I);
+      if(dim == 3)
+	    _PCDVC_Calculate3D( pcdvc, _swarm, lCell_I);
+      else
+	    _PCDVC_Calculate2D( pcdvc, _swarm, lCell_I);
 
-    /* reset the below parameters incase they were originally set for interpolation restarts */
-    if(lCell_I == swarm->cellLocalCount - 1){
-        self->maxDeletions           = self->maxDeletions_orig;
-        self->maxSplits              = self->maxSplits_orig;
-        self->Inflow                 = self->Inflow_orig;
-        self->splitInInterfaceCells  = self->splitInInterfaceCells_orig;
-        self->deleteInInterfaceCells = self->deleteInInterfaceCells_orig;
-    }
+      /* reset the below parameters incase they were originally set for interpolation restarts */
+      if(lCell_I == swarm->cellLocalCount - 1){
+         self->maxDeletions           = self->maxDeletions_orig;
+         self->maxSplits              = self->maxSplits_orig;
+         self->Inflow                 = self->Inflow_orig;
+         self->splitInInterfaceCells  = self->splitInInterfaceCells_orig;
+         self->deleteInInterfaceCells = self->deleteInInterfaceCells_orig;
+      }
 
 }
 /*-------------------------------------------------------------------------------------------------------------------------
 ** Public Functions
 */
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/PCDVC.h
--- a/Utils/src/PCDVC.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/PCDVC.h	Tue Feb 02 16:55:08 2010 +1100
@@ -4,14 +4,14 @@
 ** Redistribution and use in source and binary forms, with or without modification,
 ** are permitted provided that the following conditions are met:
 **
-**              * Redistributions of source code must retain the above copyright notice, 
-**                      this list of conditions and the following disclaimer.
-**              * Redistributions in binary form must reproduce the above copyright 
-**                      notice, this list of conditions and the following disclaimer in the 
-**                      documentation and/or other materials provided with the distribution.
-**              * Neither the name of the Monash University nor the names of its contributors 
-**                      may be used to endorse or promote products derived from this software 
-**                      without specific prior written permission.
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
 **
 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
@@ -26,7 +26,7 @@
 **
 **
 ** Contact:
-*%              Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
 *%
 ** Author:
 **              Mirko Velic - Mirko.Velic at sci.monash.edu.au
@@ -34,12 +34,12 @@
 **              Julian Giordani - julian.giordani at sci.monash.edu.au
 **
 **  Assumptions:
-**       I am assuming that the xi's (local coords) on the IntegrationPoint particles
+**  	 I am assuming that the xi's (local coords) on the IntegrationPoint particles
 **       are precalculated somewhere and get reset based on material PIC positions each time step.
 **
 **  Notes:
 **         The PCDVC class should really be a class the next level up here.
-**         We should be able to swap out the WeightsCalculator_CalculateAll function instead of just setting
+**	   We should be able to swap out the WeightsCalculator_CalculateAll function instead of just setting
 **                 a pointer inside that function.
 **
 **         If the function  getIntParticleMaterialRef_PointingToMaterialParticle ever gets called
@@ -68,105 +68,94 @@
 #ifndef __PICellerator_Weights_PCDVCClass_h__
 #define __PICellerator_Weights_PCDVCClass_h__
 
-/* Textual name of this class */
-extern const Type PCDVC_Type;
+	/* Textual name of this class */
+	extern const Type PCDVC_Type;
 
-/* PCDVC information */
-//   #define __PCDVC 
-/* Who's my daddy */ 
-//    __DVCWeights 
-/* My Data structures */ 
-//  MaterialPointsSwarm* materialPointsSwarm; 
-//  int upT; 
-//  int lowT;
+	/* PCDVC information */
+     //   #define __PCDVC 
+                /* Who's my daddy */ 
+            //    __DVCWeights 
+		/* My Data structures */ 
+             //  MaterialPointsSwarm* materialPointsSwarm; 
+              //  int upT; 
+              //  int lowT;
 
-#define __PCDVC                                                         \
-    __DVCWeights                                                        \
-                                                                        \
-    MaterialPointsSwarm*  materialPointsSwarm;                          \
-    double                upperT;                                       \
-    double                lowerT;                                       \
-    Bool                  splitInInterfaceCells;                        \
-    Bool                  deleteInInterfaceCells;                       \
-    int                   maxDeletions;                                 \
-    int                   maxSplits;                                    \
-    Bool                  Inflow;                                       \
-    double                CentPosRatio;                                 \
-    int                   ParticlesPerCell;                             \
-    double                Threshold;                                    \
-    /* we also need to store some parameters, as everything is turned up      */ \
-    /* for interpolation restarts (which may require significant repopulation */ \
-    /* and after the first timestep needs to be set back to correct values    */ \
-    int                   maxDeletions_orig;                            \
-    int                   maxSplits_orig;                               \
-    Bool                  Inflow_orig;                                  \
-    Bool                  splitInInterfaceCells_orig;                   \
-    Bool                  deleteInInterfaceCells_orig;
+#define __PCDVC \
+        __DVCWeights \
+	MaterialPointsSwarm*  materialPointsSwarm;   \
+	double                upperT;                \
+	double                lowerT;                \
+	Bool                  splitInInterfaceCells; \
+	Bool                  deleteInInterfaceCells; \
+	int                   maxDeletions;          \
+	int                   maxSplits;             \
+	Bool                  Inflow;                \
+	double                CentPosRatio;          \
+	int                   ParticlesPerCell;      \
+	double                Threshold;             \
+	/* we also need to store some parameters, as everything is turned up      */          \
+	/* for interpolation restarts (which may require significant repopulation */          \
+	/* and after the first timestep needs to be set back to correct values    */          \
+	int                   maxDeletions_orig;          \
+	int                   maxSplits_orig;             \
+	Bool                  Inflow_orig;                \
+	Bool                  splitInInterfaceCells_orig; \
+	Bool                  deleteInInterfaceCells_orig;
 
 struct PCDVC { __PCDVC };
 
 struct deleteParticle{
-    Particle_Index indexWithinCell;
-    Particle_Index indexOnCPU;
+      Particle_Index indexWithinCell;
+      Particle_Index indexOnCPU;
 };
 
-/*---------------------------------------------------------------------------------------------------------------------
-** Constructors
-*/
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	PCDVC* PCDVC_New( Name name, Dimension_Index dim ) ;
+	PCDVC* _PCDVC_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name );
 
+	void _PCDVC_Init( void* pcdvc, MaterialPointsSwarm* mps, double upT, double lowT, int maxDeletions, int maxSplits, Bool splitInInterfaceCells, Bool deleteInInterfaceCells, int *res, Bool Inflow, double CentPosRatio, int ParticlesPerCell, double Threshold ) ;
+	void PCDVC_InitAll( void* pcdvc, Dimension_Index dim ) ;
 
 
-PCDVC* PCDVC_New( Name name, Dimension_Index dim, int* res,
-                  MaterialPointsSwarm* mps, double upT, double lowT,
-                  int maxDeletions, int maxSplits, Bool splitInInterfaceCells,
-                  Bool deleteInInterfaceCells, Bool Inflow, double CentPosRatio,
-                  int ParticlesPerCell, double Threshold ) ;
+	/* Stg_Class_Delete PCDVC implementation */
+	void _PCDVC_Delete( void* pcdvc );
+	void _PCDVC_Print( void* pcdvc, Stream* stream );
+	#define PCDVC_Copy( self ) \
+		(PCDVC*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define PCDVC_DeepCopy( self ) \
+		(PCDVC*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _PCDVC_Copy( void* pcdvc, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void* _PCDVC_DefaultNew( Name name ) ;
 
+	void _PCDVC_Construct( void* pcdvc, Stg_ComponentFactory* cf, void* data ) ;
 
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define PCDVC_DEFARGS \
-                DVCWEIGHTS_DEFARGS
-
-	#define PCDVC_PASSARGS \
-                DVCWEIGHTS_PASSARGS
-
-PCDVC* _PCDVC_New(  PCDVC_DEFARGS  );
-
-void _PCDVC_Init( void* pcdvc, MaterialPointsSwarm* mps, double upT, double lowT,
-                  int maxDeletions, int maxSplits, Bool splitInInterfaceCells,
-                  Bool deleteInInterfaceCells, Bool Inflow, double CentPosRatio,
-                  int ParticlesPerCell, double Threshold ) ;
-
-
-/* Stg_Class_Delete PCDVC implementation */
-void _PCDVC_Delete( void* pcdvc );
-void _PCDVC_Print( void* pcdvc, Stream* stream );
-#define PCDVC_Copy( self )                                      \
-    (PCDVC*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define PCDVC_DeepCopy( self )                                  \
-    (PCDVC*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _PCDVC_Copy( void* pcdvc, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-        
-void* _PCDVC_DefaultNew( Name name ) ;
-
-void _PCDVC_AssignFromXML( void* pcdvc, Stg_ComponentFactory* cf, void* data ) ;
-
-void _PCDVC_Build( void* pcdvc, void* data ) ;
-void _PCDVC_Initialise( void* pcdvc, void* data ) ;
-void _PCDVC_Destroy( void* pcdvc, void* data )  ;
-void _PCDVC_Execute( void* pcdvc, void* data );
-MaterialPointRef* getIntParticleMaterialRef_PointingToMaterialParticle( IntegrationPointsSwarm*  intSwarm, Particle_Index matLastParticle_IndexOnCPU );
-void splitIntParticleByIndexWithinCell( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm, Cell_LocalIndex lCell_I, Particle_Index intParticleToSplit_IndexOnCPU, Coord xi );
-void deleteIntParticleByIndexWithinCell( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm,  Cell_LocalIndex lCell_I, Particle_Index intParticleToSplit_IndexWithinCell );
-void deleteIntParticleByIndexOnCPU( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm, Particle_Index intParticleToSplit_IndexWithinCell );
-void splitIntParticleByIndexOnCPU( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm, Particle_Index intParticleToSplit_IndexOnCPU, Coord xi );
-void _PCDVC_Calculate3D( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I );
-void _PCDVC_Calculate2D( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I );  
-void _PCDVC_Calculate( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	void _PCDVC_Build( void* pcdvc, void* data ) ;
+	void _PCDVC_Initialise( void* pcdvc, void* data ) ;
+	void _PCDVC_Execute( void* pcdvc, void* data );
+	void _PCDVC_Destroy( void* pcdvc, void* data ) ;
+        MaterialPointRef* getIntParticleMaterialRef_PointingToMaterialParticle( IntegrationPointsSwarm*  intSwarm, Particle_Index matLastParticle_IndexOnCPU );
+        void splitIntParticleByIndexWithinCell( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm, Cell_LocalIndex lCell_I, Particle_Index intParticleToSplit_IndexOnCPU, Coord xi );
+        void deleteIntParticleByIndexWithinCell( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm,  Cell_LocalIndex lCell_I, Particle_Index intParticleToSplit_IndexWithinCell );
+        void deleteIntParticleByIndexOnCPU( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm, Particle_Index intParticleToSplit_IndexWithinCell );
+        void splitIntParticleByIndexOnCPU( IntegrationPointsSwarm* intSwarm,  MaterialPointsSwarm* matSwarm, Particle_Index intParticleToSplit_IndexOnCPU, Coord xi );
+        void _PCDVC_Calculate3D( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I );
+        void _PCDVC_Calculate2D( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I );	
+	void _PCDVC_Calculate( void* pcdvc, void* _swarm, Cell_LocalIndex lCell_I ) ;
 
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/src/Utils.h
--- a/Utils/src/Utils.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Utils/src/Utils.h	Tue Feb 02 16:55:08 2010 +1100
@@ -41,8 +41,8 @@
 */
 
 
-#ifndef __PICellerator_Utils_Utils_h__
-#define __PICellerator_Utils_Utils_h__
+#ifndef __PICellerator_Utils_h__
+#define __PICellerator_Utils_h__
 
 	#include "types.h"
 	#include "BuoyancyForceTerm.h"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/PCDVCSuite.c
--- a/Utils/tests/PCDVCSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,368 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** Role:
-**   Tests the PCDVCSuite
-**
-** $Id: testPCDVC.c 3462 2006-02-19 06:53:24Z WalterLandry $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-//#include "PICellerator/PopulationControl/PopulationControl.h"
-//#include "PICellerator/Weights/Weights.h"
-#include <PICellerator/PICellerator.h>
-#include "PCDVCSuite.h"
-
-#define CURR_MODULE_NAME "PCDVCSuite"
-
-typedef struct {
-} PCDVCSuiteData;
-
-extern void _IntegrationPointsSwarm_UpdateHook( void* timeIntegrator, void* swarm );
-
-void ConstantFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-	*value = -3.0;
-}
-void LinearFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-	double x = xi[0];
-	double y = xi[1];
-
-	*value = 2.0 + 2.2 * x - y;
-}
-void ShapeFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-	double x = xi[0];
-	double y = xi[1];
-
-	*value = 1 + x + y + x * y;
-}
-void PolynomialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-	double x = xi[0];
-	double y = xi[1];
-
-	*value = 11 + 2*x*x + 3*x*x*x*y + y + x*x*x + 2*y*y;
-}
-void QuadraticFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-	double x = xi[0];
-
-	*value = 1 + x + x * x;
-}
-
-void ExponentialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-	double x = xi[0];
-	double y = xi[1];
-
-	*value = 5*exp(2*x*x*x + 2*y*y*y) * (1-x) * (1+y);
-}
-void ExponentialInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-	double x = xi[0];
-	double y = xi[1];
-
-	*value = (double) (y <= 0.1 * exp( 2*x ));
-}
-void CircleInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-	double x = xi[0];
-	double y = xi[1];
-
-	*value = (double) (x*x + y*y <= 1.0);
-}
-
-void PCDVCSuite_Setup( PCDVCSuiteData* data ) {
-}
-
-void PCDVCSuite_Teardown( PCDVCSuiteData* data ) {
-}
-
-void compareAgainstReferenceSolution(PICelleratorContext* context, Stream* stream, double mean, double standardDeviation, char* expFile) {
-	double 	meanTolerance, stdDevTolerance;
-	double 	expectedMean, expectedStdDev;
-	char		expectedFile[PCU_PATH_MAX];
-	FILE*		expectedfp;
-
-	pcu_filename_expected( expFile, expectedFile );
-	expectedfp = fopen( expectedFile, "r" );
-
-	fscanf( expectedfp, "%lf %lf", &meanTolerance, &expectedMean );
-	pcu_check_true( fabs( expectedMean - mean ) < meanTolerance );
-
-	fscanf( expectedfp, "%lf %lf", &stdDevTolerance, &expectedStdDev );
-	pcu_check_true( fabs( expectedStdDev - standardDeviation ) < stdDevTolerance );
-	
-	fclose( expectedfp );
-}
-
-void testElementIntegral_CircleInterface( PICelleratorContext* context, double* mean, double* standardDeviation ) {
-	Swarm*					integrationSwarm = (Swarm*)LiveComponentRegister_Get( context->CF->LCRegister, (Name)"integrationSwarm" );
-	Swarm*					materialSwarm    = (Swarm* )LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialPoints" );
-	FeMesh*					mesh             = (FeMesh* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"linearMesh" );
-	WeightsCalculator*	weights          = (WeightsCalculator* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"weights"  );
-	FeVariable*				feVariable;
-	Element_LocalIndex 	lElement_I       = 0;
-	double					analyticValue    = 0.0;
-	double					integral         = 0.0;
-	double					error;
-	double					errorSquaredSum  = 0.0;
-	double					errorSum         = 0.0;
-	Index						loop_I;
-	Index						count            = Dictionary_GetUnsignedInt_WithDefault( context->dictionary, "SampleSize", 5000 );
-	void*						data;
-		      IntegrationPoint* intParticle;
-		      MaterialPoint*  materialPoint;
-	/* Create FeVariable */
-	feVariable = FeVariable_New_Full(
-		"feVariable",
-		(DomainContext*) context,
-		mesh,
-		NULL,
-		NULL,
-		NULL,
-		NULL,
-		NULL,
-		NULL, 
-		1,
-		context->dim,
-		False,
-		False,
-		False,
-		MPI_COMM_WORLD,
-		context->fieldVariable_Register );
-
-	feVariable->_interpolateWithinElement = CircleInterface;
-	analyticValue = M_PI;
-
-	for ( loop_I = 0 ; loop_I < count ; loop_I++ ) {
-		/* Layout Particles */
-		Swarm_Random_Seed( (long) loop_I );
-		_Swarm_InitialiseParticles( materialSwarm, data );
-
-		_IntegrationPointsSwarm_UpdateHook( NULL, integrationSwarm );
-		/* The following function should not be called here as it is already called ultimately via the above function */
-		/* calling this function again causes a first iteration in Lloyd's algorithm for the Voronoi cells which we don't want here */
-		//WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
-		if(loop_I%10 == 0){
-		      int i;
-
-		      for(i=0;i<integrationSwarm->cellParticleCountTbl[0];i++){
-			    intParticle  =  (IntegrationPoint*)Swarm_ParticleInCellAt( integrationSwarm, 0, i );
-			    materialPoint = (MaterialPoint*)Swarm_ParticleInCellAt( materialSwarm, 0, i );
-			    //printf("In %s M(%10.7lf %10.7lf) I(%10.7lf %10.7lf) W(%.4lf) particle layout type %s: point %d in cell %d\n",__func__,materialPoint->coord[0], materialPoint->coord[1],
-			//	   intParticle->xi[0], intParticle->xi[1], intParticle->weight, materialSwarm->particleLayout->type, i, 0);
-		
-			    //printf("%lf %lf\n",intParticle->xi[0],intParticle->xi[1]);
-		      }
-                }
-
-		/* Evaluate Integral */
-		integral = FeVariable_IntegrateElement( feVariable, integrationSwarm, lElement_I );
-
-		/* Calculate Error */
-		error = fabs( ( integral - analyticValue )/( analyticValue ) );
-		errorSum += error;
-		errorSquaredSum += error*error;
-	}
-
-	/* Calculate Mean and Standard Deviation */
-	*mean = errorSum / (double) count;
-	*standardDeviation = sqrt( errorSquaredSum / (double) count - *mean * *mean );
-	printf("In %s: Mean %lf SD %lf Sol %lf Count = %d\n", __func__, *mean, *standardDeviation, analyticValue,   count);
-	Stg_Component_Destroy( feVariable, NULL, True );
-}
-
-void testElementIntegral_PolynomialFunction( PICelleratorContext* context, double* mean, double* standardDeviation ) {
-	Swarm*					integrationSwarm = (Swarm*)LiveComponentRegister_Get( context->CF->LCRegister, (Name)"integrationSwarm" );
-	Swarm*					materialSwarm    = (Swarm* )LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialPoints" );
-	FeMesh*					mesh             = (FeMesh* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"linearMesh" );
-	WeightsCalculator*	weights          = (WeightsCalculator* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"weights"  );
-	FeVariable*				feVariable;
-	Element_LocalIndex 	lElement_I       = 0;
-	double					analyticValue    = 0.0;
-	double					integral         = 0.0;
-	double					error;
-	double					errorSquaredSum  = 0.0;
-	double					errorSum         = 0.0;
-	Index						loop_I;
-	Index						count            = Dictionary_GetUnsignedInt_WithDefault( context->dictionary, "SampleSize", 5000 );
-	void*						data;
-
-	/* Create FeVariable */
-	feVariable = FeVariable_New_Full(
-		"feVariable",
-		(DomainContext*) context,
-		mesh,
-		NULL,
-		NULL,
-		NULL,
-		NULL,
-		NULL,
-		NULL, 
-		1,
-		context->dim,
-		False,
-		False,
-		False,
-		MPI_COMM_WORLD,
-		context->fieldVariable_Register );
-
-	feVariable->_interpolateWithinElement = PolynomialFunction;
-	analyticValue = 148.0/3.0;
-
-	for ( loop_I = 0 ; loop_I < count ; loop_I++ ) {
-		/* Layout Particles */
-		Swarm_Random_Seed( (long) loop_I );
-		_Swarm_InitialiseParticles( materialSwarm, data );
-
-		_IntegrationPointsSwarm_UpdateHook( NULL, integrationSwarm );
-		/* The following function should not be called here as it is already called ultimately via the above function */
-		/* calling this function again causes a first iteration in Lloyd's algorithm for the Voronoi cells which we don't want here */
-		//WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
-
-		/* Evaluate Integral */
-		integral = FeVariable_IntegrateElement( feVariable, integrationSwarm, lElement_I );
-
-		/* Calculate Error */
-		error = fabs( integral - analyticValue )/fabs( analyticValue );
-		errorSum += error;
-		errorSquaredSum += error*error;
-	}
-
-	/* Calculate Mean and Standard Deviation */
-	*mean = errorSum / (double) count;
-	*standardDeviation = sqrt( errorSquaredSum / (double) count - *mean * *mean );
-	printf("In %s: Mean %lf SD %lf Sol %lf\n", __func__, *mean, *standardDeviation, analyticValue);
-	Stg_Component_Destroy( feVariable, NULL, True );
-}
-
-void testElementIntegral_ExponentialInterface( PICelleratorContext* context, double* mean, double* standardDeviation ) {
-	Swarm*              integrationSwarm = (Swarm*)LiveComponentRegister_Get( context->CF->LCRegister, (Name)"integrationSwarm" );
-	Swarm*              materialSwarm    = (Swarm* )LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialPoints" );
-	FeMesh* 	    mesh             = (FeMesh* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"linearMesh" );
-	WeightsCalculator*  weights          = (WeightsCalculator* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"weights"  );
-	FeVariable*         feVariable;
-	Element_LocalIndex  lElement_I       = 0;
-	double              analyticValue    = 0.0;
-	double              integral         = 0.0;
-	double              error;
-	double              errorSquaredSum  = 0.0;
-	double              errorSum         = 0.0;
-	Index               loop_I;
-	Index               count            = Dictionary_GetUnsignedInt_WithDefault( context->dictionary, "SampleSize", 5000 );
-	void*               data;
-
-	/* Create FeVariable */
-	feVariable = FeVariable_New_Full(
-		"feVariable",
-		(DomainContext*) context,
-		mesh,
-		NULL,
-		NULL,
-		NULL,
-		NULL,
-		NULL,
-		NULL, 
-		1,
-		context->dim,
-		False,
-		False,
-		False,
-		MPI_COMM_WORLD,
-		context->fieldVariable_Register );
-
-	feVariable->_interpolateWithinElement = ExponentialInterface;
-	analyticValue = 0.05 * (exp(2) - exp(-2)) + 2.0;
-
-	for ( loop_I = 0 ; loop_I < count ; loop_I++ ) {
-		/* Layout Particles */
-		Swarm_Random_Seed( (long) loop_I );
-		_Swarm_InitialiseParticles( materialSwarm, data );
-
-		_IntegrationPointsSwarm_UpdateHook( NULL, integrationSwarm );
-		/* The following function should not be called here as it is already called ultimately via the above function */
-		/* calling this function again causes a first iteration in Lloyd's algorithm for the Voronoi cells which we don't want here */
-		//WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
-
-		/* Evaluate Integral */
-		integral = FeVariable_IntegrateElement( feVariable, integrationSwarm, lElement_I );
-
-		/* Calculate Error */
-		error = fabs( integral - analyticValue )/fabs( analyticValue );
-		errorSum += error;
-		errorSquaredSum += error*error;
-	}
-
-	/* Calculate Mean and Standard Deviation */
-	*mean = errorSum / (double) count;
-	*standardDeviation = sqrt( errorSquaredSum / (double) count - *mean * *mean );
-	printf("In %s: Mean %lf SD %lf Sol %lf\n", __func__, *mean, *standardDeviation, analyticValue);
-	Stg_Component_Destroy( feVariable, NULL, True );
-}
-
-void PCDVCSuite_Test( PCDVCSuiteData* data ) {
-	PICelleratorContext*	context;
-	Stg_ComponentFactory*	cf;
-	char			inputFile[PCU_PATH_MAX];
-	Stream*			stream           = Journal_Register( Info_Type, (Name)CURR_MODULE_NAME  );
-	double			mean;
-	double			standardDeviation;
-
-	pcu_filename_input( "testPCDVC.xml", inputFile );
-
-   /* rejigged this test to clean up after each run */
-	context = _PICelleratorContext_DefaultNew( "context" );
-	cf = stgMainInitFromXML( inputFile, MPI_COMM_WORLD, context );
-	stgMainBuildAndInitialise( cf );
-	testElementIntegral_CircleInterface( context, &mean, &standardDeviation );
-	compareAgainstReferenceSolution(context, stream, mean, standardDeviation, "testPCDVC_CircleInterface.expected" );
-	stgMainDestroy( cf );
-
-   context = _PICelleratorContext_DefaultNew( "context" );
-	cf = stgMainInitFromXML( inputFile, MPI_COMM_WORLD, context );
-	stgMainBuildAndInitialise( cf );
-	testElementIntegral_PolynomialFunction( context, &mean, &standardDeviation );
-	compareAgainstReferenceSolution(context, stream, mean, standardDeviation, "testPCDVC_PolynomialFunction.expected" );
-	stgMainDestroy( cf );
-
-   context = _PICelleratorContext_DefaultNew( "context" );
-	cf = stgMainInitFromXML( inputFile, MPI_COMM_WORLD, context );
-	stgMainBuildAndInitialise( cf );
-	testElementIntegral_ExponentialInterface( context, &mean, &standardDeviation );
-	compareAgainstReferenceSolution(context, stream, mean, standardDeviation, "testPCDVC_ExponentialInterface.expected" );
-	stgMainDestroy( cf );
-}
-
-
-void PCDVCSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, PCDVCSuiteData );
-   pcu_suite_setFixtures( suite, PCDVCSuite_Setup, PCDVCSuite_Teardown );
-   pcu_suite_addTest( suite, PCDVCSuite_Test );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/PCDVCSuite.h
--- a/Utils/tests/PCDVCSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef PICellerator_PCDVCSuite_h
-#define PICellerator_PCDVCSuite_h
-
-void PCDVCSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/expected/testPCDVC_Circle.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/expected/testPCDVC_Circle.0of1.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.001000 of 0.162000
+Standard Deviation is within tolerance, 0.001000 of 0.063000
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/expected/testPCDVC_CircleInterface.expected
--- a/Utils/tests/expected/testPCDVC_CircleInterface.expected	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-0.05 0.104
-0.01 0.06
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/expected/testPCDVC_ExpIface.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/expected/testPCDVC_ExpIface.0of1.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.001000 of 0.070000
+Standard Deviation is within tolerance, 0.001000 of 0.050000
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/expected/testPCDVC_ExponentialInterface.expected
--- a/Utils/tests/expected/testPCDVC_ExponentialInterface.expected	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-0.04 0.055
-0.01 0.042
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/expected/testPCDVC_Poly.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/expected/testPCDVC_Poly.0of1.output.dat.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.001000 of 0.012000
+Standard Deviation is within tolerance, 0.001000 of 0.002000
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/expected/testPCDVC_PolynomialFunction.expected
--- a/Utils/tests/expected/testPCDVC_PolynomialFunction.expected	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-0.001000 0.0092
-0.001000 0.0022
-#the above numbers are
-#first line
-# mean tolerance for the relative mean and the relative mean itself
-#second line
-# mean std dev tolerance and the expected std dev
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/input/testElementIntegral.xml
--- a/Utils/tests/input/testElementIntegral.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-	
-	<include>StgFEM/LinearMesh.xml</include>
-	<include>StgFEM/VelocityField.xml</include>
-	<include>StgFEM/TimeIntegrator.xml</include>
-	
-	<struct name="components" mergeType="merge">
-		<struct name="everywhere">
-			<param name="Type">Everywhere</param>
-		</struct>
-		<struct name="material">
-			<param name="Type">Material</param>
-			<param name="Shape">everywhere</param>
-		</struct>
-		<struct name="elementCellLayout">
-			<param name="Type">ElementCellLayout</param>
-			<param name="Mesh">linearMesh</param>
-		</struct>
-		<struct name="localLayout">
-			<param name="Type">MappedParticleLayout</param>
-		</struct>
-		<struct name="integrationSwarm">
-			<param name="Type">IntegrationPointsSwarm</param>
-			<param name="CellLayout">elementCellLayout</param>
-			<param name="ParticleLayout">localLayout</param>
-			<param name="FeMesh">linearMesh</param>
-			<param name="WeightsCalculator">weights</param>
-			<param name="TimeIntegrator">timeIntegrator</param>
-			<param name="IntegrationPointMapper">mapper</param>
-		</struct>
-		<struct name="mapper">
-			<param name="Type">CoincidentMapper</param>
-			<param name="IntegrationPointsSwarm">integrationSwarm</param>
-			<param name="MaterialPointsSwarm">materialPoints</param>
-		</struct>
-		<struct name="particleLayout">
-			<param name="Type">RandomParticleLayout</param>
-			<param name="cellParticleCount">particleCount</param>
-		</struct>
-		<struct name="pMovementHandler"> 
-			<param name="Type">ParticleMovementHandler</param>
-		</struct>
-		<struct name="materialPoints">
-			<param name="Type">MaterialPointsSwarm</param>
-			<param name="CellLayout">elementCellLayout</param>
-			<param name="ParticleLayout">particleLayout</param>
-			<param name="FeMesh">linearMesh</param>
-			<param name="WeightsCalculator">weights</param>
-			<param name="TimeIntegrator">timeIntegrator</param>
-			<list name="ParticleCommHandlers">
-				<param>pMovementHandler</param>
-			</list>
-		</struct>
-							  
-	</struct>
-
-	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
-	<param name="maxTimeSteps"> 1 </param>
-	<param name="dumpEvery"> 1 </param>
-	<param name="outputPath"> ./output </param>
-	<param name="dim"> 2 </param>
-	
-	<param name="particleCount"> 20 </param>
-	<param name="FunctionName"> CircleInterface </param>
-	<param name="SampleSize"> 1000 </param>
-
-	<!-- Mesh Stuff -->
-	<param name="elementResI"> 2 </param>
-	<param name="elementResJ"> 2 </param>
-	<param name="elementResK"> 1 </param>
-	
-	<param name="shadowDepth"> 1 </param>
-	<param name="minX"> 0.0 </param>
-	<param name="minY"> 0.0 </param>
-	<param name="minZ"> 0.0 </param>
-	<param name="maxX"> 4.0 </param>
-	<param name="maxY"> 4.0 </param>
-	<param name="maxZ"> 1.0 </param>
-	<param name="allowUnbalancing"> True </param>
-	<param name="buildElementNodeTbl"> True </param>
-	
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/input/testPCDVC.xml
--- a/Utils/tests/input/testPCDVC.xml	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
-
-<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
-	
-	<!-- This included xml is a copy from PICellerator/Weights/tests
-	directory. It uses a plugin defined in that directory --> 
-	<include>testElementIntegral.xml</include>
-	
-	<struct name="components" mergeType="merge">
-
-		<struct name="weights">
-  			<param name="Type">PCDVC</param>
-			<param name="resolutionX">10</param>
-			<param name="resolutionY">10</param>
-			<param name="resolutionZ">10</param>
-			<param name="lowerT">0.6</param>
-			<param name="upperT">25</param>
-			<param name="maxDeletions">0</param>
-			<param name="maxSplits">0</param>
-			<param name="MaterialPointsSwarm">materialPoints</param>
-		</struct>
-	</struct>
-
-</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/testElementIntegral.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testElementIntegral.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>StgFEM/LinearMesh.xml</include>
+	<include>StgFEM/VelocityField.xml</include>
+	<include>StgFEM/TimeIntegrator.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="elementCellLayout">
+			<param name="Type">ElementCellLayout</param>
+			<param name="Mesh">linearMesh</param>
+		</struct>
+		<struct name="localLayout">
+			<param name="Type">MappedParticleLayout</param>
+		</struct>
+		<struct name="integrationSwarm">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">localLayout</param>
+			<param name="FeMesh">linearMesh</param>
+			<param name="WeightsCalculator">weights</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="IntegrationPointMapper">mapper</param>
+		</struct>
+		<struct name="mapper">
+			<param name="Type">CoincidentMapper</param>
+			<param name="IntegrationPointsSwarm">integrationSwarm</param>
+			<param name="MaterialPointsSwarm">materialPoints</param>
+		</struct>
+		<struct name="particleLayout">
+			<param name="Type">RandomParticleLayout</param>
+			<param name="cellParticleCount">particleCount</param>
+		</struct>
+		<struct name="pMovementHandler"> 
+			<param name="Type">ParticleMovementHandler</param>
+		</struct>
+		<struct name="materialPoints">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">particleLayout</param>
+			<param name="FeMesh">linearMesh</param>
+			<param name="WeightsCalculator">weights</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<list name="ParticleCommHandlers">
+				<param>pMovementHandler</param>
+			</list>
+		</struct>
+							  
+	</struct>
+
+	<list name="plugins">
+		<param>testElementIntegral</param>
+	</list>
+	
+	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
+	<param name="maxTimeSteps"> 1 </param>
+	<param name="dumpEvery"> 1 </param>
+	<param name="outputPath"> ./output </param>
+	<param name="dim"> 2 </param>
+	
+	<param name="particleCount"> 20 </param>
+	<param name="FunctionName"> CircleInterface </param>
+	<param name="SampleSize"> 1000 </param>
+
+	<!-- Mesh Stuff -->
+	<param name="elementResI"> 2 </param>
+	<param name="elementResJ"> 2 </param>
+	<param name="elementResK"> 1 </param>
+	
+	<param name="shadowDepth"> 1 </param>
+	<param name="minX"> 0.0 </param>
+	<param name="minY"> 0.0 </param>
+	<param name="minZ"> 0.0 </param>
+	<param name="maxX"> 4.0 </param>
+	<param name="maxY"> 4.0 </param>
+	<param name="maxZ"> 1.0 </param>
+	<param name="allowUnbalancing"> True </param>
+	<param name="buildElementNodeTbl"> True </param>
+	
+</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/testPCDVC.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testPCDVC.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<list name="import" mergeType="merge">
+		<param>PICellerator</param>
+	</list>
+
+	<!-- This included xml is a copy from PICellerator/Weights/tests
+	directory. It uses a plugin defined in that directory --> 
+	<include>testElementIntegral.xml</include>
+	
+	<struct name="components" mergeType="merge">
+
+		<struct name="weights">
+  			<param name="Type">PCDVC</param>
+			<param name="resolutionX">10</param>
+			<param name="resolutionY">10</param>
+			<param name="resolutionZ">10</param>
+			<param name="lowerT">0.6</param>
+			<param name="upperT">25</param>
+			<param name="maxDeletions">3</param>
+			<param name="maxSplits">3</param>
+			<param name="MaterialPointsSwarm">materialPoints</param>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/testPCDVC_Circle.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testPCDVC_Circle.0of1.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testConstantWeightsCircle.0of1.sh 279 2006-04-11 12:36:05Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testPCDVC.xml --FunctionName=CircleInterface --mean-tolerance=0.001 --standardDeviation-tolerance=0.001 --mean-expectedValue=0.162 --standardDeviation-expectedValue=0.063" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/testPCDVC_ExpIface.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testPCDVC_ExpIface.0of1.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testConstantWeightsExpIface.0of1.sh 279 2006-04-11 12:36:05Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testPCDVC.xml --FunctionName=ExponentialInterface --mean-tolerance=0.001 --standardDeviation-tolerance=0.001 --mean-expectedValue=0.07 --standardDeviation-expectedValue=0.05" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Utils/tests/testPCDVC_Poly.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testPCDVC_Poly.0of1.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,52 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+## Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+##	Victoria, 3800, Australia
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##
+## Contributors:
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+##	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testConstantWeightsPoly.0of1.sh 279 2006-04-11 12:36:05Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "StGermain testPCDVC.xml --FunctionName=PolynomialFunction --mean-tolerance=0.001 --standardDeviation-tolerance=0.001 --mean-expectedValue=0.012 --standardDeviation-expectedValue=0.002" "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/ConstantWeights.c
--- a/Weights/src/ConstantWeights.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/ConstantWeights.c	Tue Feb 02 16:55:08 2010 +1100
@@ -1,28 +1,28 @@
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 **
 ** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**      Melbourne, 3053, Australia.
+**	Melbourne, 3053, Australia.
 ** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**      Victoria, 3800, Australia
+**	Victoria, 3800, Australia
 **
 ** Primary Contributing Organisations:
-**      Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**      Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**      Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
 **
 ** Contributors:
-**      Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**      Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**      Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**      Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**      David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**      Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**      Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**      Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**      Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**      Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**      David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**      Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
 **
 **  This library is free software; you can redistribute it and/or
 **  modify it under the terms of the GNU Lesser General Public
@@ -62,131 +62,159 @@ const Type ConstantWeights_Type = "Const
 /*----------------------------------------------------------------------------------------------------------------------------------
 ** Constructors
 */
+ConstantWeights* ConstantWeights_New( Name name, Dimension_Index dim ) {
+	ConstantWeights* self = (ConstantWeights*) _ConstantWeights_DefaultNew( name );
 
-ConstantWeights* ConstantWeights_New( Name name, int dim ) {
-    ConstantWeights *self = _ConstantWeights_DefaultNew( name );
-
-    self->isConstructed = True;
-    _WeightsCalculator_Init( self, dim );
-    _ConstantWeights_Init( self );
+	ConstantWeights_InitAll( self, dim );
 
 	return self;
 }
 
-ConstantWeights* _ConstantWeights_New(  CONSTANTWEIGHTS_DEFARGS  ) {
-    ConstantWeights* self;
+ConstantWeights* _ConstantWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name )
+{
+	ConstantWeights* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(ConstantWeights) );
+	self = (ConstantWeights*)_WeightsCalculator_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			name );
 
-    /* Allocate memory */
-    assert( _sizeOfSelf >= sizeof(ConstantWeights) );
-    self = (ConstantWeights*)_WeightsCalculator_New(  WEIGHTSCALCULATOR_PASSARGS  );
+	
+	/* General info */
 
-    /* General info */
-
-    /* Virtual Info */
-
-    return self;
+	/* Virtual Info */
+	
+	return self;
 }
 
 void _ConstantWeights_Init( void* constantWeights  ) {
-	ConstantWeights* self;
-		
-	self = (ConstantWeights*)constantWeights;
+	ConstantWeights* self = (ConstantWeights*)constantWeights;
+	
+	self->isConstructed = True;
+
 }
 
+void ConstantWeights_InitAll( void* constantWeights, Dimension_Index dim ) {
+	ConstantWeights* self = (ConstantWeights*)constantWeights;
+
+	WeightsCalculator_InitAll( self, dim );
+	_ConstantWeights_Init( self );
+}
 
 /*------------------------------------------------------------------------------------------------------------------------
 ** Virtual functions
 */
 
 void _ConstantWeights_Delete( void* constantWeights ) {
-    ConstantWeights* self = (ConstantWeights*)constantWeights;
-        
-    /* Delete parent */
-    _WeightsCalculator_Delete( self );
+	ConstantWeights* self = (ConstantWeights*)constantWeights;
+	
+	/* Delete parent */
+	_WeightsCalculator_Delete( self );
 }
 
 
 void _ConstantWeights_Print( void* constantWeights, Stream* stream ) {
-    ConstantWeights* self = (ConstantWeights*)constantWeights;
-        
-    /* Print parent */
-    _WeightsCalculator_Print( self, stream );
+	ConstantWeights* self = (ConstantWeights*)constantWeights;
+	
+	/* Print parent */
+	_WeightsCalculator_Print( self, stream );
 }
 
 
 
 void* _ConstantWeights_Copy( void* constantWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    ConstantWeights*    self = (ConstantWeights*)constantWeights;
-    ConstantWeights*    newConstantWeights;
-        
-    newConstantWeights = (ConstantWeights*)_WeightsCalculator_Copy( self, dest, deep, nameExt, ptrMap );
-        
-    return (void*)newConstantWeights;
+	ConstantWeights*	self = (ConstantWeights*)constantWeights;
+	ConstantWeights*	newConstantWeights;
+	
+	newConstantWeights = (ConstantWeights*)_WeightsCalculator_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newConstantWeights;
 }
 
 void* _ConstantWeights_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(ConstantWeights);
-	Type                                                      type = ConstantWeights_Type;
-	Stg_Class_DeleteFunction*                              _delete = _ConstantWeights_Delete;
-	Stg_Class_PrintFunction*                                _print = _ConstantWeights_Print;
-	Stg_Class_CopyFunction*                                  _copy = _ConstantWeights_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _ConstantWeights_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _ConstantWeights_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _ConstantWeights_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _ConstantWeights_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _ConstantWeights_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _ConstantWeights_Destroy;
-	AllocationType                              nameAllocationType = NON_GLOBAL;
-	WeightsCalculator_CalculateFunction*                _calculate = _ConstantWeights_Calculate;
-
-    return (void*) _ConstantWeights_New(  CONSTANTWEIGHTS_PASSARGS  );
+	return (void*) _ConstantWeights_New(
+			sizeof(ConstantWeights),
+			ConstantWeights_Type,
+			_ConstantWeights_Delete,
+			_ConstantWeights_Print,
+			_ConstantWeights_Copy,
+			_ConstantWeights_DefaultNew,
+			_ConstantWeights_Construct,
+			_ConstantWeights_Build,
+			_ConstantWeights_Initialise,
+			_ConstantWeights_Execute,
+			_ConstantWeights_Destroy,
+			_ConstantWeights_Calculate,
+			name );
 }
 
 
-void _ConstantWeights_AssignFromXML( void* constantWeights, Stg_ComponentFactory* cf, void* data ) {
-    ConstantWeights*         self          = (ConstantWeights*) constantWeights;
+void _ConstantWeights_Construct( void* constantWeights, Stg_ComponentFactory* cf, void* data ) {
+	ConstantWeights*	     self          = (ConstantWeights*) constantWeights;
 
-    _WeightsCalculator_AssignFromXML( self, cf, data );
-        
-    _ConstantWeights_Init( self );
+	_WeightsCalculator_Construct( self, cf, data );
+	
+	_ConstantWeights_Init( self );
 }
 
 void _ConstantWeights_Build( void* constantWeights, void* data ) {
-    ConstantWeights*    self = (ConstantWeights*)constantWeights;
+	ConstantWeights*	self = (ConstantWeights*)constantWeights;
 
-    _WeightsCalculator_Build( self, data );
+	_WeightsCalculator_Build( self, data );
 }
-
-void _ConstantWeights_Destroy( void* constantWeights, void* data ) {
-    ConstantWeights*    self = (ConstantWeights*)constantWeights;
-
-    _WeightsCalculator_Destroy( self, data );
-}
-
 void _ConstantWeights_Initialise( void* constantWeights, void* data ) {
-    ConstantWeights*    self = (ConstantWeights*)constantWeights;
-        
-    _WeightsCalculator_Initialise( self, data );
+	ConstantWeights*	self = (ConstantWeights*)constantWeights;
+	
+	_WeightsCalculator_Initialise( self, data );
 }
 void _ConstantWeights_Execute( void* constantWeights, void* data ) {
-    ConstantWeights*    self = (ConstantWeights*)constantWeights;
-        
-    _WeightsCalculator_Execute( self, data );
+	ConstantWeights*	self = (ConstantWeights*)constantWeights;
+	
+	_WeightsCalculator_Execute( self, data );
+}
+void _ConstantWeights_Destroy( void* constantWeights, void* data ) {
+	ConstantWeights*	self = (ConstantWeights*)constantWeights;
+	
+	_WeightsCalculator_Destroy( self, data );
 }
 
 /*-------------------------------------------------------------------------------------------------------------------------
 ** Private Functions
 */
 void _ConstantWeights_Calculate( void* constantWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
-    ConstantWeights*             self            = (ConstantWeights*)  constantWeights;
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    double                       weight;
-    Particle_InCellIndex         cParticleCount;
-                
-    cParticleCount = swarm->cellParticleCountTbl[lCell_I];
-    weight = self->cellLocalVolume / (double) cParticleCount;
-    WeightsCalculator_SetWeightsValueAllInCell( self, swarm, lCell_I, weight );
+	ConstantWeights*             self            = (ConstantWeights*)  constantWeights;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	double                       weight;
+	Particle_InCellIndex         cParticleCount;
+		
+	cParticleCount = swarm->cellParticleCountTbl[lCell_I];
+	weight = self->cellLocalVolume / (double) cParticleCount;
+	WeightsCalculator_SetWeightsValueAllInCell( self, swarm, lCell_I, weight );
 }
 
 /*-------------------------------------------------------------------------------------------------------------------------
@@ -194,5 +222,3 @@ void _ConstantWeights_Calculate( void* c
 */
 
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/ConstantWeights.h
--- a/Weights/src/ConstantWeights.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/ConstantWeights.h	Tue Feb 02 16:55:08 2010 +1100
@@ -1,28 +1,28 @@
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 **
 ** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**      Melbourne, 3053, Australia.
+**	Melbourne, 3053, Australia.
 ** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**      Victoria, 3800, Australia
+**	Victoria, 3800, Australia
 **
 ** Primary Contributing Organisations:
-**      Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**      Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**      Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
 **
 ** Contributors:
-**      Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**      Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**      Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**      Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**      David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**      Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**      Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**      Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**      Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**      Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**      David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**      Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
 **
 **  This library is free software; you can redistribute it and/or
 **  modify it under the terms of the GNU Lesser General Public
@@ -40,15 +40,15 @@
 **
 */
 /** \file
- **  Role:
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: ConstantWeights.h 374 2006-10-12 08:59:41Z SteveQuenette $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: ConstantWeights.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_Weights_ConstantWeightsClass_h__
 #define __PICellerator_Weights_ConstantWeightsClass_h__
@@ -58,67 +58,62 @@
 
 	/* ConstantWeights information */
 	#define __ConstantWeights \
-    /* General info */ \
-	__WeightsCalculator \
-	\
-	/* Virtual Info */ \
+		/* General info */ \
+		__WeightsCalculator \
+		/* Virtual Info */\
+		\
 
 	struct ConstantWeights { __ConstantWeights };
-
+	
+	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Constructors
 	*/
+	ConstantWeights* ConstantWeights_New( Name name, Dimension_Index dim ) ;
+	ConstantWeights* _ConstantWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name );
 
-	ConstantWeights* ConstantWeights_New( Name name, int dim );
+	void _ConstantWeights_Init( void* constantWeights  ) ;
+	void ConstantWeights_InitAll( void* constantWeights, Dimension_Index dim ) ;
 
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define CONSTANTWEIGHTS_DEFARGS \
-		WEIGHTSCALCULATOR_DEFARGS
-
-	#define CONSTANTWEIGHTS_PASSARGS \
-		WEIGHTSCALCULATOR_PASSARGS
-
-	ConstantWeights* _ConstantWeights_New(  CONSTANTWEIGHTS_DEFARGS  );
-
-	void _ConstantWeights_Init( void* constantWeights );
 
 	/* Stg_Class_Delete ConstantWeights implementation */
 	void _ConstantWeights_Delete( void* constantWeights );
-
 	void _ConstantWeights_Print( void* constantWeights, Stream* stream );
-
 	#define ConstantWeights_Copy( self ) \
 		(ConstantWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define ConstantWeights_DeepCopy( self ) \
 		(ConstantWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
 	void* _ConstantWeights_Copy( void* constantWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-        
-	void* _ConstantWeights_DefaultNew( Name name );
-
-	void _ConstantWeights_AssignFromXML( void* constantWeights, Stg_ComponentFactory* cf, void* data );
-
-	void _ConstantWeights_Build( void* constantWeights, void* data );
-
-	void _ConstantWeights_Destroy( void* constantWeights, void* data );
-
-	void _ConstantWeights_Initialise( void* constantWeights, void* data );
-
+	
+	void* _ConstantWeights_DefaultNew( Name name ) ;
+void _ConstantWeights_Construct( void* constantWeights, Stg_ComponentFactory* cf, void* data ) ;
+	void _ConstantWeights_Build( void* constantWeights, void* data ) ;
+	void _ConstantWeights_Initialise( void* constantWeights, void* data ) ;
 	void _ConstantWeights_Execute( void* constantWeights, void* data );
-        
-	void _ConstantWeights_Calculate( void* constantWeights, void* _swarm, Cell_LocalIndex lCell_I );
-
+	void _ConstantWeights_Destroy( void* constantWeights, void* data ) ;
+	
+		
+	void _ConstantWeights_Calculate( void* constantWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Private functions
 	*/
-        
+	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Public functions
 	*/
-        
+	
+	
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/DVCWeights.c
--- a/Weights/src/DVCWeights.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/DVCWeights.c	Tue Feb 02 16:55:08 2010 +1100
@@ -4,14 +4,14 @@
 ** Redistribution and use in source and binary forms, with or without modification,
 ** are permitted provided that the following conditions are met:
 **
-**              * Redistributions of source code must retain the above copyright notice, 
-**                      this list of conditions and the following disclaimer.
-**              * Redistributions in binary form must reproduce the above copyright 
-**                      notice, this list of conditions and the following disclaimer in the 
-**                      documentation and/or other materials provided with the distribution.
-**              * Neither the name of the Monash University nor the names of its contributors 
-**                      may be used to endorse or promote products derived from this software 
-**                      without specific prior written permission.
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
 **
 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
@@ -26,18 +26,18 @@
 **
 **
 ** Contact:
-*%              Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
 *%
 ** Author:
 **              Mirko Velic - Mirko.Velic at sci.monash.edu.au
 **
 **  Assumptions:
-**       I am assuming that the xi's (local coords) on the IntegrationPoint particles
+**  	 I am assuming that the xi's (local coords) on the IntegrationPoint particles
 **       are precalculated somewhere and get reset based on material PIC positions each time step.
 **
 **  Notes:
 **         The DVCWeights class should really be a class the next level up here.
-**         We should be able to swap out the WeightsCalculator_CalculateAll function instead of just setting
+**	   We should be able to swap out the WeightsCalculator_CalculateAll function instead of just setting
 **                 a pointer inside that function 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -79,37 +79,67 @@ const Type DVCWeights_Type = "DVCWeights
 /*----------------------------------------------------------------------------------------------------------------------------------
 ** Constructors
 */
-DVCWeights* DVCWeights_New( Name name, Dimension_Index dim, int *res ) {
-	DVCWeights *self = _DVCWeights_DefaultNew( name );
+DVCWeights* DVCWeights_New( Name name, Dimension_Index dim ) {
+	DVCWeights* self = (DVCWeights*) _DVCWeights_DefaultNew( name );
 
-	self->isConstructed = True;
-	_WeightsCalculator_Init( self, dim );
-	_DVCWeights_Init( self, res );
-
+	DVCWeights_InitAll( self, dim );
 	return self;
 }
 
-DVCWeights* _DVCWeights_New(  DVCWEIGHTS_DEFARGS  ) {
-    DVCWeights* self;
-        
-    /* Allocate memory */
-    assert( _sizeOfSelf >= sizeof(DVCWeights) );
-    self = (DVCWeights*)_WeightsCalculator_New(  WEIGHTSCALCULATOR_PASSARGS  );
-        
-    /* General info */
+DVCWeights* _DVCWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name )
+{
+	DVCWeights* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(DVCWeights) );
+	self = (DVCWeights*)_WeightsCalculator_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			name );
 
-    /* Virtual Info */
+	
+	/* General info */
 
-    return self;
+	/* Virtual Info */
+	return self;
 }
 
 void _DVCWeights_Init( void* dvcWeights, int *res ) {
-    DVCWeights* self = (DVCWeights*)dvcWeights;
+	DVCWeights* self = (DVCWeights*)dvcWeights;
+	self->isConstructed = True;
 
-    self->resX = res[I_AXIS];
-    self->resY = res[J_AXIS];
-    self->resZ = res[K_AXIS];
+	self->resX = res[I_AXIS];
+	self->resY = res[J_AXIS];
+	self->resZ = res[K_AXIS];
 
+}
+
+void DVCWeights_InitAll( void* dvcWeights, Dimension_Index dim ) {
+	DVCWeights* self = (DVCWeights*)dvcWeights;
+	WeightsCalculator_InitAll( self, dim );
 }
 
 /*------------------------------------------------------------------------------------------------------------------------
@@ -117,81 +147,80 @@ void _DVCWeights_Init( void* dvcWeights,
 */
 
 void _DVCWeights_Delete( void* dvcWeights ) {
-    DVCWeights* self = (DVCWeights*)dvcWeights;
-    /* Delete parent */
-    _WeightsCalculator_Delete( self );
+	DVCWeights* self = (DVCWeights*)dvcWeights;
+	/* Delete parent */
+	_WeightsCalculator_Delete( self );
 }
 
 
 void _DVCWeights_Print( void* dvcWeights, Stream* stream ) {
-    DVCWeights* self = (DVCWeights*)dvcWeights;
-    /* Print parent */
-    _WeightsCalculator_Print( self, stream );
+	DVCWeights* self = (DVCWeights*)dvcWeights;
+	/* Print parent */
+	_WeightsCalculator_Print( self, stream );
 }
 
 
 
 void* _DVCWeights_Copy( void* dvcWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    DVCWeights* self = (DVCWeights*)dvcWeights;
-    DVCWeights* newDVCWeights;
-        
-    newDVCWeights = (DVCWeights*)_WeightsCalculator_Copy( self, dest, deep, nameExt, ptrMap );
-    return (void*)newDVCWeights;
+	DVCWeights*	self = (DVCWeights*)dvcWeights;
+	DVCWeights*	newDVCWeights;
+	
+	newDVCWeights = (DVCWeights*)_WeightsCalculator_Copy( self, dest, deep, nameExt, ptrMap );
+	return (void*)newDVCWeights;
 }
 
 void* _DVCWeights_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(DVCWeights);
-	Type                                                      type = DVCWeights_Type;
-	Stg_Class_DeleteFunction*                              _delete = _DVCWeights_Delete;
-	Stg_Class_PrintFunction*                                _print = _DVCWeights_Print;
-	Stg_Class_CopyFunction*                                  _copy = _DVCWeights_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _DVCWeights_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _DVCWeights_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _DVCWeights_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _DVCWeights_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _DVCWeights_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _DVCWeights_Destroy;
-	AllocationType                              nameAllocationType = NON_GLOBAL;
-	WeightsCalculator_CalculateFunction*                _calculate = _DVCWeights_Calculate;
-
-    return (void*) _DVCWeights_New(  DVCWEIGHTS_PASSARGS  );
+	return (void*) _DVCWeights_New(
+			sizeof(DVCWeights),
+			DVCWeights_Type,
+			_DVCWeights_Delete,
+			_DVCWeights_Print,
+			_DVCWeights_Copy,
+			_DVCWeights_DefaultNew,
+			_DVCWeights_Construct,
+			_DVCWeights_Build,
+			_DVCWeights_Initialise,
+			_DVCWeights_Execute,
+			_DVCWeights_Destroy,
+			_DVCWeights_Calculate,
+			name );
 }
 
 
-void _DVCWeights_AssignFromXML( void* dvcWeights, Stg_ComponentFactory* cf, void *data ) {
+void _DVCWeights_Construct( void* dvcWeights, Stg_ComponentFactory* cf, void *data ) {
 
-    DVCWeights*      self          = (DVCWeights*) dvcWeights;
+	DVCWeights*	     self          = (DVCWeights*) dvcWeights;
 
-    int defaultResolution;
-    int resolution[3];
+	int defaultResolution;
+	int resolution[3];
 
-    _WeightsCalculator_AssignFromXML( self, cf, data );
 
-    defaultResolution = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, (Dictionary_Entry_Key)"resolution", 10  );
-    resolution[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, (Dictionary_Entry_Key)"resolutionX", defaultResolution  );
-    resolution[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, (Dictionary_Entry_Key)"resolutionY", defaultResolution  );
-    resolution[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, (Dictionary_Entry_Key)"resolutionZ", defaultResolution  );
+	defaultResolution = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolution", 10 );
+	resolution[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionX", defaultResolution );
+	resolution[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionY", defaultResolution );
+	resolution[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionZ", defaultResolution );
+	
+	_WeightsCalculator_Construct( self, cf, data );
+
        
-    _DVCWeights_Init( self, resolution );
+	_DVCWeights_Init( self, resolution );
 }
 
 void _DVCWeights_Build( void* dvcWeights, void* data ) {
-    DVCWeights* self = (DVCWeights*)dvcWeights;
-    _WeightsCalculator_Build( self, data );
+	DVCWeights*	self = (DVCWeights*)dvcWeights;
+	_WeightsCalculator_Build( self, data );
 }
 void _DVCWeights_Initialise( void* dvcWeights, void* data ) {
-    DVCWeights* self = (DVCWeights*)dvcWeights;
-    _WeightsCalculator_Initialise( self, data );
+	DVCWeights*	self = (DVCWeights*)dvcWeights;
+	_WeightsCalculator_Initialise( self, data );
 }
 void _DVCWeights_Execute( void* dvcWeights, void* data ) {
-    DVCWeights* self = (DVCWeights*)dvcWeights;
-    _WeightsCalculator_Execute( self, data );
+	DVCWeights*	self = (DVCWeights*)dvcWeights;
+	_WeightsCalculator_Execute( self, data );
 }
-
 void _DVCWeights_Destroy( void* dvcWeights, void* data ) {
-    DVCWeights* self = (DVCWeights*)dvcWeights;
-    _WeightsCalculator_Destroy( self, data );
+	DVCWeights*	self = (DVCWeights*)dvcWeights;
+	_WeightsCalculator_Destroy( self, data );
 }
 
 /*-------------------------------------------------------------------------------------------------------------------------
@@ -200,744 +229,742 @@ void _DVCWeights_Destroy( void* dvcWeigh
 
 /** Get centroids of each voronoi region */
 void _DVCWeights_GetCentroids( struct cell *cells,struct particle *pList,
-                               int n, int m, int l,int nump,double vol){
-    int i;
-    int *count;
+		   int n, int m, int l,int nump,double vol){
+  int i;
+  int *count;
 
-    count=(int *)malloc(sizeof(int)*nump);
+  count=(int *)malloc(sizeof(int)*nump);
 
-    for(i=0;i<nump;i++){
-        count[i] = 0;
-        pList[ i ].cx = 0.0;
-        pList[ i ].cy = 0.0;
-        pList[ i ].cz = 0.0;    
-    }
-    for(i=0;i<n*m*l;i++){
-        pList[ cells[i].p ].cx += cells[i].x;
-        pList[ cells[i].p ].cy += cells[i].y;
-        pList[ cells[i].p ].cz += cells[i].z;
-        count[ cells[i].p ]++;//for total volume of a cell
-    }
-    for(i=0;i<nump;i++){
-        pList[ i ].w = count[i]*vol;
-        if(count[i] != 0){
-            pList[ i ].cx /= count[i];
-            pList[ i ].cy /= count[i];
-            pList[ i ].cz /= count[i];
-        } 
-    }
-    free(count);
+  for(i=0;i<nump;i++){
+    count[i] = 0;
+    pList[ i ].cx = 0.0;
+    pList[ i ].cy = 0.0;
+    pList[ i ].cz = 0.0;    
+  }
+  for(i=0;i<n*m*l;i++){
+    pList[ cells[i].p ].cx += cells[i].x;
+    pList[ cells[i].p ].cy += cells[i].y;
+    pList[ cells[i].p ].cz += cells[i].z;
+    count[ cells[i].p ]++;//for total volume of a cell
+  }
+  for(i=0;i<nump;i++){
+    pList[ i ].w = count[i]*vol;
+    if(count[i] != 0){
+      pList[ i ].cx /= count[i];
+      pList[ i ].cy /= count[i];
+      pList[ i ].cz /= count[i];
+    } 
+  }
+  free(count);
 }
 /** Get centroids of each voronoi region in 2D*/
 void _DVCWeights_GetCentroids2D( struct cell2d *cells,struct particle2d *pList,
-                                 int n, int m, int nump,double vol){
-    int i;
-    int *count;
+		   int n, int m, int nump,double vol){
+  int i;
+  int *count;
 
-    count=(int *)malloc(sizeof(int)*nump);
+  count=(int *)malloc(sizeof(int)*nump);
   
-    for(i=0;i<nump;i++){
-        count[i] = 0;
-        pList[ i ].cx = 0.0;
-        pList[ i ].cy = 0.0;
-    }
-    for(i=0;i<n*m;i++){
-        pList[ cells[i].p ].cx += cells[i].x;
-        pList[ cells[i].p ].cy += cells[i].y;
-        count[ cells[i].p ]++;//for total volume of a cell
-    }
-    for(i=0;i<nump;i++){
-        pList[ i ].w = count[i]*vol;
-        if(count[i] != 0){
-            pList[ i ].cx /= count[i];
-            pList[ i ].cy /= count[i];
-        } 
-    }  
-    free(count);
+  for(i=0;i<nump;i++){
+    count[i] = 0;
+    pList[ i ].cx = 0.0;
+    pList[ i ].cy = 0.0;
+  }
+  for(i=0;i<n*m;i++){
+    pList[ cells[i].p ].cx += cells[i].x;
+    pList[ cells[i].p ].cy += cells[i].y;
+    count[ cells[i].p ]++;//for total volume of a cell
+  }
+  for(i=0;i<nump;i++){
+    pList[ i ].w = count[i]*vol;
+    if(count[i] != 0){
+      pList[ i ].cx /= count[i];
+      pList[ i ].cy /= count[i];
+    } 
+  }  
+  free(count);
 }
 
 /** Claim a cell for a particle in the list */
 void _DVCWeights_ClaimCells(struct chain **bbchain,struct cell **ccells,struct particle **pList,int p_i){
-    int i,count;
-    int cell_num0;
-    double x0,y0,x1,y1,x2,y2,z0,z1,z2,dist1;
-    struct chain *bchain = &(*bbchain)[p_i];
-    struct cell *cells = *ccells;
-    int *temp;
+  int i,count;
+  int cell_num0;
+  double x0,y0,x1,y1,x2,y2,z0,z1,z2,dist1;
+  struct chain *bchain = &(*bbchain)[p_i];
+  struct cell *cells = *ccells;
+  int *temp;
 
-    count = 0;
-    bchain->numclaimed = 0;
+  count = 0;
+  bchain->numclaimed = 0;
 
 
-    for(i=0;i<bchain->sizeofboundary;i++){
-        cell_num0 = bchain->new_bound_cells[i];// cell number we are trying to claim
-        if(cells[cell_num0].p == -1){//if cell unowned then claim cell
-            /* This is the bit needed for mallocing */
-            /* do a test here to see if we need to realloc bchain->new_claimed_cells and bchain->new_bound_cells */
-            if( count > bchain->new_claimed_cells_malloced - 1 ){
-                temp = (int *)realloc( bchain->new_claimed_cells, (bchain->new_claimed_cells_malloced + DVC_INC)*sizeof(int) );
-                bchain->new_claimed_cells = temp;
-                bchain->new_claimed_cells_malloced += DVC_INC;
-                temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + DVC_INC)*sizeof(int) );
-                bchain->new_bound_cells = temp;
-                bchain->new_bound_cells_malloced += DVC_INC;      
-            }
-            /* end of bit needed for mallocing */
-            bchain->new_claimed_cells[count] = cell_num0;
-            bchain->numclaimed++;
-            count++;
-            cells[cell_num0].p = p_i;// this cell is now owned by particle p_i
-        }
-        else{
-            if(cells[cell_num0].p != p_i){
-                //we need a contest between particles for the cell.
-                x2 = (*pList)[p_i].x;
-                y2 = (*pList)[p_i].y;
-                z2 = (*pList)[p_i].z;
-                x1 = (*pList)[cells[cell_num0].p].x;
-                y1 = (*pList)[cells[cell_num0].p].y;
-                z1 = (*pList)[cells[cell_num0].p].z;
-                x0 = cells[cell_num0].x;
-                y0 = cells[cell_num0].y;
-                z0 = cells[cell_num0].z;
-        
-                dist1 = _DVCWeights_DistanceTest(x0,y0,z0,x1,y1,z1,x2,y2,z2);
-                if(dist1 > 0.0){
-                    bchain->new_claimed_cells[count] = cell_num0;
-                    bchain->numclaimed++;
-                    count++;
-                    cells[cell_num0].p = p_i;// this cell is now owned by particle p_i
-                }
-            }//if
-        }//else
+  for(i=0;i<bchain->sizeofboundary;i++){
+    cell_num0 = bchain->new_bound_cells[i];// cell number we are trying to claim
+    if(cells[cell_num0].p == -1){//if cell unowned then claim cell
+       /* This is the bit needed for mallocing */
+       /* do a test here to see if we need to realloc bchain->new_claimed_cells and bchain->new_bound_cells */
+       if( count > bchain->new_claimed_cells_malloced - 1 ){
+	     temp = (int *)realloc( bchain->new_claimed_cells, (bchain->new_claimed_cells_malloced + DVC_INC)*sizeof(int) );
+	     bchain->new_claimed_cells = temp;
+	     bchain->new_claimed_cells_malloced += DVC_INC;
+	     temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + DVC_INC)*sizeof(int) );
+	     bchain->new_bound_cells = temp;
+	     bchain->new_bound_cells_malloced += DVC_INC;	  
+       }
+       /* end of bit needed for mallocing */
+      bchain->new_claimed_cells[count] = cell_num0;
+      bchain->numclaimed++;
+      count++;
+      cells[cell_num0].p = p_i;// this cell is now owned by particle p_i
     }
-    bchain->new_claimed_cells[count] = -1;// end of list
+    else{
+      if(cells[cell_num0].p != p_i){
+	//we need a contest between particles for the cell.
+	x2 = (*pList)[p_i].x;
+	y2 = (*pList)[p_i].y;
+	z2 = (*pList)[p_i].z;
+	x1 = (*pList)[cells[cell_num0].p].x;
+	y1 = (*pList)[cells[cell_num0].p].y;
+	z1 = (*pList)[cells[cell_num0].p].z;
+	x0 = cells[cell_num0].x;
+	y0 = cells[cell_num0].y;
+	z0 = cells[cell_num0].z;
+	
+	dist1 = _DVCWeights_DistanceTest(x0,y0,z0,x1,y1,z1,x2,y2,z2);
+	if(dist1 > 0.0){
+	  bchain->new_claimed_cells[count] = cell_num0;
+	  bchain->numclaimed++;
+	  count++;
+	  cells[cell_num0].p = p_i;// this cell is now owned by particle p_i
+	}
+      }//if
+    }//else
+  }
+  bchain->new_claimed_cells[count] = -1;// end of list
 }
 
 /** Claim a cell for a particle in the list  in 2D*/
 void _DVCWeights_ClaimCells2D(struct chain **bbchain,struct cell2d **ccells,struct particle2d **pList,int p_i){
-    int i,count;
-    int cell_num0;
-    double x0,y0,x1,y1,x2,y2,dist1;
-    struct chain *bchain = &(*bbchain)[p_i];
-    struct cell2d *cells = *ccells;
-    int *temp;
+  int i,count;
+  int cell_num0;
+  double x0,y0,x1,y1,x2,y2,dist1;
+  struct chain *bchain = &(*bbchain)[p_i];
+  struct cell2d *cells = *ccells;
+  int *temp;
 
-    count = 0;
-    bchain->numclaimed = 0;
+  count = 0;
+  bchain->numclaimed = 0;
 
 
-    for(i=0;i<bchain->sizeofboundary;i++){
-        cell_num0 = bchain->new_bound_cells[i];// cell number we are trying to claim
-        if(cells[cell_num0].p == -1){//if cell unowned then claim cell
-            /* This is the bit needed for mallocing */
-            /* do a test here to see if we need to realloc bchain->new_claimed_cells and bchain->new_bound_cells */
-            if( count > bchain->new_claimed_cells_malloced - 1 ){
-                temp = (int *)realloc( bchain->new_claimed_cells, (bchain->new_claimed_cells_malloced + DVC_INC)*sizeof(int) );
-                bchain->new_claimed_cells = temp;
-                bchain->new_claimed_cells_malloced += DVC_INC;
-                temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + DVC_INC)*sizeof(int) );
-                bchain->new_bound_cells = temp;
-                bchain->new_bound_cells_malloced += DVC_INC;      
-            }
-            /* end of bit needed for mallocing */
-            bchain->new_claimed_cells[count] = cell_num0;
-            bchain->numclaimed++;
-            count++;
-            cells[cell_num0].p = p_i;// this cell is now owned by particle p_i
-        }
-        else{
-            if(cells[cell_num0].p != p_i){
-                //we need a contest between particles for the cell.
-                x2 = (*pList)[p_i].x;
-                y2 = (*pList)[p_i].y;
-                x1 = (*pList)[cells[cell_num0].p].x;
-                y1 = (*pList)[cells[cell_num0].p].y;
-                x0 = cells[cell_num0].x;
-                y0 = cells[cell_num0].y;
-        
-                dist1 = _DVCWeights_DistanceTest2D(x0,y0,x1,y1,x2,y2);
-                if(dist1 > 0.0){
-                    bchain->new_claimed_cells[count] = cell_num0;
-                    bchain->numclaimed++;
-                    count++;
-                    cells[cell_num0].p = p_i;// this cell is now owned by particle p_i
-                }
-            }//if
-        }//else
+  for(i=0;i<bchain->sizeofboundary;i++){
+    cell_num0 = bchain->new_bound_cells[i];// cell number we are trying to claim
+    if(cells[cell_num0].p == -1){//if cell unowned then claim cell
+       /* This is the bit needed for mallocing */
+       /* do a test here to see if we need to realloc bchain->new_claimed_cells and bchain->new_bound_cells */
+       if( count > bchain->new_claimed_cells_malloced - 1 ){
+	     temp = (int *)realloc( bchain->new_claimed_cells, (bchain->new_claimed_cells_malloced + DVC_INC)*sizeof(int) );
+	     bchain->new_claimed_cells = temp;
+	     bchain->new_claimed_cells_malloced += DVC_INC;
+	     temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + DVC_INC)*sizeof(int) );
+	     bchain->new_bound_cells = temp;
+	     bchain->new_bound_cells_malloced += DVC_INC;	  
+       }
+       /* end of bit needed for mallocing */
+      bchain->new_claimed_cells[count] = cell_num0;
+      bchain->numclaimed++;
+      count++;
+      cells[cell_num0].p = p_i;// this cell is now owned by particle p_i
     }
-    bchain->new_claimed_cells[count] = -1;// end of list
+    else{
+      if(cells[cell_num0].p != p_i){
+	//we need a contest between particles for the cell.
+	x2 = (*pList)[p_i].x;
+	y2 = (*pList)[p_i].y;
+	x1 = (*pList)[cells[cell_num0].p].x;
+	y1 = (*pList)[cells[cell_num0].p].y;
+	x0 = cells[cell_num0].x;
+	y0 = cells[cell_num0].y;
+	
+	dist1 = _DVCWeights_DistanceTest2D(x0,y0,x1,y1,x2,y2);
+	if(dist1 > 0.0){
+	  bchain->new_claimed_cells[count] = cell_num0;
+	  bchain->numclaimed++;
+	  count++;
+	  cells[cell_num0].p = p_i;// this cell is now owned by particle p_i
+	}
+      }//if
+    }//else
+  }
+  bchain->new_claimed_cells[count] = -1;// end of list
 }
 
 /** Reset the values in the cells so that the grid over the element can be used again */
 void _DVCWeights_ResetGrid(struct cell **cells, int n){
-    int i;
+  int i;
 
-    for(i=0;i<n;i++){
-        (*cells)[i].p = -1;
-        (*cells)[i].done = 0;
-    }
+  for(i=0;i<n;i++){
+    (*cells)[i].p = -1;
+    (*cells)[i].done = 0;
+  }
 }
 
 /** Reset the values in the cells so that the grid over the element can be used again, in 2D */
 void _DVCWeights_ResetGrid2D(struct cell2d **cells, int n){
-    int i;
+  int i;
 
-    for(i=0;i<n;i++){
-        (*cells)[i].p = -1;
-        (*cells)[i].done = 0;
-    }
+  for(i=0;i<n;i++){
+    (*cells)[i].p = -1;
+    (*cells)[i].done = 0;
+  }
 }
 
 /** Update the list of the cells on the boundary of the growing voronoi cells 
-    Add new particles on the boundary, and remove particles no longer on the boundary.*/
+	Add new particles on the boundary, and remove particles no longer on the boundary.*/
 void _DVCWeights_UpdateBchain(struct chain **bbchain,struct cell **ccells,int p_i){
-    int i,k,count;
-    int cell_num0,cell_num[6],cell_num1;
-    struct chain *bchain = &(*bbchain)[p_i];
-    struct cell *cells = *ccells;
-    int *temp;
+  int i,k,count;
+  int cell_num0,cell_num[6],cell_num1;
+  struct chain *bchain = &(*bbchain)[p_i];
+  struct cell *cells = *ccells;
+  int *temp;
 
-    count = 0;
-    bchain->sizeofboundary = 0;
-    for(i=0;i<bchain->numclaimed;i++){
-        cell_num0 =bchain->new_claimed_cells[i];
+  count = 0;
+  bchain->sizeofboundary = 0;
+  for(i=0;i<bchain->numclaimed;i++){
+    cell_num0 =bchain->new_claimed_cells[i];
 
-        cell_num[0] = cells[cell_num0].S;    
-        cell_num[1] = cells[cell_num0].N;
-        cell_num[2] = cells[cell_num0].E;
-        cell_num[3] = cells[cell_num0].W;
-        cell_num[4] = cells[cell_num0].U;
-        cell_num[5] = cells[cell_num0].D;
+    cell_num[0] = cells[cell_num0].S;    
+    cell_num[1] = cells[cell_num0].N;
+    cell_num[2] = cells[cell_num0].E;
+    cell_num[3] = cells[cell_num0].W;
+    cell_num[4] = cells[cell_num0].U;
+    cell_num[5] = cells[cell_num0].D;
 
-        for(k=0;k<6;k++){
-            cell_num1 = cell_num[k];
-            // if cell does not already belong to the particle and hasn't been
-            // marked as being done then add it to new boundary array and mark it
-            // as done
-            if(cell_num1 != -2){
-                if(cells[cell_num1].p != p_i && cells[cell_num1].done != 1){
-                    /* This is the bit needed for mallocing */     
-                    /* do a test here to see if we need to realloc bchain->new_claimed_cells and bchain->new_bound_cells */
-                    if( count > bchain->new_bound_cells_malloced - 1 ){
-                        temp = (int *)realloc( bchain->new_claimed_cells, (bchain->new_claimed_cells_malloced + DVC_INC)*sizeof(int) );
-                        bchain->new_claimed_cells = temp;
-                        bchain->new_claimed_cells_malloced += DVC_INC;
-                        temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + DVC_INC)*sizeof(int) );
-                        bchain->new_bound_cells = temp;
-                        bchain->new_bound_cells_malloced += DVC_INC; 
-                    }
-                    /* end of bit needed for mallocing */
-                    bchain->new_bound_cells[count] = cell_num1;
-                    bchain->sizeofboundary++;
-                    count++;
-                    cells[cell_num1].done = 1;
-                }//if
-            }//if cell_num1
-        }//for k
-    }//for
-    // reset the done flags back to zero for next time
-    for(i=0;i<count;i++){
-        cells[  bchain->new_bound_cells[i]  ].done = 0;
-    }
+    for(k=0;k<6;k++){
+	  cell_num1 = cell_num[k];
+      // if cell does not already belong to the particle and hasn't been
+      // marked as being done then add it to new boundary array and mark it
+      // as done
+      if(cell_num1 != -2){
+	if(cells[cell_num1].p != p_i && cells[cell_num1].done != 1){
+	   /* This is the bit needed for mallocing */	   
+	   /* do a test here to see if we need to realloc bchain->new_claimed_cells and bchain->new_bound_cells */
+	   if( count > bchain->new_bound_cells_malloced - 1 ){
+		 temp = (int *)realloc( bchain->new_claimed_cells, (bchain->new_claimed_cells_malloced + DVC_INC)*sizeof(int) );
+		 bchain->new_claimed_cells = temp;
+		 bchain->new_claimed_cells_malloced += DVC_INC;
+		 temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + DVC_INC)*sizeof(int) );
+		 bchain->new_bound_cells = temp;
+		 bchain->new_bound_cells_malloced += DVC_INC; 
+	   }
+	   /* end of bit needed for mallocing */
+	  bchain->new_bound_cells[count] = cell_num1;
+	  bchain->sizeofboundary++;
+	  count++;
+	  cells[cell_num1].done = 1;
+	}//if
+      }//if cell_num1
+    }//for k
+  }//for
+  // reset the done flags back to zero for next time
+  for(i=0;i<count;i++){
+    cells[  bchain->new_bound_cells[i]  ].done = 0;
+  }
 }
 
 /** Update the list of the cells on the boundary of the growing voronoi cells 
-    Add new particles on the boundary, and remove particles no longer on the boundary. In 2D*/
+	Add new particles on the boundary, and remove particles no longer on the boundary. In 2D*/
 void _DVCWeights_UpdateBchain2D(struct chain **bbchain,struct cell2d **ccells,int p_i){
-    int i,k,count;
-    int cell_num0,cell_num[4],cell_num1;
-    struct chain *bchain = &(*bbchain)[p_i];
-    struct cell2d *cells = *ccells;
-    int *temp;
+  int i,k,count;
+  int cell_num0,cell_num[4],cell_num1;
+  struct chain *bchain = &(*bbchain)[p_i];
+  struct cell2d *cells = *ccells;
+  int *temp;
 
-    count = 0;
-    bchain->sizeofboundary = 0;
-    for(i=0;i<bchain->numclaimed;i++){
-        cell_num0 =bchain->new_claimed_cells[i];
+  count = 0;
+  bchain->sizeofboundary = 0;
+  for(i=0;i<bchain->numclaimed;i++){
+    cell_num0 =bchain->new_claimed_cells[i];
 
-        cell_num[0] = cells[cell_num0].S;    
-        cell_num[1] = cells[cell_num0].N;
-        cell_num[2] = cells[cell_num0].E;
-        cell_num[3] = cells[cell_num0].W;
+    cell_num[0] = cells[cell_num0].S;    
+    cell_num[1] = cells[cell_num0].N;
+    cell_num[2] = cells[cell_num0].E;
+    cell_num[3] = cells[cell_num0].W;
 
-        for(k=0;k<4;k++){
-            cell_num1 = cell_num[k];
-            // if cell does not already belong to the particle and hasn't been
-            // marked as being done then add it to new boundary array and mark it
-            // as done
-            if(cell_num1 != -2){
-                if(cells[cell_num1].p != p_i && cells[cell_num1].done != 1){
-                    /* This is the bit needed for mallocing */     
-                    /* do a test here to see if we need to realloc bchain->new_claimed_cells and bchain->new_bound_cells */
-                    if( count > bchain->new_bound_cells_malloced - 1 ){
-                        temp = (int *)realloc( bchain->new_claimed_cells, (bchain->new_claimed_cells_malloced + DVC_INC)*sizeof(int) );
-                        bchain->new_claimed_cells = temp;
-                        bchain->new_claimed_cells_malloced += DVC_INC;
-                        temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + DVC_INC)*sizeof(int) );
-                        bchain->new_bound_cells = temp;
-                        bchain->new_bound_cells_malloced += DVC_INC; 
-                    }
-                    /* end of bit needed for mallocing */
-                    bchain->new_bound_cells[count] = cell_num1;
-                    bchain->sizeofboundary++;
-                    count++;
-                    cells[cell_num1].done = 1;
-                }//if
-            }//if cell_num1
-        }//for k
-    }//for
-    // reset the done flags back to zero for next time
-    for(i=0;i<count;i++){
-        cells[  bchain->new_bound_cells[i]  ].done = 0;
-    }
+    for(k=0;k<4;k++){
+      cell_num1 = cell_num[k];
+      // if cell does not already belong to the particle and hasn't been
+      // marked as being done then add it to new boundary array and mark it
+      // as done
+      if(cell_num1 != -2){
+	if(cells[cell_num1].p != p_i && cells[cell_num1].done != 1){
+	   /* This is the bit needed for mallocing */	   
+	   /* do a test here to see if we need to realloc bchain->new_claimed_cells and bchain->new_bound_cells */
+	   if( count > bchain->new_bound_cells_malloced - 1 ){
+		 temp = (int *)realloc( bchain->new_claimed_cells, (bchain->new_claimed_cells_malloced + DVC_INC)*sizeof(int) );
+		 bchain->new_claimed_cells = temp;
+		 bchain->new_claimed_cells_malloced += DVC_INC;
+		 temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + DVC_INC)*sizeof(int) );
+		 bchain->new_bound_cells = temp;
+		 bchain->new_bound_cells_malloced += DVC_INC; 
+	   }
+	   /* end of bit needed for mallocing */
+	  bchain->new_bound_cells[count] = cell_num1;
+	  bchain->sizeofboundary++;
+	  count++;
+	  cells[cell_num1].done = 1;
+	}//if
+      }//if cell_num1
+    }//for k
+  }//for
+  // reset the done flags back to zero for next time
+  for(i=0;i<count;i++){
+    cells[  bchain->new_bound_cells[i]  ].done = 0;
+  }
 }
 
 
 /** Construct the grid over the element. This grid is fixed. 
-    (n, m, l) are (z, x, y) grid resolutions respectively.*/
+ (n, m, l) are (z, x, y) grid resolutions respectively.*/
 void _DVCWeights_ConstructGrid(struct cell **cell_list, int n, int m, int l,
-                               double x0,double y0,double z0,double x1,double y1,double z1){
-    struct cell *cells;
-    int i,j,k;
-    double dx,dy,dz,Dx,Dy,Dz,X,Y,Z;
+		    double x0,double y0,double z0,double x1,double y1,double z1){
+  struct cell *cells;
+  int i,j,k;
+  double dx,dy,dz,Dx,Dy,Dz,X,Y,Z;
 
-    cells = malloc(n*m*l*sizeof(struct cell));
-    for(i=0;i<l*m*n;i++){
-        cells[i].S = -2;
-        cells[i].N = -2;
-        cells[i].E = -2;
-        cells[i].W = -2;
-        cells[i].U = -2;
-        cells[i].D = -2;
-        cells[i].p = -1;
-        cells[i].done = 0;
+  cells = malloc(n*m*l*sizeof(struct cell));
+  for(i=0;i<l*m*n;i++){
+    cells[i].S = -2;
+    cells[i].N = -2;
+    cells[i].E = -2;
+    cells[i].W = -2;
+    cells[i].U = -2;
+    cells[i].D = -2;
+    cells[i].p = -1;
+    cells[i].done = 0;
+  }
+  for(k=0;k<n;k++){
+    for(i=0;i<l*(m-1);i++){
+      cells[i+k*l*m].N=i+k*l*m+l;
+      cells[i+l+k*l*m].S = i+k*l*m;
     }
-    for(k=0;k<n;k++){
-        for(i=0;i<l*(m-1);i++){
-            cells[i+k*l*m].N=i+k*l*m+l;
-            cells[i+l+k*l*m].S = i+k*l*m;
-        }
+  }
+  for(k=0;k<n-1;k++){
+    for(i=0;i<l*m;i++){
+      cells[i+k*l*m].U=i+k*l*m+l*m;
+      cells[i+k*l*m+l*m].D = i+k*l*m;
     }
-    for(k=0;k<n-1;k++){
-        for(i=0;i<l*m;i++){
-            cells[i+k*l*m].U=i+k*l*m+l*m;
-            cells[i+k*l*m+l*m].D = i+k*l*m;
-        }
-    }
+  }
   
-    Dx = x1-x0; Dy = y1-y0; Dz = z1-z0;
-    dx = Dx/l;  dy = Dy/m;  dz = Dz/n;
-    Z = z0 - dz/2.0;
-    for(k=0;k<n;k++){
-        Z = Z + dz;
-        Y = y0 - dy/2.0;
-        for(j=0;j<m;j++){
-            Y = Y + dy;
-            X = x0 - dx/2.0;
-            for(i=0;i<l;i++){
-                X=X+dx;
-                cells[i+l*j+k*l*m].x = X;
-                cells[i+l*j+k*l*m].y = Y;
-                cells[i+l*j+k*l*m].z = Z;
-                if(i!= l-1){
-                    cells[i+l*j+k*l*m].E = i+l*j+1+k*l*m;
-                    cells[i+l*j+1+k*l*m].W = i+l*j+k*l*m;
-                }
-            }//x
-        }//y
-    }//z
-    *cell_list = cells; 
+  Dx = x1-x0; Dy = y1-y0; Dz = z1-z0;
+  dx = Dx/l;  dy = Dy/m;  dz = Dz/n;
+  Z = z0 - dz/2.0;
+  for(k=0;k<n;k++){
+    Z = Z + dz;
+    Y = y0 - dy/2.0;
+    for(j=0;j<m;j++){
+      Y = Y + dy;
+      X = x0 - dx/2.0;
+      for(i=0;i<l;i++){
+	X=X+dx;
+	cells[i+l*j+k*l*m].x = X;
+	cells[i+l*j+k*l*m].y = Y;
+	cells[i+l*j+k*l*m].z = Z;
+	if(i!= l-1){
+	  cells[i+l*j+k*l*m].E = i+l*j+1+k*l*m;
+	  cells[i+l*j+1+k*l*m].W = i+l*j+k*l*m;
+	}
+      }//x
+    }//y
+  }//z
+  *cell_list = cells; 
 }
 
 
 /** Construct the grid over the element. This grid is fixed. 
-    (m, l) are (x, y) grid resolutions respectively.*/
+  (m, l) are (x, y) grid resolutions respectively.*/
 void _DVCWeights_ConstructGrid2D(struct cell2d **cell_list, int m, int l,
-                                 double x0,double y0,double x1,double y1){
-    struct cell2d *cells;
-    int i,j;
-    double dx,dy,Dx,Dy,X,Y;
+		    double x0,double y0,double x1,double y1){
+  struct cell2d *cells;
+  int i,j;
+  double dx,dy,Dx,Dy,X,Y;
 
-    cells = malloc(m*l*sizeof(struct cell));
-    for(i=0;i<l*m;i++){
-        cells[i].S = -2;
-        cells[i].N = -2;
-        cells[i].E = -2;
-        cells[i].W = -2;
-        cells[i].p = -1;
-        cells[i].done = 0;
+  cells = malloc(m*l*sizeof(struct cell));
+  for(i=0;i<l*m;i++){
+    cells[i].S = -2;
+    cells[i].N = -2;
+    cells[i].E = -2;
+    cells[i].W = -2;
+    cells[i].p = -1;
+    cells[i].done = 0;
+  }
+  for(i=0;i<l*(m-1);i++){
+    cells[i].N=i+l;
+    cells[i+l].S = i;
+  }
+  Dx = x1-x0; Dy = y1-y0;
+  dx = Dx/l;  dy = Dy/m;
+  Y = y0 - dy/2.0;
+  for(j=0;j<m;j++){
+    Y = Y + dy;
+    X = x0 - dx/2.0;
+    for(i=0;i<l;i++){
+      X=X+dx;
+      cells[i+l*j].x = X;
+      cells[i+l*j].y = Y;
+      if(i!= l-1){
+	cells[i+l*j].E = i+l*j+1;
+	cells[i+l*j+1].W = i+l*j;
+      }
     }
-    for(i=0;i<l*(m-1);i++){
-        cells[i].N=i+l;
-        cells[i+l].S = i;
-    }
-    Dx = x1-x0; Dy = y1-y0;
-    dx = Dx/l;  dy = Dy/m;
-    Y = y0 - dy/2.0;
-    for(j=0;j<m;j++){
-        Y = Y + dy;
-        X = x0 - dx/2.0;
-        for(i=0;i<l;i++){
-            X=X+dx;
-            cells[i+l*j].x = X;
-            cells[i+l*j].y = Y;
-            if(i!= l-1){
-                cells[i+l*j].E = i+l*j+1;
-                cells[i+l*j+1].W = i+l*j;
-            }
-        }
-    }
-    *cell_list = cells; 
+  }
+  *cell_list = cells; 
 }
 
 /** Calculate the sqaure of the distance between two points */
 double _DVCWeights_DistanceSquared(double x0, double y0, double z0, double x1, double y1, double z1){
-    return (x1-x0)*(x1-x0)+(y1-y0)*(y1-y0)+(z1-z0)*(z1-z0);
+	return (x1-x0)*(x1-x0)+(y1-y0)*(y1-y0)+(z1-z0)*(z1-z0);
 }
 
 /** Calculate the sqaure of the distance between two points in 2D*/
 double _DVCWeights_DistanceSquared2D(double x0, double y0,double x1, double y1){
-    return (x1-x0)*(x1-x0)+(y1-y0)*(y1-y0);
+	return (x1-x0)*(x1-x0)+(y1-y0)*(y1-y0);
 }
 double _DVCWeights_DistanceTest2D(double x0, double y0, double x1, double y1,double x2, double y2){
-    return (x1+x2-x0-x0)*(x1-x2) + (y1+y2-y0-y0)*(y1-y2);
+        return (x1+x2-x0-x0)*(x1-x2) + (y1+y2-y0-y0)*(y1-y2);
 }
 double _DVCWeights_DistanceTest(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2){
-    return (x1+x2-x0-x0)*(x1-x2) + (y1+y2-y0-y0)*(y1-y2) + (z1+z2-z0-z0)*(z1-z2);
+        return (x1+x2-x0-x0)*(x1-x2) + (y1+y2-y0-y0)*(y1-y2) + (z1+z2-z0-z0)*(z1-z2);
 }
 /** Allocate the internal structs for the bchain (boundary chain) and the plist (particle list) */
 void _DVCWeights_InitialiseStructs( struct chain **bchain, struct particle **pList, int nump){
 
-    int i;
-    // init the data structures
-    if( (*bchain = (struct chain *)malloc( nump*sizeof(struct chain ) )) == 0){
-        Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"DVC_Weights" ), "No memory for bchain in '%s'\nCannot continue.\n", __func__);
-    }
-    // note that doing bchain[i]->new... doesn't work
-    for(i=0;i<nump;i++){
-        (*bchain)[i].new_claimed_cells = (int *)malloc(DVC_INC*sizeof(int));
-        (*bchain)[i].new_claimed_cells_malloced = DVC_INC;
-        (*bchain)[i].new_bound_cells = (int *)malloc(DVC_INC*sizeof(int));
-        (*bchain)[i].new_bound_cells_malloced = DVC_INC;
-    }
-    if( (*pList = (struct particle *)malloc( nump*sizeof(struct particle ) )) == 0){
-        Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"DVC_Weights" ),"No memory for pList in '%s'\nCannot continue.\n", __func__);
-    }
+   int i;
+      // init the data structures
+      if( (*bchain = (struct chain *)malloc( nump*sizeof(struct chain ) )) == 0){
+	 	Journal_Firewall( 0 , Journal_Register(Error_Type, "DVC_Weights"), "No memory for bchain in '%s'\nCannot continue.\n", __func__);
+      }
+      // note that doing bchain[i]->new... doesn't work
+      for(i=0;i<nump;i++){
+	 (*bchain)[i].new_claimed_cells = (int *)malloc(DVC_INC*sizeof(int));
+	 (*bchain)[i].new_claimed_cells_malloced = DVC_INC;
+	 (*bchain)[i].new_bound_cells = (int *)malloc(DVC_INC*sizeof(int));
+	 (*bchain)[i].new_bound_cells_malloced = DVC_INC;
+      }
+      if( (*pList = (struct particle *)malloc( nump*sizeof(struct particle ) )) == 0){
+	 Journal_Firewall( 0 , Journal_Register(Error_Type, "DVC_Weights"),"No memory for pList in '%s'\nCannot continue.\n", __func__);
+      }
 
-    /* Initialise all particle values to zero */
-    for (i = 0; i < nump; i++) {
-        (*pList)[i].x = 0; (*pList)[i].y = 0; (*pList)[i].z = 0;
-        (*pList)[i].cx = 0; (*pList)[i].cy = 0; (*pList)[i].cz = 0;
-        (*pList)[i].w = 0;
-        (*pList)[i].index = 0;
-    }
+   /* Initialise all particle values to zero */
+   for (i = 0; i < nump; i++) {
+      (*pList)[i].x = 0; (*pList)[i].y = 0; (*pList)[i].z = 0;
+      (*pList)[i].cx = 0; (*pList)[i].cy = 0; (*pList)[i].cz = 0;
+      (*pList)[i].w = 0;
+      (*pList)[i].index = 0;
+   }
 }
 /** Allocate the internal structs for the bchain (boundary chain) and the plist (particle list) */
 void _DVCWeights_InitialiseStructs2D( struct chain **bchain, struct particle2d **pList, int nump){
 
-    int i;
-    // init the data structures
-    if( (*bchain = (struct chain *)malloc( nump*sizeof(struct chain ) )) == 0){
-        Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"DVC_Weights" ),"No memory for bchain in '%s'\nCannot continue.\n", __func__);
-    }
-    //
-    for(i=0;i<nump;i++){
-        (*bchain)[i].new_claimed_cells = (int *)malloc(DVC_INC*sizeof(int));
-        (*bchain)[i].new_claimed_cells_malloced = DVC_INC;
-        (*bchain)[i].new_bound_cells = (int *)malloc(DVC_INC*sizeof(int));
-        (*bchain)[i].new_bound_cells_malloced = DVC_INC;
-    }
-    if( (*pList = (struct particle2d *)malloc( nump*sizeof(struct particle2d ) )) == 0){
-        Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"DVC_Weights" ),"No memory for pList in '%s'\nCannot continue.\n", __func__);
-    }
+   int i;
+      // init the data structures
+      if( (*bchain = (struct chain *)malloc( nump*sizeof(struct chain ) )) == 0){
+	 Journal_Firewall( 0 , Journal_Register(Error_Type, "DVC_Weights"),"No memory for bchain in '%s'\nCannot continue.\n", __func__);
+      }
+      //
+      for(i=0;i<nump;i++){
+	 (*bchain)[i].new_claimed_cells = (int *)malloc(DVC_INC*sizeof(int));
+	 (*bchain)[i].new_claimed_cells_malloced = DVC_INC;
+	 (*bchain)[i].new_bound_cells = (int *)malloc(DVC_INC*sizeof(int));
+	 (*bchain)[i].new_bound_cells_malloced = DVC_INC;
+      }
+      if( (*pList = (struct particle2d *)malloc( nump*sizeof(struct particle2d ) )) == 0){
+	 Journal_Firewall( 0 , Journal_Register(Error_Type, "DVC_Weights"),"No memory for pList in '%s'\nCannot continue.\n", __func__);
+      }
 
-    /* Initialise all particle values to zero */
-    for (i = 0; i < nump; i++) {
-        (*pList)[i].x = 0; (*pList)[i].y = 0;
-        (*pList)[i].cx = 0; (*pList)[i].cy = 0;
-        (*pList)[i].w = 0;
-        (*pList)[i].index = 0;
-    }
+   /* Initialise all particle values to zero */
+   for (i = 0; i < nump; i++) {
+      (*pList)[i].x = 0; (*pList)[i].y = 0;
+      (*pList)[i].cx = 0; (*pList)[i].cy = 0;
+      (*pList)[i].w = 0;
+      (*pList)[i].index = 0;
+   }
 }
 
 /** Create the Voronoi diagram by growing the voronoi cells from the particle locations.
-    All the parameters passed into _DVCWeights_CreateVoronoi
-    must be initialised already. */
+  All the parameters passed into _DVCWeights_CreateVoronoi
+  must be initialised already. */
 void _DVCWeights_CreateVoronoi( struct chain **bchain, struct particle **pList, struct cell **cells, 
-                                double dx, double dy, double dz,
-                                int nump,
-                                int numx, int numy, int numz, 
-                                double BBXMIN, double BBXMAX, 
-                                double BBYMIN, double BBYMAX,
-                                double BBZMIN, double BBZMAX){
-    int i,j,k,l;
-    int count;
-    int claimed;
+		     double dx, double dy, double dz,
+		     int nump,
+		     int numx, int numy, int numz, 
+		     double BBXMIN, double BBXMAX, 
+		     double BBYMIN, double BBYMAX,
+		     double BBZMIN, double BBZMAX){
+      int i,j,k,l;
+      int count;
+      int claimed;
 
-    for(i=0;i<nump;i++){
-        k = ((*pList)[i].x - BBXMIN)/dx;
-        j = ((*pList)[i].y - BBYMIN)/dy;
-        l = ((*pList)[i].z - BBZMIN)/dz;
+      for(i=0;i<nump;i++){
+	    k = ((*pList)[i].x - BBXMIN)/dx;
+	    j = ((*pList)[i].y - BBYMIN)/dy;
+	    l = ((*pList)[i].z - BBZMIN)/dz;
         /* If a particle is exactly on the border then make sure it is in a valid cell inside the element */
-        if (k == numx){  k--; }
-        if (j == numy) { j--; }
-        if (l == numz) { l--; }
-        (*cells)[k+j*numx+l*numx*numy].p = i; //particle number i
-        (*bchain)[i].numclaimed = 1;// number of most recently claimed cells
-        (*bchain)[i].sizeofboundary = 0;
-        (*bchain)[i].totalclaimed = 1;// total of claimed cells so far.
-        (*bchain)[i].done = 0;
-        (*bchain)[i].index = k+j*numx+l*numx*numy;// ith particle is in cell # k+j*numx
-        (*bchain)[i].new_claimed_cells[0] = k+j*numx+l*numx*numy; 
-        // ith particle has just claimed cell number k+j*numx+l*numx*numy
-        (*bchain)[i].new_claimed_cells[1] = -1;// denotes end of claimed_cells list
-        // when we have finished claiming cells we call this function.
-        _DVCWeights_UpdateBchain(bchain,cells,i);
-    }
-    count = i;// number of particles
-    claimed = 1;
+	    if (k == numx){  k--; }
+	    if (j == numy) { j--; }
+	    if (l == numz) { l--; }
+	    (*cells)[k+j*numx+l*numx*numy].p = i; //particle number i
+	    (*bchain)[i].numclaimed = 1;// number of most recently claimed cells
+	    (*bchain)[i].sizeofboundary = 0;
+	    (*bchain)[i].totalclaimed = 1;// total of claimed cells so far.
+	    (*bchain)[i].done = 0;
+	    (*bchain)[i].index = k+j*numx+l*numx*numy;// ith particle is in cell # k+j*numx
+	    (*bchain)[i].new_claimed_cells[0] = k+j*numx+l*numx*numy; 
+	    // ith particle has just claimed cell number k+j*numx+l*numx*numy
+	    (*bchain)[i].new_claimed_cells[1] = -1;// denotes end of claimed_cells list
+	    // when we have finished claiming cells we call this function.
+	    _DVCWeights_UpdateBchain(bchain,cells,i);
+      }
+      count = i;// number of particles
+      claimed = 1;
       
-    while(claimed != 0){
-        claimed = 0 ;
-        for(i=0;i<count;i++){
-            _DVCWeights_ClaimCells(bchain,cells,pList,i);
-            claimed += (*bchain)[i].numclaimed;
-            _DVCWeights_UpdateBchain(bchain,cells,i);
-        }
-    }//while
+      while(claimed != 0){
+	    claimed = 0 ;
+	    for(i=0;i<count;i++){
+		  _DVCWeights_ClaimCells(bchain,cells,pList,i);
+		  claimed += (*bchain)[i].numclaimed;
+		  _DVCWeights_UpdateBchain(bchain,cells,i);
+	    }
+      }//while
 }
 
 /** Create the Voronoi diagram by growing the voronoi cells from the particle locations.
-    All the parameters passed into _DVCWeights_CreateVoronoi2D
-    must be initialised already. */
+  All the parameters passed into _DVCWeights_CreateVoronoi2D
+  must be initialised already. */
 void _DVCWeights_CreateVoronoi2D( struct chain **bchain, struct particle2d **pList, struct cell2d **cells, 
-                                  double dx, double dy,
-                                  int nump,
-                                  int numx, int numy,
-                                  double BBXMIN, double BBXMAX, 
-                                  double BBYMIN, double BBYMAX){
-    int i,j,k;
-    int claimed;
+		       double dx, double dy,
+		       int nump,
+		       int numx, int numy,
+		       double BBXMIN, double BBXMAX, 
+		       double BBYMIN, double BBYMAX){
+   int i,j,k;
+   int claimed;
 
-    for(i=0;i<nump;i++){
-        k = ((*pList)[i].x - BBXMIN)/dx;
-        j = ((*pList)[i].y - BBYMIN)/dy;
-        /* If particle is on the border exactly, make sure it is
-           put in a valid cell inside the element */
-        if (k == numx){
-            k--;
-        }
-        if ( j == numy) {
-            j--;
-        }
-        
-        (*cells)[k+j*numx].p = i; //particle number i
+   for(i=0;i<nump;i++){
+      k = ((*pList)[i].x - BBXMIN)/dx;
+      j = ((*pList)[i].y - BBYMIN)/dy;
+	/* If particle is on the border exactly, make sure it is
+	   put in a valid cell inside the element */
+	if (k == numx){
+		k--;
+	}
+	if ( j == numy) {
+		j--;
+	}
+	
+      (*cells)[k+j*numx].p = i; //particle number i
       
-        (*bchain)[i].numclaimed = 1;// number of most recently claimed cells
-        (*bchain)[i].sizeofboundary = 0;
-        (*bchain)[i].totalclaimed = 1;// total of claimed cells so far.
-        (*bchain)[i].done = 0;
-        (*bchain)[i].index = k+j*numx;// ith particle is in cell # k+j*numx
-        (*bchain)[i].new_claimed_cells[0] = k+j*numx; // ith particle has just claimed cell number k+j*numx
-        (*bchain)[i].new_claimed_cells[1] = -1;// denotes end of claimed_cells list
-        // when we have finished claiming cells we call this function.
-        _DVCWeights_UpdateBchain2D( bchain, cells, i);
-    }//nump
+      (*bchain)[i].numclaimed = 1;// number of most recently claimed cells
+      (*bchain)[i].sizeofboundary = 0;
+      (*bchain)[i].totalclaimed = 1;// total of claimed cells so far.
+      (*bchain)[i].done = 0;
+      (*bchain)[i].index = k+j*numx;// ith particle is in cell # k+j*numx
+      (*bchain)[i].new_claimed_cells[0] = k+j*numx; // ith particle has just claimed cell number k+j*numx
+      (*bchain)[i].new_claimed_cells[1] = -1;// denotes end of claimed_cells list
+      // when we have finished claiming cells we call this function.
+      _DVCWeights_UpdateBchain2D( bchain, cells, i);
+   }//nump
    
-    claimed = 1;
+   claimed = 1;
 
-    while(claimed != 0){
-        claimed = 0 ;
-        for(i=0;i<nump;i++){
-            _DVCWeights_ClaimCells2D( bchain, cells, pList, i);
-            claimed += (*bchain)[i].numclaimed;
-            _DVCWeights_UpdateBchain2D( bchain, cells, i);
-        }
-    }//while
+   while(claimed != 0){
+      claimed = 0 ;
+      for(i=0;i<nump;i++){
+	 _DVCWeights_ClaimCells2D( bchain, cells, pList, i);
+	 claimed += (*bchain)[i].numclaimed;
+	 _DVCWeights_UpdateBchain2D( bchain, cells, i);
+      }
+   }//while
 }
 
 /* Calculate the integration weighting for each particle by contructing
-   a voronoi diagram in an element in 3D*/
+a voronoi diagram in an element in 3D*/
 void _DVCWeights_Calculate3D( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
-    DVCWeights*             self            = (DVCWeights*)  dvcWeights;
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    Particle_InCellIndex         cParticleCount;
-    IntegrationPoint**           particle;
-    static int visited = 0 ;
-    double dx,dy,dz,da;
-    static struct cell *cells;// the connected grid
-    struct particle *pList;// particle List
-    struct chain *bchain;//boundary chain
-    int nump,numx,numy,numz;
-    double BBXMIN = -1.0; // the ranges of the local coordinates of a FEM cell.
-    double BBXMAX = 1.0;
-    double BBYMIN = -1.0;
-    double BBYMAX = 1.0;
-    double BBZMIN = -1.0;
-    double BBZMAX = 1.0;
-    int i,k;
+	DVCWeights*             self            = (DVCWeights*)  dvcWeights;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	Particle_InCellIndex         cParticleCount;
+	IntegrationPoint**           particle;
+	static int visited = 0 ;
+	double dx,dy,dz,da;
+	static struct cell *cells;// the connected grid
+	struct particle *pList;// particle List
+	struct chain *bchain;//boundary chain
+	int nump,numx,numy,numz;
+	double BBXMIN = -1.0; // the ranges of the local coordinates of a FEM cell.
+	double BBXMAX = 1.0;
+	double BBYMIN = -1.0;
+	double BBYMAX = 1.0;
+	double BBZMIN = -1.0;
+	double BBZMAX = 1.0;
+	int i,k;
 
-    numx = self->resX;
-    numy = self->resY;
-    numz = self->resZ;
+	numx = self->resX;
+	numy = self->resY;
+	numz = self->resZ;
 
-    nump = cParticleCount = swarm->cellParticleCountTbl[lCell_I];
+	nump = cParticleCount = swarm->cellParticleCountTbl[lCell_I];
 
-    Journal_Firewall( nump , Journal_Register( Error_Type, (Name)"DVC_Weights" ), "Error in %s: Problem has an under resolved cell (Cell Id = %d), add more particles to your model\n", __func__, lCell_I );
+	Journal_Firewall( nump , Journal_Register(Error_Type, "DVC_Weights"), "Error in %s: Problem has an under resolved cell (Cell Id = %d), add more particles to your model\n", __func__, lCell_I );
 
-    dx = (BBXMAX - BBXMIN)/numx;
-    dy = (BBYMAX - BBYMIN)/numy;
-    dz = (BBZMAX - BBZMIN)/numz;
-    da = dx*dy*dz;
-        
-    // Construct the grid for the Voronoi cells only once.
-    // If we wanted to call this function again during a job with a different resolution
-    // then we should destroy the grid once we have looped through the whole mesh.
-    // I am assuming we are not going to do that for now.
-    // Easy to implement this anyway, if needed.
-    if(!visited){
-        /* The DVCWeights class should really be a class the next level up here */
-        /* We should be able to swap out the WeightsCalculator_CalculateAll instead of just setting
-           a pointer inside that function */
-        visited++;
-        _DVCWeights_ConstructGrid(&cells,numz,numy,numx,BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);
-    }
-        
-        
-    // init the data structures
-    _DVCWeights_InitialiseStructs( &bchain, &pList, nump);
-    _DVCWeights_ResetGrid(&cells,numz*numy*numx);
-        
-    particle = (IntegrationPoint**)malloc(nump*sizeof(IntegrationPoint*));
-        
-    // initialize the particle positions to be the local coordinates of the material swarm particles
-    // I am assuming the xi's (local coords) are precalculated somewhere and get reset based on material
-    // positions each time step.
-    for(i=0;i<nump;i++){
-              
-        particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, i );
-        pList[i].x = particle[i]->xi[0];
-        pList[i].y = particle[i]->xi[1];
-        pList[i].z = particle[i]->xi[2];
-              
-    }
-    _DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
-    _DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
-    // We are setting the integration points to be the centroids of the Voronoi regions here and
-    // the weight is the volume of each Voronoi region.
-    for(i=0;i<nump;i++){
+	dx = (BBXMAX - BBXMIN)/numx;
+	dy = (BBYMAX - BBYMIN)/numy;
+	dz = (BBZMAX - BBZMIN)/numz;
+	da = dx*dy*dz;
+	
+	// Construct the grid for the Voronoi cells only once.
+	// If we wanted to call this function again during a job with a different resolution
+	// then we should destroy the grid once we have looped through the whole mesh.
+	// I am assuming we are not going to do that for now.
+	// Easy to implement this anyway, if needed.
+	if(!visited){
+	      /* The DVCWeights class should really be a class the next level up here */
+	      /* We should be able to swap out the WeightsCalculator_CalculateAll instead of just setting
+                 a pointer inside that function */
+	      visited++;
+	      _DVCWeights_ConstructGrid(&cells,numz,numy,numx,BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);
+	}
+	
+	
+	// init the data structures
+	_DVCWeights_InitialiseStructs( &bchain, &pList, nump);
+	_DVCWeights_ResetGrid(&cells,numz*numy*numx);
+	
+	particle = (IntegrationPoint**)malloc(nump*sizeof(IntegrationPoint*));
+	
+        // initialize the particle positions to be the local coordinates of the material swarm particles
+	// I am assuming the xi's (local coords) are precalculated somewhere and get reset based on material
+	// positions each time step.
+	for(i=0;i<nump;i++){
+	      
+	      particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, i );
+	      pList[i].x = particle[i]->xi[0];
+	      pList[i].y = particle[i]->xi[1];
+	      pList[i].z = particle[i]->xi[2];
+	      
+	}
+	_DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+	_DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
+	// We are setting the integration points to be the centroids of the Voronoi regions here and
+	// the weight is the volume of each Voronoi region.
+	for(i=0;i<nump;i++){
 
-        particle[i]->xi[0] = pList[i].cx;
-        particle[i]->xi[1] = pList[i].cy;
-        particle[i]->xi[2] = pList[i].cz;
-        particle[i]->weight = pList[i].w;
+	      particle[i]->xi[0] = pList[i].cx;
+	      particle[i]->xi[1] = pList[i].cy;
+	      particle[i]->xi[2] = pList[i].cz;
+	      particle[i]->weight = pList[i].w;
 
-    }   
-    for(k=0;k<nump;k++){
-        free(bchain[k].new_claimed_cells);
-        free(bchain[k].new_bound_cells);
-    }
-    free(particle);
-    free(bchain);
-    free(pList);
+	}	
+	for(k=0;k<nump;k++){
+	      free(bchain[k].new_claimed_cells);
+	      free(bchain[k].new_bound_cells);
+	}
+	free(particle);
+	free(bchain);
+	free(pList);
 
 }
 
 /* Calculate the integration weighting for each particle by contructing
-   a voronoi diagram in an element in 2D*/
+a voronoi diagram in an element in 2D*/
 void _DVCWeights_Calculate2D( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
-    DVCWeights*             self            = (DVCWeights*)  dvcWeights;
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    Particle_InCellIndex         cParticleCount;
-    IntegrationPoint**           particle;
-    static int visited = 0 ;
-    double dx,dy,da;
-    static struct cell2d *cells;// the connected grid
-    struct particle2d *pList;// particle List
-    struct chain *bchain;//boundary chain
-    int nump,numx,numy;
-    double BBXMIN = -1.0; // the ranges of the local coordinates of a FEM cell.
-    double BBXMAX = 1.0;
-    double BBYMIN = -1.0;
-    double BBYMAX = 1.0;
-    int i,k;
+	DVCWeights*             self            = (DVCWeights*)  dvcWeights;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	Particle_InCellIndex         cParticleCount;
+	IntegrationPoint**           particle;
+	static int visited = 0 ;
+	double dx,dy,da;
+	static struct cell2d *cells;// the connected grid
+	struct particle2d *pList;// particle List
+	struct chain *bchain;//boundary chain
+	int nump,numx,numy;
+	double BBXMIN = -1.0; // the ranges of the local coordinates of a FEM cell.
+	double BBXMAX = 1.0;
+	double BBYMIN = -1.0;
+	double BBYMAX = 1.0;
+	int i,k;
 
-    numx = self->resX;
-    numy = self->resY;
+	numx = self->resX;
+	numy = self->resY;
 
-    nump = cParticleCount = swarm->cellParticleCountTbl[lCell_I];
+	nump = cParticleCount = swarm->cellParticleCountTbl[lCell_I];
 
-    Journal_Firewall( nump , Journal_Register( Error_Type, (Name)"DVC_Weights" ), "Error in %s: Problem has an under resolved cell (Cell Id = %d), add more particles to your model\n", __func__, lCell_I );
+	Journal_Firewall( nump , Journal_Register(Error_Type, "DVC_Weights"), "Error in %s: Problem has an under resolved cell (Cell Id = %d), add more particles to your model\n", __func__, lCell_I );
 
-    dx = (BBXMAX - BBXMIN)/numx;
-    dy = (BBYMAX - BBYMIN)/numy;
-    da = dx*dy;
-        
-    // Construct the grid for the Voronoi cells only once.
-    // If we wanted to call this function again during a job with a different resolution
-    // then we should destroy the grid once we have looped through the whole mesh.
-    // I am assuming we are not going to do that for now.
-    // Easy to implement this anyway, if needed.
-    if(!visited){
-        /* The DVCWeights class should really be a class the next level up here */
-        /* We should be able to swap out the WeightsCalculator_CalculateAll instead of just setting
-           a pointer inside that function */
-        visited++;
-        _DVCWeights_ConstructGrid2D(&cells,numy,numx,BBXMIN,BBYMIN,BBXMAX,BBYMAX);
-    }
-        
-        
-    // init the data structures
-    _DVCWeights_InitialiseStructs2D( &bchain, &pList, nump);
-    _DVCWeights_ResetGrid2D(&cells,numy*numx);
-        
-    particle = (IntegrationPoint**)malloc(nump*sizeof(IntegrationPoint*));
-        
-    // initialize the particle positions to be the local coordinates of the material swarm particles
-    // I am assuming the xi's (local coords) are precalculated somewhere and get reset based on material
-    // positions each time step.
-    for(i=0;i<nump;i++){
-              
-        particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, i );
-        pList[i].x = particle[i]->xi[0];
-        pList[i].y = particle[i]->xi[1];
-              
-    }
-    _DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
-    _DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
-    // We are setting the integration points to be the centroids of the Voronoi regions here and
-    // the weight is the volume of each Voronoi region.
-    for(i=0;i<nump;i++){
+	dx = (BBXMAX - BBXMIN)/numx;
+	dy = (BBYMAX - BBYMIN)/numy;
+	da = dx*dy;
+	
+	// Construct the grid for the Voronoi cells only once.
+	// If we wanted to call this function again during a job with a different resolution
+	// then we should destroy the grid once we have looped through the whole mesh.
+	// I am assuming we are not going to do that for now.
+	// Easy to implement this anyway, if needed.
+	if(!visited){
+	      /* The DVCWeights class should really be a class the next level up here */
+	      /* We should be able to swap out the WeightsCalculator_CalculateAll instead of just setting
+                 a pointer inside that function */
+	      visited++;
+	      _DVCWeights_ConstructGrid2D(&cells,numy,numx,BBXMIN,BBYMIN,BBXMAX,BBYMAX);
+	}
+	
+	
+	// init the data structures
+	_DVCWeights_InitialiseStructs2D( &bchain, &pList, nump);
+	_DVCWeights_ResetGrid2D(&cells,numy*numx);
+	
+	particle = (IntegrationPoint**)malloc(nump*sizeof(IntegrationPoint*));
+	
+        // initialize the particle positions to be the local coordinates of the material swarm particles
+	// I am assuming the xi's (local coords) are precalculated somewhere and get reset based on material
+	// positions each time step.
+	for(i=0;i<nump;i++){
+	      
+	      particle[i] = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, i );
+	      pList[i].x = particle[i]->xi[0];
+	      pList[i].y = particle[i]->xi[1];
+	      
+	}
+	_DVCWeights_CreateVoronoi2D( &bchain, &pList, &cells, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
+	_DVCWeights_GetCentroids2D( cells, pList,numy,numx,nump,da);
+	// We are setting the integration points to be the centroids of the Voronoi regions here and
+	// the weight is the volume of each Voronoi region.
+	for(i=0;i<nump;i++){
 
-        particle[i]->xi[0] = pList[i].cx;
-        particle[i]->xi[1] = pList[i].cy;
-        particle[i]->weight = pList[i].w;
+	      particle[i]->xi[0] = pList[i].cx;
+	      particle[i]->xi[1] = pList[i].cy;
+	      particle[i]->weight = pList[i].w;
 
-    }   
-    for(k=0;k<nump;k++){
-        free(bchain[k].new_claimed_cells);
-        free(bchain[k].new_bound_cells);
-    }
-    free(particle);
-    free(bchain);
-    free(pList);
+	}	
+	for(k=0;k<nump;k++){
+	      free(bchain[k].new_claimed_cells);
+	      free(bchain[k].new_bound_cells);
+	}
+	free(particle);
+	free(bchain);
+	free(pList);
 
 }
 
 void _DVCWeights_Calculate( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I ){
-    Swarm* swarm = (Swarm*) _swarm;
-    Dimension_Index dim = swarm->dim;
+      Swarm* swarm = (Swarm*) _swarm;
+      Dimension_Index dim = swarm->dim;
 
-    if(dim == 3){
-        _DVCWeights_Calculate3D( dvcWeights, _swarm, lCell_I);
-    }
-    else {
-        _DVCWeights_Calculate2D( dvcWeights, _swarm, lCell_I);
-    }
+      if(dim == 3){
+	    _DVCWeights_Calculate3D( dvcWeights, _swarm, lCell_I);
+      }
+      else {
+	    _DVCWeights_Calculate2D( dvcWeights, _swarm, lCell_I);
+      }
 }
 /*-------------------------------------------------------------------------------------------------------------------------
 ** Public Functions
 */
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/DVCWeights.h
--- a/Weights/src/DVCWeights.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/DVCWeights.h	Tue Feb 02 16:55:08 2010 +1100
@@ -4,14 +4,14 @@
 ** Redistribution and use in source and binary forms, with or without modification,
 ** are permitted provided that the following conditions are met:
 **
-**              * Redistributions of source code must retain the above copyright notice, 
-**                      this list of conditions and the following disclaimer.
-**              * Redistributions in binary form must reproduce the above copyright 
-**                      notice, this list of conditions and the following disclaimer in the 
-**                      documentation and/or other materials provided with the distribution.
-**              * Neither the name of the Monash University nor the names of its contributors 
-**                      may be used to endorse or promote products derived from this software 
-**                      without specific prior written permission.
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
 **
 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
@@ -26,13 +26,13 @@
 **
 **
 ** Contact:
-*%              Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
 *%
 ** Author:
 **              Mirko Velic - Mirko.Velic at sci.monash.edu.au
 **
 **  Assumptions:
-**       I am assuming that the xi's (local coords) on the IntegrationPoint particles
+**  	 I am assuming that the xi's (local coords) on the IntegrationPoint particles
 **       are precalculated somewhere and get reset based on material PIC positions each time step.
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -54,217 +54,216 @@
 #ifndef __PICellerator_Weights_DVCWeightsClass_h__
 #define __PICellerator_Weights_DVCWeightsClass_h__
 
-/* Textual name of this class */
-extern const Type DVCWeights_Type;
+	/* Textual name of this class */
+	extern const Type DVCWeights_Type;
 
-/* DVCWeights information */
-#define __DVCWeights                            \
-    /* General info */                          \
-    __WeightsCalculator                         \
-                                                \
-    /* Virtual Info */                          \
-    /* Parameters that are passed in */         \
-    int resX;                                   \
-    int resY;                                   \
-    int resZ;
+	/* DVCWeights information */
+	#define __DVCWeights \
+		/* General info */ \
+		__WeightsCalculator \
+		/* Virtual Info */\
+		/* Parameters that are passed in */ \
+                int resX; \
+                int resY; \
+                int resZ;
 
-struct DVCWeights { __DVCWeights };
-        
+	struct DVCWeights { __DVCWeights };
+	
 #define DVC_INC 150
-        
+	
 struct cell{
-    int p;/*particle index number*/
-    int index;
-    int N;
-    int S;
-    int E;
-    int W;
-    int U;
-    int D;
-    double x;
-    double y;
-    double z;
-    int done;
+  int p;/*particle index number*/
+  int index;
+  int N;
+  int S;
+  int E;
+  int W;
+  int U;
+  int D;
+  double x;
+  double y;
+  double z;
+  int done;
 };
 struct cell2d{
-    int p;/* particle index number */
-    int index;
-    int N;
-    int S;
-    int E;
-    int W;
-    double x;
-    double y;
-    int done;
+  int p;/* particle index number */
+  int index;
+  int N;
+  int S;
+  int E;
+  int W;
+  double x;
+  double y;
+  int done;
 };
 struct chain{
-    int p;/*particle index number*/
-    int index;/*cell number in grid*/
-    int sizeofboundary; /* number of cells on boundary so far */
-    int numclaimed;
-    int totalclaimed;
-    int new_bound_cells_malloced;
-    int new_claimed_cells_malloced; 
-    int *new_bound_cells;
-    int *new_claimed_cells;
-    int done;
+  int p;/*particle index number*/
+  int index;/*cell number in grid*/
+  int sizeofboundary; /* number of cells on boundary so far */
+  int numclaimed;
+  int totalclaimed;
+  int new_bound_cells_malloced;
+  int new_claimed_cells_malloced; 
+  int *new_bound_cells;
+  int *new_claimed_cells;
+  int done;
 };
 struct particle{
-    double x;
-    double y;
-    double z;
-    double cx;
-    double cy;
-    double cz;
-    double w;
-    int index;
+  double x;
+  double y;
+  double z;
+  double cx;
+  double cy;
+  double cz;
+  double w;
+  int index;
 };
 struct particle2d{
-    double x;
-    double y;
-    double cx;
-    double cy;
-    double w;
-    int index;
+  double x;
+  double y;
+  double cx;
+  double cy;
+  double w;
+  int index;
 };
 /* Private function prototypes in 3D */
-void   _DVCWeights_GetCentroids(        
-    struct cell *cells,
-    struct particle *pList,
-    int n,
-    int m, 
-    int l,
-    int nump,
-    double vol);
-void   _DVCWeights_ClaimCells(
-    struct chain **bchain,
-    struct cell **cells,
-    struct particle **pList,
-    int p_i);
-void   _DVCWeights_UpdateBchain(
-    struct chain **bchain,
-    struct cell **cells,
-    int p_i);
-void   _DVCWeights_ResetGrid(struct cell **cells, int n );
+	void   _DVCWeights_GetCentroids(	
+				struct cell *cells,
+				struct particle *pList,
+				int n,
+				int m, 
+				int l,
+				int nump,
+				double vol);
+	void   _DVCWeights_ClaimCells(
+				struct chain **bchain,
+				struct cell **cells,
+				struct particle **pList,
+				int p_i);
+	void   _DVCWeights_UpdateBchain(
+				struct chain **bchain,
+				struct cell **cells,
+				int p_i);
+	void   _DVCWeights_ResetGrid(struct cell **cells, int n );
 
-double _DVCWeights_DistanceSquared(
-    double x0, double y0, double z0, 
-    double x1, double y1, double z1);
-double _DVCWeights_DistanceTest(double x0, double y0, double z0, 
-                                double x1, double y1, double z1,
-                                double x2, double y2, double z2);       
-void   _DVCWeights_ConstructGrid(
-    struct cell **cell_list, 
-    int n, int m, int l,
-    double x0, double y0, double z0,
-    double x1, double y1, double z1);
-void   _DVCWeights_InitialiseStructs( 
-    struct chain **bchain, 
-    struct particle **pList, 
-    int nump);
-void   _DVCWeights_CreateVoronoi( 
-    struct chain **bchain, 
-    struct particle **pList, 
-    struct cell **cells, 
-    double dx, double dy, double dz,
-    int nump,
-    int numx, int numy, int numz, 
-    double BBXMIN, double BBXMAX, 
-    double BBYMIN, double BBYMAX,
-    double BBZMIN, double BBZMAX);
+	double _DVCWeights_DistanceSquared(
+				double x0, double y0, double z0, 
+				double x1, double y1, double z1);
+        double _DVCWeights_DistanceTest(double x0, double y0, double z0, 
+                                        double x1, double y1, double z1,
+                                        double x2, double y2, double z2);	
+	void   _DVCWeights_ConstructGrid(
+				struct cell **cell_list, 
+				int n, int m, int l,
+		    	double x0, double y0, double z0,
+				double x1, double y1, double z1);
+	void   _DVCWeights_InitialiseStructs( 
+				struct chain **bchain, 
+				struct particle **pList, 
+				int nump);
+	void   _DVCWeights_CreateVoronoi( 
+				struct chain **bchain, 
+				struct particle **pList, 
+				struct cell **cells, 
+		     	double dx, double dy, double dz,
+		     	int nump,
+		     	int numx, int numy, int numz, 
+		     	double BBXMIN, double BBXMAX, 
+		     	double BBYMIN, double BBYMAX,
+		     	double BBZMIN, double BBZMAX);
 /* Private function prototypes in 2D */
-void   _DVCWeights_GetCentroids2D( 
-    struct cell2d *cells, 
-    struct particle2d *pList,
-    int n, 
-    int m, 
-    int nump,
-    double vol);
-void   _DVCWeights_ClaimCells2D(
-    struct chain **bchain,
-    struct cell2d **cells,
-    struct particle2d **pList,
-    int p_i);
-void   _DVCWeights_UpdateBchain2D(
-    struct chain **bchain,
-    struct cell2d **cells,
-    int p_i);
-void   _DVCWeights_ResetGrid2D(struct cell2d **cells, int n );
-double _DVCWeights_DistanceSquared2D(double x0, double y0, double x1, double y1);
-double _DVCWeights_DistanceTest2D(double x0, double y0,
-                                  double x1, double y1,
-                                  double x2, double y2);
-void   _DVCWeights_ConstructGrid2D(
-    struct cell2d **cell_list, 
-    int m, int l,
-    double x0, double y0,
-    double x1, double y1);
-void   _DVCWeights_InitialiseStructs2D( 
-    struct chain **bchain, 
-    struct particle2d **pList, 
-    int nump);
-void   _DVCWeights_CreateVoronoi2D( 
-    struct chain **bchain, 
-    struct particle2d **pList, 
-    struct cell2d **cells, 
-    double dx, double dy,
-    int nump,
-    int numx, int numy,
-    double BBXMIN, double BBXMAX, 
-    double BBYMIN, double BBYMAX);
+	void   _DVCWeights_GetCentroids2D( 
+				struct cell2d *cells, 
+				struct particle2d *pList,
+				int n, 
+				int m, 
+				int nump,
+				double vol);
+	void   _DVCWeights_ClaimCells2D(
+				struct chain **bchain,
+				struct cell2d **cells,
+				struct particle2d **pList,
+				int p_i);
+	void   _DVCWeights_UpdateBchain2D(
+				struct chain **bchain,
+				struct cell2d **cells,
+				int p_i);
+	void   _DVCWeights_ResetGrid2D(struct cell2d **cells, int n );
+	double _DVCWeights_DistanceSquared2D(double x0, double y0, double x1, double y1);
+	double _DVCWeights_DistanceTest2D(double x0, double y0,
+					  double x1, double y1,
+					  double x2, double y2);
+	void   _DVCWeights_ConstructGrid2D(
+				struct cell2d **cell_list, 
+				int m, int l,
+				double x0, double y0,
+				double x1, double y1);
+	void   _DVCWeights_InitialiseStructs2D( 
+				struct chain **bchain, 
+				struct particle2d **pList, 
+				int nump);
+	void   _DVCWeights_CreateVoronoi2D( 
+				struct chain **bchain, 
+				struct particle2d **pList, 
+				struct cell2d **cells, 
+				double dx, double dy,
+				int nump,
+				int numx, int numy,
+				double BBXMIN, double BBXMAX, 
+				double BBYMIN, double BBYMAX);
 
-void   _DVCWeights_Calculate2D( 
-    void* dvcWeights, 
-    void* _swarm, 
-    Cell_LocalIndex lCell_I );
-void   _DVCWeights_Calculate3D( 
-    void* dvcWeights, 
-    void* _swarm, 
-    Cell_LocalIndex lCell_I );
+	void   _DVCWeights_Calculate2D( 
+				void* dvcWeights, 
+				void* _swarm, 
+				Cell_LocalIndex lCell_I );
+	void   _DVCWeights_Calculate3D( 
+				void* dvcWeights, 
+				void* _swarm, 
+				Cell_LocalIndex lCell_I );
 
 
-/*---------------------------------------------------------------------------------------------------------------------
-** Constructors
-*/
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	DVCWeights* DVCWeights_New( Name name, Dimension_Index dim ) ;
+	DVCWeights* _DVCWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name );
 
+	void _DVCWeights_Init( void* dvcWeights, int *res ) ;
+	void DVCWeights_InitAll( void* dvcWeights, Dimension_Index dim ) ;
 
 
-DVCWeights* DVCWeights_New( Name name, Dimension_Index dim, int *res ) ;
+	/* Stg_Class_Delete DVCWeights implementation */
+	void _DVCWeights_Delete( void* dvcWeights );
+	void _DVCWeights_Print( void* dvcWeights, Stream* stream );
+	#define DVCWeights_Copy( self ) \
+		(DVCWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define DVCWeights_DeepCopy( self ) \
+		(DVCWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _DVCWeights_Copy( void* dvcWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void* _DVCWeights_DefaultNew( Name name ) ;
 
+	void _DVCWeights_Construct( void* dvcWeights, Stg_ComponentFactory* cf, void* data ) ;
+
+	void _DVCWeights_Build( void* dvcWeights, void* data ) ;
+	void _DVCWeights_Initialise( void* dvcWeights, void* data ) ;
+	void _DVCWeights_Execute( void* dvcWeights, void* data );
+	void _DVCWeights_Destroy( void* dvcWeights, void* data ) ;
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define DVCWEIGHTS_DEFARGS \
-                WEIGHTSCALCULATOR_DEFARGS
-
-	#define DVCWEIGHTS_PASSARGS \
-                WEIGHTSCALCULATOR_PASSARGS
-
-DVCWeights* _DVCWeights_New(  DVCWEIGHTS_DEFARGS  );
-
-void _DVCWeights_Init( void* dvcWeights, int *res ) ;
-
-/* Stg_Class_Delete DVCWeights implementation */
-void _DVCWeights_Delete( void* dvcWeights );
-void _DVCWeights_Print( void* dvcWeights, Stream* stream );
-#define DVCWeights_Copy( self )                                         \
-    (DVCWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define DVCWeights_DeepCopy( self )                                     \
-    (DVCWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _DVCWeights_Copy( void* dvcWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-        
-void* _DVCWeights_DefaultNew( Name name ) ;
-
-void _DVCWeights_AssignFromXML( void* dvcWeights, Stg_ComponentFactory* cf, void* data ) ;
-
-void _DVCWeights_Build( void* dvcWeights, void* data );
-void _DVCWeights_Initialise( void* dvcWeights, void* data );
-void _DVCWeights_Execute( void* dvcWeights, void* data );
-void _DVCWeights_Destroy( void* dvcWeights, void* data );
-                
-void _DVCWeights_Calculate( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
+		
+	void _DVCWeights_Calculate( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
 
 #endif
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/Finalise.c
--- a/Weights/src/Finalise.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/Finalise.c	Tue Feb 02 16:55:08 2010 +1100
@@ -52,9 +52,7 @@
 #include <stdio.h>
 
 Bool PICellerator_Weights_Finalise( void ) {
-	Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
 	
 	return True;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/Init.c
--- a/Weights/src/Init.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/Init.c	Tue Feb 02 16:55:08 2010 +1100
@@ -54,13 +54,13 @@ Bool PICellerator_Weights_Init( int* arg
 Bool PICellerator_Weights_Init( int* argc, char** argv[] ) {
 	Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
 
-	Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
 
-	Stg_ComponentRegister_Add( componentsRegister, ConstantWeights_Type, (Name)"0", _ConstantWeights_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, VolumeWeights_Type, (Name)"0", _VolumeWeights_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, IterativeWeights_Type, (Name)"0", _IterativeWeights_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, MomentBalanceWeights_Type, (Name)"0", _MomentBalanceWeights_DefaultNew  );
-	Stg_ComponentRegister_Add( componentsRegister, DVCWeights_Type, (Name)"0", _DVCWeights_DefaultNew  );
+	Stg_ComponentRegister_Add( componentsRegister, ConstantWeights_Type,          "0", _ConstantWeights_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, VolumeWeights_Type,            "0", _VolumeWeights_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, IterativeWeights_Type,         "0", _IterativeWeights_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, MomentBalanceWeights_Type,     "0", _MomentBalanceWeights_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, DVCWeights_Type,   			  "0", _DVCWeights_DefaultNew );
 	
 	RegisterParent( WeightsCalculator_Type,      Stg_Component_Type );
 	RegisterParent( ConstantWeights_Type,        WeightsCalculator_Type );
@@ -71,5 +71,3 @@ Bool PICellerator_Weights_Init( int* arg
 	
 	return True;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/IterativeWeights.c
--- a/Weights/src/IterativeWeights.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/IterativeWeights.c	Tue Feb 02 16:55:08 2010 +1100
@@ -66,39 +66,70 @@ const Type IterativeWeights_Type = "Iter
 ** Constructors
 */
 
-IterativeWeights* _IterativeWeights_New(  ITERATIVEWEIGHTS_DEFARGS  ) {
-    IterativeWeights* self;
+IterativeWeights* _IterativeWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name )
+{
+	IterativeWeights* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(IterativeWeights) );
+	self = (IterativeWeights*)_ConstantWeights_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			name );
 
-    /* Allocate memory */
-    assert( _sizeOfSelf >= sizeof(IterativeWeights) );
-    self = (IterativeWeights*)_ConstantWeights_New(  CONSTANTWEIGHTS_PASSARGS  );
 	
-    /* General info */
+	/* General info */
 
-    /* Virtual Info */
+	/* Virtual Info */
 	
-    return self;
+	return self;
 }
 
-void _IterativeWeights_Init( void* iterativeWeights, WeightsCalculator* initialWeights,
-                             Iteration_Index maxIterations, double tolerance, double alpha )
-{
-    IterativeWeights* self = (IterativeWeights*)iterativeWeights;
+void _IterativeWeights_Init( void* iterativeWeights, WeightsCalculator* initialWeights, Iteration_Index maxIterations, double tolerance, double alpha ) {
+	IterativeWeights* self = (IterativeWeights*)iterativeWeights;
+	
+	self->isConstructed = True;
 
-    if ( initialWeights ) {
-        self->initialWeights = initialWeights;
-        self->freeInitialWeights = False;
-    }
-    else {
-        self->initialWeights = (WeightsCalculator*) ConstantWeights_New( "initialWeights", self->dim );
-        self->freeInitialWeights = True;
-    }
+	if ( initialWeights ) {
+		self->initialWeights = initialWeights;
+		self->freeInitialWeights = False;
+	}
+	else {
+		self->initialWeights = (WeightsCalculator*) ConstantWeights_New( "initialWeights", self->dim );
+		self->freeInitialWeights = True;
+	}
 
-    self->maxIterations = maxIterations;
-    self->tolerance = tolerance;
-    self->alpha = alpha;
+	self->maxIterations = maxIterations;
+	self->tolerance = tolerance;
+	self->alpha = alpha;
 	
-    Journal_Firewall( self->dim == 2, Journal_Register( Error_Type, (Name)self->type  ), "%s only works in 2D.\n", self->type );
+	Journal_Firewall( self->dim == 2, 
+			Journal_Register( Error_Type, self->type ),
+			"%s only works in 2D.\n", self->type );
+	
 }
 
 /*------------------------------------------------------------------------------------------------------------------------
@@ -106,147 +137,141 @@ void _IterativeWeights_Init( void* itera
 */
 
 void _IterativeWeights_Delete( void* iterativeWeights ) {
-    IterativeWeights* self = (IterativeWeights*)iterativeWeights;
+	IterativeWeights* self = (IterativeWeights*)iterativeWeights;
 	
-    if (self->freeInitialWeights )
-        Stg_Class_Delete( self->initialWeights );
-    /* Delete parent */
-    _ConstantWeights_Delete( self );
+	if (self->freeInitialWeights )
+		Stg_Class_Delete( self->initialWeights );
+	/* Delete parent */
+	_ConstantWeights_Delete( self );
 }
 
 
 void _IterativeWeights_Print( void* iterativeWeights, Stream* stream ) {
-    IterativeWeights* self = (IterativeWeights*)iterativeWeights;
+	IterativeWeights* self = (IterativeWeights*)iterativeWeights;
 	
-    /* Print parent */
-    _ConstantWeights_Print( self, stream );
+	/* Print parent */
+	_ConstantWeights_Print( self, stream );
 }
 
 
 
 void* _IterativeWeights_Copy( void* iterativeWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
-    IterativeWeights*	newIterativeWeights;
+	IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
+	IterativeWeights*	newIterativeWeights;
 	
-    newIterativeWeights = (IterativeWeights*)_ConstantWeights_Copy( self, dest, deep, nameExt, ptrMap );
+	newIterativeWeights = (IterativeWeights*)_ConstantWeights_Copy( self, dest, deep, nameExt, ptrMap );
 	
-    return (void*)newIterativeWeights;
+	return (void*)newIterativeWeights;
 }
 
 void* _IterativeWeights_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(IterativeWeights);
-	Type                                                      type = IterativeWeights_Type;
-	Stg_Class_DeleteFunction*                              _delete = _IterativeWeights_Delete;
-	Stg_Class_PrintFunction*                                _print = _IterativeWeights_Print;
-	Stg_Class_CopyFunction*                                  _copy = _IterativeWeights_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _IterativeWeights_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _IterativeWeights_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _IterativeWeights_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _IterativeWeights_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _IterativeWeights_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _IterativeWeights_Destroy;
-	AllocationType                              nameAllocationType = NON_GLOBAL;
-	WeightsCalculator_CalculateFunction*                _calculate = _IterativeWeights_Calculate;
-
-    return (void*) _IterativeWeights_New(  ITERATIVEWEIGHTS_PASSARGS  );
+	return (void*) _IterativeWeights_New(
+			sizeof(IterativeWeights),
+			IterativeWeights_Type,
+			_IterativeWeights_Delete,
+			_IterativeWeights_Print,
+			_IterativeWeights_Copy,
+			_IterativeWeights_DefaultNew,
+			_IterativeWeights_Construct,
+			_IterativeWeights_Build,
+			_IterativeWeights_Initialise,
+			_IterativeWeights_Execute,
+			_IterativeWeights_Destroy,
+			_IterativeWeights_Calculate,
+			name );
 }
 
 
-void _IterativeWeights_AssignFromXML( void* iterativeWeights, Stg_ComponentFactory* cf, void* data ) {
-    IterativeWeights*	     self          = (IterativeWeights*) iterativeWeights;
-    WeightsCalculator*       initialWeights;
-    Iteration_Index          maxIterations;
-    double                   tolerance;
-    double                   alpha;
+void _IterativeWeights_Construct( void* iterativeWeights, Stg_ComponentFactory* cf, void* data ) {
+	IterativeWeights*	     self          = (IterativeWeights*) iterativeWeights;
+	WeightsCalculator*       initialWeights;
+	Iteration_Index          maxIterations;
+	double                   tolerance;
+	double                   alpha;
+	
+	_ConstantWeights_Construct( self, cf, data );
 
-    _ConstantWeights_AssignFromXML( self, cf, data );
+	initialWeights =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "InitialWeights", WeightsCalculator, False, data ) ;
 
-    initialWeights =  Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"InitialWeights", WeightsCalculator, False, data  );
-
-    maxIterations = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, (Dictionary_Entry_Key)"maxIterations", 10  );
-    tolerance     = Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"tolerance", 0.01  );
-    alpha         = Stg_ComponentFactory_GetDouble( cf, self->name, (Dictionary_Entry_Key)"alpha", 0.8  ); /* 0.8 is default in Dufour p. 65 */
+	maxIterations = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "maxIterations", 10 );
+	tolerance     = Stg_ComponentFactory_GetDouble( cf, self->name, "tolerance", 0.01 );
+	alpha         = Stg_ComponentFactory_GetDouble( cf, self->name, "alpha", 0.8 ); /* 0.8 is default in Dufour p. 65 */
 	
-    _IterativeWeights_Init( self, initialWeights, maxIterations, tolerance, alpha );
+	_IterativeWeights_Init( self, initialWeights, maxIterations, tolerance, alpha );
 }
 
 void _IterativeWeights_Build( void* iterativeWeights, void* data ) {
-    IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
+	IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
 
-    Stg_Component_Build( self->initialWeights, data, False ); 
-    _ConstantWeights_Build( self, data );
+	_ConstantWeights_Build( self, data );
 }
 void _IterativeWeights_Initialise( void* iterativeWeights, void* data ) {
-    IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
-
-    Stg_Component_Initialise( self->initialWeights, data, False ); 	
-    _ConstantWeights_Initialise( self, data );
+	IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
+	
+	_ConstantWeights_Initialise( self, data );
 }
 void _IterativeWeights_Execute( void* iterativeWeights, void* data ) {
-    IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
+	IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
 	
-    _ConstantWeights_Execute( self, data );
+	_ConstantWeights_Execute( self, data );
 }
 void _IterativeWeights_Destroy( void* iterativeWeights, void* data ) {
-    IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
-
-    if (self->freeInitialWeights )
-       Stg_Component_Destroy( self->initialWeights, data, False ); 	
-    _ConstantWeights_Destroy( self, data );
+	IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
+	
+	_ConstantWeights_Destroy( self, data );
 }
 
 /*-------------------------------------------------------------------------------------------------------------------------
 ** Private Functions
 */
 void _IterativeWeights_Calculate( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
-    IterativeWeights*            self            = (IterativeWeights*)  iterativeWeights;
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    Iteration_Index              iteration_I;
-    double                       constaintLHS[3] = { 0.0,0.0,0.0 };
-    double                       squareTerms[3]  = { 0.0,0.0,1.0 };
-    double                       constaintError;
-    Particle_InCellIndex         cParticle_I;
-    Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
-    IntegrationPoint*            particle;
-    Dimension_Index              dim_I;
-    Dimension_Index              dim             = self->dim;
+	IterativeWeights*            self            = (IterativeWeights*)  iterativeWeights;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	Iteration_Index              iteration_I;
+	double                       constaintLHS[3] = { 0.0,0.0,0.0 };
+	double                       squareTerms[3]  = { 0.0,0.0,1.0 };
+	double                       constaintError;
+	Particle_InCellIndex         cParticle_I;
+	Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
+	IntegrationPoint*            particle;
+	Dimension_Index              dim_I;
+	Dimension_Index              dim             = self->dim;
 
-    /* Initialise Weights Using Constant Weights routine - Dufour Equation 2.52 */
-    WeightsCalculator_CalculateCell( self->initialWeights, swarm, lCell_I );
+	/* Initialise Weights Using Constant Weights routine - Dufour Equation 2.52 */
+	WeightsCalculator_CalculateCell( self->initialWeights, swarm, lCell_I );
 		
-    for ( iteration_I = 0 ; iteration_I < self->maxIterations ; iteration_I++ ) {
-        constaintLHS[ I_AXIS ] = WeightsCalculator_GetConstraintLHS( self, swarm, lCell_I, 1, 0, 0 );
-        constaintLHS[ J_AXIS ] = WeightsCalculator_GetConstraintLHS( self, swarm, lCell_I, 0, 1, 0 );
-        if ( self->dim == 3 )
-            constaintLHS[ K_AXIS ] = WeightsCalculator_GetConstraintLHS( self, swarm, lCell_I, 0, 0, 1 );
+	for ( iteration_I = 0 ; iteration_I < self->maxIterations ; iteration_I++ ) {
+		constaintLHS[ I_AXIS ] = WeightsCalculator_GetConstraintLHS( self, swarm, lCell_I, 1, 0, 0 );
+		constaintLHS[ J_AXIS ] = WeightsCalculator_GetConstraintLHS( self, swarm, lCell_I, 0, 1, 0 );
+		if ( self->dim == 3 )
+			constaintLHS[ K_AXIS ] = WeightsCalculator_GetConstraintLHS( self, swarm, lCell_I, 0, 0, 1 );
 
-        /* Test for convergence - See Dufour Equation 2.55 */
-        constaintError = 
-            fabs(constaintLHS[ I_AXIS ]) + 
-            fabs(constaintLHS[ J_AXIS ]) + 
-            fabs(constaintLHS[ K_AXIS ]);
+		/* Test for convergence - See Dufour Equation 2.55 */
+		constaintError = 
+			fabs(constaintLHS[ I_AXIS ]) + 
+			fabs(constaintLHS[ J_AXIS ]) + 
+			fabs(constaintLHS[ K_AXIS ]);
 
-        if ( constaintError < self->tolerance )
-            /* Then this cell has converged - bail out of loop */
-            break;
+		if ( constaintError < self->tolerance )
+			/* Then this cell has converged - bail out of loop */
+			break;
 
-        /* Adjust weights according to Dufour Equation 2.54 */
-        squareTerms[ I_AXIS ] = WeightsCalculator_GetLocalCoordSum( self, swarm, lCell_I, 2, 0, 0 );
-        squareTerms[ J_AXIS ] = WeightsCalculator_GetLocalCoordSum( self, swarm, lCell_I, 0, 2, 0 );
-        if ( self->dim == 3 )
-            squareTerms[ K_AXIS ] = WeightsCalculator_GetLocalCoordSum( self, swarm, lCell_I, 0, 0, 2 );
+		/* Adjust weights according to Dufour Equation 2.54 */
+		squareTerms[ I_AXIS ] = WeightsCalculator_GetLocalCoordSum( self, swarm, lCell_I, 2, 0, 0 );
+		squareTerms[ J_AXIS ] = WeightsCalculator_GetLocalCoordSum( self, swarm, lCell_I, 0, 2, 0 );
+		if ( self->dim == 3 )
+			squareTerms[ K_AXIS ] = WeightsCalculator_GetLocalCoordSum( self, swarm, lCell_I, 0, 0, 2 );
 
-        for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-            particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+		for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+			particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
 			
-            for ( dim_I = 0 ; dim_I < dim ; dim_I++ )
-                particle->weight -= self->alpha * constaintLHS[ dim_I ] / squareTerms[ dim_I ] * particle->xi[ dim_I ] ;
-        }
+			for ( dim_I = 0 ; dim_I < dim ; dim_I++ )
+				particle->weight -= self->alpha * constaintLHS[ dim_I ] / squareTerms[ dim_I ] * particle->xi[ dim_I ] ;
+		}
 
-        /* Scale Weights to ensure constant constaint */
-        IterativeWeights_ScaleForConstantConstraint( self, swarm, lCell_I );
-    }
+		/* Scale Weights to ensure constant constaint */
+		IterativeWeights_ScaleForConstantConstraint( self, swarm, lCell_I );
+	}
 }
 
 
@@ -255,23 +280,21 @@ void _IterativeWeights_Calculate( void* 
 */
 
 void IterativeWeights_ScaleForConstantConstraint( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
-    IterativeWeights*            self            = (IterativeWeights*)  iterativeWeights;
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    double                       weightsTotal    = 0.0;
-    Particle_InCellIndex         cParticle_I;
-    Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
-    IntegrationPoint*            particle;
+	IterativeWeights*            self            = (IterativeWeights*)  iterativeWeights;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	double                       weightsTotal    = 0.0;
+	Particle_InCellIndex         cParticle_I;
+	Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
+	IntegrationPoint*            particle;
 
-    weightsTotal = WeightsCalculator_SumCellWeights( self, swarm, lCell_I );
+	weightsTotal = WeightsCalculator_SumCellWeights( self, swarm, lCell_I );
 
-    for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-        particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+	for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
 
-        /* Scale weights so that sum of weights = cellLocalVolume */
-        particle->weight *= self->cellLocalVolume/weightsTotal;
-    }
+		/* Scale weights so that sum of weights = cellLocalVolume */
+		particle->weight *= self->cellLocalVolume/weightsTotal;
+	}
 }
 	
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/IterativeWeights.h
--- a/Weights/src/IterativeWeights.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/IterativeWeights.h	Tue Feb 02 16:55:08 2010 +1100
@@ -1,28 +1,28 @@
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 **
 ** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**      Melbourne, 3053, Australia.
+**	Melbourne, 3053, Australia.
 ** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**      Victoria, 3800, Australia
+**	Victoria, 3800, Australia
 **
 ** Primary Contributing Organisations:
-**      Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**      Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**      Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
 **
 ** Contributors:
-**      Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**      Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**      Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**      Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**      David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**      Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**      Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**      Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**      Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**      Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**      David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**      Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
 **
 **  This library is free software; you can redistribute it and/or
 **  modify it under the terms of the GNU Lesser General Public
@@ -40,15 +40,15 @@
 **
 */
 /** \file
- **  Role:
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: IterativeWeights.h 374 2006-10-12 08:59:41Z SteveQuenette $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: IterativeWeights.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_Weights_IterativeWeightsClass_h__
 #define __PICellerator_Weights_IterativeWeightsClass_h__
@@ -58,67 +58,63 @@
 
 	/* IterativeWeights information */
 	#define __IterativeWeights \
-	/* General info */ \
+		/* General info */ \
 		__ConstantWeights \
-		\
-		/* Virtual Info */ \
-		WeightsCalculator*	initialWeights; \
-		Iteration_Index		maxIterations; \
-		double					tolerance; \
-		double					alpha; \
-		Bool						freeInitialWeights;
+		/* Virtual Info */\
+		WeightsCalculator*                        initialWeights;    \
+		Iteration_Index                           maxIterations;     \
+		double                                    tolerance;         \
+		double                                    alpha;             \
+		Bool                                      freeInitialWeights;\
+		
+
+	struct IterativeWeights { __IterativeWeights };
 	
-	struct IterativeWeights { __IterativeWeights };
-
+	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Constructors
 	*/
-
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define ITERATIVEWEIGHTS_DEFARGS \
-		CONSTANTWEIGHTS_DEFARGS
-
-	#define ITERATIVEWEIGHTS_PASSARGS \
-		CONSTANTWEIGHTS_PASSARGS
-
-	IterativeWeights* _IterativeWeights_New(  ITERATIVEWEIGHTS_DEFARGS  );
+	IterativeWeights* _IterativeWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name );
 
 	/* Stg_Class_Delete IterativeWeights implementation */
 	void _IterativeWeights_Delete( void* iterativeWeights );
-
 	void _IterativeWeights_Print( void* iterativeWeights, Stream* stream );
-
 	#define IterativeWeights_Copy( self ) \
 		(IterativeWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
 	#define IterativeWeights_DeepCopy( self ) \
 		(IterativeWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
 	void* _IterativeWeights_Copy( void* iterativeWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-        
-	void* _IterativeWeights_DefaultNew( Name name );
-
-	void _IterativeWeights_AssignFromXML( void* iterativeWeights, Stg_ComponentFactory* cf, void* data );
-
-	void _IterativeWeights_Build( void* iterativeWeights, void* data );
-
-	void _IterativeWeights_Initialise( void* iterativeWeights, void* data );
-
+	
+	void* _IterativeWeights_DefaultNew( Name name ) ;
+void _IterativeWeights_Construct( void* iterativeWeights, Stg_ComponentFactory* cf, void* data ) ;
+	void _IterativeWeights_Build( void* iterativeWeights, void* data ) ;
+	void _IterativeWeights_Initialise( void* iterativeWeights, void* data ) ;
 	void _IterativeWeights_Execute( void* iterativeWeights, void* data );
-
-	void _IterativeWeights_Destroy( void* iterativeWeights, void* data );
-                
-	void _IterativeWeights_Calculate( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I );
+	void _IterativeWeights_Destroy( void* iterativeWeights, void* data ) ;
+	
+		
+	void _IterativeWeights_Calculate( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Private functions
 	*/
-        
+	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Public functions
 	*/
 	void IterativeWeights_ScaleForConstantConstraint( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
-        
+	
+	
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/MomentBalanceWeights.c
--- a/Weights/src/MomentBalanceWeights.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/MomentBalanceWeights.c	Tue Feb 02 16:55:08 2010 +1100
@@ -1,28 +1,28 @@
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 **
 ** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**      Melbourne, 3053, Australia.
+**	Melbourne, 3053, Australia.
 ** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**      Victoria, 3800, Australia
+**	Victoria, 3800, Australia
 **
 ** Primary Contributing Organisations:
-**      Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**      Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**      Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
 **
 ** Contributors:
-**      Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**      Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**      Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**      Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**      David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**      Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**      Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**      Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**      Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**      Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**      David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**      Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
 **
 **  This library is free software; you can redistribute it and/or
 **  modify it under the terms of the GNU Lesser General Public
@@ -63,45 +63,81 @@ const Type MomentBalanceWeights_Type = "
 /*----------------------------------------------------------------------------------------------------------------------------------
 ** Constructors
 */
+MomentBalanceWeights* MomentBalanceWeights_New( Name name, Dimension_Index dim, WeightsCalculator* backupWeights ) {
+	MomentBalanceWeights* self = (MomentBalanceWeights*) _MomentBalanceWeights_DefaultNew( name );
 
-MomentBalanceWeights* MomentBalanceWeights_New( Name name, Dimension_Index dim, WeightsCalculator* backupWeights ) {
-	MomentBalanceWeights* self = _MomentBalanceWeights_DefaultNew( name );
-
-	self->isConstructed = True;
-	_WeightsCalculator_Init( self, dim );
-	_MomentBalanceWeights_Init( self, backupWeights );
+	MomentBalanceWeights_InitAll( self, dim, backupWeights );
 
 	return self;
 }
 
-MomentBalanceWeights* _MomentBalanceWeights_New(  MOMENTBALANCEWEIGHTS_DEFARGS  ) {
+MomentBalanceWeights* _MomentBalanceWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name )
+{
 	MomentBalanceWeights* self;
 	
-    /* Allocate memory */
-    assert( _sizeOfSelf >= sizeof(MomentBalanceWeights) );
-    self = (MomentBalanceWeights*)_WeightsCalculator_New(  WEIGHTSCALCULATOR_PASSARGS  ); 
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(MomentBalanceWeights) );
+	self = (MomentBalanceWeights*)_WeightsCalculator_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			name );
 
-    /* General info */
+	
+	/* General info */
 
-    /* Virtual Info */
-
-    return self;
+	/* Virtual Info */
+	
+	return self;
 }
 
 void _MomentBalanceWeights_Init( void* momentBalanceWeights, WeightsCalculator* backupWeights ) {
-    MomentBalanceWeights* self = (MomentBalanceWeights*)momentBalanceWeights;
+	MomentBalanceWeights* self = (MomentBalanceWeights*)momentBalanceWeights;
+	
+	self->isConstructed = True;
 
-    if ( backupWeights ) {
-        self->backupWeights = backupWeights;
-        self->freeBackupWeights = False;
-    }
-    else {
-        self->backupWeights = (WeightsCalculator*) ConstantWeights_New( "backupWeights", self->dim );
-        self->freeBackupWeights = True;
-    }
-        
-    Journal_Firewall( self->dim == 2, Journal_Register( Error_Type, (Name)self->type  ), "%s only works in 2D.\n", self->type );
-        
+	if ( backupWeights ) {
+		self->backupWeights = backupWeights;
+		self->freeBackupWeights = False;
+	}
+	else {
+		self->backupWeights = (WeightsCalculator*) ConstantWeights_New( "backupWeights", self->dim );
+		self->freeBackupWeights = True;
+	}
+	
+	Journal_Firewall( self->dim == 2, 
+			Journal_Register( Error_Type, self->type ),
+			"%s only works in 2D.\n", self->type );
+	
+}
+
+void MomentBalanceWeights_InitAll( void* momentBalanceWeights, Dimension_Index dim, WeightsCalculator* backupWeights ) {
+	MomentBalanceWeights* self = (MomentBalanceWeights*)momentBalanceWeights;
+
+	WeightsCalculator_InitAll( self, dim );
+	_MomentBalanceWeights_Init( self, backupWeights );
 }
 
 /*------------------------------------------------------------------------------------------------------------------------
@@ -109,82 +145,81 @@ void _MomentBalanceWeights_Init( void* m
 */
 
 void _MomentBalanceWeights_Delete( void* momentBalanceWeights ) {
-    MomentBalanceWeights* self = (MomentBalanceWeights*)momentBalanceWeights;
-        
-    /* Delete parent */
-    _WeightsCalculator_Delete( self );
+	MomentBalanceWeights* self = (MomentBalanceWeights*)momentBalanceWeights;
+
+	if ( self->freeBackupWeights )
+		Stg_Class_Delete( self->backupWeights );
+	
+	/* Delete parent */
+	_WeightsCalculator_Delete( self );
 }
 
+
 void _MomentBalanceWeights_Print( void* momentBalanceWeights, Stream* stream ) {
-    MomentBalanceWeights* self = (MomentBalanceWeights*)momentBalanceWeights;
-        
-    /* Print parent */
-    _WeightsCalculator_Print( self, stream );
+	MomentBalanceWeights* self = (MomentBalanceWeights*)momentBalanceWeights;
+	
+	/* Print parent */
+	_WeightsCalculator_Print( self, stream );
 }
 
 void* _MomentBalanceWeights_Copy( void* momentBalanceWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    MomentBalanceWeights*       self = (MomentBalanceWeights*)momentBalanceWeights;
-    MomentBalanceWeights*       newMomentBalanceWeights;
-        
-    newMomentBalanceWeights = (MomentBalanceWeights*)_WeightsCalculator_Copy( self, dest, deep, nameExt, ptrMap );
-        
-    return (void*)newMomentBalanceWeights;
+	MomentBalanceWeights*	self = (MomentBalanceWeights*)momentBalanceWeights;
+	MomentBalanceWeights*	newMomentBalanceWeights;
+	
+	newMomentBalanceWeights = (MomentBalanceWeights*)_WeightsCalculator_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newMomentBalanceWeights;
 }
 
 void* _MomentBalanceWeights_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(MomentBalanceWeights);
-	Type                                                      type = MomentBalanceWeights_Type;
-	Stg_Class_DeleteFunction*                              _delete = _MomentBalanceWeights_Delete;
-	Stg_Class_PrintFunction*                                _print = _MomentBalanceWeights_Print;
-	Stg_Class_CopyFunction*                                  _copy = _MomentBalanceWeights_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _MomentBalanceWeights_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _MomentBalanceWeights_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _MomentBalanceWeights_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _MomentBalanceWeights_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _MomentBalanceWeights_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _MomentBalanceWeights_Destroy;
-	AllocationType                              nameAllocationType = NON_GLOBAL;
-	WeightsCalculator_CalculateFunction*                _calculate = _MomentBalanceWeights_Calculate;
-
-    return (void*) _MomentBalanceWeights_New(  MOMENTBALANCEWEIGHTS_PASSARGS  );
+	return (void*) _MomentBalanceWeights_New(
+			sizeof(MomentBalanceWeights),
+			MomentBalanceWeights_Type,
+			_MomentBalanceWeights_Delete,
+			_MomentBalanceWeights_Print,
+			_MomentBalanceWeights_Copy,
+			_MomentBalanceWeights_DefaultNew,
+			_MomentBalanceWeights_Construct,
+			_MomentBalanceWeights_Build,
+			_MomentBalanceWeights_Initialise,
+			_MomentBalanceWeights_Execute,
+			_MomentBalanceWeights_Destroy,
+			_MomentBalanceWeights_Calculate,
+			name );
 }
 
-void _MomentBalanceWeights_AssignFromXML( void* momentBalanceWeights, Stg_ComponentFactory* cf, void* data ) {
-    MomentBalanceWeights*            self          = (MomentBalanceWeights*) momentBalanceWeights;
-    WeightsCalculator*           backupWeights;
+void _MomentBalanceWeights_Construct( void* momentBalanceWeights, Stg_ComponentFactory* cf, void* data ) {
+	MomentBalanceWeights*	     self          = (MomentBalanceWeights*) momentBalanceWeights;
+	WeightsCalculator*           backupWeights;
 
-    _WeightsCalculator_AssignFromXML( self, cf, data );
+	_WeightsCalculator_Construct( self, cf, data );
+	
+	backupWeights =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "BackupWeights", WeightsCalculator, False, data );
 
-    backupWeights =  Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"BackupWeights", WeightsCalculator, False, data  );
-
-    _MomentBalanceWeights_Init( self, backupWeights );
+	_MomentBalanceWeights_Init( self, backupWeights );
 }
 
 void _MomentBalanceWeights_Build( void* momentBalanceWeights, void* data ) {
-    MomentBalanceWeights*       self = (MomentBalanceWeights*)momentBalanceWeights;
-    
-    Stg_Component_Build( self->backupWeights, data, False );
-    _WeightsCalculator_Build( self, data );
+	MomentBalanceWeights*	self = (MomentBalanceWeights*)momentBalanceWeights;
+
+	_WeightsCalculator_Build( self, data );
 }
 void _MomentBalanceWeights_Initialise( void* momentBalanceWeights, void* data ) {
-    MomentBalanceWeights*       self = (MomentBalanceWeights*)momentBalanceWeights;
-
-    Stg_Component_Initialise( self->backupWeights, data, False );
-    _WeightsCalculator_Initialise( self, data );
+	MomentBalanceWeights*	self = (MomentBalanceWeights*)momentBalanceWeights;
+	
+	_WeightsCalculator_Initialise( self, data );
 }
 void _MomentBalanceWeights_Execute( void* momentBalanceWeights, void* data ) {
-    MomentBalanceWeights*       self = (MomentBalanceWeights*)momentBalanceWeights;
-        
-    _WeightsCalculator_Execute( self, data );
+	MomentBalanceWeights*	self = (MomentBalanceWeights*)momentBalanceWeights;
+	
+	_WeightsCalculator_Execute( self, data );
 }
 void _MomentBalanceWeights_Destroy( void* momentBalanceWeights, void* data ) {
-    MomentBalanceWeights*       self = (MomentBalanceWeights*)momentBalanceWeights;
+	MomentBalanceWeights*	self = (MomentBalanceWeights*)momentBalanceWeights;
+	
+	_WeightsCalculator_Destroy( self, data );
+}
 
-    if ( self->freeBackupWeights )
-       Stg_Component_Destroy( self->backupWeights, data, False );
-    _WeightsCalculator_Destroy( self, data );
-}
 
 
 /*-------------------------------------------------------------------------------------------------------------------------
@@ -192,289 +227,289 @@ void _MomentBalanceWeights_Destroy( void
 */
 
 typedef struct {
-    double         x;
-    double         y;
-    double         z;
-    double         weight;
-    Particle_Index particleCount;
+	double         x;
+	double         y;
+	double         z;
+	double         weight;
+	Particle_Index particleCount;
 } RegionInfo;
 
 typedef enum {
-    REGION_A,
-    REGION_B,
-    REGION_C,
-    REGION_D,
-    REGION_E,
-    REGION_F,
-    REGION_G,
-    REGION_H
+	REGION_A,
+	REGION_B,
+	REGION_C,
+	REGION_D,
+	REGION_E,
+	REGION_F,
+	REGION_G,
+	REGION_H
 } RegionIndex;
 
 
-#define _MomentBalanceWeights_WhichRegion2D( xi )               \
-    (( xi[ I_AXIS ] < 0.0 )                                     \
-     ? (( xi[ J_AXIS ] < 0.0 ) ? REGION_C : REGION_B )          \
-     : (( xi[ J_AXIS ] < 0.0 ) ? REGION_D : REGION_A ) )
+#define _MomentBalanceWeights_WhichRegion2D( xi )\
+	(( xi[ I_AXIS ] < 0.0 )                                 \
+		? (( xi[ J_AXIS ] < 0.0 ) ? REGION_C : REGION_B )   \
+	 	: (( xi[ J_AXIS ] < 0.0 ) ? REGION_D : REGION_A ) )
 
 void _MomentBalanceWeights_Calculate( void* momentBalanceWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
-    MomentBalanceWeights*        self            = (MomentBalanceWeights*)  momentBalanceWeights;
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
-    Particle_InCellIndex         cParticle_I;
-    RegionInfo                   region[4];
-    RegionIndex                  region_I;
-    double*                      xi;
-    double                       n;
-    double                       m;
-    IntegrationPoint*            particle;
-    double                       a,b,c;
-                
-    /* First Step -
-     * Assume all weights are constant in quadrants - i.e.                  
-     * -------------
-     * |  B  |  A  |
-     * |  C  |  D  |
-     * -------------
-     *
-     * This gives us three constaint equations:
-     * W_A N_A + W_B N_B + W_C N_C + W_D N_D = 4
-     * W_A X_A + W_D X_D = W_B X_B + W_C X_C
-     * W_A Y_A + W_B Y_B = W_C Y_C + W_D Y_D 
-     *
-     * where
-     *
-     * W_Q is the weight for each particle in region Q,
-     * N_Q is the number of particles in region Q,
-     * X_Q = \sum_{q=1}^{N_q} |\xi_{q} | and
-     * Y_Q = \sum_{q=1}^{N_q} |\eta_{q}| */
+	MomentBalanceWeights*        self            = (MomentBalanceWeights*)  momentBalanceWeights;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
+	Particle_InCellIndex         cParticle_I;
+	RegionInfo                   region[4];
+	RegionIndex                  region_I;
+	double*                      xi;
+	double                       n;
+	double                       m;
+	IntegrationPoint*            particle;
+	double                       a,b,c;
+		
+	/* First Step -
+	 * Assume all weights are constant in quadrants - i.e.                  
+	 * -------------
+	 * |  B  |  A  |
+	 * |  C  |  D  |
+	 * -------------
+	 *
+	 * This gives us three constaint equations:
+	 * W_A N_A + W_B N_B + W_C N_C + W_D N_D = 4
+	 * W_A X_A + W_D X_D = W_B X_B + W_C X_C
+	 * W_A Y_A + W_B Y_B = W_C Y_C + W_D Y_D 
+	 *
+	 * where
+	 *
+	 * W_Q is the weight for each particle in region Q,
+	 * N_Q is the number of particles in region Q,
+	 * X_Q = \sum_{q=1}^{N_q} |\xi_{q} | and
+	 * Y_Q = \sum_{q=1}^{N_q} |\eta_{q}| */
 
-    memset( region, 0, 4 * sizeof(RegionInfo) );
+	memset( region, 0, 4 * sizeof(RegionInfo) );
 
-    /* Calculate region data from particle local coordinates */
-    for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-        particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
-        xi       = particle->xi;
+	/* Calculate region data from particle local coordinates */
+	for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+		xi       = particle->xi;
 
-        region_I = _MomentBalanceWeights_WhichRegion2D( xi );
-        region[ region_I ].x += fabs(xi[ I_AXIS ]);
-        region[ region_I ].y += fabs(xi[ J_AXIS ]);
+		region_I = _MomentBalanceWeights_WhichRegion2D( xi );
+		region[ region_I ].x += fabs(xi[ I_AXIS ]);
+		region[ region_I ].y += fabs(xi[ J_AXIS ]);
 
-        region[ region_I ].particleCount++;
-    }
+		region[ region_I ].particleCount++;
+	}
 
-    /* Make sure each region has particles - otherwise use back up */
-    if ( region[ REGION_A ].particleCount == 0 ||
-         region[ REGION_B ].particleCount == 0 ||
-         region[ REGION_C ].particleCount == 0 ||
-         region[ REGION_D ].particleCount == 0 ) 
-    {
-        WeightsCalculator_CalculateCell( self->backupWeights, swarm, lCell_I );
-        return;
-    }
+	/* Make sure each region has particles - otherwise use back up */
+	if ( region[ REGION_A ].particleCount == 0 ||
+	     region[ REGION_B ].particleCount == 0 ||
+	     region[ REGION_C ].particleCount == 0 ||
+	     region[ REGION_D ].particleCount == 0 ) 
+	{
+		WeightsCalculator_CalculateCell( self->backupWeights, swarm, lCell_I );
+		return;
+	}
 
 
-    /** Let  n = W_B/W_C and
-     *       m = W_D/W_C 
-     *
-     * Assume that the ratios of W_A/W_B and W_D/W_C are the same and
-     * (which also means that W_A/W_D = W_B/W_C)
-     *  
-     * Therefore:
-     *       nm = W_A/W_C 
-     *
-     * This gives us the constraint equations
-     *
-     * nm N_A + n N_B + N_C + m N_D = 4/W_C
-     * nm X_A + m X_D = n X_B + X_C
-     * nm Y_A + n Y_B = Y_C + m Y_D
-     *
-     * Therefore:
-     * m = \frac{n X_B + X_C}{n X_A + X_D} = \frac{ Y_C - n Y_B }{ nY_A - Y_D }
-     * and
-     * (X_B Y_A + Y_B X_A)n^2 + (X_C Y_A + Y_B X_D - Y_D X_B - X_A Y_C)n - (X_C Y_D + Y_C X_D) = 0
-     * which we can solve using the quadratic formula */
+	/** Let  n = W_B/W_C and
+	 *       m = W_D/W_C 
+	 *
+	 * Assume that the ratios of W_A/W_B and W_D/W_C are the same and
+	 * (which also means that W_A/W_D = W_B/W_C)
+	 *  
+	 * Therefore:
+	 *       nm = W_A/W_C 
+	 *
+	 * This gives us the constraint equations
+	 *
+	 * nm N_A + n N_B + N_C + m N_D = 4/W_C
+	 * nm X_A + m X_D = n X_B + X_C
+	 * nm Y_A + n Y_B = Y_C + m Y_D
+	 *
+	 * Therefore:
+	 * m = \frac{n X_B + X_C}{n X_A + X_D} = \frac{ Y_C - n Y_B }{ nY_A - Y_D }
+	 * and
+	 * (X_B Y_A + Y_B X_A)n^2 + (X_C Y_A + Y_B X_D - Y_D X_B - X_A Y_C)n - (X_C Y_D + Y_C X_D) = 0
+	 * which we can solve using the quadratic formula */
 
-    a = ( region[ REGION_A ].y * region[ REGION_B ].x + region[ REGION_A ].x * region[ REGION_B ].y );
-    b = ( region[ REGION_A ].y * region[ REGION_C ].x - region[ REGION_A ].x * region[ REGION_C ].y ) +
-        ( region[ REGION_B ].y * region[ REGION_D ].x - region[ REGION_B ].x * region[ REGION_D ].y );
-    c = - ( region[ REGION_D ].y * region[ REGION_C ].x + region[ REGION_D ].x * region[ REGION_C ].y );
+	a = ( region[ REGION_A ].y * region[ REGION_B ].x + region[ REGION_A ].x * region[ REGION_B ].y );
+	b = ( region[ REGION_A ].y * region[ REGION_C ].x - region[ REGION_A ].x * region[ REGION_C ].y ) +
+		( region[ REGION_B ].y * region[ REGION_D ].x - region[ REGION_B ].x * region[ REGION_D ].y );
+	c = - ( region[ REGION_D ].y * region[ REGION_C ].x + region[ REGION_D ].x * region[ REGION_C ].y );
 
-    /* We take the solution which will always give a positive n */
-    n = (-b + sqrt( b*b - 4.0 * a * c ))/(2.0 * a);
-                
-    m = ( n * region[ REGION_B ].x + region[ REGION_C ].x)/
-        ( n * region[ REGION_A ].x + region[ REGION_D ].x);
+	/* We take the solution which will always give a positive n */
+	n = (-b + sqrt( b*b - 4.0 * a * c ))/(2.0 * a);
+		
+	m = ( n * region[ REGION_B ].x + region[ REGION_C ].x)/
+	    ( n * region[ REGION_A ].x + region[ REGION_D ].x);
 
-    /* Calculate weights from intermediate values */
-    region[ REGION_C ].weight = self->cellLocalVolume /
-        ( (double) region[ REGION_A ].particleCount * n * m
-          + (double) region[ REGION_B ].particleCount * n
-          + (double) region[ REGION_C ].particleCount  
-          + (double) region[ REGION_D ].particleCount * m );
+	/* Calculate weights from intermediate values */
+	region[ REGION_C ].weight = self->cellLocalVolume /
+			( (double) region[ REGION_A ].particleCount * n * m
+			+ (double) region[ REGION_B ].particleCount * n
+			+ (double) region[ REGION_C ].particleCount  
+			+ (double) region[ REGION_D ].particleCount * m );
 
-    region[ REGION_A ].weight = n * m * region[ REGION_C ].weight;
-    region[ REGION_B ].weight = n *     region[ REGION_C ].weight;
-    region[ REGION_D ].weight =     m * region[ REGION_C ].weight;
+	region[ REGION_A ].weight = n * m * region[ REGION_C ].weight;
+	region[ REGION_B ].weight = n *     region[ REGION_C ].weight;
+	region[ REGION_D ].weight =     m * region[ REGION_C ].weight;
 
-    /* Assign weights to particles according to which region it is in */
-    for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-        particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
-        xi       = particle->xi;
+	/* Assign weights to particles according to which region it is in */
+	for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+		xi       = particle->xi;
 
-        region_I = _MomentBalanceWeights_WhichRegion2D( xi );
-        particle->weight = region[ region_I ].weight;
-    }
+		region_I = _MomentBalanceWeights_WhichRegion2D( xi );
+		particle->weight = region[ region_I ].weight;
+	}
 }
 
 
-#define _MomentBalanceWeights_WhichRegion3D( xi )               \
-    (( xi[ K_AXIS ] < 0.0 )                                     \
-     ? ( (( xi[ I_AXIS ] < 0.0 )                                \
-          ? (( xi[ J_AXIS ] < 0.0 ) ? REGION_C : REGION_B )     \
-          : (( xi[ J_AXIS ] < 0.0 ) ? REGION_D : REGION_A ) ))  \
-     : ( (( xi[ I_AXIS ] < 0.0 )                                \
-          ? (( xi[ J_AXIS ] < 0.0 ) ? REGION_G : REGION_F )     \
-          : (( xi[ J_AXIS ] < 0.0 ) ? REGION_H : REGION_E ) )))
+#define _MomentBalanceWeights_WhichRegion3D( xi )\
+	(( xi[ K_AXIS ] < 0.0 )                                 \
+		? ( (( xi[ I_AXIS ] < 0.0 )                                 \
+			? (( xi[ J_AXIS ] < 0.0 ) ? REGION_C : REGION_B )   \
+			: (( xi[ J_AXIS ] < 0.0 ) ? REGION_D : REGION_A ) ))  \
+	 	: ( (( xi[ I_AXIS ] < 0.0 )                                 \
+			? (( xi[ J_AXIS ] < 0.0 ) ? REGION_G : REGION_F )   \
+			: (( xi[ J_AXIS ] < 0.0 ) ? REGION_H : REGION_E ) )))
 
 void _MomentBalanceWeights_Calculate3D( void* momentBalanceWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
-    MomentBalanceWeights*        self            = (MomentBalanceWeights*)  momentBalanceWeights;
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
-    Particle_InCellIndex         cParticle_I;
-    RegionInfo                   region[8];
-    RegionIndex                  region_I;
-    double*                      xi;
-    double                       n;
-    double                       m;
-/*      double                       q; */
-    IntegrationPoint*            particle;
-    double                       a,b,c;
-                
-    /* First Step -
-     * Assume all weights are constant in octants - i.e.                  
-     * -FRONT-FACE--
-     * |  B  |  A  |
-     * |  C  |  D  |
-     * -------------
-     *
-     * --BACK-FACE--
-     * |  F  |  E  |
-     * |  G  |  H  |
-     * -------------
-     *
-     * This gives us four constaint equations:
-     * W_A N_A + W_B N_B + W_C N_C + W_D N_D + W_E N_E + W_F N_F + W_G N_G + W_H N_H= 8
-     * W_A X_A + W_D X_D + W_E X_E + W_H X_H = W_B X_B + W_C X_C + W_F X_F + W_G X_G
-     * W_A Y_A + W_B Y_B + W_F Y_F + W_E Y_E = W_C Y_C + W_D Y_D + W_G Y_G + W_H Y_H
-     * W_A Z_A + W_B Z_B + W_C Z_C + W_D Z_D = W_E Z_E + W_F Z_F + W_G Z_G + W_H Z_H
-     *
-     * where
-     *
-     * W_Q is the weight for each particle in region Q,
-     * N_Q is the number of particles in region Q,
-     * X_Q = \sum_{q=1}^{N_q} |\xi_{q}  | and
-     * Y_Q = \sum_{q=1}^{N_q} |\eta_{q} | 
-     * Z_Q = \sum_{q=1}^{N_q} |\zeta_{q}| */
+	MomentBalanceWeights*        self            = (MomentBalanceWeights*)  momentBalanceWeights;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
+	Particle_InCellIndex         cParticle_I;
+	RegionInfo                   region[8];
+	RegionIndex                  region_I;
+	double*                      xi;
+	double                       n;
+	double                       m;
+/*	double                       q; */
+	IntegrationPoint*            particle;
+	double                       a,b,c;
+		
+	/* First Step -
+	 * Assume all weights are constant in octants - i.e.                  
+	 * -FRONT-FACE--
+	 * |  B  |  A  |
+	 * |  C  |  D  |
+	 * -------------
+	 *
+	 * --BACK-FACE--
+	 * |  F  |  E  |
+	 * |  G  |  H  |
+	 * -------------
+	 *
+	 * This gives us four constaint equations:
+	 * W_A N_A + W_B N_B + W_C N_C + W_D N_D + W_E N_E + W_F N_F + W_G N_G + W_H N_H= 8
+	 * W_A X_A + W_D X_D + W_E X_E + W_H X_H = W_B X_B + W_C X_C + W_F X_F + W_G X_G
+	 * W_A Y_A + W_B Y_B + W_F Y_F + W_E Y_E = W_C Y_C + W_D Y_D + W_G Y_G + W_H Y_H
+	 * W_A Z_A + W_B Z_B + W_C Z_C + W_D Z_D = W_E Z_E + W_F Z_F + W_G Z_G + W_H Z_H
+	 *
+	 * where
+	 *
+	 * W_Q is the weight for each particle in region Q,
+	 * N_Q is the number of particles in region Q,
+	 * X_Q = \sum_{q=1}^{N_q} |\xi_{q}  | and
+	 * Y_Q = \sum_{q=1}^{N_q} |\eta_{q} | 
+	 * Z_Q = \sum_{q=1}^{N_q} |\zeta_{q}| */
 
-    memset( region, 0, 8 * sizeof(RegionInfo) );
+	memset( region, 0, 8 * sizeof(RegionInfo) );
 
-    /* Calculate region data from particle local coordinates */
-    for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-        particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
-        xi       = particle->xi;
+	/* Calculate region data from particle local coordinates */
+	for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+		xi       = particle->xi;
 
-        region_I = _MomentBalanceWeights_WhichRegion3D( xi );
-        region[ region_I ].x += fabs(xi[ I_AXIS ]);
-        region[ region_I ].y += fabs(xi[ J_AXIS ]);
-        region[ region_I ].z += fabs(xi[ K_AXIS ]);
+		region_I = _MomentBalanceWeights_WhichRegion3D( xi );
+		region[ region_I ].x += fabs(xi[ I_AXIS ]);
+		region[ region_I ].y += fabs(xi[ J_AXIS ]);
+		region[ region_I ].z += fabs(xi[ K_AXIS ]);
 
-        region[ region_I ].particleCount++;
-    }
+		region[ region_I ].particleCount++;
+	}
 
-    /* Make sure each region has particles - otherwise use back up */
-    if ( region[ REGION_A ].particleCount == 0 ||
-         region[ REGION_B ].particleCount == 0 ||
-         region[ REGION_C ].particleCount == 0 ||
-         region[ REGION_D ].particleCount == 0 ||
-         region[ REGION_E ].particleCount == 0 ||
-         region[ REGION_F ].particleCount == 0 ||
-         region[ REGION_G ].particleCount == 0 ||
-         region[ REGION_H ].particleCount == 0 ) 
-    {
-        WeightsCalculator_CalculateCell( self->backupWeights, swarm, lCell_I );
-        return;
-    }
+	/* Make sure each region has particles - otherwise use back up */
+	if ( region[ REGION_A ].particleCount == 0 ||
+	     region[ REGION_B ].particleCount == 0 ||
+	     region[ REGION_C ].particleCount == 0 ||
+	     region[ REGION_D ].particleCount == 0 ||
+	     region[ REGION_E ].particleCount == 0 ||
+	     region[ REGION_F ].particleCount == 0 ||
+	     region[ REGION_G ].particleCount == 0 ||
+	     region[ REGION_H ].particleCount == 0 ) 
+	{
+		WeightsCalculator_CalculateCell( self->backupWeights, swarm, lCell_I );
+		return;
+	}
 
 
-    /** Let  n = W_B/W_C and
-     *       m = W_D/W_C 
-     *       q = W_G/W_C 
-     *
-     * To keep ratios even - as in 2D case assume:
-     *  
-     * Therefore:
-     *       nm  = W_A/W_C 
-     *       nmq = W_E/W_C 
-     *       nq  = W_F/W_C 
-     *       mq  = W_H/W_C 
-     *
-     * This gives us the constrain equations
-     *
-     * n X_B + X_C + nq X_F + q X_G      = nm X_A + m X_D + nmq X_E + mq X_H
-     * n Y_B + nm Y_A + nq Y_F + nmq Y_E = Y_C + m Y_D + q Y_G + mq Y_H
-     * nm Z_A + n Z_B + Z_C + m Z_D      = nmq Z_E + nq Z_F + q Z_G + mq Z_H
-     *
-     * Therefore, we obtain 3 equations for m:
-     * m = \frac{ n X_B + X_C + nq X_F + q X_G }{ n X_A + X_D + nq X_E + q X_H }
-     *   = \frac{ n Y_B + nq Y_F - Y_C - q Y_G }{ Y_D + q Y_H + - n Y_A - nq Y_E }
-     *   TODO other one
-     *
-     * which gives two quadratics for n in terms of q:
-     *
-     *   n^2 ( q^2(X_E Y_F + X_F Y_E) + q(X_E Y_B + X_B Y_E + X_A Y_F + X_F Y_A) + (X_B Y_A + X_A Y_B) )
-     * + n   ( q^2( X_G Y_E - X_E Y_G + X_H Y_F - X_F Y_H ) + 
-     *                          + q ( X_H Y_B - X_B Y_H + X_D Y_F - X_F Y_D + X_C Y_E - Y_C X_E + X_G Y_A - X_A Y_G )
-     *                          ( X_C Y_A - X_A Y_C ) + (X_D Y_B - X_B Y_D) )
-     * - ( q^2( X_H Y_G + X_G Y_H ) + q( X_G Y_D + X_D Y_G + X_H Y_C + X_C Y_H ) + X_D Y_C + X_C Y_D ) = 0
-     *
-     * and
-     *   TODO other one
-     *
-     * which we can solve using the quadratic formula:
-     *
-     * n = 
-     * */
+	/** Let  n = W_B/W_C and
+	 *       m = W_D/W_C 
+	 *       q = W_G/W_C 
+	 *
+	 * To keep ratios even - as in 2D case assume:
+	 *  
+	 * Therefore:
+	 *       nm  = W_A/W_C 
+	 *       nmq = W_E/W_C 
+	 *       nq  = W_F/W_C 
+	 *       mq  = W_H/W_C 
+	 *
+	 * This gives us the constrain equations
+	 *
+	 * n X_B + X_C + nq X_F + q X_G      = nm X_A + m X_D + nmq X_E + mq X_H
+	 * n Y_B + nm Y_A + nq Y_F + nmq Y_E = Y_C + m Y_D + q Y_G + mq Y_H
+	 * nm Z_A + n Z_B + Z_C + m Z_D      = nmq Z_E + nq Z_F + q Z_G + mq Z_H
+	 *
+	 * Therefore, we obtain 3 equations for m:
+	 * m = \frac{ n X_B + X_C + nq X_F + q X_G }{ n X_A + X_D + nq X_E + q X_H }
+	 *   = \frac{ n Y_B + nq Y_F - Y_C - q Y_G }{ Y_D + q Y_H + - n Y_A - nq Y_E }
+	 *   TODO other one
+	 *
+	 * which gives two quadratics for n in terms of q:
+	 *
+	 *   n^2 ( q^2(X_E Y_F + X_F Y_E) + q(X_E Y_B + X_B Y_E + X_A Y_F + X_F Y_A) + (X_B Y_A + X_A Y_B) )
+	 * + n   ( q^2( X_G Y_E - X_E Y_G + X_H Y_F - X_F Y_H ) + 
+	 * 				+ q ( X_H Y_B - X_B Y_H + X_D Y_F - X_F Y_D + X_C Y_E - Y_C X_E + X_G Y_A - X_A Y_G )
+	 * 				( X_C Y_A - X_A Y_C ) + (X_D Y_B - X_B Y_D) )
+	 * - ( q^2( X_H Y_G + X_G Y_H ) + q( X_G Y_D + X_D Y_G + X_H Y_C + X_C Y_H ) + X_D Y_C + X_C Y_D ) = 0
+	 *
+	 * and
+	 *   TODO other one
+	 *
+	 * which we can solve using the quadratic formula:
+	 *
+	 * n = 
+	 * */
 
-    a = ( region[ REGION_A ].y * region[ REGION_B ].x + region[ REGION_A ].x * region[ REGION_B ].y );
-    b = ( region[ REGION_A ].y * region[ REGION_C ].x - region[ REGION_A ].x * region[ REGION_C ].y ) +
-        ( region[ REGION_B ].y * region[ REGION_D ].x - region[ REGION_B ].x * region[ REGION_D ].y );
-    c = - ( region[ REGION_D ].y * region[ REGION_C ].x + region[ REGION_D ].x * region[ REGION_C ].y );
+	a = ( region[ REGION_A ].y * region[ REGION_B ].x + region[ REGION_A ].x * region[ REGION_B ].y );
+	b = ( region[ REGION_A ].y * region[ REGION_C ].x - region[ REGION_A ].x * region[ REGION_C ].y ) +
+		( region[ REGION_B ].y * region[ REGION_D ].x - region[ REGION_B ].x * region[ REGION_D ].y );
+	c = - ( region[ REGION_D ].y * region[ REGION_C ].x + region[ REGION_D ].x * region[ REGION_C ].y );
 
-    /* We take the solution which will always give a positive n */
-    n = (-b + sqrt( b*b - 4.0 * a * c ))/(2.0 * a);
-                
-    m = ( n * region[ REGION_B ].x + region[ REGION_C ].x)/
-        ( n * region[ REGION_A ].x + region[ REGION_D ].x);
+	/* We take the solution which will always give a positive n */
+	n = (-b + sqrt( b*b - 4.0 * a * c ))/(2.0 * a);
+		
+	m = ( n * region[ REGION_B ].x + region[ REGION_C ].x)/
+	    ( n * region[ REGION_A ].x + region[ REGION_D ].x);
 
-    /* Calculate weights from intermediate values */
-    region[ REGION_C ].weight = self->cellLocalVolume /
-        ( (double) region[ REGION_A ].particleCount * n * m
-          + (double) region[ REGION_B ].particleCount * n
-          + (double) region[ REGION_C ].particleCount  
-          + (double) region[ REGION_D ].particleCount * m );
+	/* Calculate weights from intermediate values */
+	region[ REGION_C ].weight = self->cellLocalVolume /
+			( (double) region[ REGION_A ].particleCount * n * m
+			+ (double) region[ REGION_B ].particleCount * n
+			+ (double) region[ REGION_C ].particleCount  
+			+ (double) region[ REGION_D ].particleCount * m );
 
-    region[ REGION_A ].weight = n * m * region[ REGION_C ].weight;
-    region[ REGION_B ].weight = n *     region[ REGION_C ].weight;
-    region[ REGION_D ].weight =     m * region[ REGION_C ].weight;
+	region[ REGION_A ].weight = n * m * region[ REGION_C ].weight;
+	region[ REGION_B ].weight = n *     region[ REGION_C ].weight;
+	region[ REGION_D ].weight =     m * region[ REGION_C ].weight;
 
-    /* Assign weights to particles according to which region it is in */
-    for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-        particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
-        xi       = particle->xi;
+	/* Assign weights to particles according to which region it is in */
+	for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+		xi       = particle->xi;
 
-        region_I = _MomentBalanceWeights_WhichRegion2D( xi );
-        particle->weight = region[ region_I ].weight;
-    }
+		region_I = _MomentBalanceWeights_WhichRegion2D( xi );
+		particle->weight = region[ region_I ].weight;
+	}
 }
 
 /*-------------------------------------------------------------------------------------------------------------------------
@@ -482,5 +517,3 @@ void _MomentBalanceWeights_Calculate3D( 
 */
 
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/MomentBalanceWeights.h
--- a/Weights/src/MomentBalanceWeights.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/MomentBalanceWeights.h	Tue Feb 02 16:55:08 2010 +1100
@@ -1,28 +1,28 @@
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 **
 ** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**      Melbourne, 3053, Australia.
+**	Melbourne, 3053, Australia.
 ** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**      Victoria, 3800, Australia
+**	Victoria, 3800, Australia
 **
 ** Primary Contributing Organisations:
-**      Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**      Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**      Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
 **
 ** Contributors:
-**      Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**      Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**      Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**      Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**      David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**      Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**      Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**      Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**      Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**      Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**      David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**      Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
 **
 **  This library is free software; you can redistribute it and/or
 **  modify it under the terms of the GNU Lesser General Public
@@ -40,90 +40,79 @@
 **
 */
 /** \file
- **  Role:
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: MomentBalanceWeights.h 374 2006-10-12 08:59:41Z SteveQuenette $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: MomentBalanceWeights.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_Weights_MomentBalanceWeightsClass_h__
 #define __PICellerator_Weights_MomentBalanceWeightsClass_h__
 
-/* Textual name of this class */
-extern const Type MomentBalanceWeights_Type;
+	/* Textual name of this class */
+	extern const Type MomentBalanceWeights_Type;
 
 	/* MomentBalanceWeights information */
 	#define __MomentBalanceWeights \
 		/* General info */ \
 		__WeightsCalculator \
+		/* Virtual Info */\
 		\
-		/* Virtual Info */ \
-		WeightsCalculator*	backupWeights; \
-		Bool						freeBackupWeights;
+		WeightsCalculator*            backupWeights;            \
+		Bool                          freeBackupWeights;
 
 	struct MomentBalanceWeights { __MomentBalanceWeights };
-
-
-
+	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Constructors
 	*/
+	MomentBalanceWeights* MomentBalanceWeights_New( Name name, Dimension_Index dim, WeightsCalculator* backupWeights ) ;
+	MomentBalanceWeights* _MomentBalanceWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name );
 
-	MomentBalanceWeights* MomentBalanceWeights_New( Name name, Dimension_Index dim, WeightsCalculator* backupWeights );
-
-	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define MOMENTBALANCEWEIGHTS_DEFARGS \
-                WEIGHTSCALCULATOR_DEFARGS
-
-	#define MOMENTBALANCEWEIGHTS_PASSARGS \
-                WEIGHTSCALCULATOR_PASSARGS
-
-	MomentBalanceWeights* _MomentBalanceWeights_New(  MOMENTBALANCEWEIGHTS_DEFARGS  );
+	void MomentBalanceWeights_InitAll( void* momentBalanceWeights, Dimension_Index dim, WeightsCalculator* backupWeights ) ;
 
 	/* Stg_Class implementation */
 	void _MomentBalanceWeights_Delete( void* momentBalanceWeights );
-
 	void _MomentBalanceWeights_Print( void* momentBalanceWeights, Stream* stream );
-
 	#define MomentBalanceWeights_Copy( self ) \
 		(MomentBalanceWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-	#define MomentBalanceWeights_DeepCopy( self )                           \
+	#define MomentBalanceWeights_DeepCopy( self ) \
 		(MomentBalanceWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-
-	void _MomentBalanceWeights_Init( void* momentBalanceWeights, WeightsCalculator* backupWeights );
-
 	void* _MomentBalanceWeights_Copy( void* momentBalanceWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-        
-	void* _MomentBalanceWeights_DefaultNew( Name name );
-
-	void _MomentBalanceWeights_AssignFromXML( void* momentBalanceWeights, Stg_ComponentFactory* cf, void* data );
-
-	void _MomentBalanceWeights_Build( void* momentBalanceWeights, void* data );
-
-	void _MomentBalanceWeights_Initialise( void* momentBalanceWeights, void* data );
-
-	void _MomentBalanceWeights_Destroy( void* momentBalanceWeights, void* data );
-
+	
+	void* _MomentBalanceWeights_DefaultNew( Name name ) ;
+void _MomentBalanceWeights_Construct( void* momentBalanceWeights, Stg_ComponentFactory* cf, void* data ) ;
+	void _MomentBalanceWeights_Build( void* momentBalanceWeights, void* data ) ;
+	void _MomentBalanceWeights_Initialise( void* momentBalanceWeights, void* data ) ;
 	void _MomentBalanceWeights_Execute( void* momentBalanceWeights, void* data );
-                
-	void _MomentBalanceWeights_Calculate( void* momentBalanceWeights, void* _swarm, Cell_LocalIndex lCell_I );
-
-/*---------------------------------------------------------------------------------------------------------------------
-** Private functions
-*/
-        
-/*---------------------------------------------------------------------------------------------------------------------
-** Public functions
-*/
-        
-        
+	void _MomentBalanceWeights_Destroy( void* momentBalanceWeights, void* data ) ;
+	
+		
+	void _MomentBalanceWeights_Calculate( void* momentBalanceWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	
+	
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/VolumeWeights.c
--- a/Weights/src/VolumeWeights.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/VolumeWeights.c	Tue Feb 02 16:55:08 2010 +1100
@@ -7,7 +7,7 @@
 **	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
 **	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
 **	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org) ) {
-IrregTopology* self = (IrregTopology*)ir
+	IrregTopology* self = (IrregTopology*)ir
 **	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
 **	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
 **
@@ -43,35 +43,69 @@ const Type VolumeWeights_Type = "VolumeW
 ** Constructors
 */
 VolumeWeights* VolumeWeights_New( Name name, Dimension_Index dim, Stg_Shape* shape, FeMesh* mesh ) {
-	VolumeWeights *self = _VolumeWeights_DefaultNew( name );
+	VolumeWeights* self = (VolumeWeights*) _VolumeWeights_DefaultNew( name );
 
-	self->isConstructed = True;
-	_WeightsCalculator_Init( self, dim );
-	_VolumeWeights_Init( self, shape, mesh );
+	VolumeWeights_InitAll( self, dim, shape, mesh );
 
 	return self;
 }
 
-VolumeWeights* _VolumeWeights_New(  VOLUMEWEIGHTS_DEFARGS  ) {
-    VolumeWeights* self;
+VolumeWeights* _VolumeWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name )
+{
+	VolumeWeights* self;
 	
-    /* Allocate memory */
-    assert( _sizeOfSelf >= sizeof(VolumeWeights) );
-    self = (VolumeWeights*)_WeightsCalculator_New(  WEIGHTSCALCULATOR_PASSARGS  );
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(VolumeWeights) );
+	self = (VolumeWeights*)_WeightsCalculator_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			name );
+
 	
-    /* General info */
+	/* General info */
 
-    /* Virtual Info */
-
-    return self;
+	/* Virtual Info */
+	
+	return self;
 }
 
 void _VolumeWeights_Init( void* weights, Stg_Shape* shape, FeMesh* mesh ) {
-    VolumeWeights* self = (VolumeWeights*)weights;
+	VolumeWeights* self = (VolumeWeights*)weights;
+	
+	self->isConstructed = True;
 
-    self->shape = shape;
-    self->mesh  = mesh;
+	self->shape = shape;
+	self->mesh  = mesh;
 
+}
+void VolumeWeights_InitAll( void* weights, Dimension_Index dim, Stg_Shape* shape, FeMesh* mesh ) {
+	VolumeWeights* self = (VolumeWeights*)weights;
+
+	WeightsCalculator_InitAll( self, dim );
+	_VolumeWeights_Init( self, shape, mesh );
 }
 
 /*------------------------------------------------------------------------------------------------------------------------
@@ -79,142 +113,134 @@ void _VolumeWeights_Init( void* weights,
 */
 
 void _VolumeWeights_Delete( void* weights ) {
-    VolumeWeights* self = (VolumeWeights*)weights;
+	VolumeWeights* self = (VolumeWeights*)weights;
 	
-    /* Delete parent */
-    _WeightsCalculator_Delete( self );
+	/* Delete parent */
+	_WeightsCalculator_Delete( self );
 }
 
 
 void _VolumeWeights_Print( void* weights, Stream* stream ) {
-    VolumeWeights* self = (VolumeWeights*)weights;
+	VolumeWeights* self = (VolumeWeights*)weights;
 	
-    /* Print parent */
-    _WeightsCalculator_Print( self, stream );
+	/* Print parent */
+	_WeightsCalculator_Print( self, stream );
 }
 
 
 
 void* _VolumeWeights_Copy( void* weights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    VolumeWeights*	self = (VolumeWeights*)weights;
-    VolumeWeights*	newVolumeWeights;
+	VolumeWeights*	self = (VolumeWeights*)weights;
+	VolumeWeights*	newVolumeWeights;
 	
-    newVolumeWeights = (VolumeWeights*)_WeightsCalculator_Copy( self, dest, deep, nameExt, ptrMap );
+	newVolumeWeights = (VolumeWeights*)_WeightsCalculator_Copy( self, dest, deep, nameExt, ptrMap );
 	
-    return (void*)newVolumeWeights;
+	return (void*)newVolumeWeights;
 }
 
 void* _VolumeWeights_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof(VolumeWeights);
-	Type                                                      type = VolumeWeights_Type;
-	Stg_Class_DeleteFunction*                              _delete = _VolumeWeights_Delete;
-	Stg_Class_PrintFunction*                                _print = _VolumeWeights_Print;
-	Stg_Class_CopyFunction*                                  _copy = _VolumeWeights_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _VolumeWeights_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _VolumeWeights_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _VolumeWeights_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _VolumeWeights_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _VolumeWeights_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _VolumeWeights_Destroy;
-	AllocationType                              nameAllocationType = NON_GLOBAL;
-	WeightsCalculator_CalculateFunction*                _calculate = _VolumeWeights_Calculate;
-
-    return (void*) _VolumeWeights_New(  VOLUMEWEIGHTS_PASSARGS  );
+	return (void*) _VolumeWeights_New(
+			sizeof(VolumeWeights),
+			VolumeWeights_Type,
+			_VolumeWeights_Delete,
+			_VolumeWeights_Print,
+			_VolumeWeights_Copy,
+			_VolumeWeights_DefaultNew,
+			_VolumeWeights_Construct,
+			_VolumeWeights_Build,
+			_VolumeWeights_Initialise,
+			_VolumeWeights_Execute,
+			_VolumeWeights_Destroy,
+			_VolumeWeights_Calculate,
+			name );
 }
 
 
-void _VolumeWeights_AssignFromXML( void* weights, Stg_ComponentFactory* cf, void* data ) {
-    VolumeWeights*	     self          = (VolumeWeights*) weights;
-    Stg_Shape*           shape;
-    FeMesh*  mesh;
+void _VolumeWeights_Construct( void* weights, Stg_ComponentFactory* cf, void* data ) {
+	VolumeWeights*	     self          = (VolumeWeights*) weights;
+	Stg_Shape*           shape;
+	FeMesh*  mesh;
 
-    _WeightsCalculator_AssignFromXML( self, cf, data );
+	_WeightsCalculator_Construct( self, cf, data );
 
-    shape = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Shape", Stg_Shape, True, data  );
-    mesh  = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Mesh", FeMesh, True, data  );
+	shape = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Shape", Stg_Shape, True, data );
+	mesh  = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Mesh", FeMesh, True, data );
 /*
-  Journal_Firewall(
-  Stg_Class_IsInstance( shape, Sphere_Type ),
-  Journal_MyStream( Error_Type, self ),
-  "In func %s, VolumeWeights is only designed for spheres right now.\n",
-  __func__ );
+	Journal_Firewall(
+			Stg_Class_IsInstance( shape, Sphere_Type ),
+			Journal_MyStream( Error_Type, self ),
+			"In func %s, VolumeWeights is only designed for spheres right now.\n",
+			__func__ );
 */	
-    _VolumeWeights_Init( self, shape, mesh );
+	_VolumeWeights_Init( self, shape, mesh );
 }
 
 void _VolumeWeights_Build( void* weights, void* data ) {
-    VolumeWeights*	self = (VolumeWeights*)weights;
+	VolumeWeights*	self = (VolumeWeights*)weights;
 
-    Stg_Component_Build( self->shape, data, False );
-    Stg_Component_Build( self->mesh, data, False );
-    _WeightsCalculator_Build( self, data );
+	_WeightsCalculator_Build( self, data );
 }
 void _VolumeWeights_Initialise( void* weights, void* data ) {
-    VolumeWeights*	self = (VolumeWeights*)weights;
-
-    Stg_Component_Initialise( self->shape, data, False );
-    Stg_Component_Initialise( self->mesh, data, False );	
-    _WeightsCalculator_Initialise( self, data );
+	VolumeWeights*	self = (VolumeWeights*)weights;
+	
+	_WeightsCalculator_Initialise( self, data );
 }
 void _VolumeWeights_Execute( void* weights, void* data ) {
-    VolumeWeights*	self = (VolumeWeights*)weights;
+	VolumeWeights*	self = (VolumeWeights*)weights;
 	
-    _WeightsCalculator_Execute( self, data );
+	_WeightsCalculator_Execute( self, data );
 }
 void _VolumeWeights_Destroy( void* weights, void* data ) {
-    VolumeWeights*	self = (VolumeWeights*)weights;
-
-    Stg_Component_Destroy( self->shape, data, False );
-    Stg_Component_Destroy( self->mesh, data, False );	
-    _WeightsCalculator_Destroy( self, data );
+	VolumeWeights*	self = (VolumeWeights*)weights;
+	
+	_WeightsCalculator_Destroy( self, data );
 }
 
 /*-------------------------------------------------------------------------------------------------------------------------
 ** Private Functions
 */
 void _VolumeWeights_Calculate( void* weights, void* _swarm, Cell_LocalIndex lCell_I ) {
-    VolumeWeights*               self               = (VolumeWeights*)  weights;
-    Swarm*                       swarm              = (Swarm*) _swarm;
-    Sphere*                      shape              = (Sphere*)self->shape;
-    Index                        numberOfParticles;
-    double                       volume;
-    double                       dx;
-    double                       dy;
-    double                       dz;
-    double                       weight;
-    Grid*				vertGrid;
+	VolumeWeights*               self               = (VolumeWeights*)  weights;
+	Swarm*                       swarm              = (Swarm*) _swarm;
+	Sphere*                      shape              = (Sphere*)self->shape;
+	Index                        numberOfParticles;
+	double                       volume;
+	double                       dx;
+	double                       dy;
+	double                       dz;
+	double                       weight;
+	Grid*				vertGrid;
 	
-    MPI_Allreduce( 
-        &(swarm->particleLocalCount),
-        &(numberOfParticles),
-        1,
-        MPI_UNSIGNED,
-        MPI_SUM,
-        MPI_COMM_WORLD );
+	MPI_Allreduce( 
+		&(swarm->particleLocalCount),
+		&(numberOfParticles),
+		1,
+		MPI_UNSIGNED,
+		MPI_SUM,
+		MPI_COMM_WORLD );
 
-    volume = Stg_Shape_CalculateVolume( shape );
+	volume = Stg_Shape_CalculateVolume( shape );
 
-    /*
-    ** NOTE: Big assumption that the mesh is regular.
-    */
-    vertGrid = *(Grid**)ExtensionManager_Get( self->mesh->info, self->mesh, 
-                                              ExtensionManager_GetHandle( self->mesh->info, (Name)"vertexGrid" ) );
+	/*
+	** 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)(vertGrid->sizes[2] - 1);
-    }
-    else {
-        dz = 1.0;
-    }
+	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)(vertGrid->sizes[2] - 1);
+	}
+	else {
+		dz = 1.0;
+	}
 
-    /* (V / np) * 4 / ( dx * dy * dz ) */
-    /* Where 4 in the value of cellLocalVolume in 2D */
-    weight = (volume / (double)numberOfParticles) * ( self->cellLocalVolume / ( dx * dy * dz )  );
+	/* (V / np) * 4 / ( dx * dy * dz ) */
+	/* Where 4 in the value of cellLocalVolume in 2D */
+	weight = (volume / (double)numberOfParticles) * ( self->cellLocalVolume / ( dx * dy * dz ) );
 
-    WeightsCalculator_SetWeightsValueAllInCell( self, swarm, lCell_I, weight );
+	WeightsCalculator_SetWeightsValueAllInCell( self, swarm, lCell_I, weight );
 }
 
 /*-------------------------------------------------------------------------------------------------------------------------
@@ -222,5 +248,3 @@ void _VolumeWeights_Calculate( void* wei
 */
 
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/VolumeWeights.h
--- a/Weights/src/VolumeWeights.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/VolumeWeights.h	Tue Feb 02 16:55:08 2010 +1100
@@ -3,12 +3,12 @@
 ** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
 **
 ** Authors:
-**      Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**      Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**      Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**      Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**      Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**      Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
 **
 ** This file may be distributed under the terms of the VPAC Public License
 ** as defined by VPAC of Australia and appearing in the file
@@ -19,74 +19,72 @@
 **
 */
 /** \file
- **  Role:
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: VolumeWeights.h 189 2005-10-20 00:39:29Z RobertTurnbull $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: VolumeWeights.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_Weights_VolumeWeightsClass_h__
 #define __PICellerator_Weights_VolumeWeightsClass_h__
 
-/* Textual name of this class */
-extern const Type VolumeWeights_Type;
+	/* Textual name of this class */
+	extern const Type VolumeWeights_Type;
 
-/* VolumeWeights information */
-#define __VolumeWeights                         \
-    __WeightsCalculator                         \
-                                                \
-    Stg_Shape*              shape;              \
-    FeMesh*     mesh; 
+	/* VolumeWeights information */
+	#define __VolumeWeights \
+		__WeightsCalculator \
+		Stg_Shape*              shape; \
+		FeMesh*     mesh; 
 
-struct VolumeWeights { __VolumeWeights };
-        
-        
-/*---------------------------------------------------------------------------------------------------------------------
-** Constructors
-*/
+	struct VolumeWeights { __VolumeWeights };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	VolumeWeights* VolumeWeights_New( Name name, Dimension_Index dim, Stg_Shape* shape, FeMesh* mesh );
+	VolumeWeights* _VolumeWeights_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name );
 
+	void _VolumeWeights_Init( void* weights, Stg_Shape* shape, FeMesh* mesh ) ;
+	void VolumeWeights_InitAll( void* weights, Dimension_Index dim, Stg_Shape* shape, FeMesh* mesh ) ;
 
 
-VolumeWeights* VolumeWeights_New( Name name, Dimension_Index dim, Stg_Shape* shape, FeMesh* mesh );
-
+	/* Stg_Class_Delete VolumeWeights implementation */
+	void _VolumeWeights_Delete( void* weights );
+	void _VolumeWeights_Print( void* weights, Stream* stream );
+	#define VolumeWeights_Copy( self ) \
+		(VolumeWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define VolumeWeights_DeepCopy( self ) \
+		(VolumeWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _VolumeWeights_Copy( void* weights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define VOLUMEWEIGHTS_DEFARGS \
-                WEIGHTSCALCULATOR_DEFARGS
-
-	#define VOLUMEWEIGHTS_PASSARGS \
-                WEIGHTSCALCULATOR_PASSARGS
-
-VolumeWeights* _VolumeWeights_New(  VOLUMEWEIGHTS_DEFARGS  );
-
-void _VolumeWeights_Init( void* weights, Stg_Shape* shape, FeMesh* mesh ) ;
-
-
-/* Stg_Class_Delete VolumeWeights implementation */
-void _VolumeWeights_Delete( void* weights );
-void _VolumeWeights_Print( void* weights, Stream* stream );
-#define VolumeWeights_Copy( self )                                      \
-    (VolumeWeights*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define VolumeWeights_DeepCopy( self )                                  \
-    (VolumeWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _VolumeWeights_Copy( void* weights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-        
-void* _VolumeWeights_DefaultNew( Name name ) ;
-void _VolumeWeights_AssignFromXML( void* weights, Stg_ComponentFactory* cf, void* data ) ;
-void _VolumeWeights_Build( void* weights, void* data ) ;
-void _VolumeWeights_Initialise( void* weights, void* data ) ;
-void _VolumeWeights_Execute( void* weights, void* data );
-void _VolumeWeights_Destroy( void* weights, void* data );
-                
-void _VolumeWeights_Calculate( void* weights, void* _swarm, Cell_LocalIndex lCell_I ) ;
-        
-        
+	void* _VolumeWeights_DefaultNew( Name name ) ;
+void _VolumeWeights_Construct( void* weights, Stg_ComponentFactory* cf, void* data ) ;
+	void _VolumeWeights_Build( void* weights, void* data ) ;
+	void _VolumeWeights_Initialise( void* weights, void* data ) ;
+	void _VolumeWeights_Execute( void* weights, void* data );
+	void _VolumeWeights_Destroy( void* weights, void* data ) ;
+	
+		
+	void _VolumeWeights_Calculate( void* weights, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	
+	
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/Weights.h
--- a/Weights/src/Weights.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/Weights.h	Tue Feb 02 16:55:08 2010 +1100
@@ -50,8 +50,8 @@
 **
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
-#ifndef __PICellerator_Weights_Weights_h__
-#define __PICellerator_Weights_Weights_h__
+#ifndef __PICellerator_Weights_h__
+#define __PICellerator_Weights_h__
 
 	#include "types.h"
 	#include "Init.h"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/WeightsCalculator.c
--- a/Weights/src/WeightsCalculator.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/WeightsCalculator.c	Tue Feb 02 16:55:08 2010 +1100
@@ -1,28 +1,28 @@
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 **
 ** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**      Melbourne, 3053, Australia.
+**	Melbourne, 3053, Australia.
 ** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**      Victoria, 3800, Australia
+**	Victoria, 3800, Australia
 **
 ** Primary Contributing Organisations:
-**      Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**      Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**      Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
 **
 ** Contributors:
-**      Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**      Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**      Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**      Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**      David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**      Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**      Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**      Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**      Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**      Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**      David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**      Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
 **
 **  This library is free software; you can redistribute it and/or
 **  modify it under the terms of the GNU Lesser General Public
@@ -45,7 +45,6 @@
 #include <mpi.h>
 #include <StGermain/StGermain.h>
 #include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
 
 #include "types.h"
 #include "WeightsCalculator.h"
@@ -62,90 +61,120 @@ const Type WeightsCalculator_Type = "Wei
 */
 
 
-WeightsCalculator* _WeightsCalculator_New(  WEIGHTSCALCULATOR_DEFARGS  ) {
-    WeightsCalculator* self;
+WeightsCalculator* _WeightsCalculator_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name )
+{
+	WeightsCalculator* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(WeightsCalculator) );
+	self = (WeightsCalculator*)_Stg_Component_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			name ,
+			NON_GLOBAL );
+	
+	/* General info */
 
-    /* Allocate memory */
-    assert( _sizeOfSelf >= sizeof(WeightsCalculator) );
-    self = (WeightsCalculator*)_Stg_Component_New(  STG_COMPONENT_PASSARGS  );
-
-    /* General info */
-
-    /* Virtual Info */
-    self->_calculate = _calculate;
-
-    return self;
+	/* Virtual Info */
+	self->_calculate = _calculate;
+	
+	return self;
 }
 
-void _WeightsCalculator_Init( void* weightsCalculator, int dim ) {
-    WeightsCalculator* self = (WeightsCalculator*)weightsCalculator;
+void _WeightsCalculator_Init( void* weightsCalculator, Dimension_Index dim ) {
+	WeightsCalculator* self = (WeightsCalculator*)weightsCalculator;
+	
+	self->isConstructed = True;
+	self->dim = dim;
 
-    self->dim = dim;
-    self->cellLocalVolume = pow( 2.0, (double) dim );
+	self->cellLocalVolume = pow( 2.0, (double) dim );
 }
 
+
+void WeightsCalculator_InitAll( void* weightsCalculator, Dimension_Index dim ){
+	WeightsCalculator* self = (WeightsCalculator*)weightsCalculator;
+
+	_WeightsCalculator_Init( self, dim );
+}
+	
 
 /*------------------------------------------------------------------------------------------------------------------------
 ** Virtual functions
 */
 
 void _WeightsCalculator_Delete( void* weightsCalculator ) {
-    WeightsCalculator* self = (WeightsCalculator*)weightsCalculator;
-        
-    /* Delete parent */
-    _Stg_Component_Delete( self );
+	WeightsCalculator* self = (WeightsCalculator*)weightsCalculator;
+	
+	/* Delete parent */
+	_Stg_Component_Delete( self );
 }
 
 
 void _WeightsCalculator_Print( void* weightsCalculator, Stream* stream ) {
-    WeightsCalculator* self = (WeightsCalculator*)weightsCalculator;
-        
-    /* Print parent */
-    _Stg_Component_Print( self, stream );
+	WeightsCalculator* self = (WeightsCalculator*)weightsCalculator;
+	
+	/* Print parent */
+	_Stg_Component_Print( self, stream );
 }
 
 
 void* _WeightsCalculator_Copy( void* weightsCalculator, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    WeightsCalculator*  self = (WeightsCalculator*)weightsCalculator;
-    WeightsCalculator*  newWeightsCalculator;
-        
-    newWeightsCalculator = (WeightsCalculator*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
-        
-    return (void*)newWeightsCalculator;
+	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+	WeightsCalculator*	newWeightsCalculator;
+	
+	newWeightsCalculator = (WeightsCalculator*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newWeightsCalculator;
 }
 
 
 
-void _WeightsCalculator_AssignFromXML( void* weightsCalculator, Stg_ComponentFactory* cf, void* data ) {
-    WeightsCalculator*   self          = (WeightsCalculator*) weightsCalculator;
-    Dimension_Index      dim;
+void _WeightsCalculator_Construct( void* weightsCalculator, Stg_ComponentFactory* cf, void* data ) {
+	WeightsCalculator*	 self          = (WeightsCalculator*) weightsCalculator;
+	Dimension_Index      dim;
 
-    self->context = Stg_ComponentFactory_ConstructByKey( cf, self->name, (Dictionary_Entry_Key)"Context", FiniteElementContext, False, data );
-    if( !self->context  ) 
-        self->context = Stg_ComponentFactory_ConstructByName( cf, (Name)"context", FiniteElementContext, True, data  );
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
 
-    dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, (Dictionary_Entry_Key)"dim", 0  );
-
-    _WeightsCalculator_Init( self, dim );
+	_WeightsCalculator_Init( self, dim );
 }
 
 void _WeightsCalculator_Build( void* weightsCalculator, void* data ) {
-/*      WeightsCalculator*      self = (WeightsCalculator*)weightsCalculator; */
+/* 	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator; */
 
 }
-
-void _WeightsCalculator_Destroy( void* weightsCalculator, void* data ) {
-/*      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; */
+	
 }
 
 /*--------------------------------------------------------------------------------------------------------------------------
@@ -153,308 +182,306 @@ void _WeightsCalculator_Execute( void* w
 */
 
 void WeightsCalculator_CalculateCell( void* weightsCalculator, void* swarm, Cell_LocalIndex lCell_I ) {
-    WeightsCalculator*  self = (WeightsCalculator*)weightsCalculator;
+	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
 
-    self->_calculate( self, swarm, lCell_I );
+	self->_calculate( self, swarm, lCell_I );
 }
 
 
-        
+	
 /*----------------------------------------------------------------------------------------------------------------------------------
 ** Private Functions
 */
 
 
 void WeightsCalculator_CalculateAll( void* weightsCalculator, void* _swarm ) {
-    WeightsCalculator*   self           = (WeightsCalculator*)weightsCalculator;
-    Swarm*               swarm          = (Swarm*) _swarm;
-    Cell_LocalIndex          cellLocalCount = swarm->cellLocalCount;
-    Cell_LocalIndex          cellGlobalCount = 0;
-    Cell_LocalIndex          lCell_I;
-    unsigned int         numberOfCompletionPrintIncrements=10;
-    double               completionRatioIncrement= 1 / (double)numberOfCompletionPrintIncrements;
-    double               nextCompletionRatioToPrint=0;
-    Cell_Index           nextCompletedCellCountToPrint=0;
-    Cell_Index           nextPlusOneCompletedCellCountToPrint=0;
-    Stream*              stream = Journal_Register( Info_Type, (Name)self->type  );
-    Processor_Index      formerStreamPrintingRank = 0;
+	WeightsCalculator*   self           = (WeightsCalculator*)weightsCalculator;
+	Swarm*               swarm          = (Swarm*) _swarm;
+	Cell_LocalIndex	     cellLocalCount = swarm->cellLocalCount;
+	Cell_LocalIndex	     cellGlobalCount = 0;
+	Cell_LocalIndex	     lCell_I;
+	unsigned int         numberOfCompletionPrintIncrements=10;
+	double               completionRatioIncrement= 1 / (double)numberOfCompletionPrintIncrements;
+	double               nextCompletionRatioToPrint=0;
+	Cell_Index           nextCompletedCellCountToPrint=0;
+	Cell_Index           nextPlusOneCompletedCellCountToPrint=0;
+	Stream*              stream = Journal_Register( Info_Type, self->type );
+	Processor_Index      formerStreamPrintingRank = 0;
 
-    Journal_RPrintf( stream, "In func %s(): for swarm \"%s\"\n", __func__, swarm->name );
-    Stream_Indent( stream );
-    formerStreamPrintingRank = Stream_GetPrintingRank( stream );
-    Stream_SetPrintingRank( stream, 0 );
-    MPI_Reduce( &cellLocalCount, &cellGlobalCount, 1, MPI_UNSIGNED, MPI_SUM, 0, swarm->comm );
-    Journal_RPrintf( stream, "Calculating weights for the particles in the %u global cells\n",
-                     cellGlobalCount );
-    Stream_Indent( stream );
+	Journal_RPrintf( stream, "In func %s(): for swarm \"%s\"\n", __func__, swarm->name );
+	Stream_Indent( stream );
+	formerStreamPrintingRank = Stream_GetPrintingRank( stream );
+	Stream_SetPrintingRank( stream, 0 );
+	MPI_Reduce( &cellLocalCount, &cellGlobalCount, 1, MPI_UNSIGNED, MPI_SUM, 0, swarm->comm );
+	Journal_RPrintf( stream, "Calculating weights for the particles in the %u global cells\n",
+		cellGlobalCount );
+	Stream_Indent( stream );
 
-    nextCompletionRatioToPrint = completionRatioIncrement;
-    nextCompletedCellCountToPrint = ceil(cellLocalCount * nextCompletionRatioToPrint - 0.001 );
+	nextCompletionRatioToPrint = completionRatioIncrement;
+	nextCompletedCellCountToPrint = ceil(cellLocalCount * nextCompletionRatioToPrint - 0.001 );
 
-    /* Loop over all local cells */
-    for ( lCell_I = 0 ; lCell_I < cellLocalCount ; lCell_I++ ) {
-/*              WeightsCalculator_CheckEmptyCell( self, swarm, lCell_I );*/
-        WeightsCalculator_CalculateCell( self, swarm, lCell_I );
-/*               TODO: parallelise */
+	/* Loop over all local cells */
+	for ( lCell_I = 0 ; lCell_I < cellLocalCount ; lCell_I++ ) {
+/*		WeightsCalculator_CheckEmptyCell( self, swarm, lCell_I );*/
+		WeightsCalculator_CalculateCell( self, swarm, lCell_I );
+/* 		 TODO: parallelise */
 
-        if ( (lCell_I+1) >= nextCompletedCellCountToPrint ) {
-            nextPlusOneCompletedCellCountToPrint = ceil(( cellLocalCount
-                                                          * (nextCompletionRatioToPrint + completionRatioIncrement )) - 0.001 );
+		if ( (lCell_I+1) >= nextCompletedCellCountToPrint ) {
+			nextPlusOneCompletedCellCountToPrint = ceil(( cellLocalCount
+				* (nextCompletionRatioToPrint + completionRatioIncrement )) - 0.001 );
 
-            while ( (lCell_I+1) >= nextPlusOneCompletedCellCountToPrint )
-            {
-                nextCompletionRatioToPrint += completionRatioIncrement;
-                nextPlusOneCompletedCellCountToPrint = ceil(( cellLocalCount
-                                                              * (nextCompletionRatioToPrint + completionRatioIncrement )) - 0.001 );
-                if ( nextCompletionRatioToPrint >= 1.0 ) {
-                    nextCompletionRatioToPrint = 1.0;
-                    break;
-                }
-            }
-            Journal_Printf( stream, "done %.0f%% (%u cells)...\n", 
-                            (nextCompletionRatioToPrint * 100),
-                            lCell_I+1 );
-            nextCompletionRatioToPrint += completionRatioIncrement;
-            nextCompletedCellCountToPrint = ceil(cellLocalCount * nextCompletionRatioToPrint - 0.001);
-        }
-    }
-    Stream_UnIndent( stream );
-    /* Need this barrier so the time is accurate */
-    MPI_Barrier( swarm->comm );
-    Stream_SetPrintingRank( stream, formerStreamPrintingRank );
-    Stream_UnIndent( stream );
-    Journal_RPrintf( stream, "%s(): finished update of weights for swarm \"%s\"\n"
-                     /*"\ttook %g secs\n"*/, __func__, swarm->name );
+			while ( (lCell_I+1) >= nextPlusOneCompletedCellCountToPrint )
+			{
+				nextCompletionRatioToPrint += completionRatioIncrement;
+				nextPlusOneCompletedCellCountToPrint = ceil(( cellLocalCount
+					* (nextCompletionRatioToPrint + completionRatioIncrement )) - 0.001 );
+				if ( nextCompletionRatioToPrint >= 1.0 ) {
+					nextCompletionRatioToPrint = 1.0;
+					break;
+				}
+			}
+			Journal_Printf( stream, "done %.0f%% (%u cells)...\n", 
+				(nextCompletionRatioToPrint * 100),
+				lCell_I+1 );
+			nextCompletionRatioToPrint += completionRatioIncrement;
+			nextCompletedCellCountToPrint = ceil(cellLocalCount * nextCompletionRatioToPrint - 0.001);
+		}
+	}
+	Stream_UnIndent( stream );
+	/* Need this barrier so the time is accurate */
+	MPI_Barrier( swarm->comm );
+	Stream_SetPrintingRank( stream, formerStreamPrintingRank );
+	Stream_UnIndent( stream );
+	Journal_RPrintf( stream, "%s(): finished update of weights for swarm \"%s\"\n"
+		/*"\ttook %g secs\n"*/, __func__, swarm->name );
 }
 
 
 void WeightsCalculator_SetWeightsValueAll( void* weightsCalculator, void* _swarm, double weight ) {
-    WeightsCalculator*           self              = (WeightsCalculator*) weightsCalculator;
-    Swarm*                       swarm             = (Swarm*) _swarm;
-    Cell_LocalIndex              lCell_I;
+	WeightsCalculator*           self              = (WeightsCalculator*) weightsCalculator;
+	Swarm*                       swarm             = (Swarm*) _swarm;
+	Cell_LocalIndex              lCell_I;
 
-    for ( lCell_I = 0 ; lCell_I < swarm->cellLocalCount ; lCell_I++ )
-        WeightsCalculator_SetWeightsValueAllInCell( self, swarm, lCell_I, weight );
+	for ( lCell_I = 0 ; lCell_I < swarm->cellLocalCount ; lCell_I++ )
+		WeightsCalculator_SetWeightsValueAllInCell( self, swarm, lCell_I, weight );
 }
 
 void WeightsCalculator_SetWeightsValueAllInCell( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I, double weight ) {
-    Swarm*                       swarm             = (Swarm*) _swarm;
-    Particle_InCellIndex         cParticleCount    = swarm->cellParticleCountTbl[lCell_I];
-    Particle_InCellIndex         cParticle_I;
-    IntegrationPoint*            particle;
-        
-    /* Loop over particles in this cell */
-    for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-        particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+	Swarm*                       swarm             = (Swarm*) _swarm;
+	Particle_InCellIndex         cParticleCount    = swarm->cellParticleCountTbl[lCell_I];
+	Particle_InCellIndex         cParticle_I;
+	IntegrationPoint*            particle;
+	
+	/* Loop over particles in this cell */
+	for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
 
-        particle->weight = weight;
-    }
+		particle->weight = weight;
+	}
 }
 
 #define TOLERENCE 0.0001
 #define MAX_ORDER 100
 
 Constraint_Index WeightsCalculator_FindConstraintOrder( void* weightsCalculator, void* _swarm, Dimension_Index dim, Stream* stream ) {
-    WeightsCalculator*           self              = (WeightsCalculator*) weightsCalculator;
-    Swarm*                       swarm             = (Swarm*) _swarm;
-    Constraint_Index             order             =  0;
-    double                       error;
+	WeightsCalculator*           self              = (WeightsCalculator*) weightsCalculator;
+	Swarm*                       swarm             = (Swarm*) _swarm;
+	Constraint_Index             order             =  0;
+	double                       error;
 
-    while ( (error = WeightsCalculator_TestConstraint( self, swarm, dim, order )) < TOLERENCE ) {
-        order++;
-        if (order > MAX_ORDER) {
-            Journal_Printf( stream, "Reached maximum number of constraints to calculate.\n");
-            break;
-        }
-    }
+	while ( (error = WeightsCalculator_TestConstraint( self, swarm, dim, order )) < TOLERENCE ) {
+		order++;
+		if (order > MAX_ORDER) {
+			Journal_Printf( stream, "Reached maximum number of constraints to calculate.\n");
+			break;
+		}
+	}
 
-    /* If test fails then decrement to last order that the test passed */
-    order--;
+	/* If test fails then decrement to last order that the test passed */
+	order--;
 
-    if (order == (Constraint_Index) -1)
-        Journal_Printf( stream, "Weights '%s' for swarm '%s' satisfy no weight constraints.\n", 
-                        self->name, swarm->name );
-    else 
-        Journal_Printf( stream, "Weights '%s' for swarm '%s' satisfy weight constraints to order %u.\n", 
-                        self->name, swarm->name, order );
-        
-    return order;
+	if (order == (Constraint_Index) -1)
+		Journal_Printf( stream, "Weights '%s' for swarm '%s' satisfy no weight constraints.\n", 
+				self->name, swarm->name );
+	else 
+		Journal_Printf( stream, "Weights '%s' for swarm '%s' satisfy weight constraints to order %u.\n", 
+				self->name, swarm->name, order );
+	
+	return order;
 }
 
 double WeightsCalculator_TestConstraint( void* weightsCalculator, void* _swarm, Dimension_Index dim, Constraint_Index order ) {
-    WeightsCalculator*           self              = (WeightsCalculator*) weightsCalculator;
-    Swarm*                       swarm             = (Swarm*) _swarm;
-    Cell_LocalIndex                  lCell_I;
-    double                       error            = 0.0;
+	WeightsCalculator*           self              = (WeightsCalculator*) weightsCalculator;
+	Swarm*                       swarm             = (Swarm*) _swarm;
+	Cell_LocalIndex	             lCell_I;
+	double                       error            = 0.0;
 
-    /* Loop over all local cells */
-    for ( lCell_I = 0 ; lCell_I < swarm->cellLocalCount ; lCell_I++ ) 
-        error += WeightsCalculator_TestConstraintOverCell( self, swarm, lCell_I, dim, order );
+	/* Loop over all local cells */
+	for ( lCell_I = 0 ; lCell_I < swarm->cellLocalCount ; lCell_I++ ) 
+		error += WeightsCalculator_TestConstraintOverCell( self, swarm, lCell_I, dim, order );
 
-    Journal_DPrintfL( swarm->debug, 2, "In func %s: Error for weights for constraints of order %u is %0.3g\n", __func__, order, error );
-    return error;
+	Journal_DPrintfL( swarm->debug, 2, "In func %s: Error for weights for constraints of order %u is %0.3g\n", __func__, order, error );
+	return error;
 }
 
 #define IS_ODD(A)  ((A) % 2 == 1)
 
 double WeightsCalculator_TestConstraintOverCell( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I, Dimension_Index dim, Constraint_Index order ) {
-    Swarm*                       swarm             = (Swarm*) _swarm;
-    Particle_InCellIndex         cParticle_I;
-    IntegrationPoint*            particle;
-    double                       volume            = pow(2.0, (double) dim);
-    Index                        power_i, power_j;
-    double                       rightHandSide;
-    double                       leftHandSide;
-    double                       error             = 0.0;
-    double*                      xi;
-    Constraint_Index             constraintCount   = 0;
-        
-    Journal_DPrintfL( swarm->debug, 2, 
-                      "In func %s: For Cell %u and Dimension %u and order %u\n", __func__, lCell_I, dim, order );
-    Stream_Indent( swarm->debug );
+	Swarm*                       swarm             = (Swarm*) _swarm;
+	Particle_InCellIndex         cParticle_I;
+	IntegrationPoint*            particle;
+	double                       volume            = pow(2.0, (double) dim);
+	Index                        power_i, power_j;
+	double                       rightHandSide;
+	double                       leftHandSide;
+	double                       error             = 0.0;
+	double*                      xi;
+	Constraint_Index             constraintCount   = 0;
+	
+	Journal_DPrintfL( swarm->debug, 2, 
+			"In func %s: For Cell %u and Dimension %u and order %u\n", __func__, lCell_I, dim, order );
+	Stream_Indent( swarm->debug );
 
-    for ( power_j = 0 ; power_j <= order ; power_j++ ) {
-        for ( power_i = power_j ; power_i <= order ; power_i++ ) {
-            /* Sum number of constrainst calculated */
-            constraintCount++;
+	for ( power_j = 0 ; power_j <= order ; power_j++ ) {
+		for ( power_i = power_j ; power_i <= order ; power_i++ ) {
+			/* Sum number of constrainst calculated */
+			constraintCount++;
 
-            /************ Calculate Right Hand Side of Constraint **************************/
-            if ( IS_ODD( power_i ) || IS_ODD( power_j ) || IS_ODD( order - power_i - power_j ) )
-                rightHandSide = 0.0;
-            else 
-                rightHandSide = volume/
-                    (double)(( power_i + 1 )*( power_j + 1 )*( order - power_i - power_j + 1));
-                        
-            Journal_DPrintfL( swarm->debug, 3, 
-                              "Constraint %u: \\Sigma w_p \\xi^%u \\eta^%u \\Zeta^%u = %0.3g\n", 
-                              constraintCount, power_i, order - power_i - power_j, power_j , rightHandSide );
-            /************ Calculate Left Hand Side of Constraint **************************/
-            leftHandSide = 0.0;
-                        
-            /* Loop over particles in this cell */
-            Stream_Indent( swarm->debug );
-            for ( cParticle_I = 0 ; cParticle_I < swarm->cellParticleCountTbl[lCell_I]; cParticle_I++ ) {
-                particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
-                                
-                /* Get local Coordinates of particle */
-                xi = particle->xi;
-                        
-                leftHandSide += particle->weight * 
-                    pow( xi[ I_AXIS ], (double) power_i ) *
-                    pow( xi[ J_AXIS ], (double) (order - power_i - power_j) ) *
-                    pow( xi[ K_AXIS ], (double) power_j ) ;
-                Journal_DPrintfL( swarm->debug, 3, 
-                                  "ParticleInCell %u, weight = %0.3g, local element coords = (%0.3g, %0.3g, %0.3g)\n", 
-                                  cParticle_I, particle->weight, 
-                                  xi[ I_AXIS ], xi[ J_AXIS ], xi[ K_AXIS ],
-                                  power_i, (order - power_i - power_j), power_j );
-            }
-            Stream_UnIndent( swarm->debug );
+			/************ Calculate Right Hand Side of Constraint **************************/
+			if ( IS_ODD( power_i ) || IS_ODD( power_j ) || IS_ODD( order - power_i - power_j ) )
+				rightHandSide = 0.0;
+			else 
+				rightHandSide = volume/
+					(double)(( power_i + 1 )*( power_j + 1 )*( order - power_i - power_j + 1));
+			
+			Journal_DPrintfL( swarm->debug, 3, 
+					"Constraint %u: \\Sigma w_p \\xi^%u \\eta^%u \\Zeta^%u = %0.3g\n", 
+					constraintCount, power_i, order - power_i - power_j, power_j , rightHandSide );
+			/************ Calculate Left Hand Side of Constraint **************************/
+			leftHandSide = 0.0;
+			
+			/* Loop over particles in this cell */
+			Stream_Indent( swarm->debug );
+			for ( cParticle_I = 0 ; cParticle_I < swarm->cellParticleCountTbl[lCell_I]; cParticle_I++ ) {
+				particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+				
+				/* Get local Coordinates of particle */
+				xi = particle->xi;
+			
+				leftHandSide += particle->weight * 
+					pow( xi[ I_AXIS ], (double) power_i ) *
+					pow( xi[ J_AXIS ], (double) (order - power_i - power_j) ) *
+					pow( xi[ K_AXIS ], (double) power_j ) ;
+				Journal_DPrintfL( swarm->debug, 3, 
+					"ParticleInCell %u, weight = %0.3g, local element coords = (%0.3g, %0.3g, %0.3g)\n", 
+					cParticle_I, particle->weight, 
+					xi[ I_AXIS ], xi[ J_AXIS ], xi[ K_AXIS ],
+					power_i, (order - power_i - power_j), power_j );
+			}
+			Stream_UnIndent( swarm->debug );
 
-            /* Calculate Error */
-            error += fabs(leftHandSide - rightHandSide);
+			/* Calculate Error */
+			error += fabs(leftHandSide - rightHandSide);
 
-            Journal_DPrintfL( swarm->debug, 3, "RHS = %2.5f LHS = %2.5f: Total Error = %f\n", rightHandSide, leftHandSide, error );
+			Journal_DPrintfL( swarm->debug, 3, "RHS = %2.5f LHS = %2.5f: Total Error = %f\n", rightHandSide, leftHandSide, error );
 
-        }
-        /* 3D Constrain Equations collapse to 2D constraint equation only if j = 0 */
-        if (dim == 2) 
-            break;
-    }
-    Stream_UnIndent( swarm->debug );
+		}
+		/* 3D Constrain Equations collapse to 2D constraint equation only if j = 0 */
+		if (dim == 2) 
+			break;
+	}
+	Stream_UnIndent( swarm->debug );
 
-    Journal_Firewall( dim == 2 ? constraintCount == order + 1 : constraintCount*2 == (order + 1)*(order + 2) , 
-                      Journal_Register( Error_Type, (Name)swarm->type  ),
-                      "In func %s: Number of constraints %u incorrect for dimension %u which should be %u\n", 
-                      __func__ , dim == 2 ? order + 1 : (order + 1)*(order + 2)/2 );
+	Journal_Firewall( dim == 2 ? constraintCount == order + 1 : constraintCount*2 == (order + 1)*(order + 2) , 
+			Journal_Register( Error_Type, swarm->type ),
+			"In func %s: Number of constraints %u incorrect for dimension %u which should be %u\n", 
+			__func__ , dim == 2 ? order + 1 : (order + 1)*(order + 2)/2 );
 
-    return error;
+	return error;
 }
 
 double WeightsCalculator_GetConstraintLHS( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I, Index power_i, Index power_j, Index power_k ) {
-    Swarm*                       swarm           = (Swarm*)             _swarm;
-    Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
-    Particle_InCellIndex         cParticle_I;
-    IntegrationPoint*            particle;
-    double                       leftHandSide    = 0.0;
-    double*                      xi;
-        
-    /* Loop over particles in this cell */
-    for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-        particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
-                
-        /* Get local Coordinates of particle */
-        xi = particle->xi;
-        
-        leftHandSide += particle->weight * 
-            pow( xi[ I_AXIS ], (double) power_i ) *
-            pow( xi[ J_AXIS ], (double) power_j ) ;
+	Swarm*                       swarm           = (Swarm*)             _swarm;
+	Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
+	Particle_InCellIndex         cParticle_I;
+	IntegrationPoint*            particle;
+	double                       leftHandSide    = 0.0;
+	double*                      xi;
+	
+	/* Loop over particles in this cell */
+	for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+		
+		/* Get local Coordinates of particle */
+		xi = particle->xi;
+	
+		leftHandSide += particle->weight * 
+			pow( xi[ I_AXIS ], (double) power_i ) *
+			pow( xi[ J_AXIS ], (double) power_j ) ;
 
-        if ( swarm->dim == 3 )
-            leftHandSide += particle->weight * pow( xi[ K_AXIS ], (double) power_k );
+		if ( swarm->dim == 3 )
+			leftHandSide += particle->weight * pow( xi[ K_AXIS ], (double) power_k );
 
-    }
-    return leftHandSide;
+	}
+	return leftHandSide;
 }
 
 double WeightsCalculator_GetLocalCoordSum( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I, Index power_i, Index power_j, Index power_k ) 
 {
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
-    Particle_InCellIndex         cParticle_I;
-    IntegrationPoint*            particle;
-    double                       localCoordSum   = 0.0;
-    double*                      xi;
-        
-    /* Loop over particles in this cell */
-    for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-        particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
-                
-        /* Get local Coordinates of particle */
-        xi = particle->xi;
-        
-        localCoordSum += 
-            pow( xi[ I_AXIS ], (double) power_i ) *
-            pow( xi[ J_AXIS ], (double) power_j ) ;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
+	Particle_InCellIndex         cParticle_I;
+	IntegrationPoint*            particle;
+	double                       localCoordSum   = 0.0;
+	double*                      xi;
+	
+	/* Loop over particles in this cell */
+	for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+		
+		/* Get local Coordinates of particle */
+		xi = particle->xi;
+	
+		localCoordSum += 
+			pow( xi[ I_AXIS ], (double) power_i ) *
+			pow( xi[ J_AXIS ], (double) power_j ) ;
 
-        if ( swarm->dim == 3 )
-            localCoordSum += pow( xi[ K_AXIS ], (double) power_k );
+		if ( swarm->dim == 3 )
+			localCoordSum += pow( xi[ K_AXIS ], (double) power_k );
 
-    }
-    return localCoordSum;
+	}
+	return localCoordSum;
 }
 
 
 double WeightsCalculator_SumCellWeights( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I ) {
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    double                       weightsTotal    = 0.0;
-    Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
-    Particle_InCellIndex         cParticle_I;
-    IntegrationPoint*            particle;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	double                       weightsTotal    = 0.0;
+	Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];
+	Particle_InCellIndex         cParticle_I;
+	IntegrationPoint*            particle;
 
-    /* Find Sum of the Weights */
-    for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
-        particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
-                
-        /* Put weight onto particle */
-        weightsTotal += particle->weight;
-    }
+	/* Find Sum of the Weights */
+	for ( cParticle_I = 0 ; cParticle_I < cParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+		
+		/* Put weight onto particle */
+		weightsTotal += particle->weight;
+	}
 
-    return weightsTotal;
+	return weightsTotal;
 }
 
 void WeightsCalculator_CheckEmptyCell( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I ) {
-    WeightsCalculator*           self              = (WeightsCalculator*) weightsCalculator;
-    Swarm*                       swarm           = (Swarm*) _swarm;
-    Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];        
+	WeightsCalculator*           self              = (WeightsCalculator*) weightsCalculator;
+	Swarm*                       swarm           = (Swarm*) _swarm;
+	Particle_InCellIndex         cParticleCount  = swarm->cellParticleCountTbl[lCell_I];	
 
-    if ( cParticleCount == 0 ) {
-        Journal_Firewall( cParticleCount, Journal_Register( Error_Type, (Name)self->type  ),
-                          "Error in func '%s' for %s '%s' and %s '%s' - Cell %u has no particles.\n"
-                          "You must either add more initial particles or add population control.\n",
-                          __func__, self->type, self->name, swarm->type, swarm->name, lCell_I );
-    }
+	if ( cParticleCount == 0 ) {
+		Journal_Firewall( cParticleCount, Journal_Register( Error_Type, self->type ),
+				"Error in func '%s' for %s '%s' and %s '%s' - Cell %u has no particles.\n"
+				"You must either add more initial particles or add population control.\n",
+				__func__, self->type, self->name, swarm->type, swarm->name, lCell_I );
+	}
 }
-                        
-
-
+			
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/src/WeightsCalculator.h
--- a/Weights/src/WeightsCalculator.h	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/src/WeightsCalculator.h	Tue Feb 02 16:55:08 2010 +1100
@@ -1,28 +1,28 @@
 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 **
 ** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
-**      Melbourne, 3053, Australia.
+**	Melbourne, 3053, Australia.
 ** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
-**      Victoria, 3800, Australia
+**	Victoria, 3800, Australia
 **
 ** Primary Contributing Organisations:
-**      Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
-**      Australian Computational Earth Systems Simulator - http://www.access.edu.au
-**      Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
 **
 ** Contributors:
-**      Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
-**      Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
-**      Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**      Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**      David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
-**      Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
-**      Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
-**      Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
-**      Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**      Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**      David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
-**      Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
 **
 **  This library is free software; you can redistribute it and/or
 **  modify it under the terms of the GNU Lesser General Public
@@ -40,100 +40,96 @@
 **
 */
 /** \file
- **  Role:
- **
- ** Assumptions:
- **
- ** Comments:
- **
- ** $Id: WeightsCalculator.h 374 2006-10-12 08:59:41Z SteveQuenette $
- **
- **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: WeightsCalculator.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
 #ifndef __PICellerator_Weights_WeightsCalculator_h__
 #define __PICellerator_Weights_WeightsCalculator_h__
 
-typedef void (WeightsCalculator_CalculateFunction)( void* self, void* swarm, Cell_LocalIndex lCell_I );
+	typedef void (WeightsCalculator_CalculateFunction)( void* weightsCalculator, void* swarm, Cell_LocalIndex lCell_I );
 
-/* Textual name of this class */
-extern const Type WeightsCalculator_Type;
+	/* Textual name of this class */
+	extern const Type WeightsCalculator_Type;
 
-/* WeightsCalculator information */
-#define __WeightsCalculator \
-	/* General info */ \
-	__Stg_Component \
-	\
-	/* Virtual Info */ \
-	FiniteElementContext*						context; \
-	WeightsCalculator_CalculateFunction*  _calculate; \
-	/* Other Info */ \
-	double                                cellLocalVolume; \
-	Dimension_Index                       dim;
+	/* WeightsCalculator information */
+	#define __WeightsCalculator \
+		/* General info */ \
+		__Stg_Component \
+		/* Virtual Info */\
+		WeightsCalculator_CalculateFunction*  _calculate;        \
+		/* Other Info */\
+		double                                cellLocalVolume;   \
+		Dimension_Index                       dim;
 
 	struct WeightsCalculator { __WeightsCalculator };
-        
+	
+	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Constructors
 	*/
-
-
-
+	WeightsCalculator* _WeightsCalculator_New(
+		SizeT                                 _sizeOfSelf, 
+		Type                                  type,
+		Stg_Class_DeleteFunction*             _delete,
+		Stg_Class_PrintFunction*              _print,
+		Stg_Class_CopyFunction*               _copy, 
+		Stg_Component_DefaultConstructorFunction* _defaultConstructor,
+		Stg_Component_ConstructFunction*      _construct,
+		Stg_Component_BuildFunction*          _build,
+		Stg_Component_InitialiseFunction*     _initialise,
+		Stg_Component_ExecuteFunction*        _execute,
+		Stg_Component_DestroyFunction*        _destroy,		
+		WeightsCalculator_CalculateFunction*  _calculate,
+		Name                                  name );
 	
-	#ifndef ZERO
-	#define ZERO 0
-	#endif
-
-	#define WEIGHTSCALCULATOR_DEFARGS \
-                STG_COMPONENT_DEFARGS, \
-                WeightsCalculator_CalculateFunction*  _calculate
-
-	#define WEIGHTSCALCULATOR_PASSARGS \
-                STG_COMPONENT_PASSARGS, \
-	        _calculate
-
-	WeightsCalculator* _WeightsCalculator_New(  WEIGHTSCALCULATOR_DEFARGS  );
-
-	void _WeightsCalculator_Init( void* self , int dim );
+	void _WeightsCalculator_Init( void* weightsCalculator , Dimension_Index dim) ;
+	void WeightsCalculator_InitAll( void* weightsCalculator, Dimension_Index dim );
 
 	/* Stg_Class_Delete WeightsCalculator implementation */
-	void _WeightsCalculator_Delete( void* self );
-	void _WeightsCalculator_Print( void* self, Stream* stream );
-	#define WeightsCalculator_Copy( self )                                  \
-	    (WeightsCalculator*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-	#define WeightsCalculator_DeepCopy( self )                              \
-	    (WeightsCalculator*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-	void* _WeightsCalculator_Copy( void* self, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-        
-	void _WeightsCalculator_AssignFromXML( void* self, Stg_ComponentFactory* cf, void* data ) ;
-	void _WeightsCalculator_Build( void* self, void* data ) ;
-	void _WeightsCalculator_Destroy( void* self, void* data ) ;
-	void _WeightsCalculator_Initialise( void* self, void* data ) ;
-	void _WeightsCalculator_Execute( void* self, void* data );
-        
+	void _WeightsCalculator_Delete( void* weightsCalculator );
+	void _WeightsCalculator_Print( void* weightsCalculator, Stream* stream );
+	#define WeightsCalculator_Copy( self ) \
+		(WeightsCalculator*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define WeightsCalculator_DeepCopy( self ) \
+		(WeightsCalculator*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _WeightsCalculator_Copy( void* weightsCalculator, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+void _WeightsCalculator_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _WeightsCalculator_Build( void* weightsCalculator, void* data ) ;
+	void _WeightsCalculator_Initialise( void* weightsCalculator, void* data ) ;
+	void _WeightsCalculator_Execute( void* weightsCalculator, void* data );
+	void _WeightsCalculator_Destroy( void* weightsCalculator, void* data ) ;
+	
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Public member functions
 	*/
-	void WeightsCalculator_CalculateCell( void* self, void* swarm, Cell_LocalIndex lCell_I ) ;
-        
-	void WeightsCalculator_CalculateAll( void* self, void* _swarm ) ;
+	void WeightsCalculator_CalculateCell( void* weightsCalculator, void* swarm, Cell_LocalIndex lCell_I ) ;
+	
+	void WeightsCalculator_CalculateAll( void* weightsCalculator, void* _swarm ) ;
 	/*---------------------------------------------------------------------------------------------------------------------
 	** Private Member functions
 	*/
 
-	#define WeightsCalculator_ZeroWeights( self, swarm )                    \
-	    WeightsCalculator_SetWeightsValueAll( (self), (swarm), 0.0 )
-	#define WeightsCalculator_ZeroWeightsInCell( self, swarm, lCell_I )     \
-	    WeightsCalculator_SetWeightsValueAllInCell( (self), (swarm), (lCell_I), 0.0 )
-        
-	void WeightsCalculator_SetWeightsValueAll( void* self, void* _swarm, double weight ) ;
-	void WeightsCalculator_SetWeightsValueAllInCell( void* self, void* _swarm, Cell_LocalIndex lCell_I, double weight ) ;
-	Constraint_Index WeightsCalculator_FindConstraintOrder( void* self, void* _swarm, Dimension_Index dim, Stream* stream ) ;
-	double WeightsCalculator_TestConstraint( void* self, void* _swarm, Dimension_Index dim, Constraint_Index order ) ;
-	double WeightsCalculator_TestConstraintOverCell( void* self, void* _swarm, Cell_LocalIndex lCell_I, Dimension_Index dim, Constraint_Index order ) ;
-	double WeightsCalculator_GetConstraintLHS( void* self, void* _swarm, Cell_LocalIndex lCell_I, Index power_i, Index power_j, Index power_k ) ;
-	double WeightsCalculator_GetLocalCoordSum( void* self, void* _swarm, Cell_LocalIndex lCell_I, Index power_i, Index power_j, Index power_k ) ;
-	double WeightsCalculator_SumCellWeights( void* self, void* _swarm, Cell_LocalIndex lCell_I ) ;
-	void WeightsCalculator_CheckEmptyCell( void* self, void* _swarm, Cell_LocalIndex lCell_I ) ;
-        
+	#define WeightsCalculator_ZeroWeights( self, swarm ) \
+		WeightsCalculator_SetWeightsValueAll( (self), (swarm), 0.0 )
+	#define WeightsCalculator_ZeroWeightsInCell( self, swarm, lCell_I ) \
+		WeightsCalculator_SetWeightsValueAllInCell( (self), (swarm), (lCell_I), 0.0 )
+	
+	void WeightsCalculator_SetWeightsValueAll( void* weightsCalculator, void* _swarm, double weight ) ;
+	void WeightsCalculator_SetWeightsValueAllInCell( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I, double weight ) ;
+	Constraint_Index WeightsCalculator_FindConstraintOrder( void* weightsCalculator, void* _swarm, Dimension_Index dim, Stream* stream ) ;
+	double WeightsCalculator_TestConstraint( void* weightsCalculator, void* _swarm, Dimension_Index dim, Constraint_Index order ) ;
+	double WeightsCalculator_TestConstraintOverCell( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I, Dimension_Index dim, Constraint_Index order ) ;
+	double WeightsCalculator_GetConstraintLHS( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I, Index power_i, Index power_j, Index power_k ) ;
+	double WeightsCalculator_GetLocalCoordSum( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I, Index power_i, Index power_j, Index power_k ) ;
+	double WeightsCalculator_SumCellWeights( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	void WeightsCalculator_CheckEmptyCell( void* weightsCalculator, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	
 #endif 
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/ConstantWeightsSuite.c
--- a/Weights/tests/ConstantWeightsSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,275 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** Role:
-**   Tests the ConstantWeightsSuite
-**
-** $Id: testWeights.c 3462 2006-02-19 06:53:24Z WalterLandry $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include "ConstantWeightsSuite.h"
-
-typedef struct {
-   PICelleratorContext* context;
-   Stg_ComponentFactory* cf;
-} ConstantWeightsSuiteData;
-
-void constantFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   *value = -3.0;
-}
-void linearFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = 2.0 + 2.2 * x - y;
-}
-void shapeFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = 1 + x + y + x * y;
-}
-void polynomialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = 11 + 2*x*x + 3*x*x*x*y + y + x*x*x + 2*y*y;
-}
-void quadraticFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-
-   *value = 1 + x + x * x;
-}
-void exponentialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = 5*exp(2*x*x*x + 2*y*y*y) * (1-x) * (1+y);
-}
-void exponentialInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = (double) (y <= 0.1 * exp( 2*x ));
-}
-void circleInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = (double) (x*x + y*y <= 1.0);
-}
-
-void WeightsSuite_TestElementIntegral(
- 	PICelleratorContext*	context,
- 	Name 						funcName,
- 	Index						count,   // was SampleSize - defaults to 5000
- 	double					meanTolerance,
-  	double					stdDevTolerance,
-  	double					expectedMean,
-  	double					expectedStdDev ) 
-{
-   Swarm*              integrationSwarm = (Swarm*)LiveComponentRegister_Get( context->CF->LCRegister, (Name)"integrationSwarm" );
-   Swarm*              materialSwarm    = (Swarm* )LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialPoints" );
-   FeMesh*             mesh             = (FeMesh* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"linearMesh" );
-   WeightsCalculator*  weights          = (WeightsCalculator* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"weights"  );
-   FeVariable*         feVariable;
-   Element_LocalIndex  lElement_I       = 0;
-   double              analyticValue    = 0.0;
-   double              integral         = 0.0;
-   double              error;
-   double              errorSquaredSum  = 0.0;
-   double              errorSum         = 0.0;
-   double              mean;
-   double              standardDeviation;
-   Index               loop_I;
-   void*               data;
-   double              differenceMean, differenceStdDev;   
-
-   /* Create FeVariable */
-   feVariable = FeVariable_New_Full(
-		"feVariable", 
-		(DomainContext*) context,
-		mesh,
-		NULL,
-		NULL,
-		NULL,
-		NULL,
-		NULL,
-		NULL, 
-     	1,
-		context->dim,
-		False,
-		False,
-		False,
-		MPI_COMM_WORLD,
-		context->fieldVariable_Register );
-
-   Journal_Firewall( (funcName!=NULL), Journal_Register( Error_Type, (Name)"ConstantWeightsSuite"  ),
-      "Error, function name input to %s is NULL", __func__ );
-
-   if ( strcasecmp( funcName, "ShapeFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = shapeFunction;
-      analyticValue = 4.0;
-   }
-   else if ( strcasecmp( funcName, "ConstantFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = constantFunction;
-      analyticValue = -12.0;
-   }
-   else if ( strcasecmp( funcName, "LinearFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = linearFunction;
-      analyticValue = 8.0;
-   }
-   else if ( strcasecmp( funcName, "QuadraticFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = quadraticFunction;
-      analyticValue = 16.0/3.0;
-   }
-   else if ( strcasecmp( funcName, "PolynomialFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = polynomialFunction;
-      analyticValue = 148.0/3.0;
-   }
-   else if ( strcasecmp( funcName, "ExponentialFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = exponentialFunction;
-      analyticValue = 0.0 /*TODO*/;
-      abort();
-   }
-   else if ( strcasecmp( funcName, "ExponentialInterface" ) == 0 ) {
-      feVariable->_interpolateWithinElement = exponentialInterface;
-      analyticValue = 0.05 * (exp(2) - exp(-2)) + 2.0;
-   }
-   else if ( strcasecmp( funcName, "CircleInterface" ) == 0 ) {
-      feVariable->_interpolateWithinElement = circleInterface;
-      analyticValue = M_PI;
-   }
-   else 
-      Journal_Firewall( False,
-            Journal_Register( Error_Type, (Name)"ConstantWeightsSuite"  ),
-            "Cannot understand function name '%s'\n", funcName );
-
-   for ( loop_I = 0 ; loop_I < count ; loop_I++ ) {
-      Swarm_Random_Seed( (long) loop_I );
-      /* Layout Particles */
-      _Swarm_InitialiseParticles( materialSwarm, data );
-
-      _IntegrationPointsSwarm_UpdateHook( NULL, integrationSwarm );
-      
-      WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
-
-      /* Evaluate Integral */
-      integral = FeVariable_IntegrateElement( feVariable, integrationSwarm, lElement_I );
-
-      /* Calculate Error */
-      error = fabs( integral - analyticValue )/fabs( analyticValue );
-      errorSum += error;
-      errorSquaredSum += error*error;
-   }
-
-   /* Calculate Mean and Standard Deviation */
-   mean = errorSum / (double) count;
-   standardDeviation = sqrt( errorSquaredSum / (double) count - mean * mean );
-
-   //printf( "Func: %s - Mean = %g; SD = %g\n", funcName, mean, standardDeviation );
-
-   /* compare the mean and standard deviation */
-   differenceMean = fabs(mean - expectedMean);
-   differenceStdDev = fabs(standardDeviation - expectedStdDev);
-   pcu_check_le( differenceMean, meanTolerance );
-   pcu_check_le( differenceStdDev, stdDevTolerance );
-}
-void ConstantWeightsSuite_Setup( ConstantWeightsSuiteData* data ) {
-   char	xmlInputFilename[PCU_PATH_MAX];
-
-   pcu_filename_input( "testConstantWeights.xml", xmlInputFilename );
-   data->cf = stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD, NULL );
-   data->context = (PICelleratorContext*)LiveComponentRegister_Get( data->cf->LCRegister, (Name)"context"  );
-	// Stg_ComponentFactory_BuildComponents( data->cf, NULL );
-   
-   stgMainBuildAndInitialise( data->cf );
-}
-
-void ConstantWeightsSuite_Teardown( ConstantWeightsSuiteData* data ) {
-	stgMainDestroy( data->cf );
-}
-
-void ConstantWeightsSuite_TestConstantFunction( ConstantWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "ConstantFunction", 1000,
-      1e-10, /* --mean-tolerance */
-      1e-10, /* --standardDeviation-tolerance */
-      2.96059e-16, /* --mean-expectedValue */
-      4.98509e-23 /* --standardDeviation-expectedValue */ );
-}
-void ConstantWeightsSuite_TestLinearFunction ( ConstantWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "LinearFunction", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.119677, /* --mean-expectedValue */
-      0.0921005 /* --standardDeviation-expectedValue */ );
-}
-
-void ConstantWeightsSuite_TestQuadraticFunction ( ConstantWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "QuadraticFunction", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.0840621, /* --mean-expectedValue */
-      0.0627759 /* --standardDeviation-expectedValue */ );
-}
-
-void ConstantWeightsSuite_TestPolynomialFunction ( ConstantWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "PolynomialFunction", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.0174753, /* --mean-expectedValue */
-      0.0137385 /* --standardDeviation-expectedValue */ );
-}
-
-void ConstantWeightsSuite_TestCircleInterface( ConstantWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "CircleInterface", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.091215, /* --mean-expectedValue */
-      0.066458 /* --standardDeviation-expectedValue */ );
-}
-   
-void ConstantWeightsSuite_TestExponentialInterface( ConstantWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "ExponentialInterface", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.155483, /* --mean-expectedValue */
-      0.116796 /* --standardDeviation-expectedValue */ );
-}
-   
-void ConstantWeightsSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, ConstantWeightsSuiteData );
-   pcu_suite_setFixtures( suite, ConstantWeightsSuite_Setup, ConstantWeightsSuite_Teardown );
-   pcu_suite_addTest( suite, ConstantWeightsSuite_TestConstantFunction );
-   pcu_suite_addTest( suite, ConstantWeightsSuite_TestLinearFunction );
-   pcu_suite_addTest( suite, ConstantWeightsSuite_TestQuadraticFunction );
-   pcu_suite_addTest( suite, ConstantWeightsSuite_TestPolynomialFunction );
-   pcu_suite_addTest( suite, ConstantWeightsSuite_TestExponentialInterface );
-   pcu_suite_addTest( suite, ConstantWeightsSuite_TestCircleInterface );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/ConstantWeightsSuite.c.
--- a/Weights/tests/ConstantWeightsSuite.c.	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include "PICellerator/PopulationControl/PopulationControl.h"
-#include "PICellerator/Weights/Weights.h"
-
-#include "ConstantWeightsSuite.h"
-
-typedef struct {
-   DomainContext*       context;
-} ConstantWeightsSuiteData;
-
-void ConstantFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   *value = -3.0;
-}
-void LinearFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = 2.0 + 2.2 * x - y;
-}
-void ShapeFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = 1 + x + y + x * y;
-}
-void PolynomialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = 11 + 2*x*x + 3*x*x*x*y + y + x*x*x + 2*y*y;
-}
-void QuadraticFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-
-   *value = 1 + x + x * x;
-}
-void ExponentialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = 5*exp(2*x*x*x + 2*y*y*y) * (1-x) * (1+y);
-}
-void ExponentialInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = (double) (y <= 0.1 * exp( 2*x ));
-}
-void CircleInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
-   double x = xi[0];
-   double y = xi[1];
-
-   *value = (double) (x*x + y*y <= 1.0);
-}
-
-
-void WeightsSuite_TestElementIntegral(
-      DomainContext* context,
-      Name           funcName,
-      Index          count,   // was SampleSize - defaults to 5000
-      double         meanTolerance,
-      double         stdDevTolerance,
-      double         expectedMean,
-      double         expectedStdDev ) 
-{
-   Swarm*              integrationSwarm = (Swarm*)LiveComponentRegister_Get(
-                           context->CF->LCRegister, "integrationSwarm" );
-   Swarm*              materialSwarm    = (Swarm*)LiveComponentRegister_Get(
-                           context->CF->LCRegister, "materialPoints" );
-   FeMesh*             mesh             = (FeMesh*) LiveComponentRegister_Get(
-                           context->CF->LCRegister, "linearMesh" );
-   WeightsCalculator*  weights          = (WeightsCalculator*) LiveComponentRegister_Get(
-                           context->CF->LCRegister, "weights" );
-   FeVariable*         feVariable;
-   Element_LocalIndex  lElement_I       = 0;
-   double              analyticValue    = 0.0;
-   double              integral         = 0.0;
-   double              error;
-   double              errorSquaredSum  = 0.0;
-   double              errorSum         = 0.0;
-   /*Particle_Index      lParticle_I;*/
-   /*IntegrationPoint*   particle;*/
-   double              mean;
-   double              standardDeviation;
-   Index               loop_I;
-   /*ElementLayout*      elementLayout    = mesh->layout->elementLayout;*/
-   void*               data;
-   double              differenceMean, differenceStdDev;   
-
-   assert( integrationSwarm );
-   assert( materialSwarm );
-   assert( mesh );
-   assert( weights );
-
-   /* Create FeVariable */
-   feVariable = FeVariable_New_Full( "feVariable", mesh, NULL, NULL, NULL, NULL, NULL, NULL, 
-         1, context->dim, False, False, False, MPI_COMM_WORLD, context->fieldVariable_Register );
-
-   Journal_Firewall( (funcName!=NULL),
-      Journal_Register( Error_Type, "WeightsSuite" ),
-      "Error, function name input to %s is NULL", __func__ );
-
-   if ( strcasecmp( funcName, "ShapeFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = ShapeFunction;
-      analyticValue = 4.0;
-   }
-   else if ( strcasecmp( funcName, "ConstantFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = ConstantFunction;
-      analyticValue = -12.0;
-   }
-   else if ( strcasecmp( funcName, "LinearFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = LinearFunction;
-      analyticValue = 8.0;
-   }
-   else if ( strcasecmp( funcName, "QuadraticFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = QuadraticFunction;
-      analyticValue = 16.0/3.0;
-   }
-   else if ( strcasecmp( funcName, "PolynomialFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = PolynomialFunction;
-      analyticValue = 148.0/3.0;
-   }
-   else if ( strcasecmp( funcName, "ExponentialFunction" ) == 0 ) {
-      feVariable->_interpolateWithinElement = ExponentialFunction;
-      analyticValue = 0.0 /*TODO*/;
-      abort();
-   }
-   else if ( strcasecmp( funcName, "ExponentialInterface" ) == 0 ) {
-      feVariable->_interpolateWithinElement = ExponentialInterface;
-      analyticValue = 0.05 * (exp(2) - exp(-2)) + 2.0;
-   }
-   else if ( strcasecmp( funcName, "CircleInterface" ) == 0 ) {
-      feVariable->_interpolateWithinElement = CircleInterface;
-      analyticValue = M_PI;
-   }
-   else 
-      Journal_Firewall( False,
-            Journal_Register( Error_Type, "WeightsSuite" ),
-            "Cannot understand function name '%s'\n", funcName );
-
-   for ( loop_I = 0 ; loop_I < count ; loop_I++ ) {
-      /* Layout Particles */
-      Swarm_Random_Seed( (long) loop_I );
-      _Swarm_InitialiseParticles( materialSwarm, data );
-
-      _IntegrationPointsSwarm_UpdateHook( NULL, integrationSwarm );
-      
-      WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
-
-      /* Evaluate Integral */
-      integral = FeVariable_IntegrateElement( feVariable, integrationSwarm, lElement_I );
-
-      /* Calculate Error */
-      error = fabs( integral - analyticValue )/fabs( analyticValue );
-      errorSum += error;
-      errorSquaredSum += error*error;
-   }
-
-   /* Calculate Mean and Standard Deviation */
-   mean = errorSum / (double) count;
-   standardDeviation = sqrt( errorSquaredSum / (double) count - mean * mean );
-
-   /* compare the mean and standard deviation */
-   differenceMean = fabs(mean - expectedMean);
-   differenceStdDev = fabs(standardDeviation - expectedStdDev);
-   pcu_check_le( differenceMean, meanTolerance );
-   pcu_check_le( differenceStdDev, stdDevTolerance );
-}
-
-
-void ConstantWeightsSuite_Setup( ConstantWeightsSuiteData* data ) {
-   char              xmlInputFilename[PCU_PATH_MAX];
-
-   pcu_filename_input( "testConstantWeights.xml", xmlInputFilename );
-   data->context = (DomainContext*)stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD );
-} 
-
-
-void ConstantWeightsSuite_Teardown( ConstantWeightsSuiteData* data ) {
-   stgMainDestroy( (AbstractContext*)data->context );
-}
-
-
-void ConstantWeightsSuite_TestElementIntegral_Circle( ConstantWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "CircleInterface", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.091215, /* --mean-expectedValue */
-      0.066458 /* --standardDeviation-expectedValue */ );
-}
-
-
-void ConstantWeightsSuite_TestElementIntegral_Exponential( ConstantWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "ExponentialInterface", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.155483, /* --mean-expectedValue */
-      0.116796 /* --standardDeviation-expectedValue */ );
-}
-
-
-void ConstantWeightsSuite_TestElementIntegral_Polynomial( ConstantWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "PolynomialFunction", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.017475, /* --mean-expectedValue */
-      0.013738 /* --standardDeviation-expectedValue */ );
-}
-
-
-void ConstantWeightsSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, ConstantWeightsSuiteData );
-   pcu_suite_setFixtures( suite, ConstantWeightsSuite_Setup, ConstantWeightsSuite_Teardown );
-   pcu_suite_addTest( suite, ConstantWeightsSuite_TestElementIntegral_Circle );
-/* TEMPORARILY disable multiple tests until Toolbox/Context issue sorted out (See tickets #70,#71
- in StGermain trac) -- PatrickSunter, 19 Aug 2009 */
-#if 0
-   pcu_suite_addTest( suite, ConstantWeightsSuite_TestElementIntegral_Exponential );
-   pcu_suite_addTest( suite, ConstantWeightsSuite_TestElementIntegral_Polynomial );
-#endif
-}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/ConstantWeightsSuite.c.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/ConstantWeightsSuite.c.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,258 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "pcu/pcu.h"
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include "PICellerator/PopulationControl/PopulationControl.h"
+#include "PICellerator/Weights/Weights.h"
+
+#include "ConstantWeightsSuite.h"
+
+typedef struct {
+   DomainContext*       context;
+} ConstantWeightsSuiteData;
+
+void ConstantFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
+   *value = -3.0;
+}
+void LinearFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
+   double x = xi[0];
+   double y = xi[1];
+
+   *value = 2.0 + 2.2 * x - y;
+}
+void ShapeFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
+   double x = xi[0];
+   double y = xi[1];
+
+   *value = 1 + x + y + x * y;
+}
+void PolynomialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
+   double x = xi[0];
+   double y = xi[1];
+
+   *value = 11 + 2*x*x + 3*x*x*x*y + y + x*x*x + 2*y*y;
+}
+void QuadraticFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
+   double x = xi[0];
+
+   *value = 1 + x + x * x;
+}
+void ExponentialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
+   double x = xi[0];
+   double y = xi[1];
+
+   *value = 5*exp(2*x*x*x + 2*y*y*y) * (1-x) * (1+y);
+}
+void ExponentialInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
+   double x = xi[0];
+   double y = xi[1];
+
+   *value = (double) (y <= 0.1 * exp( 2*x ));
+}
+void CircleInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value ) {
+   double x = xi[0];
+   double y = xi[1];
+
+   *value = (double) (x*x + y*y <= 1.0);
+}
+
+
+void WeightsSuite_TestElementIntegral(
+      DomainContext* context,
+      Name           funcName,
+      Index          count,   // was SampleSize - defaults to 5000
+      double         meanTolerance,
+      double         stdDevTolerance,
+      double         expectedMean,
+      double         expectedStdDev ) 
+{
+   Swarm*              integrationSwarm = (Swarm*)LiveComponentRegister_Get(
+                           context->CF->LCRegister, "integrationSwarm" );
+   Swarm*              materialSwarm    = (Swarm*)LiveComponentRegister_Get(
+                           context->CF->LCRegister, "materialPoints" );
+   FeMesh*             mesh             = (FeMesh*) LiveComponentRegister_Get(
+                           context->CF->LCRegister, "linearMesh" );
+   WeightsCalculator*  weights          = (WeightsCalculator*) LiveComponentRegister_Get(
+                           context->CF->LCRegister, "weights" );
+   FeVariable*         feVariable;
+   Element_LocalIndex  lElement_I       = 0;
+   double              analyticValue    = 0.0;
+   double              integral         = 0.0;
+   double              error;
+   double              errorSquaredSum  = 0.0;
+   double              errorSum         = 0.0;
+   /*Particle_Index      lParticle_I;*/
+   /*IntegrationPoint*   particle;*/
+   double              mean;
+   double              standardDeviation;
+   Index               loop_I;
+   /*ElementLayout*      elementLayout    = mesh->layout->elementLayout;*/
+   void*               data;
+   double              differenceMean, differenceStdDev;   
+
+   assert( integrationSwarm );
+   assert( materialSwarm );
+   assert( mesh );
+   assert( weights );
+
+   /* Create FeVariable */
+   feVariable = FeVariable_New_Full( "feVariable", mesh, NULL, NULL, NULL, NULL, NULL, NULL, 
+         1, context->dim, False, False, False, MPI_COMM_WORLD, context->fieldVariable_Register );
+
+   Journal_Firewall( (funcName!=NULL),
+      Journal_Register( Error_Type, "WeightsSuite" ),
+      "Error, function name input to %s is NULL", __func__ );
+
+   if ( strcasecmp( funcName, "ShapeFunction" ) == 0 ) {
+      feVariable->_interpolateWithinElement = ShapeFunction;
+      analyticValue = 4.0;
+   }
+   else if ( strcasecmp( funcName, "ConstantFunction" ) == 0 ) {
+      feVariable->_interpolateWithinElement = ConstantFunction;
+      analyticValue = -12.0;
+   }
+   else if ( strcasecmp( funcName, "LinearFunction" ) == 0 ) {
+      feVariable->_interpolateWithinElement = LinearFunction;
+      analyticValue = 8.0;
+   }
+   else if ( strcasecmp( funcName, "QuadraticFunction" ) == 0 ) {
+      feVariable->_interpolateWithinElement = QuadraticFunction;
+      analyticValue = 16.0/3.0;
+   }
+   else if ( strcasecmp( funcName, "PolynomialFunction" ) == 0 ) {
+      feVariable->_interpolateWithinElement = PolynomialFunction;
+      analyticValue = 148.0/3.0;
+   }
+   else if ( strcasecmp( funcName, "ExponentialFunction" ) == 0 ) {
+      feVariable->_interpolateWithinElement = ExponentialFunction;
+      analyticValue = 0.0 /*TODO*/;
+      abort();
+   }
+   else if ( strcasecmp( funcName, "ExponentialInterface" ) == 0 ) {
+      feVariable->_interpolateWithinElement = ExponentialInterface;
+      analyticValue = 0.05 * (exp(2) - exp(-2)) + 2.0;
+   }
+   else if ( strcasecmp( funcName, "CircleInterface" ) == 0 ) {
+      feVariable->_interpolateWithinElement = CircleInterface;
+      analyticValue = M_PI;
+   }
+   else 
+      Journal_Firewall( False,
+            Journal_Register( Error_Type, "WeightsSuite" ),
+            "Cannot understand function name '%s'\n", funcName );
+
+   for ( loop_I = 0 ; loop_I < count ; loop_I++ ) {
+      /* Layout Particles */
+      Swarm_Random_Seed( (long) loop_I );
+      _Swarm_InitialiseParticles( materialSwarm, data );
+
+      _IntegrationPointsSwarm_UpdateHook( NULL, integrationSwarm );
+      
+      WeightsCalculator_CalculateCell( weights, integrationSwarm, lElement_I );
+
+      /* Evaluate Integral */
+      integral = FeVariable_IntegrateElement( feVariable, integrationSwarm, lElement_I );
+
+      /* Calculate Error */
+      error = fabs( integral - analyticValue )/fabs( analyticValue );
+      errorSum += error;
+      errorSquaredSum += error*error;
+   }
+
+   /* Calculate Mean and Standard Deviation */
+   mean = errorSum / (double) count;
+   standardDeviation = sqrt( errorSquaredSum / (double) count - mean * mean );
+
+   /* compare the mean and standard deviation */
+   differenceMean = fabs(mean - expectedMean);
+   differenceStdDev = fabs(standardDeviation - expectedStdDev);
+   pcu_check_le( differenceMean, meanTolerance );
+   pcu_check_le( differenceStdDev, stdDevTolerance );
+}
+
+
+void ConstantWeightsSuite_Setup( ConstantWeightsSuiteData* data ) {
+   char              xmlInputFilename[PCU_PATH_MAX];
+
+   pcu_filename_input( "testConstantWeights.xml", xmlInputFilename );
+   data->context = (DomainContext*)stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD );
+} 
+
+
+void ConstantWeightsSuite_Teardown( ConstantWeightsSuiteData* data ) {
+   stgMainDestroy( (AbstractContext*)data->context );
+}
+
+
+void ConstantWeightsSuite_TestElementIntegral_Circle( ConstantWeightsSuiteData* data ) {
+   WeightsSuite_TestElementIntegral( data->context, "CircleInterface", 1000,
+      0.000001, /* --mean-tolerance */
+      0.000001, /* --standardDeviation-tolerance */
+      0.091215, /* --mean-expectedValue */
+      0.066458 /* --standardDeviation-expectedValue */ );
+}
+
+
+void ConstantWeightsSuite_TestElementIntegral_Exponential( ConstantWeightsSuiteData* data ) {
+   WeightsSuite_TestElementIntegral( data->context, "ExponentialInterface", 1000,
+      0.000001, /* --mean-tolerance */
+      0.000001, /* --standardDeviation-tolerance */
+      0.155483, /* --mean-expectedValue */
+      0.116796 /* --standardDeviation-expectedValue */ );
+}
+
+
+void ConstantWeightsSuite_TestElementIntegral_Polynomial( ConstantWeightsSuiteData* data ) {
+   WeightsSuite_TestElementIntegral( data->context, "PolynomialFunction", 1000,
+      0.000001, /* --mean-tolerance */
+      0.000001, /* --standardDeviation-tolerance */
+      0.017475, /* --mean-expectedValue */
+      0.013738 /* --standardDeviation-expectedValue */ );
+}
+
+
+void ConstantWeightsSuite( pcu_suite_t* suite ) {
+   pcu_suite_setData( suite, ConstantWeightsSuiteData );
+   pcu_suite_setFixtures( suite, ConstantWeightsSuite_Setup, ConstantWeightsSuite_Teardown );
+   pcu_suite_addTest( suite, ConstantWeightsSuite_TestElementIntegral_Circle );
+/* TEMPORARILY disable multiple tests until Toolbox/Context issue sorted out (See tickets #70,#71
+ in StGermain trac) -- PatrickSunter, 19 Aug 2009 */
+#if 0
+   pcu_suite_addTest( suite, ConstantWeightsSuite_TestElementIntegral_Exponential );
+   pcu_suite_addTest( suite, ConstantWeightsSuite_TestElementIntegral_Polynomial );
+#endif
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/ConstantWeightsSuite.h
--- a/Weights/tests/ConstantWeightsSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include <PICellerator/PICellerator.h>
-
-#ifndef PICellerator_ConstantWeightsSuite_h
-#define PICellerator_ConstantWeightsSuite_h
-
-void constantFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value );
-void linearFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value );
-void shapeFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value );
-void polynomialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value );
-void quadraticFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value );
-void exponentialFunction( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value );
-void exponentialInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value );
-void circleInterface( void* feVariable, Element_DomainIndex dElement_I, Coord xi, double* value );
-
-void WeightsSuite_TestElementIntegral( PICelleratorContext* context, Name funcName, Index count,
-	 double meanTolerance, double stdDevTolerance, double expectedMean, double expectedStdDev );
-
-void ConstantWeightsSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/ConstantWeightsSuite.h.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/ConstantWeightsSuite.h.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,15 @@
+#ifndef StGermain_ConstantWeights_h
+#define StGermain_ConstantWeights_h
+
+void WeightsSuite_TestElementIntegral(
+      DomainContext* context,
+      Name           funcName,
+      Index          count,
+      double         meanTolerance,
+      double         stdDevTolerance,
+      double         expectedMean,
+      double         expectedStdDev );
+
+void ConstantWeightsSuite( pcu_suite_t* suite );
+
+#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/DVCWeightsSuite.c
--- a/Weights/tests/DVCWeightsSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,546 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include "PICellerator/PopulationControl/PopulationControl.h"
-#include "PICellerator/Weights/Weights.h"
-
-
-/* the ranges of the local coordinates of a FEM cell.*/
-const double BBXMIN = -1.0; 
-const double BBXMAX = 1.0;
-const double BBYMIN = -1.0;
-const double BBYMAX = 1.0;
-const double BBZMIN = -1.0;
-const double BBZMAX = 1.0;
-
-typedef struct {
-   struct cell*         cells;   /* the 3D connected grid */ 
-   struct particle*     pList;   /* 3D particle List */
-   struct chain*        bchain;  /*3D boundary chain */
-
-   struct cell2d*       cells2D; /* the 2D connected grid */
-   struct particle2d*   pList2D; /*2D particle List */
-   struct chain*        bchain2D;/*2D boundary chain */
-   unsigned int         numx,numy,numz;
-   unsigned int         nump,nump2D;
-   unsigned int         px, py, pz;
-   double               dx,dy,dz;
-   double               da,da2D;
-} DVCWeightsSuiteData;
-
-
-void DVCWeightsSuite_Setup( DVCWeightsSuiteData* data ) {
-   data->cells = NULL;
-   data->pList = NULL;
-   data->bchain = NULL;
-   data->cells2D = NULL;
-   data->pList2D = NULL;
-   data->bchain2D = NULL;
-
-   /*Define the resolution */
-   data->numx = 10;/* the data are hard-coded at this time, so don't change this from 10 */
-   data->numy = 10;/* the data are hard-coded at this time, so don't change this from 10 */
-   data->numz = 10;/* the data are hard-coded at this time, so don't change this from 10 */
-
-   /*Define the number of particles */
-   data->px = 2;
-   data->py = 2; 
-   data->pz = 2;
-   //data->nump = data->px * data->py * data->pz;
-   data->nump = 10; /* the data are hard-coded at this time, so don't change this from 10 */
-   //data->nump2D = data->px * data->py;
-   data->nump2D = 10; /* the data are hard-coded at this time, so don't change this from 10 */
-
-   data->dx = (BBXMAX - BBXMIN)/data->numx;
-   data->dy = (BBYMAX - BBYMIN)/data->numy;
-   data->dz = (BBZMAX - BBZMIN)/data->numz;
-   data->da = data->dx*data->dy*data->dz;
-   data->da2D = data->dx*data->dy;
-}
-
-
-void DVCWeightsSuite_Teardown( DVCWeightsSuiteData* data ) {
-   if(data->bchain) { free(data->bchain); }
-   if(data->pList) { free(data->pList); }
-   if(data->cells) { free(data->cells); }
-
-   if(data->bchain2D) { free(data->bchain2D); }
-   if(data->pList2D) { free(data->pList2D); }
-   if(data->cells2D) { free(data->cells2D); }
-}
-
-
-/* Do the testing of the 3D functions*/
-void DVCWeightsSuite_TestConstructGrid( DVCWeightsSuiteData* data ) {
-   FILE *fp;
-   unsigned int   ii=0;
-   const char*    gridFilename = "DVCWeightsSuite_testConstructGrid.txt";
-   char           expectedGridFilename[PCU_PATH_MAX];
-   //int passed=0;
-   char line[100];
-   float x,y,z,dx,dy,dz;
-   int N,S,E,W,U,D;
-   float tol=1e-6;
-   /* We'll use an expected file for this test, as visual checking of the correct parameters is probably
-    *  most logical way to maintain it */
-
-   _DVCWeights_ConstructGrid(&data->cells, data->numz, data->numy, data->numx, BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);		
-   pcu_filename_expected( gridFilename, expectedGridFilename );/* get the expected filename to open */
-   fp=fopen(expectedGridFilename,"r");
-   if(!fp){
-     pcu_check_true(0);
-     Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"DVCWeightsSuite_TestConstructGrid" ),"expected test File %s Not Found in function %s\n" ,expectedGridFilename, __func__);
-   }
-   else{
-     /* Print out the grid */
-     for (ii = 0; ii < (data->numx * data->numy * data->numz); ii++ ) {
-       pcu_check_true( data->cells[ii].p == -1 );   /* Particle index: shouldn't be set up yet */
-       pcu_check_true( data->cells[ii].done == 0 );
-       fgets(line,100,fp);  fgets(line,100,fp);
-       sscanf(line,"\t\tValues: (N: %d, S: %d, E: %d, W: %d, U: %d, D: %d)\n",&N,&S,&E,&W,&U,&D);
-       pcu_check_true( data->cells[ii].N == N );
-       pcu_check_true( data->cells[ii].S == S );
-       pcu_check_true( data->cells[ii].E == E );
-       pcu_check_true( data->cells[ii].W == W );
-       pcu_check_true( data->cells[ii].U == U );
-       pcu_check_true( data->cells[ii].D == D );
-       fgets(line,100,fp);
-       sscanf(line,"\t\tCoords: ( %f, %f, %f)\n",&x,&y,&z);
-       dx = (data->cells[ii].x - x)*(data->cells[ii].x - x); 
-       dy = (data->cells[ii].y - y)*(data->cells[ii].y - y); 
-       dz = (data->cells[ii].z - z)*(data->cells[ii].z - z); 
-       pcu_check_true( dx < tol );
-       pcu_check_true( dy < tol );
-       pcu_check_true( dz < tol );
-     }
-   }
-   fclose(fp);
-}
-
-
-void DVCWeightsSuite_TestInitialiseStructs( DVCWeightsSuiteData* data ) {
-   unsigned int   ii;   
-
-   
-   _DVCWeights_InitialiseStructs( &data->bchain, &data->pList, data->nump);
-   for (ii = 0; ii < data->nump; ii++) {
-      pcu_check_true( data->bchain[ii].new_claimed_cells_malloced == DVC_INC );
-      pcu_check_true( data->bchain[ii].new_bound_cells_malloced == DVC_INC );
-   }
-}
-   
-
-void DVCWeightsSuite_TestResetGrid( DVCWeightsSuiteData* data ) {
-   unsigned int   i;
-   
-   _DVCWeights_ConstructGrid(&data->cells, data->numz, data->numy, data->numx, BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);		
-   _DVCWeights_ResetGrid(&data->cells, data->numz*data->numy*data->numx);
-
-   for ( i = 0; i < data->numz*data->numy*data->numx; i++) {
-      pcu_check_true( data->cells[i].p == -1 );
-      pcu_check_true( data->cells[i].done == 0 );
-   }
-}
-
-
-void _DVCWeightsSuite_InitialiseParticleCoords( DVCWeightsSuiteData* data ) {
-   int            i;
-
-   /*Initialise particle coords */
-
-   i=0;
-   data->pList[i].x = -0.64320939127356 ; i++;
-   data->pList[i].x = -0.57575625646859 ; i++;
-   data->pList[i].x = -0.44866901542991 ; i++;
-   data->pList[i].x = -0.45453263074160 ; i++;
-   data->pList[i].x = -0.56068608816713 ; i++;
-   data->pList[i].x = -0.31215981673449 ; i++;
-   data->pList[i].x = -0.94066464062780 ; i++;
-   data->pList[i].x = +0.05528775136918 ; i++;
-   data->pList[i].x = -0.62383012939245 ; i++;
-   data->pList[i].x = +0.43985756300390 ; i++;
-   
-   i=0;
-   data->pList[i].y = -0.20064506959170 ; i++;
-   data->pList[i].y = -0.87612858321518 ; i++;
-   data->pList[i].y = -0.90448551066220 ; i++;
-   data->pList[i].y = -0.26452634204179 ; i++;
-   data->pList[i].y = -0.59652493428439 ; i++;
-   data->pList[i].y = +0.29530759342015 ; i++;
-   data->pList[i].y = +0.75698726624250 ; i++;
-   data->pList[i].y = +0.01171378418803 ; i++;
-   data->pList[i].y = -0.76168798375875 ; i++;
-   data->pList[i].y = +0.27507007215172 ; i++;  
-
-   i=0;
-   data->pList[i].z = -0.66680242400616; i++;
-   data->pList[i].z = -0.89170031249523; i++;
-   data->pList[i].z = -0.35793361812830; i++;
-   data->pList[i].z = -0.55526655819267; i++;
-   data->pList[i].z = -0.91176854260266; i++;
-   data->pList[i].z = -0.70107179880142; i++;
-   data->pList[i].z = +0.31083723250777; i++;
-   data->pList[i].z = +0.83138376288116; i++;
-   data->pList[i].z = -0.88380649406463; i++;
-   data->pList[i].z = +0.76169187109917; i++;  
-
-   for ( i = 0; i < data->nump; i++) {	    
-      //Journal_Printf( stream, "data->pList[%d]:", i);
-      //Journal_Printf( stream, "\t\t coords: (x, y, z) = (%f, %f, %f)\n",
-      //   data->pList[i].x, data->pList[i].y, data->pList[i].z);
-
-   }
-}
-
-
-void DVCWeightsSuite_TestCreateVoronoi( DVCWeightsSuiteData* data ) {
-   int            i;
-
-   _DVCWeights_ConstructGrid(&data->cells, data->numz, data->numy, data->numx, BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);		
-   _DVCWeights_InitialiseStructs( &data->bchain, &data->pList, data->nump);
-
-   _DVCWeightsSuite_InitialiseParticleCoords( data );
-   _DVCWeights_CreateVoronoi( &data->bchain, &data->pList, &data->cells, data->dx, data->dy, data->dz,
-      data->nump, data->numx, data->numy, data->numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
-   
-   /* data->bchain changes */
-   for (i = 0; i < data->nump; i++) {
-      //pcu_check_true( data->bchain[i].index == (data->nump-1) ); //This value doesn't matter at the moment: also nump-1 is the wrong number anyway
-      pcu_check_true( data->bchain[i].sizeofboundary == 0 );
-      pcu_check_true( data->bchain[i].numclaimed == 0 );
-      pcu_check_true( data->bchain[i].totalclaimed == 1 );
-      pcu_check_true( data->bchain[i].new_bound_cells_malloced == DVC_INC );
-      pcu_check_true( data->bchain[i].new_claimed_cells_malloced == DVC_INC );
-      pcu_check_true( data->bchain[i].done == 0 );
-   }
-   /* particle values */
-   for (i = 0; i < data->nump; i++) {
-      pcu_check_true( (data->pList[i].cx == 0) && (data->pList[i].cy == 0) && (data->pList[i].cz == 0));
-      pcu_check_true( data->pList[i].w == 0 );
-   }
-}
-
-
-void DVCWeightsSuite_TestGetCentroids( DVCWeightsSuiteData* data ) {
-   FILE *fp;
-   unsigned int   i;
-   const char*    centroidsFilename = "DVCWeightsSuite_testGetCentroids.txt";
-   char           expectedCentroidsFilename[PCU_PATH_MAX];
-   char line[100];
-   float x,y,z,dx,dy,dz;
-   float tol=1e-6;
-   /* We'll use an expected file for this test, as visual checking of the correct parameters is probably
-    *  most logical way to maintain it */
-   
-   _DVCWeights_ConstructGrid(&data->cells, data->numz, data->numy, data->numx, BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);
-   _DVCWeights_InitialiseStructs( &data->bchain, &data->pList, data->nump);
-   _DVCWeightsSuite_InitialiseParticleCoords( data );
-   _DVCWeights_CreateVoronoi( &data->bchain, &data->pList, &data->cells, data->dx, data->dy, data->dz,
-      data->nump, data->numx, data->numy, data->numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
-
-   _DVCWeights_GetCentroids( data->cells, data->pList,data->numz,data->numy,data->numx,data->nump,data->da);
-
-   pcu_filename_expected(centroidsFilename, expectedCentroidsFilename);/* get the expected filename to open */
-   fp=fopen(expectedCentroidsFilename,"r");
-   if(!fp){
-     pcu_check_true(0);
-     Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"DVCWeightsSuite_TestGetCentroids" ),"expected test File %s Not Found in function %s\n" ,expectedCentroidsFilename, __func__);
-   }
-   else{
-     for (i = 0; i < data->nump; i++) {
-       fgets(line,100,fp);
-    
-       fgets(line,100,fp);
-       sscanf(line,"\t\tcoords: (x, y, z) = ( %f, %f, %f)\n",&x,&y,&z);
-       dx = (data->pList[i].x -x)*(data->pList[i].x -x);
-       dy = (data->pList[i].y -y)*(data->pList[i].y -y);
-       dz = (data->pList[i].z -z)*(data->pList[i].z -z);
-       pcu_check_true( dx < tol );
-       pcu_check_true( dy < tol );
-       pcu_check_true( dz < tol );
-
-       fgets(line,100,fp);
-       sscanf(line,"\t\tcentroids: (cx, cy, cz) = ( %f, %f, %f)\n",&x,&y,&z);
-       dx = (data->pList[i].cx -x)*(data->pList[i].cx -x);
-       dy = (data->pList[i].cy -y)*(data->pList[i].cy -y);
-       dz = (data->pList[i].cz -z)*(data->pList[i].cz -z);
-       pcu_check_true( dx < tol );
-       pcu_check_true( dy < tol );
-       pcu_check_true( dz < tol );
-       
-       fgets(line,100,fp);
-       sscanf(line,"\t\tweight = %f\n",&x);
-       dx = (data->pList[i].w -x)*(data->pList[i].w -x);
-       pcu_check_true( dx < tol );
-     }
-   }
-   fclose(fp);
-}
-
-
-void DVCWeightsSuite_TestDistanceSquared( DVCWeightsSuiteData* data ) {
-   double particleDistance;		
-   double particle0[3], particle1[3];
-
-   particle0[0] = 0.5;	particle0[1] = 0.5;	particle0[2] = 0.5;
-   particle1[0] = 0.25; particle1[1] = 0.25; 	particle1[2] = 0; 		
-
-   particleDistance = _DVCWeights_DistanceSquared(
-      particle0[0], particle0[1], particle0[2],
-      particle1[0], particle1[1], particle1[2]);
-
-   pcu_check_true( particleDistance == 0.375 );
-}
-
-
-/* 2D Functions */
-
-void DVCWeightsSuite_TestConstructGrid2D( DVCWeightsSuiteData* data ) {
-   FILE *fp;
-   unsigned int   ii=0;
-   const char*    gridFilename = "DVCWeightsSuite_testConstructGrid2D.txt";
-   char           expectedGridFilename[PCU_PATH_MAX];
-   char line[100];
-   float x,y,dx,dy;
-   int N,S,E,W;
-   float tol=1e-6;
-
-   _DVCWeights_ConstructGrid2D(&data->cells2D,data->numy,data->numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);		
-
-   pcu_filename_expected( gridFilename, expectedGridFilename );/* get the expected filename to open */
-   fp=fopen(expectedGridFilename,"r");
-   if(!fp){
-     pcu_check_true(0);
-     Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"DVCWeightsSuite_TestConstructGrid2D" ),"expected test File %s Not Found in function %s\n" ,expectedGridFilename, __func__);
-   }
-   else{
-     /* Print out the grid */
-     for (ii = 0; ii < (data->numx * data->numy); ii++ ) {
-       pcu_check_true( data->cells2D[ii].p == -1 );   /* Particle index: shouldn't be set up yet */
-       pcu_check_true( data->cells2D[ii].done == 0 );
-       fgets(line,100,fp);  fgets(line,100,fp);
-       sscanf(line,"\t\tValues: (N: %d, S: %d, E: %d, W: %d)\n",&N,&S,&E,&W);
-       pcu_check_true( data->cells2D[ii].N == N );
-       pcu_check_true( data->cells2D[ii].S == S );
-       pcu_check_true( data->cells2D[ii].E == E );
-       pcu_check_true( data->cells2D[ii].W == W );
-       fgets(line,100,fp);
-       sscanf(line,"\t\tCoords: ( %f, %f)\n",&x,&y);
-       dx = (data->cells2D[ii].x - x)*(data->cells2D[ii].x - x); 
-       dy = (data->cells2D[ii].y - y)*(data->cells2D[ii].y - y); 
-       pcu_check_true( dx < tol );
-       pcu_check_true( dy < tol );
-     }
-   }
-   fclose(fp);
-}
-
-void DVCWeightsSuite_TestInitialiseStructs2D( DVCWeightsSuiteData* data ) {
-   unsigned int   ii;   
-
-   _DVCWeights_InitialiseStructs2D( &data->bchain2D, &data->pList2D, data->nump2D);
-   for (ii = 0; ii < data->nump2D; ii++) {
-      pcu_check_true( data->bchain2D[ii].new_claimed_cells_malloced == DVC_INC );
-      pcu_check_true( data->bchain2D[ii].new_bound_cells_malloced == DVC_INC );
-   }
-}
-
-   
-void DVCWeightsSuite_TestResetGrid2D( DVCWeightsSuiteData* data ) {
-   unsigned int   i;
-   
-   _DVCWeights_ConstructGrid2D(&data->cells2D,data->numy,data->numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);
-   _DVCWeights_ResetGrid2D(&data->cells2D,data->numx*data->numy);
-
-   for ( i = 0; i < data->numx*data->numy; i++) {
-      pcu_check_true( data->cells2D[i].p == -1 );
-      pcu_check_true( data->cells2D[i].done == 0 );
-   }
-}
-
-void _DVCWeightsSuite_InitialiseParticleCoords2D( DVCWeightsSuiteData* data ) {
-   int i;
-
-   /*Initialise particle coords */
-   i=0;
-   data->pList2D[i].x = -0.55376385338604 ; i++;
-   data->pList2D[i].x = -0.10488151479512 ; i++;
-   data->pList2D[i].x = +0.13873003050685 ; i++;
-   data->pList2D[i].x = -0.05016296077520 ; i++;
-   data->pList2D[i].x = +0.90808211639524 ; i++;
-   data->pList2D[i].x = -0.69216587487608 ; i++;
-   data->pList2D[i].x = -0.62051867879927 ; i++;
-   data->pList2D[i].x = +0.24515981227160 ; i++;
-   data->pList2D[i].x = -0.83195694349706 ; i++;
-   data->pList2D[i].x = +0.92260552570224 ; i++;
-   
-   i=0;
-   data->pList2D[i].y = -0.56640755850822 ; i++;
-   data->pList2D[i].y = -0.01476682443172 ; i++;
-   data->pList2D[i].y = -0.05242515634745 ; i++;
-   data->pList2D[i].y = -0.93268149159849 ; i++;
-   data->pList2D[i].y = +0.91700463462621 ; i++;
-   data->pList2D[i].y = -0.47783328499645 ; i++;
-   data->pList2D[i].y = -0.27844923641533 ; i++;
-   data->pList2D[i].y = -0.66626300383359 ; i++;
-   data->pList2D[i].y = +0.17968866135925 ; i++;
-   data->pList2D[i].y = -0.58136314433068 ; i++;
-   
-
-   for ( i = 0; i < data->nump2D; i++) {	    
-      //Journal_Printf( stream, "data->pList2D[%d]:", i);
-      //Journal_Printf( stream, "\t\t coords: (x, y) = (%f, %f)\n",
-      //   data->pList2D[i].x, data->pList2D[i].y);
-
-   }
-}
-
-
-void DVCWeightsSuite_TestCreateVoronoi2D( DVCWeightsSuiteData* data ) {
-   int i;
-
-   _DVCWeights_ConstructGrid2D(&data->cells2D,data->numy,data->numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);
-   _DVCWeights_InitialiseStructs2D( &data->bchain2D, &data->pList2D, data->nump2D);
-
-   _DVCWeightsSuite_InitialiseParticleCoords2D( data );
-   _DVCWeights_CreateVoronoi2D( &data->bchain2D, &data->pList2D, &data->cells2D, data->dx, data->dy,
-      data->nump2D, data->numx, data->numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
-   
-   /* data->bchain2D changes */
-   for (i = 0; i < data->nump2D; i++) {
-      //pcu_check_true( data->bchain2D[i].index == (data->nump2D-1) );//This value doesn't matter at the moment: also nump2D-1 is the wrong number anyway
-      pcu_check_true( data->bchain2D[i].sizeofboundary == 0 );
-      pcu_check_true( data->bchain2D[i].numclaimed == 0 );
-      pcu_check_true( data->bchain2D[i].totalclaimed == 1 );
-      pcu_check_true( data->bchain2D[i].new_bound_cells_malloced == DVC_INC );
-      pcu_check_true( data->bchain2D[i].new_claimed_cells_malloced == DVC_INC );
-      pcu_check_true( data->bchain2D[i].done == 0 );
-   }
-   /* particle values */
-   for (i = 0; i < data->nump2D; i++) {
-      pcu_check_true( (data->pList2D[i].cx == 0) && (data->pList2D[i].cy == 0) );
-      pcu_check_true( data->pList2D[i].w == 0 );
-   }
-}
-
-
-void DVCWeightsSuite_TestGetCentroids2D( DVCWeightsSuiteData* data ) {
-   FILE *fp;
-   unsigned int   i;
-   const char*    centroidsFilename = "DVCWeightsSuite_testGetCentroids2D.txt";
-   char           expectedCentroidsFilename[PCU_PATH_MAX];
-   char line[100];
-   float x,y,dx,dy;
-   float tol=1e-6;
-
-   _DVCWeights_ConstructGrid2D(&data->cells2D,data->numy,data->numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);
-   _DVCWeights_InitialiseStructs2D( &data->bchain2D, &data->pList2D, data->nump2D);   
-   _DVCWeightsSuite_InitialiseParticleCoords2D( data );
-   _DVCWeights_CreateVoronoi2D( &data->bchain2D, &data->pList2D, &data->cells2D, data->dx, data->dy,
-      data->nump2D, data->numx, data->numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
-
-   _DVCWeights_GetCentroids2D( data->cells2D, data->pList2D,data->numy,data->numx,data->nump2D,data->da2D);
-
-   pcu_filename_expected( centroidsFilename, expectedCentroidsFilename );
-    fp=fopen(expectedCentroidsFilename,"r");
-   if(!fp){
-     pcu_check_true(0);
-     Journal_Firewall( 0 , Journal_Register( Error_Type, (Name)"DVCWeightsSuite_TestGetCentroids2D" ),"expected test File %s Not Found in function %s\n" ,expectedCentroidsFilename, __func__);
-   }
-   else{
-
-     for (i = 0; i < data->nump2D; i++) {
-       fgets(line,100,fp);
-    
-       fgets(line,100,fp);
-       sscanf(line,"\t\tcoords: (x, y) = ( %f, %f)\n",&x,&y);
-       dx = (data->pList2D[i].x -x)*(data->pList2D[i].x -x);
-       dy = (data->pList2D[i].y -y)*(data->pList2D[i].y -y);
-       pcu_check_true( dx < tol );
-       pcu_check_true( dy < tol );
-
-       fgets(line,100,fp);
-       sscanf(line,"\t\tcentroids: (cx, cy) = ( %f, %f)\n",&x,&y);
-       dx = (data->pList2D[i].cx -x)*(data->pList2D[i].cx -x);
-       dy = (data->pList2D[i].cy -y)*(data->pList2D[i].cy -y);
-       pcu_check_true( dx < tol );
-       pcu_check_true( dy < tol );
-       
-       fgets(line,100,fp);
-       sscanf(line,"\t\tweight = %f\n",&x);
-       dx = (data->pList2D[i].w -x)*(data->pList2D[i].w -x);
-       pcu_check_true( dx < tol );
-     }
-   }
-   fclose(fp);
-}
-
-
-void DVCWeightsSuite_TestDistanceSquared2D( DVCWeightsSuiteData* data ) {
-   double particleDistance;		
-   double particle0[2], particle1[2];
-   
-   particle0[0] = 0.5;	particle0[1] = 0.5;
-   particle1[0] = 0.25; particle1[1] = 0.25;
-
-   particleDistance = _DVCWeights_DistanceSquared2D(
-      particle0[0], particle0[1],
-      particle1[0], particle1[1] );
-   
-   pcu_check_true( particleDistance == 0.125 );
-}
-
-
-void DVCWeightsSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, DVCWeightsSuiteData );
-   pcu_suite_setFixtures( suite, DVCWeightsSuite_Setup, DVCWeightsSuite_Teardown );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestConstructGrid );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestResetGrid );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestInitialiseStructs );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestCreateVoronoi );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestGetCentroids );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestDistanceSquared );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestConstructGrid2D );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestInitialiseStructs2D );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestResetGrid2D );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestCreateVoronoi2D );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestGetCentroids2D );
-   pcu_suite_addTest( suite, DVCWeightsSuite_TestDistanceSquared2D );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/DVCWeightsSuite.c.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/DVCWeightsSuite.c.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,426 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "pcu/pcu.h"
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include "PICellerator/PopulationControl/PopulationControl.h"
+#include "PICellerator/Weights/Weights.h"
+
+
+/* the ranges of the local coordinates of a FEM cell.*/
+const double BBXMIN = -1.0; 
+const double BBXMAX = 1.0;
+const double BBYMIN = -1.0;
+const double BBYMAX = 1.0;
+const double BBZMIN = -1.0;
+const double BBZMAX = 1.0;
+
+typedef struct {
+   struct cell*         cells;   /* the 3D connected grid */ 
+   struct particle*     pList;   /* 3D particle List */
+   struct chain*        bchain;  /*3D boundary chain */
+
+   struct cell2d*       cells2D; /* the 2D connected grid */
+   struct particle2d*   pList2D; /*2D particle List */
+   struct chain*        bchain2D;/*2D boundary chain */
+   unsigned int         numx,numy,numz;
+   unsigned int         nump,nump2D;
+   unsigned int         px, py, pz;
+   double               dx,dy,dz;
+   double               da,da2D;
+} DVCWeightsSuiteData;
+
+
+void DVCWeightsSuite_Setup( DVCWeightsSuiteData* data ) {
+   data->cells = NULL;
+   data->pList = NULL;
+   data->bchain = NULL;
+   data->cells2D = NULL;
+   data->pList2D = NULL;
+   data->bchain2D = NULL;
+
+   /*Define the resolution */
+   data->numx = 2;
+   data->numy = 2;
+   data->numz = 2;
+
+   /*Define the number of particles */
+   data->px = 2;
+   data->py = 2; 
+   data->pz = 2;
+   data->nump = data->px * data->py * data->pz;
+   data->nump2D = data->px * data->py;
+
+   data->dx = (BBXMAX - BBXMIN)/data->numx;
+   data->dy = (BBYMAX - BBYMIN)/data->numy;
+   data->dz = (BBZMAX - BBZMIN)/data->numz;
+   data->da = data->dx*data->dy*data->dz;
+   data->da2D = data->dx*data->dy;
+}
+
+
+void DVCWeightsSuite_Teardown( DVCWeightsSuiteData* data ) {
+   if(data->bchain) { free(data->bchain); }
+   if(data->pList) { free(data->pList); }
+   if(data->cells) { free(data->cells); }
+
+   if(data->bchain2D) { free(data->bchain2D); }
+   if(data->pList2D) { free(data->pList2D); }
+   if(data->cells2D) { free(data->cells2D); }
+}
+
+
+/* Do the testing of the 3D functions*/
+void DVCWeightsSuite_TestConstructGrid( DVCWeightsSuiteData* data ) {
+   unsigned int   ii=0;
+   Stream*        stream = Journal_Register( Info_Type, "TestConstructGrid" );
+   const char*    gridFilename = "DVCWeightsSuite_testConstructGrid.txt";
+   char           expectedGridFilename[PCU_PATH_MAX];
+   
+   /* We'll use an expected file for this test, as visual checking of the correct parameters is probably
+    *  most logical way to maintain it */
+   Stream_RedirectFile( stream, gridFilename );
+
+   _DVCWeights_ConstructGrid(&data->cells, data->numz, data->numy, data->numx, BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);		
+   
+   /* Print out the grid */
+   for (ii = 0; ii < (data->numx * data->numy * data->numz); ii++ ) {
+      pcu_check_true( data->cells[ii].p == -1 );   /* Particle index: shouldn't be set up yet */
+      pcu_check_true( data->cells[ii].done == 0 );
+
+      Journal_Printf(stream, "cell[%d]\n", ii);
+      Journal_Printf(stream, " \t\tValues: (N: %d, S: %d, E: %d, W: %d, U: %d, D: %d) \n", 
+            data->cells[ii].N, data->cells[ii].S, data->cells[ii].E, data->cells[ii].W,
+            data->cells[ii].U, data->cells[ii].D );
+      Journal_Printf(stream, " \t\tCoords: (%f, %f,%f) \n", 
+            data->cells[ii].x, data->cells[ii].y, data->cells[ii].z );
+   }
+
+   pcu_filename_expected( gridFilename, expectedGridFilename );
+   pcu_check_fileEq( gridFilename, expectedGridFilename );
+   remove( gridFilename );
+}
+
+
+void DVCWeightsSuite_TestInitialiseStructs( DVCWeightsSuiteData* data ) {
+   unsigned int   ii;   
+
+   
+   _DVCWeights_InitialiseStructs( &data->bchain, &data->pList, data->nump);
+   for (ii = 0; ii < data->nump; ii++) {
+      pcu_check_true( data->bchain[ii].new_claimed_cells_malloced == DVC_INC );
+      pcu_check_true( data->bchain[ii].new_bound_cells_malloced == DVC_INC );
+   }
+}
+   
+
+void DVCWeightsSuite_TestResetGrid( DVCWeightsSuiteData* data ) {
+   unsigned int   i;
+   
+   _DVCWeights_ConstructGrid(&data->cells, data->numz, data->numy, data->numx, BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);		
+   _DVCWeights_ResetGrid(&data->cells, data->numz*data->numy*data->numx);
+
+   for ( i = 0; i < data->numz*data->numy*data->numx; i++) {
+      pcu_check_true( data->cells[i].p == -1 );
+      pcu_check_true( data->cells[i].done == 0 );
+   }
+}
+
+
+void _DVCWeightsSuite_InitialiseParticleCoords( DVCWeightsSuiteData* data ) {
+   int            i,j,k,l;
+
+   /*Initialise particle coords */
+   l = 0;
+   for(i = 0; i < data->px ;i++){
+      for ( j = 0; j < data->py ; j++) {
+         for ( k = 0; k < data->pz; k++ ) { 
+               data->pList[l].x = (1 + i) / (data->px + 1.0);
+               data->pList[l].y = (1 + j) / ( data->py + 1.0);
+               data->pList[l].z = (1 + k) / (data->pz + 1.0);
+            l++;
+         }
+      }
+   }
+   for ( i = 0; i < data->nump; i++) {	    
+      //Journal_Printf( stream, "data->pList[%d]:", i);
+      //Journal_Printf( stream, "\t\t coords: (x, y, z) = (%f, %f, %f)\n",
+      //   data->pList[i].x, data->pList[i].y, data->pList[i].z);
+
+   }
+}
+
+
+void DVCWeightsSuite_TestCreateVoronoi( DVCWeightsSuiteData* data ) {
+   int            i;
+
+   _DVCWeights_ConstructGrid(&data->cells, data->numz, data->numy, data->numx, BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);		
+   _DVCWeights_InitialiseStructs( &data->bchain, &data->pList, data->nump);
+
+   _DVCWeightsSuite_InitialiseParticleCoords( data );
+   _DVCWeights_CreateVoronoi( &data->bchain, &data->pList, &data->cells, data->dx, data->dy, data->dz,
+      data->nump, data->numx, data->numy, data->numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+   
+   /* data->bchain changes */
+   for (i = 0; i < data->nump; i++) {
+      pcu_check_true( data->bchain[i].index == (data->nump-1) );
+      pcu_check_true( data->bchain[i].sizeofboundary == 0 );
+      pcu_check_true( data->bchain[i].numclaimed == 0 );
+      pcu_check_true( data->bchain[i].totalclaimed == 1 );
+      pcu_check_true( data->bchain[i].new_bound_cells_malloced == DVC_INC );
+      pcu_check_true( data->bchain[i].new_claimed_cells_malloced == DVC_INC );
+      pcu_check_true( data->bchain[i].done == 0 );
+   }
+   /* particle values */
+   for (i = 0; i < data->nump; i++) {
+      pcu_check_true( (data->pList[i].cx == 0) && (data->pList[i].cy == 0) && (data->pList[i].cz == 0));
+      pcu_check_true( data->pList[i].w == 0 );
+   }
+}
+
+
+void DVCWeightsSuite_TestGetCentroids( DVCWeightsSuiteData* data ) {
+   unsigned int   i;
+   Stream*        stream = Journal_Register( Info_Type, "TestGetCentroids" );
+   const char*    centroidsFilename = "DVCWeightsSuite_testGetCentroids.txt";
+   char           expectedCentroidsFilename[PCU_PATH_MAX];
+   
+   /* We'll use an expected file for this test, as visual checking of the correct parameters is probably
+    *  most logical way to maintain it */
+   Stream_RedirectFile( stream, centroidsFilename );
+
+   _DVCWeights_ConstructGrid(&data->cells, data->numz, data->numy, data->numx, BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);		
+   _DVCWeights_InitialiseStructs( &data->bchain, &data->pList, data->nump);
+   _DVCWeightsSuite_InitialiseParticleCoords( data );
+   _DVCWeights_CreateVoronoi( &data->bchain, &data->pList, &data->cells, data->dx, data->dy, data->dz,
+      data->nump, data->numx, data->numy, data->numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+
+   _DVCWeights_GetCentroids( data->cells, data->pList,data->numz,data->numy,data->numx,data->nump,data->da);
+
+   for (i = 0; i < data->nump; i++) {
+      Journal_Printf( stream, "data->pList[%d]:\n", i);
+      Journal_Printf( stream, "\t\t coords: (x, y, z) = (%f, %f, %f)\n",
+         data->pList[i].x, data->pList[i].y, data->pList[i].z);
+      Journal_Printf( stream, "\t\t centroids: (cx, cy, cz) = (%f, %f, %f)\n",
+         data->pList[i].cx, data->pList[i].cy, data->pList[i].cz);
+      Journal_Printf( stream, "\t\t weight = %f\n", data->pList[i].w);
+   }
+
+   pcu_filename_expected( centroidsFilename, expectedCentroidsFilename );
+   pcu_check_fileEq( centroidsFilename, expectedCentroidsFilename );
+   remove( centroidsFilename );
+}
+
+
+void DVCWeightsSuite_TestDistanceSquared( DVCWeightsSuiteData* data ) {
+   double particleDistance;		
+   double particle0[3], particle1[3];
+
+   particle0[0] = 0.5;	particle0[1] = 0.5;	particle0[2] = 0.5;
+   particle1[0] = 0.25; particle1[1] = 0.25; 	particle1[2] = 0; 		
+
+   particleDistance = _DVCWeights_DistanceSquared(
+      particle0[0], particle0[1], particle0[2],
+      particle1[0], particle1[1], particle1[2]);
+
+   pcu_check_true( particleDistance == 0.375 );
+}
+
+
+/* 2D Functions */
+
+void DVCWeightsSuite_TestConstructGrid2D( DVCWeightsSuiteData* data ) {
+   unsigned int   ii=0;
+   Stream*        stream = Journal_Register( Info_Type, "TestConstructGrid2D" );
+   const char*    gridFilename = "DVCWeightsSuite_testConstructGrid2D.txt";
+   char           expectedGridFilename[PCU_PATH_MAX];
+   
+   Stream_RedirectFile( stream, gridFilename );
+
+   _DVCWeights_ConstructGrid2D(&data->cells2D,data->numy,data->numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);		
+   
+   /* Print out the grid */
+   for (ii = 0; ii < (data->numx * data->numy ); ii++ ) {
+      pcu_check_true( data->cells2D[ii].p == -1 );   /* Particle index: shouldn't be set up yet */
+      pcu_check_true( data->cells2D[ii].done == 0 );
+
+      Journal_Printf(stream, "cell[%d]\n", ii);
+      Journal_Printf(stream, " \t\tValues: (N: %d, S: %d, E: %d, W: %d) \n", 
+            data->cells2D[ii].N, data->cells2D[ii].S, data->cells2D[ii].E, data->cells2D[ii].W );
+      Journal_Printf(stream, " \t\tCoords: (%f, %f)\n", 
+            data->cells2D[ii].x, data->cells2D[ii].y );			
+   }
+
+   pcu_filename_expected( gridFilename, expectedGridFilename );
+   pcu_check_fileEq( gridFilename, expectedGridFilename );
+   remove( gridFilename );
+}
+
+void DVCWeightsSuite_TestInitialiseStructs2D( DVCWeightsSuiteData* data ) {
+   unsigned int   ii;   
+
+   _DVCWeights_InitialiseStructs2D( &data->bchain2D, &data->pList2D, data->nump2D);
+   for (ii = 0; ii < data->nump2D; ii++) {
+      pcu_check_true( data->bchain2D[ii].new_claimed_cells_malloced == DVC_INC );
+      pcu_check_true( data->bchain2D[ii].new_bound_cells_malloced == DVC_INC );
+   }
+}
+
+   
+void DVCWeightsSuite_TestResetGrid2D( DVCWeightsSuiteData* data ) {
+   unsigned int   i;
+   
+   _DVCWeights_ConstructGrid2D(&data->cells2D,data->numy,data->numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);
+   _DVCWeights_ResetGrid2D(&data->cells2D,data->numx*data->numy);
+
+   for ( i = 0; i < data->numx*data->numy; i++) {
+      pcu_check_true( data->cells2D[i].p == -1 );
+      pcu_check_true( data->cells2D[i].done == 0 );
+   }
+}
+
+   
+void _DVCWeightsSuite_InitialiseParticleCoords2D( DVCWeightsSuiteData* data ) {
+   int i,j,l;
+
+   /*Initialise particle coords */
+   l = 0;
+   for(i = 0; i < data->px ;i++){
+      for ( j = 0; j < data->py ; j++) {
+         data->pList2D[l].x = (1 + i) / (data->px + 1.0);
+         data->pList2D[l].y = (1 + j) / ( data->py + 1.0);
+         l++;
+      }
+   }
+   for ( i = 0; i < data->nump2D; i++) {	    
+      //Journal_Printf( stream, "data->pList2D[%d]:", i);
+      //Journal_Printf( stream, "\t\t coords: (x, y) = (%f, %f)\n",
+      //   data->pList2D[i].x, data->pList2D[i].y);
+
+   }
+}
+
+
+void DVCWeightsSuite_TestCreateVoronoi2D( DVCWeightsSuiteData* data ) {
+   int i;
+
+   _DVCWeights_ConstructGrid2D(&data->cells2D,data->numy,data->numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);
+   _DVCWeights_InitialiseStructs2D( &data->bchain2D, &data->pList2D, data->nump2D);
+
+   _DVCWeightsSuite_InitialiseParticleCoords2D( data );
+   _DVCWeights_CreateVoronoi2D( &data->bchain2D, &data->pList2D, &data->cells2D, data->dx, data->dy,
+      data->nump2D, data->numx, data->numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
+   
+   /* data->bchain2D changes */
+   for (i = 0; i < data->nump2D; i++) {
+      pcu_check_true( data->bchain2D[i].index == (data->nump2D-1) );
+      pcu_check_true( data->bchain2D[i].sizeofboundary == 0 );
+      pcu_check_true( data->bchain2D[i].numclaimed == 0 );
+      pcu_check_true( data->bchain2D[i].totalclaimed == 1 );
+      pcu_check_true( data->bchain2D[i].new_bound_cells_malloced == DVC_INC );
+      pcu_check_true( data->bchain2D[i].new_claimed_cells_malloced == DVC_INC );
+      pcu_check_true( data->bchain2D[i].done == 0 );
+   }
+   /* particle values */
+   for (i = 0; i < data->nump2D; i++) {
+      pcu_check_true( (data->pList2D[i].cx == 0) && (data->pList2D[i].cy == 0) );
+      pcu_check_true( data->pList2D[i].w == 0 );
+   }
+}
+
+
+void DVCWeightsSuite_TestGetCentroids2D( DVCWeightsSuiteData* data ) {
+   unsigned int   i;
+   Stream*        stream = Journal_Register( Info_Type, "TestGetCentroids2D" );
+   const char*    centroidsFilename = "DVCWeightsSuite_testGetCentroids2D.txt";
+   char           expectedCentroidsFilename[PCU_PATH_MAX];
+
+   Stream_RedirectFile( stream, centroidsFilename );
+
+   _DVCWeights_ConstructGrid2D(&data->cells2D,data->numy,data->numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);
+   _DVCWeights_InitialiseStructs2D( &data->bchain2D, &data->pList2D, data->nump2D);   
+   _DVCWeightsSuite_InitialiseParticleCoords2D( data );
+   _DVCWeights_CreateVoronoi2D( &data->bchain2D, &data->pList2D, &data->cells2D, data->dx, data->dy,
+      data->nump2D, data->numx, data->numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
+
+   _DVCWeights_GetCentroids2D( data->cells2D, data->pList2D,data->numy,data->numx,data->nump2D,data->da2D);
+
+   for (i = 0; i < data->nump2D; i++) {
+      Journal_Printf( stream, "data->pList2D[%d]:\n", i);
+      Journal_Printf( stream, "\t\t coords: (x, y) = (%f, %f)\n",
+         data->pList2D[i].x, data->pList2D[i].y);
+      Journal_Printf( stream, "\t\t centroids: (cx, cy) = (%f, %f)\n",
+         data->pList2D[i].cx, data->pList2D[i].cy);
+      Journal_Printf( stream, "\t\t weight = %f\n", data->pList2D[i].w);
+   }
+
+   pcu_filename_expected( centroidsFilename, expectedCentroidsFilename );
+   pcu_check_fileEq( centroidsFilename, expectedCentroidsFilename );
+   remove( centroidsFilename );
+}
+
+
+void DVCWeightsSuite_TestDistanceSquared2D( DVCWeightsSuiteData* data ) {
+   double particleDistance;		
+   double particle0[2], particle1[2];
+   
+   particle0[0] = 0.5;	particle0[1] = 0.5;
+   particle1[0] = 0.25; particle1[1] = 0.25;
+
+   particleDistance = _DVCWeights_DistanceSquared2D(
+      particle0[0], particle0[1],
+      particle1[0], particle1[1] );
+   
+   pcu_check_true( particleDistance == 0.125 );
+}
+
+
+void DVCWeightsSuite( pcu_suite_t* suite ) {
+   pcu_suite_setData( suite, DVCWeightsSuiteData );
+   pcu_suite_setFixtures( suite, DVCWeightsSuite_Setup, DVCWeightsSuite_Teardown );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestConstructGrid );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestResetGrid );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestInitialiseStructs );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestCreateVoronoi );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestGetCentroids );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestDistanceSquared );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestConstructGrid2D );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestInitialiseStructs2D );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestResetGrid2D );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestCreateVoronoi2D );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestGetCentroids2D );
+   pcu_suite_addTest( suite, DVCWeightsSuite_TestDistanceSquared2D );
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/DVCWeightsSuite.h
--- a/Weights/tests/DVCWeightsSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef StGermain_DVCWeights_h
-#define StGermain_DVCWeights_h
-
-void DVCWeightsSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/DVCWeightsSuite.h.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/DVCWeightsSuite.h.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,6 @@
+#ifndef StGermain_DVCWeights_h
+#define StGermain_DVCWeights_h
+
+void DVCWeightsSuite( pcu_suite_t* suite );
+
+#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/DVCWeightsXMLSuite.c.disabled
--- a/Weights/tests/DVCWeightsXMLSuite.c.disabled	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/DVCWeightsXMLSuite.c.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -44,7 +44,6 @@
 
 typedef struct {
    DomainContext*       context;
-   Stg_ComponentFactory* cf;
 } DVCWeightsXMLSuiteData;
 
 
@@ -52,13 +51,12 @@ void DVCWeightsXMLSuite_Setup( DVCWeight
    char              xmlInputFilename[PCU_PATH_MAX];
 
    pcu_filename_input( "testDVCWeights.xml", xmlInputFilename );
-   data->cf = stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD, NULL );
-   data->context = LiveComponentRegister_Get( data->cf, "context" );
+   data->context = (DomainContext*)stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD );
 } 
 
 
 void DVCWeightsXMLSuite_Teardown( DVCWeightsXMLSuiteData* data ) {
-   stgMainDestroy( data->cf );
+   stgMainDestroy( (AbstractContext*)data->context );
 }
 
 
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/IterativeWeightsSuite.c
--- a/Weights/tests/IterativeWeightsSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include <PICellerator/PICellerator.h>
-
-#include "ConstantWeightsSuite.h"
-#include "IterativeWeightsSuite.h"
-
-typedef struct {
-   PICelleratorContext*       context;
-   Stg_ComponentFactory* cf;
-} IterativeWeightsSuiteData;
-
-
-void IterativeWeightsSuite_Setup( IterativeWeightsSuiteData* data ) {
-   char              xmlInputFilename[PCU_PATH_MAX];
-
-   pcu_filename_input( "testIterativeWeights.xml", xmlInputFilename );
-   data->cf = stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD, NULL );
-   data->context = (PICelleratorContext*)LiveComponentRegister_Get( data->cf->LCRegister, (Name)"context" );
-   stgMainBuildAndInitialise( data->cf );
-} 
-
-
-void IterativeWeightsSuite_Teardown( IterativeWeightsSuiteData* data ) {
-   stgMainDestroy( data->cf );
-}
-
-void IterativeWeightsSuite_TestConstantFunction( IterativeWeightsSuiteData* data  ) {
-   WeightsSuite_TestElementIntegral( data->context, "ConstantFunction", 1000,
-      1e-10, /* --mean-tolerance */
-      1e-10, /* --standardDeviation-tolerance */
-      0.0, /* --mean-expectedValue */
-      0.0 /* --standardDeviation-expectedValue */ );
-}
-void IterativeWeightsSuite_TestLinearFunction ( IterativeWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "LinearFunction", 1000,
-      1e-4, /* --mean-tolerance */
-      1e-4, /* --standardDeviation-tolerance */
-      0.0, /* --mean-expectedValue */
-      0.0 /* --standardDeviation-expectedValue */ );
-}
-void IterativeWeightsSuite_TestQuadraticFunction ( IterativeWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "QuadraticFunction", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.0430721, /* --mean-expectedValue */
-      0.0326016 /* --standardDeviation-expectedValue */ );
-}
-
-void IterativeWeightsSuite_TestPolynomialFunction( IterativeWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "PolynomialFunction", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.0175259, /* --mean-expectedValue */
-      0.013522 /* --standardDeviation-expectedValue */ );
-}
-
-void IterativeWeightsSuite_TestCircleInterface( IterativeWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "CircleInterface", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.10172, /* --mean-expectedValue */
-      0.070065 /* --standardDeviation-expectedValue */ );
-}
-
-void IterativeWeightsSuite_TestExponentialInterface( IterativeWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "ExponentialInterface", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.088927, /* --mean-expectedValue */
-      0.06681 /* --standardDeviation-expectedValue */ );
-}
-
-void IterativeWeightsSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, IterativeWeightsSuiteData );
-   pcu_suite_setFixtures( suite, IterativeWeightsSuite_Setup, IterativeWeightsSuite_Teardown );
-   pcu_suite_addTest( suite, IterativeWeightsSuite_TestConstantFunction );
-   pcu_suite_addTest( suite, IterativeWeightsSuite_TestLinearFunction );
-   pcu_suite_addTest( suite, IterativeWeightsSuite_TestQuadraticFunction );
-   pcu_suite_addTest( suite, IterativeWeightsSuite_TestPolynomialFunction );
-   pcu_suite_addTest( suite, IterativeWeightsSuite_TestCircleInterface );
-   pcu_suite_addTest( suite, IterativeWeightsSuite_TestExponentialInterface );
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/IterativeWeightsSuite.c.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/IterativeWeightsSuite.c.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,100 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "pcu/pcu.h"
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include "PICellerator/PopulationControl/PopulationControl.h"
+#include "PICellerator/Weights/Weights.h"
+
+#include "ConstantWeightsSuite.h"
+#include "IterativeWeightsSuite.h"
+
+typedef struct {
+   DomainContext*       context;
+} IterativeWeightsSuiteData;
+
+
+void IterativeWeightsSuite_Setup( IterativeWeightsSuiteData* data ) {
+   char              xmlInputFilename[PCU_PATH_MAX];
+
+   pcu_filename_input( "testIterativeWeights.xml", xmlInputFilename );
+   data->context = (DomainContext*)stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD );
+} 
+
+
+void IterativeWeightsSuite_Teardown( IterativeWeightsSuiteData* data ) {
+   stgMainDestroy( (AbstractContext*)data->context );
+}
+
+
+void IterativeWeightsSuite_TestElementIntegral_Circle( IterativeWeightsSuiteData* data ) {
+   WeightsSuite_TestElementIntegral( data->context, "CircleInterface", 1000,
+      0.000001, /* --mean-tolerance */
+      0.000001, /* --standardDeviation-tolerance */
+      0.10172, /* --mean-expectedValue */
+      0.070065 /* --standardDeviation-expectedValue */ );
+}
+
+
+void IterativeWeightsSuite_TestElementIntegral_Exponential( IterativeWeightsSuiteData* data ) {
+   WeightsSuite_TestElementIntegral( data->context, "ExponentialInterface", 1000,
+      0.000001, /* --mean-tolerance */
+      0.000001, /* --standardDeviation-tolerance */
+      0.088927, /* --mean-expectedValue */
+      0.06681 /* --standardDeviation-expectedValue */ );
+}
+
+
+void IterativeWeightsSuite_TestElementIntegral_Polynomial( IterativeWeightsSuiteData* data ) {
+   WeightsSuite_TestElementIntegral( data->context, "PolynomialFunction", 1000,
+      0.000001, /* --mean-tolerance */
+      0.000001, /* --standardDeviation-tolerance */
+      0.017526, /* --mean-expectedValue */
+      0.013522 /* --standardDeviation-expectedValue */ );
+}
+
+
+void IterativeWeightsSuite( pcu_suite_t* suite ) {
+   pcu_suite_setData( suite, IterativeWeightsSuiteData );
+   pcu_suite_setFixtures( suite, IterativeWeightsSuite_Setup, IterativeWeightsSuite_Teardown );
+   pcu_suite_addTest( suite, IterativeWeightsSuite_TestElementIntegral_Circle );
+/* TEMPORARILY disable multiple tests until Toolbox/Context issue sorted out (See tickets #70,#71
+ in StGermain trac) -- PatrickSunter, 19 Aug 2009 */
+#if 0
+   pcu_suite_addTest( suite, IterativeWeightsSuite_TestElementIntegral_Exponential );
+   pcu_suite_addTest( suite, IterativeWeightsSuite_TestElementIntegral_Polynomial );
+#endif
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/IterativeWeightsSuite.h
--- a/Weights/tests/IterativeWeightsSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef StGermain_IterativeWeights_h
-#define StGermain_IterativeWeights_h
-
-void IterativeWeightsSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/IterativeWeightsSuite.h.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/IterativeWeightsSuite.h.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,6 @@
+#ifndef StGermain_IterativeWeights_h
+#define StGermain_IterativeWeights_h
+
+void IterativeWeightsSuite( pcu_suite_t* suite );
+
+#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/MomentBalanceWeightsSuite.c
--- a/Weights/tests/MomentBalanceWeightsSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-**
-** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
-**
-** Authors:
-**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
-**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
-**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
-**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
-**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
-**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
-**
-**  This library is free software; you can redistribute it and/or
-**  modify it under the terms of the GNU Lesser General Public
-**  License as published by the Free Software Foundation; either
-**  version 2.1 of the License, or (at your option) any later version.
-**
-**  This library is distributed in the hope that it will be useful,
-**  but WITHOUT ANY WARRANTY; without even the implied warranty of
-**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-**  Lesser General Public License for more details.
-**
-**  You should have received a copy of the GNU Lesser General Public
-**  License along with this library; if not, write to the Free Software
-**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-**
-** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
-**
-**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include <StgDomain/StgDomain.h>
-#include <StgFEM/StgFEM.h>
-#include <PICellerator/PICellerator.h>
-
-#include "ConstantWeightsSuite.h"
-#include "MomentBalanceWeightsSuite.h"
-
-typedef struct {
-   PICelleratorContext*		context;
-   Stg_ComponentFactory*	cf;
-} MomentBalanceWeightsSuiteData;
-
-void MomentBalanceWeightsSuite_Setup( MomentBalanceWeightsSuiteData* data ) {
-   char xmlInputFilename[PCU_PATH_MAX];
-
-   pcu_filename_input( "testMomentBalanceWeights.xml", xmlInputFilename );
-   data->cf = stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD, NULL );
-   data->context = (PICelleratorContext*) LiveComponentRegister_Get( data->cf->LCRegister, (Name)"context" );
-   stgMainBuildAndInitialise( data->cf );
-} 
-
-void MomentBalanceWeightsSuite_Teardown( MomentBalanceWeightsSuiteData* data ) {
-   stgMainDestroy( data->cf );
-}
-
-void MomentBalanceWeightsSuite_TestConstantFunction( MomentBalanceWeightsSuiteData* data  ) {
-   WeightsSuite_TestElementIntegral( data->context, "ConstantFunction", 1000,
-      1e-10, /* --mean-tolerance */
-      1e-10, /* --standardDeviation-tolerance */
-      0.0, /* --mean-expectedValue */
-      0.0 /* --standardDeviation-expectedValue */ );
-}
-void MomentBalanceWeightsSuite_TestLinearFunction ( MomentBalanceWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "LinearFunction", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.00363688, /* --mean-expectedValue */
-      0.029866 /* --standardDeviation-expectedValue */ );
-}
-void MomentBalanceWeightsSuite_TestQuadraticFunction ( MomentBalanceWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "QuadraticFunction", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.0446896, /* --mean-expectedValue */
-      0.0351938 /* --standardDeviation-expectedValue */ );
-}
-
-void MomentBalanceWeightsSuite_TestPolynomialFunction( MomentBalanceWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "PolynomialFunction", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.0166968, /* --mean-expectedValue */
-      0.0130415 /* --standardDeviation-expectedValue */ );
-}
-
-void MomentBalanceWeightsSuite_TestCircleInterface( MomentBalanceWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "CircleInterface", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.0978135, /* --mean-expectedValue */
-      0.0686067 /* --standardDeviation-expectedValue */ );
-}
-
-void MomentBalanceWeightsSuite_TestExponentialInterface( MomentBalanceWeightsSuiteData* data ) {
-   WeightsSuite_TestElementIntegral( data->context, "ExponentialInterface", 1000,
-      0.000001, /* --mean-tolerance */
-      0.000001, /* --standardDeviation-tolerance */
-      0.0946707, /* --mean-expectedValue */
-      0.0752869 /* --standardDeviation-expectedValue */ );
-}
-
-void MomentBalanceWeightsSuite( pcu_suite_t* suite ) {
-   pcu_suite_setData( suite, MomentBalanceWeightsSuiteData );
-   pcu_suite_setFixtures( suite, MomentBalanceWeightsSuite_Setup, MomentBalanceWeightsSuite_Teardown );
-   pcu_suite_addTest( suite, MomentBalanceWeightsSuite_TestConstantFunction );
-   pcu_suite_addTest( suite, MomentBalanceWeightsSuite_TestLinearFunction );
-   pcu_suite_addTest( suite, MomentBalanceWeightsSuite_TestQuadraticFunction );
-   pcu_suite_addTest( suite, MomentBalanceWeightsSuite_TestPolynomialFunction );
-   pcu_suite_addTest( suite, MomentBalanceWeightsSuite_TestCircleInterface );
-   pcu_suite_addTest( suite, MomentBalanceWeightsSuite_TestExponentialInterface );
-}
-
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/MomentBalanceWeightsSuite.c.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/MomentBalanceWeightsSuite.c.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,100 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**   Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**   Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**   Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**   Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**   Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**   Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testList.c 2136 2004-09-30 02:47:13Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "pcu/pcu.h"
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include "PICellerator/PopulationControl/PopulationControl.h"
+#include "PICellerator/Weights/Weights.h"
+
+#include "ConstantWeightsSuite.h"
+#include "MomentBalanceWeightsSuite.h"
+
+typedef struct {
+   DomainContext*       context;
+} MomentBalanceWeightsSuiteData;
+
+
+void MomentBalanceWeightsSuite_Setup( MomentBalanceWeightsSuiteData* data ) {
+   char              xmlInputFilename[PCU_PATH_MAX];
+
+   pcu_filename_input( "testMomentBalanceWeights.xml", xmlInputFilename );
+   data->context = (DomainContext*)stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD );
+} 
+
+
+void MomentBalanceWeightsSuite_Teardown( MomentBalanceWeightsSuiteData* data ) {
+   stgMainDestroy( (AbstractContext*)data->context );
+}
+
+
+void MomentBalanceWeightsSuite_TestElementIntegral_Circle( MomentBalanceWeightsSuiteData* data ) {
+   WeightsSuite_TestElementIntegral( data->context, "CircleInterface", 1000,
+      0.000001, /* --mean-tolerance */
+      0.000001, /* --standardDeviation-tolerance */
+      0.097814, /* --mean-expectedValue */
+      0.068607 /* --standardDeviation-expectedValue */ );
+}
+
+
+void MomentBalanceWeightsSuite_TestElementIntegral_Exponential( MomentBalanceWeightsSuiteData* data ) {
+   WeightsSuite_TestElementIntegral( data->context, "ExponentialInterface", 1000,
+      0.000001, /* --mean-tolerance */
+      0.000001, /* --standardDeviation-tolerance */
+      0.094671, /* --mean-expectedValue */
+      0.075287 /* --standardDeviation-expectedValue */ );
+}
+
+
+void MomentBalanceWeightsSuite_TestElementIntegral_Polynomial( MomentBalanceWeightsSuiteData* data ) {
+   WeightsSuite_TestElementIntegral( data->context, "PolynomialFunction", 1000,
+      0.000001, /* --mean-tolerance */
+      0.000001, /* --standardDeviation-tolerance */
+      0.016697, /* --mean-expectedValue */
+      0.013041 /* --standardDeviation-expectedValue */ );
+}
+
+
+void MomentBalanceWeightsSuite( pcu_suite_t* suite ) {
+   pcu_suite_setData( suite, MomentBalanceWeightsSuiteData );
+   pcu_suite_setFixtures( suite, MomentBalanceWeightsSuite_Setup, MomentBalanceWeightsSuite_Teardown );
+   pcu_suite_addTest( suite, MomentBalanceWeightsSuite_TestElementIntegral_Circle );
+/* TEMPORARILY disable multiple tests until Toolbox/Context issue sorted out (See tickets #70,#71
+ in StGermain trac) -- PatrickSunter, 19 Aug 2009 */
+#if 0
+   pcu_suite_addTest( suite, MomentBalanceWeightsSuite_TestElementIntegral_Exponential );
+   pcu_suite_addTest( suite, MomentBalanceWeightsSuite_TestElementIntegral_Polynomial );
+#endif
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/MomentBalanceWeightsSuite.h
--- a/Weights/tests/MomentBalanceWeightsSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef PICellerator_MomentBalanceWeights_h
-#define PICellerator_MomentBalanceWeights_h
-
-void MomentBalanceWeightsSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/MomentBalanceWeightsSuite.h.disabled
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/MomentBalanceWeightsSuite.h.disabled	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,6 @@
+#ifndef StGermain_MomentBalanceWeights_h
+#define StGermain_MomentBalanceWeights_h
+
+void MomentBalanceWeightsSuite( pcu_suite_t* suite );
+
+#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/expected/DVCWeightsSuite_testConstructGrid.txt
--- a/Weights/tests/expected/DVCWeightsSuite_testConstructGrid.txt	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/expected/DVCWeightsSuite_testConstructGrid.txt	Tue Feb 02 16:55:08 2010 +1100
@@ -1,3000 +1,24 @@ cell[0]
 cell[0]
- 		Values: (N: 10, S: -2, E: 1, W: -2, U: 100, D: -2) 
- 		Coords: (-0.900000, -0.900000,-0.900000) 
+ 		Values: (N: 2, S: -2, E: 1, W: -2, U: 4, D: -2) 
+ 		Coords: (-0.500000, -0.500000,-0.500000) 
 cell[1]
- 		Values: (N: 11, S: -2, E: 2, W: 0, U: 101, D: -2) 
- 		Coords: (-0.700000, -0.900000,-0.900000) 
+ 		Values: (N: 3, S: -2, E: -2, W: 0, U: 5, D: -2) 
+ 		Coords: (0.500000, -0.500000,-0.500000) 
 cell[2]
- 		Values: (N: 12, S: -2, E: 3, W: 1, U: 102, D: -2) 
- 		Coords: (-0.500000, -0.900000,-0.900000) 
+ 		Values: (N: -2, S: 0, E: 3, W: -2, U: 6, D: -2) 
+ 		Coords: (-0.500000, 0.500000,-0.500000) 
 cell[3]
- 		Values: (N: 13, S: -2, E: 4, W: 2, U: 103, D: -2) 
- 		Coords: (-0.300000, -0.900000,-0.900000) 
+ 		Values: (N: -2, S: 1, E: -2, W: 2, U: 7, D: -2) 
+ 		Coords: (0.500000, 0.500000,-0.500000) 
 cell[4]
- 		Values: (N: 14, S: -2, E: 5, W: 3, U: 104, D: -2) 
- 		Coords: (-0.100000, -0.900000,-0.900000) 
+ 		Values: (N: 6, S: -2, E: 5, W: -2, U: -2, D: 0) 
+ 		Coords: (-0.500000, -0.500000,0.500000) 
 cell[5]
- 		Values: (N: 15, S: -2, E: 6, W: 4, U: 105, D: -2) 
- 		Coords: (0.100000, -0.900000,-0.900000) 
+ 		Values: (N: 7, S: -2, E: -2, W: 4, U: -2, D: 1) 
+ 		Coords: (0.500000, -0.500000,0.500000) 
 cell[6]
- 		Values: (N: 16, S: -2, E: 7, W: 5, U: 106, D: -2) 
- 		Coords: (0.300000, -0.900000,-0.900000) 
+ 		Values: (N: -2, S: 4, E: 7, W: -2, U: -2, D: 2) 
+ 		Coords: (-0.500000, 0.500000,0.500000) 
 cell[7]
- 		Values: (N: 17, S: -2, E: 8, W: 6, U: 107, D: -2) 
- 		Coords: (0.500000, -0.900000,-0.900000) 
-cell[8]
- 		Values: (N: 18, S: -2, E: 9, W: 7, U: 108, D: -2) 
- 		Coords: (0.700000, -0.900000,-0.900000) 
-cell[9]
- 		Values: (N: 19, S: -2, E: -2, W: 8, U: 109, D: -2) 
- 		Coords: (0.900000, -0.900000,-0.900000) 
-cell[10]
- 		Values: (N: 20, S: 0, E: 11, W: -2, U: 110, D: -2) 
- 		Coords: (-0.900000, -0.700000,-0.900000) 
-cell[11]
- 		Values: (N: 21, S: 1, E: 12, W: 10, U: 111, D: -2) 
- 		Coords: (-0.700000, -0.700000,-0.900000) 
-cell[12]
- 		Values: (N: 22, S: 2, E: 13, W: 11, U: 112, D: -2) 
- 		Coords: (-0.500000, -0.700000,-0.900000) 
-cell[13]
- 		Values: (N: 23, S: 3, E: 14, W: 12, U: 113, D: -2) 
- 		Coords: (-0.300000, -0.700000,-0.900000) 
-cell[14]
- 		Values: (N: 24, S: 4, E: 15, W: 13, U: 114, D: -2) 
- 		Coords: (-0.100000, -0.700000,-0.900000) 
-cell[15]
- 		Values: (N: 25, S: 5, E: 16, W: 14, U: 115, D: -2) 
- 		Coords: (0.100000, -0.700000,-0.900000) 
-cell[16]
- 		Values: (N: 26, S: 6, E: 17, W: 15, U: 116, D: -2) 
- 		Coords: (0.300000, -0.700000,-0.900000) 
-cell[17]
- 		Values: (N: 27, S: 7, E: 18, W: 16, U: 117, D: -2) 
- 		Coords: (0.500000, -0.700000,-0.900000) 
-cell[18]
- 		Values: (N: 28, S: 8, E: 19, W: 17, U: 118, D: -2) 
- 		Coords: (0.700000, -0.700000,-0.900000) 
-cell[19]
- 		Values: (N: 29, S: 9, E: -2, W: 18, U: 119, D: -2) 
- 		Coords: (0.900000, -0.700000,-0.900000) 
-cell[20]
- 		Values: (N: 30, S: 10, E: 21, W: -2, U: 120, D: -2) 
- 		Coords: (-0.900000, -0.500000,-0.900000) 
-cell[21]
- 		Values: (N: 31, S: 11, E: 22, W: 20, U: 121, D: -2) 
- 		Coords: (-0.700000, -0.500000,-0.900000) 
-cell[22]
- 		Values: (N: 32, S: 12, E: 23, W: 21, U: 122, D: -2) 
- 		Coords: (-0.500000, -0.500000,-0.900000) 
-cell[23]
- 		Values: (N: 33, S: 13, E: 24, W: 22, U: 123, D: -2) 
- 		Coords: (-0.300000, -0.500000,-0.900000) 
-cell[24]
- 		Values: (N: 34, S: 14, E: 25, W: 23, U: 124, D: -2) 
- 		Coords: (-0.100000, -0.500000,-0.900000) 
-cell[25]
- 		Values: (N: 35, S: 15, E: 26, W: 24, U: 125, D: -2) 
- 		Coords: (0.100000, -0.500000,-0.900000) 
-cell[26]
- 		Values: (N: 36, S: 16, E: 27, W: 25, U: 126, D: -2) 
- 		Coords: (0.300000, -0.500000,-0.900000) 
-cell[27]
- 		Values: (N: 37, S: 17, E: 28, W: 26, U: 127, D: -2) 
- 		Coords: (0.500000, -0.500000,-0.900000) 
-cell[28]
- 		Values: (N: 38, S: 18, E: 29, W: 27, U: 128, D: -2) 
- 		Coords: (0.700000, -0.500000,-0.900000) 
-cell[29]
- 		Values: (N: 39, S: 19, E: -2, W: 28, U: 129, D: -2) 
- 		Coords: (0.900000, -0.500000,-0.900000) 
-cell[30]
- 		Values: (N: 40, S: 20, E: 31, W: -2, U: 130, D: -2) 
- 		Coords: (-0.900000, -0.300000,-0.900000) 
-cell[31]
- 		Values: (N: 41, S: 21, E: 32, W: 30, U: 131, D: -2) 
- 		Coords: (-0.700000, -0.300000,-0.900000) 
-cell[32]
- 		Values: (N: 42, S: 22, E: 33, W: 31, U: 132, D: -2) 
- 		Coords: (-0.500000, -0.300000,-0.900000) 
-cell[33]
- 		Values: (N: 43, S: 23, E: 34, W: 32, U: 133, D: -2) 
- 		Coords: (-0.300000, -0.300000,-0.900000) 
-cell[34]
- 		Values: (N: 44, S: 24, E: 35, W: 33, U: 134, D: -2) 
- 		Coords: (-0.100000, -0.300000,-0.900000) 
-cell[35]
- 		Values: (N: 45, S: 25, E: 36, W: 34, U: 135, D: -2) 
- 		Coords: (0.100000, -0.300000,-0.900000) 
-cell[36]
- 		Values: (N: 46, S: 26, E: 37, W: 35, U: 136, D: -2) 
- 		Coords: (0.300000, -0.300000,-0.900000) 
-cell[37]
- 		Values: (N: 47, S: 27, E: 38, W: 36, U: 137, D: -2) 
- 		Coords: (0.500000, -0.300000,-0.900000) 
-cell[38]
- 		Values: (N: 48, S: 28, E: 39, W: 37, U: 138, D: -2) 
- 		Coords: (0.700000, -0.300000,-0.900000) 
-cell[39]
- 		Values: (N: 49, S: 29, E: -2, W: 38, U: 139, D: -2) 
- 		Coords: (0.900000, -0.300000,-0.900000) 
-cell[40]
- 		Values: (N: 50, S: 30, E: 41, W: -2, U: 140, D: -2) 
- 		Coords: (-0.900000, -0.100000,-0.900000) 
-cell[41]
- 		Values: (N: 51, S: 31, E: 42, W: 40, U: 141, D: -2) 
- 		Coords: (-0.700000, -0.100000,-0.900000) 
-cell[42]
- 		Values: (N: 52, S: 32, E: 43, W: 41, U: 142, D: -2) 
- 		Coords: (-0.500000, -0.100000,-0.900000) 
-cell[43]
- 		Values: (N: 53, S: 33, E: 44, W: 42, U: 143, D: -2) 
- 		Coords: (-0.300000, -0.100000,-0.900000) 
-cell[44]
- 		Values: (N: 54, S: 34, E: 45, W: 43, U: 144, D: -2) 
- 		Coords: (-0.100000, -0.100000,-0.900000) 
-cell[45]
- 		Values: (N: 55, S: 35, E: 46, W: 44, U: 145, D: -2) 
- 		Coords: (0.100000, -0.100000,-0.900000) 
-cell[46]
- 		Values: (N: 56, S: 36, E: 47, W: 45, U: 146, D: -2) 
- 		Coords: (0.300000, -0.100000,-0.900000) 
-cell[47]
- 		Values: (N: 57, S: 37, E: 48, W: 46, U: 147, D: -2) 
- 		Coords: (0.500000, -0.100000,-0.900000) 
-cell[48]
- 		Values: (N: 58, S: 38, E: 49, W: 47, U: 148, D: -2) 
- 		Coords: (0.700000, -0.100000,-0.900000) 
-cell[49]
- 		Values: (N: 59, S: 39, E: -2, W: 48, U: 149, D: -2) 
- 		Coords: (0.900000, -0.100000,-0.900000) 
-cell[50]
- 		Values: (N: 60, S: 40, E: 51, W: -2, U: 150, D: -2) 
- 		Coords: (-0.900000, 0.100000,-0.900000) 
-cell[51]
- 		Values: (N: 61, S: 41, E: 52, W: 50, U: 151, D: -2) 
- 		Coords: (-0.700000, 0.100000,-0.900000) 
-cell[52]
- 		Values: (N: 62, S: 42, E: 53, W: 51, U: 152, D: -2) 
- 		Coords: (-0.500000, 0.100000,-0.900000) 
-cell[53]
- 		Values: (N: 63, S: 43, E: 54, W: 52, U: 153, D: -2) 
- 		Coords: (-0.300000, 0.100000,-0.900000) 
-cell[54]
- 		Values: (N: 64, S: 44, E: 55, W: 53, U: 154, D: -2) 
- 		Coords: (-0.100000, 0.100000,-0.900000) 
-cell[55]
- 		Values: (N: 65, S: 45, E: 56, W: 54, U: 155, D: -2) 
- 		Coords: (0.100000, 0.100000,-0.900000) 
-cell[56]
- 		Values: (N: 66, S: 46, E: 57, W: 55, U: 156, D: -2) 
- 		Coords: (0.300000, 0.100000,-0.900000) 
-cell[57]
- 		Values: (N: 67, S: 47, E: 58, W: 56, U: 157, D: -2) 
- 		Coords: (0.500000, 0.100000,-0.900000) 
-cell[58]
- 		Values: (N: 68, S: 48, E: 59, W: 57, U: 158, D: -2) 
- 		Coords: (0.700000, 0.100000,-0.900000) 
-cell[59]
- 		Values: (N: 69, S: 49, E: -2, W: 58, U: 159, D: -2) 
- 		Coords: (0.900000, 0.100000,-0.900000) 
-cell[60]
- 		Values: (N: 70, S: 50, E: 61, W: -2, U: 160, D: -2) 
- 		Coords: (-0.900000, 0.300000,-0.900000) 
-cell[61]
- 		Values: (N: 71, S: 51, E: 62, W: 60, U: 161, D: -2) 
- 		Coords: (-0.700000, 0.300000,-0.900000) 
-cell[62]
- 		Values: (N: 72, S: 52, E: 63, W: 61, U: 162, D: -2) 
- 		Coords: (-0.500000, 0.300000,-0.900000) 
-cell[63]
- 		Values: (N: 73, S: 53, E: 64, W: 62, U: 163, D: -2) 
- 		Coords: (-0.300000, 0.300000,-0.900000) 
-cell[64]
- 		Values: (N: 74, S: 54, E: 65, W: 63, U: 164, D: -2) 
- 		Coords: (-0.100000, 0.300000,-0.900000) 
-cell[65]
- 		Values: (N: 75, S: 55, E: 66, W: 64, U: 165, D: -2) 
- 		Coords: (0.100000, 0.300000,-0.900000) 
-cell[66]
- 		Values: (N: 76, S: 56, E: 67, W: 65, U: 166, D: -2) 
- 		Coords: (0.300000, 0.300000,-0.900000) 
-cell[67]
- 		Values: (N: 77, S: 57, E: 68, W: 66, U: 167, D: -2) 
- 		Coords: (0.500000, 0.300000,-0.900000) 
-cell[68]
- 		Values: (N: 78, S: 58, E: 69, W: 67, U: 168, D: -2) 
- 		Coords: (0.700000, 0.300000,-0.900000) 
-cell[69]
- 		Values: (N: 79, S: 59, E: -2, W: 68, U: 169, D: -2) 
- 		Coords: (0.900000, 0.300000,-0.900000) 
-cell[70]
- 		Values: (N: 80, S: 60, E: 71, W: -2, U: 170, D: -2) 
- 		Coords: (-0.900000, 0.500000,-0.900000) 
-cell[71]
- 		Values: (N: 81, S: 61, E: 72, W: 70, U: 171, D: -2) 
- 		Coords: (-0.700000, 0.500000,-0.900000) 
-cell[72]
- 		Values: (N: 82, S: 62, E: 73, W: 71, U: 172, D: -2) 
- 		Coords: (-0.500000, 0.500000,-0.900000) 
-cell[73]
- 		Values: (N: 83, S: 63, E: 74, W: 72, U: 173, D: -2) 
- 		Coords: (-0.300000, 0.500000,-0.900000) 
-cell[74]
- 		Values: (N: 84, S: 64, E: 75, W: 73, U: 174, D: -2) 
- 		Coords: (-0.100000, 0.500000,-0.900000) 
-cell[75]
- 		Values: (N: 85, S: 65, E: 76, W: 74, U: 175, D: -2) 
- 		Coords: (0.100000, 0.500000,-0.900000) 
-cell[76]
- 		Values: (N: 86, S: 66, E: 77, W: 75, U: 176, D: -2) 
- 		Coords: (0.300000, 0.500000,-0.900000) 
-cell[77]
- 		Values: (N: 87, S: 67, E: 78, W: 76, U: 177, D: -2) 
- 		Coords: (0.500000, 0.500000,-0.900000) 
-cell[78]
- 		Values: (N: 88, S: 68, E: 79, W: 77, U: 178, D: -2) 
- 		Coords: (0.700000, 0.500000,-0.900000) 
-cell[79]
- 		Values: (N: 89, S: 69, E: -2, W: 78, U: 179, D: -2) 
- 		Coords: (0.900000, 0.500000,-0.900000) 
-cell[80]
- 		Values: (N: 90, S: 70, E: 81, W: -2, U: 180, D: -2) 
- 		Coords: (-0.900000, 0.700000,-0.900000) 
-cell[81]
- 		Values: (N: 91, S: 71, E: 82, W: 80, U: 181, D: -2) 
- 		Coords: (-0.700000, 0.700000,-0.900000) 
-cell[82]
- 		Values: (N: 92, S: 72, E: 83, W: 81, U: 182, D: -2) 
- 		Coords: (-0.500000, 0.700000,-0.900000) 
-cell[83]
- 		Values: (N: 93, S: 73, E: 84, W: 82, U: 183, D: -2) 
- 		Coords: (-0.300000, 0.700000,-0.900000) 
-cell[84]
- 		Values: (N: 94, S: 74, E: 85, W: 83, U: 184, D: -2) 
- 		Coords: (-0.100000, 0.700000,-0.900000) 
-cell[85]
- 		Values: (N: 95, S: 75, E: 86, W: 84, U: 185, D: -2) 
- 		Coords: (0.100000, 0.700000,-0.900000) 
-cell[86]
- 		Values: (N: 96, S: 76, E: 87, W: 85, U: 186, D: -2) 
- 		Coords: (0.300000, 0.700000,-0.900000) 
-cell[87]
- 		Values: (N: 97, S: 77, E: 88, W: 86, U: 187, D: -2) 
- 		Coords: (0.500000, 0.700000,-0.900000) 
-cell[88]
- 		Values: (N: 98, S: 78, E: 89, W: 87, U: 188, D: -2) 
- 		Coords: (0.700000, 0.700000,-0.900000) 
-cell[89]
- 		Values: (N: 99, S: 79, E: -2, W: 88, U: 189, D: -2) 
- 		Coords: (0.900000, 0.700000,-0.900000) 
-cell[90]
- 		Values: (N: -2, S: 80, E: 91, W: -2, U: 190, D: -2) 
- 		Coords: (-0.900000, 0.900000,-0.900000) 
-cell[91]
- 		Values: (N: -2, S: 81, E: 92, W: 90, U: 191, D: -2) 
- 		Coords: (-0.700000, 0.900000,-0.900000) 
-cell[92]
- 		Values: (N: -2, S: 82, E: 93, W: 91, U: 192, D: -2) 
- 		Coords: (-0.500000, 0.900000,-0.900000) 
-cell[93]
- 		Values: (N: -2, S: 83, E: 94, W: 92, U: 193, D: -2) 
- 		Coords: (-0.300000, 0.900000,-0.900000) 
-cell[94]
- 		Values: (N: -2, S: 84, E: 95, W: 93, U: 194, D: -2) 
- 		Coords: (-0.100000, 0.900000,-0.900000) 
-cell[95]
- 		Values: (N: -2, S: 85, E: 96, W: 94, U: 195, D: -2) 
- 		Coords: (0.100000, 0.900000,-0.900000) 
-cell[96]
- 		Values: (N: -2, S: 86, E: 97, W: 95, U: 196, D: -2) 
- 		Coords: (0.300000, 0.900000,-0.900000) 
-cell[97]
- 		Values: (N: -2, S: 87, E: 98, W: 96, U: 197, D: -2) 
- 		Coords: (0.500000, 0.900000,-0.900000) 
-cell[98]
- 		Values: (N: -2, S: 88, E: 99, W: 97, U: 198, D: -2) 
- 		Coords: (0.700000, 0.900000,-0.900000) 
-cell[99]
- 		Values: (N: -2, S: 89, E: -2, W: 98, U: 199, D: -2) 
- 		Coords: (0.900000, 0.900000,-0.900000) 
-cell[100]
- 		Values: (N: 110, S: -2, E: 101, W: -2, U: 200, D: 0) 
- 		Coords: (-0.900000, -0.900000,-0.700000) 
-cell[101]
- 		Values: (N: 111, S: -2, E: 102, W: 100, U: 201, D: 1) 
- 		Coords: (-0.700000, -0.900000,-0.700000) 
-cell[102]
- 		Values: (N: 112, S: -2, E: 103, W: 101, U: 202, D: 2) 
- 		Coords: (-0.500000, -0.900000,-0.700000) 
-cell[103]
- 		Values: (N: 113, S: -2, E: 104, W: 102, U: 203, D: 3) 
- 		Coords: (-0.300000, -0.900000,-0.700000) 
-cell[104]
- 		Values: (N: 114, S: -2, E: 105, W: 103, U: 204, D: 4) 
- 		Coords: (-0.100000, -0.900000,-0.700000) 
-cell[105]
- 		Values: (N: 115, S: -2, E: 106, W: 104, U: 205, D: 5) 
- 		Coords: (0.100000, -0.900000,-0.700000) 
-cell[106]
- 		Values: (N: 116, S: -2, E: 107, W: 105, U: 206, D: 6) 
- 		Coords: (0.300000, -0.900000,-0.700000) 
-cell[107]
- 		Values: (N: 117, S: -2, E: 108, W: 106, U: 207, D: 7) 
- 		Coords: (0.500000, -0.900000,-0.700000) 
-cell[108]
- 		Values: (N: 118, S: -2, E: 109, W: 107, U: 208, D: 8) 
- 		Coords: (0.700000, -0.900000,-0.700000) 
-cell[109]
- 		Values: (N: 119, S: -2, E: -2, W: 108, U: 209, D: 9) 
- 		Coords: (0.900000, -0.900000,-0.700000) 
-cell[110]
- 		Values: (N: 120, S: 100, E: 111, W: -2, U: 210, D: 10) 
- 		Coords: (-0.900000, -0.700000,-0.700000) 
-cell[111]
- 		Values: (N: 121, S: 101, E: 112, W: 110, U: 211, D: 11) 
- 		Coords: (-0.700000, -0.700000,-0.700000) 
-cell[112]
- 		Values: (N: 122, S: 102, E: 113, W: 111, U: 212, D: 12) 
- 		Coords: (-0.500000, -0.700000,-0.700000) 
-cell[113]
- 		Values: (N: 123, S: 103, E: 114, W: 112, U: 213, D: 13) 
- 		Coords: (-0.300000, -0.700000,-0.700000) 
-cell[114]
- 		Values: (N: 124, S: 104, E: 115, W: 113, U: 214, D: 14) 
- 		Coords: (-0.100000, -0.700000,-0.700000) 
-cell[115]
- 		Values: (N: 125, S: 105, E: 116, W: 114, U: 215, D: 15) 
- 		Coords: (0.100000, -0.700000,-0.700000) 
-cell[116]
- 		Values: (N: 126, S: 106, E: 117, W: 115, U: 216, D: 16) 
- 		Coords: (0.300000, -0.700000,-0.700000) 
-cell[117]
- 		Values: (N: 127, S: 107, E: 118, W: 116, U: 217, D: 17) 
- 		Coords: (0.500000, -0.700000,-0.700000) 
-cell[118]
- 		Values: (N: 128, S: 108, E: 119, W: 117, U: 218, D: 18) 
- 		Coords: (0.700000, -0.700000,-0.700000) 
-cell[119]
- 		Values: (N: 129, S: 109, E: -2, W: 118, U: 219, D: 19) 
- 		Coords: (0.900000, -0.700000,-0.700000) 
-cell[120]
- 		Values: (N: 130, S: 110, E: 121, W: -2, U: 220, D: 20) 
- 		Coords: (-0.900000, -0.500000,-0.700000) 
-cell[121]
- 		Values: (N: 131, S: 111, E: 122, W: 120, U: 221, D: 21) 
- 		Coords: (-0.700000, -0.500000,-0.700000) 
-cell[122]
- 		Values: (N: 132, S: 112, E: 123, W: 121, U: 222, D: 22) 
- 		Coords: (-0.500000, -0.500000,-0.700000) 
-cell[123]
- 		Values: (N: 133, S: 113, E: 124, W: 122, U: 223, D: 23) 
- 		Coords: (-0.300000, -0.500000,-0.700000) 
-cell[124]
- 		Values: (N: 134, S: 114, E: 125, W: 123, U: 224, D: 24) 
- 		Coords: (-0.100000, -0.500000,-0.700000) 
-cell[125]
- 		Values: (N: 135, S: 115, E: 126, W: 124, U: 225, D: 25) 
- 		Coords: (0.100000, -0.500000,-0.700000) 
-cell[126]
- 		Values: (N: 136, S: 116, E: 127, W: 125, U: 226, D: 26) 
- 		Coords: (0.300000, -0.500000,-0.700000) 
-cell[127]
- 		Values: (N: 137, S: 117, E: 128, W: 126, U: 227, D: 27) 
- 		Coords: (0.500000, -0.500000,-0.700000) 
-cell[128]
- 		Values: (N: 138, S: 118, E: 129, W: 127, U: 228, D: 28) 
- 		Coords: (0.700000, -0.500000,-0.700000) 
-cell[129]
- 		Values: (N: 139, S: 119, E: -2, W: 128, U: 229, D: 29) 
- 		Coords: (0.900000, -0.500000,-0.700000) 
-cell[130]
- 		Values: (N: 140, S: 120, E: 131, W: -2, U: 230, D: 30) 
- 		Coords: (-0.900000, -0.300000,-0.700000) 
-cell[131]
- 		Values: (N: 141, S: 121, E: 132, W: 130, U: 231, D: 31) 
- 		Coords: (-0.700000, -0.300000,-0.700000) 
-cell[132]
- 		Values: (N: 142, S: 122, E: 133, W: 131, U: 232, D: 32) 
- 		Coords: (-0.500000, -0.300000,-0.700000) 
-cell[133]
- 		Values: (N: 143, S: 123, E: 134, W: 132, U: 233, D: 33) 
- 		Coords: (-0.300000, -0.300000,-0.700000) 
-cell[134]
- 		Values: (N: 144, S: 124, E: 135, W: 133, U: 234, D: 34) 
- 		Coords: (-0.100000, -0.300000,-0.700000) 
-cell[135]
- 		Values: (N: 145, S: 125, E: 136, W: 134, U: 235, D: 35) 
- 		Coords: (0.100000, -0.300000,-0.700000) 
-cell[136]
- 		Values: (N: 146, S: 126, E: 137, W: 135, U: 236, D: 36) 
- 		Coords: (0.300000, -0.300000,-0.700000) 
-cell[137]
- 		Values: (N: 147, S: 127, E: 138, W: 136, U: 237, D: 37) 
- 		Coords: (0.500000, -0.300000,-0.700000) 
-cell[138]
- 		Values: (N: 148, S: 128, E: 139, W: 137, U: 238, D: 38) 
- 		Coords: (0.700000, -0.300000,-0.700000) 
-cell[139]
- 		Values: (N: 149, S: 129, E: -2, W: 138, U: 239, D: 39) 
- 		Coords: (0.900000, -0.300000,-0.700000) 
-cell[140]
- 		Values: (N: 150, S: 130, E: 141, W: -2, U: 240, D: 40) 
- 		Coords: (-0.900000, -0.100000,-0.700000) 
-cell[141]
- 		Values: (N: 151, S: 131, E: 142, W: 140, U: 241, D: 41) 
- 		Coords: (-0.700000, -0.100000,-0.700000) 
-cell[142]
- 		Values: (N: 152, S: 132, E: 143, W: 141, U: 242, D: 42) 
- 		Coords: (-0.500000, -0.100000,-0.700000) 
-cell[143]
- 		Values: (N: 153, S: 133, E: 144, W: 142, U: 243, D: 43) 
- 		Coords: (-0.300000, -0.100000,-0.700000) 
-cell[144]
- 		Values: (N: 154, S: 134, E: 145, W: 143, U: 244, D: 44) 
- 		Coords: (-0.100000, -0.100000,-0.700000) 
-cell[145]
- 		Values: (N: 155, S: 135, E: 146, W: 144, U: 245, D: 45) 
- 		Coords: (0.100000, -0.100000,-0.700000) 
-cell[146]
- 		Values: (N: 156, S: 136, E: 147, W: 145, U: 246, D: 46) 
- 		Coords: (0.300000, -0.100000,-0.700000) 
-cell[147]
- 		Values: (N: 157, S: 137, E: 148, W: 146, U: 247, D: 47) 
- 		Coords: (0.500000, -0.100000,-0.700000) 
-cell[148]
- 		Values: (N: 158, S: 138, E: 149, W: 147, U: 248, D: 48) 
- 		Coords: (0.700000, -0.100000,-0.700000) 
-cell[149]
- 		Values: (N: 159, S: 139, E: -2, W: 148, U: 249, D: 49) 
- 		Coords: (0.900000, -0.100000,-0.700000) 
-cell[150]
- 		Values: (N: 160, S: 140, E: 151, W: -2, U: 250, D: 50) 
- 		Coords: (-0.900000, 0.100000,-0.700000) 
-cell[151]
- 		Values: (N: 161, S: 141, E: 152, W: 150, U: 251, D: 51) 
- 		Coords: (-0.700000, 0.100000,-0.700000) 
-cell[152]
- 		Values: (N: 162, S: 142, E: 153, W: 151, U: 252, D: 52) 
- 		Coords: (-0.500000, 0.100000,-0.700000) 
-cell[153]
- 		Values: (N: 163, S: 143, E: 154, W: 152, U: 253, D: 53) 
- 		Coords: (-0.300000, 0.100000,-0.700000) 
-cell[154]
- 		Values: (N: 164, S: 144, E: 155, W: 153, U: 254, D: 54) 
- 		Coords: (-0.100000, 0.100000,-0.700000) 
-cell[155]
- 		Values: (N: 165, S: 145, E: 156, W: 154, U: 255, D: 55) 
- 		Coords: (0.100000, 0.100000,-0.700000) 
-cell[156]
- 		Values: (N: 166, S: 146, E: 157, W: 155, U: 256, D: 56) 
- 		Coords: (0.300000, 0.100000,-0.700000) 
-cell[157]
- 		Values: (N: 167, S: 147, E: 158, W: 156, U: 257, D: 57) 
- 		Coords: (0.500000, 0.100000,-0.700000) 
-cell[158]
- 		Values: (N: 168, S: 148, E: 159, W: 157, U: 258, D: 58) 
- 		Coords: (0.700000, 0.100000,-0.700000) 
-cell[159]
- 		Values: (N: 169, S: 149, E: -2, W: 158, U: 259, D: 59) 
- 		Coords: (0.900000, 0.100000,-0.700000) 
-cell[160]
- 		Values: (N: 170, S: 150, E: 161, W: -2, U: 260, D: 60) 
- 		Coords: (-0.900000, 0.300000,-0.700000) 
-cell[161]
- 		Values: (N: 171, S: 151, E: 162, W: 160, U: 261, D: 61) 
- 		Coords: (-0.700000, 0.300000,-0.700000) 
-cell[162]
- 		Values: (N: 172, S: 152, E: 163, W: 161, U: 262, D: 62) 
- 		Coords: (-0.500000, 0.300000,-0.700000) 
-cell[163]
- 		Values: (N: 173, S: 153, E: 164, W: 162, U: 263, D: 63) 
- 		Coords: (-0.300000, 0.300000,-0.700000) 
-cell[164]
- 		Values: (N: 174, S: 154, E: 165, W: 163, U: 264, D: 64) 
- 		Coords: (-0.100000, 0.300000,-0.700000) 
-cell[165]
- 		Values: (N: 175, S: 155, E: 166, W: 164, U: 265, D: 65) 
- 		Coords: (0.100000, 0.300000,-0.700000) 
-cell[166]
- 		Values: (N: 176, S: 156, E: 167, W: 165, U: 266, D: 66) 
- 		Coords: (0.300000, 0.300000,-0.700000) 
-cell[167]
- 		Values: (N: 177, S: 157, E: 168, W: 166, U: 267, D: 67) 
- 		Coords: (0.500000, 0.300000,-0.700000) 
-cell[168]
- 		Values: (N: 178, S: 158, E: 169, W: 167, U: 268, D: 68) 
- 		Coords: (0.700000, 0.300000,-0.700000) 
-cell[169]
- 		Values: (N: 179, S: 159, E: -2, W: 168, U: 269, D: 69) 
- 		Coords: (0.900000, 0.300000,-0.700000) 
-cell[170]
- 		Values: (N: 180, S: 160, E: 171, W: -2, U: 270, D: 70) 
- 		Coords: (-0.900000, 0.500000,-0.700000) 
-cell[171]
- 		Values: (N: 181, S: 161, E: 172, W: 170, U: 271, D: 71) 
- 		Coords: (-0.700000, 0.500000,-0.700000) 
-cell[172]
- 		Values: (N: 182, S: 162, E: 173, W: 171, U: 272, D: 72) 
- 		Coords: (-0.500000, 0.500000,-0.700000) 
-cell[173]
- 		Values: (N: 183, S: 163, E: 174, W: 172, U: 273, D: 73) 
- 		Coords: (-0.300000, 0.500000,-0.700000) 
-cell[174]
- 		Values: (N: 184, S: 164, E: 175, W: 173, U: 274, D: 74) 
- 		Coords: (-0.100000, 0.500000,-0.700000) 
-cell[175]
- 		Values: (N: 185, S: 165, E: 176, W: 174, U: 275, D: 75) 
- 		Coords: (0.100000, 0.500000,-0.700000) 
-cell[176]
- 		Values: (N: 186, S: 166, E: 177, W: 175, U: 276, D: 76) 
- 		Coords: (0.300000, 0.500000,-0.700000) 
-cell[177]
- 		Values: (N: 187, S: 167, E: 178, W: 176, U: 277, D: 77) 
- 		Coords: (0.500000, 0.500000,-0.700000) 
-cell[178]
- 		Values: (N: 188, S: 168, E: 179, W: 177, U: 278, D: 78) 
- 		Coords: (0.700000, 0.500000,-0.700000) 
-cell[179]
- 		Values: (N: 189, S: 169, E: -2, W: 178, U: 279, D: 79) 
- 		Coords: (0.900000, 0.500000,-0.700000) 
-cell[180]
- 		Values: (N: 190, S: 170, E: 181, W: -2, U: 280, D: 80) 
- 		Coords: (-0.900000, 0.700000,-0.700000) 
-cell[181]
- 		Values: (N: 191, S: 171, E: 182, W: 180, U: 281, D: 81) 
- 		Coords: (-0.700000, 0.700000,-0.700000) 
-cell[182]
- 		Values: (N: 192, S: 172, E: 183, W: 181, U: 282, D: 82) 
- 		Coords: (-0.500000, 0.700000,-0.700000) 
-cell[183]
- 		Values: (N: 193, S: 173, E: 184, W: 182, U: 283, D: 83) 
- 		Coords: (-0.300000, 0.700000,-0.700000) 
-cell[184]
- 		Values: (N: 194, S: 174, E: 185, W: 183, U: 284, D: 84) 
- 		Coords: (-0.100000, 0.700000,-0.700000) 
-cell[185]
- 		Values: (N: 195, S: 175, E: 186, W: 184, U: 285, D: 85) 
- 		Coords: (0.100000, 0.700000,-0.700000) 
-cell[186]
- 		Values: (N: 196, S: 176, E: 187, W: 185, U: 286, D: 86) 
- 		Coords: (0.300000, 0.700000,-0.700000) 
-cell[187]
- 		Values: (N: 197, S: 177, E: 188, W: 186, U: 287, D: 87) 
- 		Coords: (0.500000, 0.700000,-0.700000) 
-cell[188]
- 		Values: (N: 198, S: 178, E: 189, W: 187, U: 288, D: 88) 
- 		Coords: (0.700000, 0.700000,-0.700000) 
-cell[189]
- 		Values: (N: 199, S: 179, E: -2, W: 188, U: 289, D: 89) 
- 		Coords: (0.900000, 0.700000,-0.700000) 
-cell[190]
- 		Values: (N: -2, S: 180, E: 191, W: -2, U: 290, D: 90) 
- 		Coords: (-0.900000, 0.900000,-0.700000) 
-cell[191]
- 		Values: (N: -2, S: 181, E: 192, W: 190, U: 291, D: 91) 
- 		Coords: (-0.700000, 0.900000,-0.700000) 
-cell[192]
- 		Values: (N: -2, S: 182, E: 193, W: 191, U: 292, D: 92) 
- 		Coords: (-0.500000, 0.900000,-0.700000) 
-cell[193]
- 		Values: (N: -2, S: 183, E: 194, W: 192, U: 293, D: 93) 
- 		Coords: (-0.300000, 0.900000,-0.700000) 
-cell[194]
- 		Values: (N: -2, S: 184, E: 195, W: 193, U: 294, D: 94) 
- 		Coords: (-0.100000, 0.900000,-0.700000) 
-cell[195]
- 		Values: (N: -2, S: 185, E: 196, W: 194, U: 295, D: 95) 
- 		Coords: (0.100000, 0.900000,-0.700000) 
-cell[196]
- 		Values: (N: -2, S: 186, E: 197, W: 195, U: 296, D: 96) 
- 		Coords: (0.300000, 0.900000,-0.700000) 
-cell[197]
- 		Values: (N: -2, S: 187, E: 198, W: 196, U: 297, D: 97) 
- 		Coords: (0.500000, 0.900000,-0.700000) 
-cell[198]
- 		Values: (N: -2, S: 188, E: 199, W: 197, U: 298, D: 98) 
- 		Coords: (0.700000, 0.900000,-0.700000) 
-cell[199]
- 		Values: (N: -2, S: 189, E: -2, W: 198, U: 299, D: 99) 
- 		Coords: (0.900000, 0.900000,-0.700000) 
-cell[200]
- 		Values: (N: 210, S: -2, E: 201, W: -2, U: 300, D: 100) 
- 		Coords: (-0.900000, -0.900000,-0.500000) 
-cell[201]
- 		Values: (N: 211, S: -2, E: 202, W: 200, U: 301, D: 101) 
- 		Coords: (-0.700000, -0.900000,-0.500000) 
-cell[202]
- 		Values: (N: 212, S: -2, E: 203, W: 201, U: 302, D: 102) 
- 		Coords: (-0.500000, -0.900000,-0.500000) 
-cell[203]
- 		Values: (N: 213, S: -2, E: 204, W: 202, U: 303, D: 103) 
- 		Coords: (-0.300000, -0.900000,-0.500000) 
-cell[204]
- 		Values: (N: 214, S: -2, E: 205, W: 203, U: 304, D: 104) 
- 		Coords: (-0.100000, -0.900000,-0.500000) 
-cell[205]
- 		Values: (N: 215, S: -2, E: 206, W: 204, U: 305, D: 105) 
- 		Coords: (0.100000, -0.900000,-0.500000) 
-cell[206]
- 		Values: (N: 216, S: -2, E: 207, W: 205, U: 306, D: 106) 
- 		Coords: (0.300000, -0.900000,-0.500000) 
-cell[207]
- 		Values: (N: 217, S: -2, E: 208, W: 206, U: 307, D: 107) 
- 		Coords: (0.500000, -0.900000,-0.500000) 
-cell[208]
- 		Values: (N: 218, S: -2, E: 209, W: 207, U: 308, D: 108) 
- 		Coords: (0.700000, -0.900000,-0.500000) 
-cell[209]
- 		Values: (N: 219, S: -2, E: -2, W: 208, U: 309, D: 109) 
- 		Coords: (0.900000, -0.900000,-0.500000) 
-cell[210]
- 		Values: (N: 220, S: 200, E: 211, W: -2, U: 310, D: 110) 
- 		Coords: (-0.900000, -0.700000,-0.500000) 
-cell[211]
- 		Values: (N: 221, S: 201, E: 212, W: 210, U: 311, D: 111) 
- 		Coords: (-0.700000, -0.700000,-0.500000) 
-cell[212]
- 		Values: (N: 222, S: 202, E: 213, W: 211, U: 312, D: 112) 
- 		Coords: (-0.500000, -0.700000,-0.500000) 
-cell[213]
- 		Values: (N: 223, S: 203, E: 214, W: 212, U: 313, D: 113) 
- 		Coords: (-0.300000, -0.700000,-0.500000) 
-cell[214]
- 		Values: (N: 224, S: 204, E: 215, W: 213, U: 314, D: 114) 
- 		Coords: (-0.100000, -0.700000,-0.500000) 
-cell[215]
- 		Values: (N: 225, S: 205, E: 216, W: 214, U: 315, D: 115) 
- 		Coords: (0.100000, -0.700000,-0.500000) 
-cell[216]
- 		Values: (N: 226, S: 206, E: 217, W: 215, U: 316, D: 116) 
- 		Coords: (0.300000, -0.700000,-0.500000) 
-cell[217]
- 		Values: (N: 227, S: 207, E: 218, W: 216, U: 317, D: 117) 
- 		Coords: (0.500000, -0.700000,-0.500000) 
-cell[218]
- 		Values: (N: 228, S: 208, E: 219, W: 217, U: 318, D: 118) 
- 		Coords: (0.700000, -0.700000,-0.500000) 
-cell[219]
- 		Values: (N: 229, S: 209, E: -2, W: 218, U: 319, D: 119) 
- 		Coords: (0.900000, -0.700000,-0.500000) 
-cell[220]
- 		Values: (N: 230, S: 210, E: 221, W: -2, U: 320, D: 120) 
- 		Coords: (-0.900000, -0.500000,-0.500000) 
-cell[221]
- 		Values: (N: 231, S: 211, E: 222, W: 220, U: 321, D: 121) 
- 		Coords: (-0.700000, -0.500000,-0.500000) 
-cell[222]
- 		Values: (N: 232, S: 212, E: 223, W: 221, U: 322, D: 122) 
- 		Coords: (-0.500000, -0.500000,-0.500000) 
-cell[223]
- 		Values: (N: 233, S: 213, E: 224, W: 222, U: 323, D: 123) 
- 		Coords: (-0.300000, -0.500000,-0.500000) 
-cell[224]
- 		Values: (N: 234, S: 214, E: 225, W: 223, U: 324, D: 124) 
- 		Coords: (-0.100000, -0.500000,-0.500000) 
-cell[225]
- 		Values: (N: 235, S: 215, E: 226, W: 224, U: 325, D: 125) 
- 		Coords: (0.100000, -0.500000,-0.500000) 
-cell[226]
- 		Values: (N: 236, S: 216, E: 227, W: 225, U: 326, D: 126) 
- 		Coords: (0.300000, -0.500000,-0.500000) 
-cell[227]
- 		Values: (N: 237, S: 217, E: 228, W: 226, U: 327, D: 127) 
- 		Coords: (0.500000, -0.500000,-0.500000) 
-cell[228]
- 		Values: (N: 238, S: 218, E: 229, W: 227, U: 328, D: 128) 
- 		Coords: (0.700000, -0.500000,-0.500000) 
-cell[229]
- 		Values: (N: 239, S: 219, E: -2, W: 228, U: 329, D: 129) 
- 		Coords: (0.900000, -0.500000,-0.500000) 
-cell[230]
- 		Values: (N: 240, S: 220, E: 231, W: -2, U: 330, D: 130) 
- 		Coords: (-0.900000, -0.300000,-0.500000) 
-cell[231]
- 		Values: (N: 241, S: 221, E: 232, W: 230, U: 331, D: 131) 
- 		Coords: (-0.700000, -0.300000,-0.500000) 
-cell[232]
- 		Values: (N: 242, S: 222, E: 233, W: 231, U: 332, D: 132) 
- 		Coords: (-0.500000, -0.300000,-0.500000) 
-cell[233]
- 		Values: (N: 243, S: 223, E: 234, W: 232, U: 333, D: 133) 
- 		Coords: (-0.300000, -0.300000,-0.500000) 
-cell[234]
- 		Values: (N: 244, S: 224, E: 235, W: 233, U: 334, D: 134) 
- 		Coords: (-0.100000, -0.300000,-0.500000) 
-cell[235]
- 		Values: (N: 245, S: 225, E: 236, W: 234, U: 335, D: 135) 
- 		Coords: (0.100000, -0.300000,-0.500000) 
-cell[236]
- 		Values: (N: 246, S: 226, E: 237, W: 235, U: 336, D: 136) 
- 		Coords: (0.300000, -0.300000,-0.500000) 
-cell[237]
- 		Values: (N: 247, S: 227, E: 238, W: 236, U: 337, D: 137) 
- 		Coords: (0.500000, -0.300000,-0.500000) 
-cell[238]
- 		Values: (N: 248, S: 228, E: 239, W: 237, U: 338, D: 138) 
- 		Coords: (0.700000, -0.300000,-0.500000) 
-cell[239]
- 		Values: (N: 249, S: 229, E: -2, W: 238, U: 339, D: 139) 
- 		Coords: (0.900000, -0.300000,-0.500000) 
-cell[240]
- 		Values: (N: 250, S: 230, E: 241, W: -2, U: 340, D: 140) 
- 		Coords: (-0.900000, -0.100000,-0.500000) 
-cell[241]
- 		Values: (N: 251, S: 231, E: 242, W: 240, U: 341, D: 141) 
- 		Coords: (-0.700000, -0.100000,-0.500000) 
-cell[242]
- 		Values: (N: 252, S: 232, E: 243, W: 241, U: 342, D: 142) 
- 		Coords: (-0.500000, -0.100000,-0.500000) 
-cell[243]
- 		Values: (N: 253, S: 233, E: 244, W: 242, U: 343, D: 143) 
- 		Coords: (-0.300000, -0.100000,-0.500000) 
-cell[244]
- 		Values: (N: 254, S: 234, E: 245, W: 243, U: 344, D: 144) 
- 		Coords: (-0.100000, -0.100000,-0.500000) 
-cell[245]
- 		Values: (N: 255, S: 235, E: 246, W: 244, U: 345, D: 145) 
- 		Coords: (0.100000, -0.100000,-0.500000) 
-cell[246]
- 		Values: (N: 256, S: 236, E: 247, W: 245, U: 346, D: 146) 
- 		Coords: (0.300000, -0.100000,-0.500000) 
-cell[247]
- 		Values: (N: 257, S: 237, E: 248, W: 246, U: 347, D: 147) 
- 		Coords: (0.500000, -0.100000,-0.500000) 
-cell[248]
- 		Values: (N: 258, S: 238, E: 249, W: 247, U: 348, D: 148) 
- 		Coords: (0.700000, -0.100000,-0.500000) 
-cell[249]
- 		Values: (N: 259, S: 239, E: -2, W: 248, U: 349, D: 149) 
- 		Coords: (0.900000, -0.100000,-0.500000) 
-cell[250]
- 		Values: (N: 260, S: 240, E: 251, W: -2, U: 350, D: 150) 
- 		Coords: (-0.900000, 0.100000,-0.500000) 
-cell[251]
- 		Values: (N: 261, S: 241, E: 252, W: 250, U: 351, D: 151) 
- 		Coords: (-0.700000, 0.100000,-0.500000) 
-cell[252]
- 		Values: (N: 262, S: 242, E: 253, W: 251, U: 352, D: 152) 
- 		Coords: (-0.500000, 0.100000,-0.500000) 
-cell[253]
- 		Values: (N: 263, S: 243, E: 254, W: 252, U: 353, D: 153) 
- 		Coords: (-0.300000, 0.100000,-0.500000) 
-cell[254]
- 		Values: (N: 264, S: 244, E: 255, W: 253, U: 354, D: 154) 
- 		Coords: (-0.100000, 0.100000,-0.500000) 
-cell[255]
- 		Values: (N: 265, S: 245, E: 256, W: 254, U: 355, D: 155) 
- 		Coords: (0.100000, 0.100000,-0.500000) 
-cell[256]
- 		Values: (N: 266, S: 246, E: 257, W: 255, U: 356, D: 156) 
- 		Coords: (0.300000, 0.100000,-0.500000) 
-cell[257]
- 		Values: (N: 267, S: 247, E: 258, W: 256, U: 357, D: 157) 
- 		Coords: (0.500000, 0.100000,-0.500000) 
-cell[258]
- 		Values: (N: 268, S: 248, E: 259, W: 257, U: 358, D: 158) 
- 		Coords: (0.700000, 0.100000,-0.500000) 
-cell[259]
- 		Values: (N: 269, S: 249, E: -2, W: 258, U: 359, D: 159) 
- 		Coords: (0.900000, 0.100000,-0.500000) 
-cell[260]
- 		Values: (N: 270, S: 250, E: 261, W: -2, U: 360, D: 160) 
- 		Coords: (-0.900000, 0.300000,-0.500000) 
-cell[261]
- 		Values: (N: 271, S: 251, E: 262, W: 260, U: 361, D: 161) 
- 		Coords: (-0.700000, 0.300000,-0.500000) 
-cell[262]
- 		Values: (N: 272, S: 252, E: 263, W: 261, U: 362, D: 162) 
- 		Coords: (-0.500000, 0.300000,-0.500000) 
-cell[263]
- 		Values: (N: 273, S: 253, E: 264, W: 262, U: 363, D: 163) 
- 		Coords: (-0.300000, 0.300000,-0.500000) 
-cell[264]
- 		Values: (N: 274, S: 254, E: 265, W: 263, U: 364, D: 164) 
- 		Coords: (-0.100000, 0.300000,-0.500000) 
-cell[265]
- 		Values: (N: 275, S: 255, E: 266, W: 264, U: 365, D: 165) 
- 		Coords: (0.100000, 0.300000,-0.500000) 
-cell[266]
- 		Values: (N: 276, S: 256, E: 267, W: 265, U: 366, D: 166) 
- 		Coords: (0.300000, 0.300000,-0.500000) 
-cell[267]
- 		Values: (N: 277, S: 257, E: 268, W: 266, U: 367, D: 167) 
- 		Coords: (0.500000, 0.300000,-0.500000) 
-cell[268]
- 		Values: (N: 278, S: 258, E: 269, W: 267, U: 368, D: 168) 
- 		Coords: (0.700000, 0.300000,-0.500000) 
-cell[269]
- 		Values: (N: 279, S: 259, E: -2, W: 268, U: 369, D: 169) 
- 		Coords: (0.900000, 0.300000,-0.500000) 
-cell[270]
- 		Values: (N: 280, S: 260, E: 271, W: -2, U: 370, D: 170) 
- 		Coords: (-0.900000, 0.500000,-0.500000) 
-cell[271]
- 		Values: (N: 281, S: 261, E: 272, W: 270, U: 371, D: 171) 
- 		Coords: (-0.700000, 0.500000,-0.500000) 
-cell[272]
- 		Values: (N: 282, S: 262, E: 273, W: 271, U: 372, D: 172) 
- 		Coords: (-0.500000, 0.500000,-0.500000) 
-cell[273]
- 		Values: (N: 283, S: 263, E: 274, W: 272, U: 373, D: 173) 
- 		Coords: (-0.300000, 0.500000,-0.500000) 
-cell[274]
- 		Values: (N: 284, S: 264, E: 275, W: 273, U: 374, D: 174) 
- 		Coords: (-0.100000, 0.500000,-0.500000) 
-cell[275]
- 		Values: (N: 285, S: 265, E: 276, W: 274, U: 375, D: 175) 
- 		Coords: (0.100000, 0.500000,-0.500000) 
-cell[276]
- 		Values: (N: 286, S: 266, E: 277, W: 275, U: 376, D: 176) 
- 		Coords: (0.300000, 0.500000,-0.500000) 
-cell[277]
- 		Values: (N: 287, S: 267, E: 278, W: 276, U: 377, D: 177) 
- 		Coords: (0.500000, 0.500000,-0.500000) 
-cell[278]
- 		Values: (N: 288, S: 268, E: 279, W: 277, U: 378, D: 178) 
- 		Coords: (0.700000, 0.500000,-0.500000) 
-cell[279]
- 		Values: (N: 289, S: 269, E: -2, W: 278, U: 379, D: 179) 
- 		Coords: (0.900000, 0.500000,-0.500000) 
-cell[280]
- 		Values: (N: 290, S: 270, E: 281, W: -2, U: 380, D: 180) 
- 		Coords: (-0.900000, 0.700000,-0.500000) 
-cell[281]
- 		Values: (N: 291, S: 271, E: 282, W: 280, U: 381, D: 181) 
- 		Coords: (-0.700000, 0.700000,-0.500000) 
-cell[282]
- 		Values: (N: 292, S: 272, E: 283, W: 281, U: 382, D: 182) 
- 		Coords: (-0.500000, 0.700000,-0.500000) 
-cell[283]
- 		Values: (N: 293, S: 273, E: 284, W: 282, U: 383, D: 183) 
- 		Coords: (-0.300000, 0.700000,-0.500000) 
-cell[284]
- 		Values: (N: 294, S: 274, E: 285, W: 283, U: 384, D: 184) 
- 		Coords: (-0.100000, 0.700000,-0.500000) 
-cell[285]
- 		Values: (N: 295, S: 275, E: 286, W: 284, U: 385, D: 185) 
- 		Coords: (0.100000, 0.700000,-0.500000) 
-cell[286]
- 		Values: (N: 296, S: 276, E: 287, W: 285, U: 386, D: 186) 
- 		Coords: (0.300000, 0.700000,-0.500000) 
-cell[287]
- 		Values: (N: 297, S: 277, E: 288, W: 286, U: 387, D: 187) 
- 		Coords: (0.500000, 0.700000,-0.500000) 
-cell[288]
- 		Values: (N: 298, S: 278, E: 289, W: 287, U: 388, D: 188) 
- 		Coords: (0.700000, 0.700000,-0.500000) 
-cell[289]
- 		Values: (N: 299, S: 279, E: -2, W: 288, U: 389, D: 189) 
- 		Coords: (0.900000, 0.700000,-0.500000) 
-cell[290]
- 		Values: (N: -2, S: 280, E: 291, W: -2, U: 390, D: 190) 
- 		Coords: (-0.900000, 0.900000,-0.500000) 
-cell[291]
- 		Values: (N: -2, S: 281, E: 292, W: 290, U: 391, D: 191) 
- 		Coords: (-0.700000, 0.900000,-0.500000) 
-cell[292]
- 		Values: (N: -2, S: 282, E: 293, W: 291, U: 392, D: 192) 
- 		Coords: (-0.500000, 0.900000,-0.500000) 
-cell[293]
- 		Values: (N: -2, S: 283, E: 294, W: 292, U: 393, D: 193) 
- 		Coords: (-0.300000, 0.900000,-0.500000) 
-cell[294]
- 		Values: (N: -2, S: 284, E: 295, W: 293, U: 394, D: 194) 
- 		Coords: (-0.100000, 0.900000,-0.500000) 
-cell[295]
- 		Values: (N: -2, S: 285, E: 296, W: 294, U: 395, D: 195) 
- 		Coords: (0.100000, 0.900000,-0.500000) 
-cell[296]
- 		Values: (N: -2, S: 286, E: 297, W: 295, U: 396, D: 196) 
- 		Coords: (0.300000, 0.900000,-0.500000) 
-cell[297]
- 		Values: (N: -2, S: 287, E: 298, W: 296, U: 397, D: 197) 
- 		Coords: (0.500000, 0.900000,-0.500000) 
-cell[298]
- 		Values: (N: -2, S: 288, E: 299, W: 297, U: 398, D: 198) 
- 		Coords: (0.700000, 0.900000,-0.500000) 
-cell[299]
- 		Values: (N: -2, S: 289, E: -2, W: 298, U: 399, D: 199) 
- 		Coords: (0.900000, 0.900000,-0.500000) 
-cell[300]
- 		Values: (N: 310, S: -2, E: 301, W: -2, U: 400, D: 200) 
- 		Coords: (-0.900000, -0.900000,-0.300000) 
-cell[301]
- 		Values: (N: 311, S: -2, E: 302, W: 300, U: 401, D: 201) 
- 		Coords: (-0.700000, -0.900000,-0.300000) 
-cell[302]
- 		Values: (N: 312, S: -2, E: 303, W: 301, U: 402, D: 202) 
- 		Coords: (-0.500000, -0.900000,-0.300000) 
-cell[303]
- 		Values: (N: 313, S: -2, E: 304, W: 302, U: 403, D: 203) 
- 		Coords: (-0.300000, -0.900000,-0.300000) 
-cell[304]
- 		Values: (N: 314, S: -2, E: 305, W: 303, U: 404, D: 204) 
- 		Coords: (-0.100000, -0.900000,-0.300000) 
-cell[305]
- 		Values: (N: 315, S: -2, E: 306, W: 304, U: 405, D: 205) 
- 		Coords: (0.100000, -0.900000,-0.300000) 
-cell[306]
- 		Values: (N: 316, S: -2, E: 307, W: 305, U: 406, D: 206) 
- 		Coords: (0.300000, -0.900000,-0.300000) 
-cell[307]
- 		Values: (N: 317, S: -2, E: 308, W: 306, U: 407, D: 207) 
- 		Coords: (0.500000, -0.900000,-0.300000) 
-cell[308]
- 		Values: (N: 318, S: -2, E: 309, W: 307, U: 408, D: 208) 
- 		Coords: (0.700000, -0.900000,-0.300000) 
-cell[309]
- 		Values: (N: 319, S: -2, E: -2, W: 308, U: 409, D: 209) 
- 		Coords: (0.900000, -0.900000,-0.300000) 
-cell[310]
- 		Values: (N: 320, S: 300, E: 311, W: -2, U: 410, D: 210) 
- 		Coords: (-0.900000, -0.700000,-0.300000) 
-cell[311]
- 		Values: (N: 321, S: 301, E: 312, W: 310, U: 411, D: 211) 
- 		Coords: (-0.700000, -0.700000,-0.300000) 
-cell[312]
- 		Values: (N: 322, S: 302, E: 313, W: 311, U: 412, D: 212) 
- 		Coords: (-0.500000, -0.700000,-0.300000) 
-cell[313]
- 		Values: (N: 323, S: 303, E: 314, W: 312, U: 413, D: 213) 
- 		Coords: (-0.300000, -0.700000,-0.300000) 
-cell[314]
- 		Values: (N: 324, S: 304, E: 315, W: 313, U: 414, D: 214) 
- 		Coords: (-0.100000, -0.700000,-0.300000) 
-cell[315]
- 		Values: (N: 325, S: 305, E: 316, W: 314, U: 415, D: 215) 
- 		Coords: (0.100000, -0.700000,-0.300000) 
-cell[316]
- 		Values: (N: 326, S: 306, E: 317, W: 315, U: 416, D: 216) 
- 		Coords: (0.300000, -0.700000,-0.300000) 
-cell[317]
- 		Values: (N: 327, S: 307, E: 318, W: 316, U: 417, D: 217) 
- 		Coords: (0.500000, -0.700000,-0.300000) 
-cell[318]
- 		Values: (N: 328, S: 308, E: 319, W: 317, U: 418, D: 218) 
- 		Coords: (0.700000, -0.700000,-0.300000) 
-cell[319]
- 		Values: (N: 329, S: 309, E: -2, W: 318, U: 419, D: 219) 
- 		Coords: (0.900000, -0.700000,-0.300000) 
-cell[320]
- 		Values: (N: 330, S: 310, E: 321, W: -2, U: 420, D: 220) 
- 		Coords: (-0.900000, -0.500000,-0.300000) 
-cell[321]
- 		Values: (N: 331, S: 311, E: 322, W: 320, U: 421, D: 221) 
- 		Coords: (-0.700000, -0.500000,-0.300000) 
-cell[322]
- 		Values: (N: 332, S: 312, E: 323, W: 321, U: 422, D: 222) 
- 		Coords: (-0.500000, -0.500000,-0.300000) 
-cell[323]
- 		Values: (N: 333, S: 313, E: 324, W: 322, U: 423, D: 223) 
- 		Coords: (-0.300000, -0.500000,-0.300000) 
-cell[324]
- 		Values: (N: 334, S: 314, E: 325, W: 323, U: 424, D: 224) 
- 		Coords: (-0.100000, -0.500000,-0.300000) 
-cell[325]
- 		Values: (N: 335, S: 315, E: 326, W: 324, U: 425, D: 225) 
- 		Coords: (0.100000, -0.500000,-0.300000) 
-cell[326]
- 		Values: (N: 336, S: 316, E: 327, W: 325, U: 426, D: 226) 
- 		Coords: (0.300000, -0.500000,-0.300000) 
-cell[327]
- 		Values: (N: 337, S: 317, E: 328, W: 326, U: 427, D: 227) 
- 		Coords: (0.500000, -0.500000,-0.300000) 
-cell[328]
- 		Values: (N: 338, S: 318, E: 329, W: 327, U: 428, D: 228) 
- 		Coords: (0.700000, -0.500000,-0.300000) 
-cell[329]
- 		Values: (N: 339, S: 319, E: -2, W: 328, U: 429, D: 229) 
- 		Coords: (0.900000, -0.500000,-0.300000) 
-cell[330]
- 		Values: (N: 340, S: 320, E: 331, W: -2, U: 430, D: 230) 
- 		Coords: (-0.900000, -0.300000,-0.300000) 
-cell[331]
- 		Values: (N: 341, S: 321, E: 332, W: 330, U: 431, D: 231) 
- 		Coords: (-0.700000, -0.300000,-0.300000) 
-cell[332]
- 		Values: (N: 342, S: 322, E: 333, W: 331, U: 432, D: 232) 
- 		Coords: (-0.500000, -0.300000,-0.300000) 
-cell[333]
- 		Values: (N: 343, S: 323, E: 334, W: 332, U: 433, D: 233) 
- 		Coords: (-0.300000, -0.300000,-0.300000) 
-cell[334]
- 		Values: (N: 344, S: 324, E: 335, W: 333, U: 434, D: 234) 
- 		Coords: (-0.100000, -0.300000,-0.300000) 
-cell[335]
- 		Values: (N: 345, S: 325, E: 336, W: 334, U: 435, D: 235) 
- 		Coords: (0.100000, -0.300000,-0.300000) 
-cell[336]
- 		Values: (N: 346, S: 326, E: 337, W: 335, U: 436, D: 236) 
- 		Coords: (0.300000, -0.300000,-0.300000) 
-cell[337]
- 		Values: (N: 347, S: 327, E: 338, W: 336, U: 437, D: 237) 
- 		Coords: (0.500000, -0.300000,-0.300000) 
-cell[338]
- 		Values: (N: 348, S: 328, E: 339, W: 337, U: 438, D: 238) 
- 		Coords: (0.700000, -0.300000,-0.300000) 
-cell[339]
- 		Values: (N: 349, S: 329, E: -2, W: 338, U: 439, D: 239) 
- 		Coords: (0.900000, -0.300000,-0.300000) 
-cell[340]
- 		Values: (N: 350, S: 330, E: 341, W: -2, U: 440, D: 240) 
- 		Coords: (-0.900000, -0.100000,-0.300000) 
-cell[341]
- 		Values: (N: 351, S: 331, E: 342, W: 340, U: 441, D: 241) 
- 		Coords: (-0.700000, -0.100000,-0.300000) 
-cell[342]
- 		Values: (N: 352, S: 332, E: 343, W: 341, U: 442, D: 242) 
- 		Coords: (-0.500000, -0.100000,-0.300000) 
-cell[343]
- 		Values: (N: 353, S: 333, E: 344, W: 342, U: 443, D: 243) 
- 		Coords: (-0.300000, -0.100000,-0.300000) 
-cell[344]
- 		Values: (N: 354, S: 334, E: 345, W: 343, U: 444, D: 244) 
- 		Coords: (-0.100000, -0.100000,-0.300000) 
-cell[345]
- 		Values: (N: 355, S: 335, E: 346, W: 344, U: 445, D: 245) 
- 		Coords: (0.100000, -0.100000,-0.300000) 
-cell[346]
- 		Values: (N: 356, S: 336, E: 347, W: 345, U: 446, D: 246) 
- 		Coords: (0.300000, -0.100000,-0.300000) 
-cell[347]
- 		Values: (N: 357, S: 337, E: 348, W: 346, U: 447, D: 247) 
- 		Coords: (0.500000, -0.100000,-0.300000) 
-cell[348]
- 		Values: (N: 358, S: 338, E: 349, W: 347, U: 448, D: 248) 
- 		Coords: (0.700000, -0.100000,-0.300000) 
-cell[349]
- 		Values: (N: 359, S: 339, E: -2, W: 348, U: 449, D: 249) 
- 		Coords: (0.900000, -0.100000,-0.300000) 
-cell[350]
- 		Values: (N: 360, S: 340, E: 351, W: -2, U: 450, D: 250) 
- 		Coords: (-0.900000, 0.100000,-0.300000) 
-cell[351]
- 		Values: (N: 361, S: 341, E: 352, W: 350, U: 451, D: 251) 
- 		Coords: (-0.700000, 0.100000,-0.300000) 
-cell[352]
- 		Values: (N: 362, S: 342, E: 353, W: 351, U: 452, D: 252) 
- 		Coords: (-0.500000, 0.100000,-0.300000) 
-cell[353]
- 		Values: (N: 363, S: 343, E: 354, W: 352, U: 453, D: 253) 
- 		Coords: (-0.300000, 0.100000,-0.300000) 
-cell[354]
- 		Values: (N: 364, S: 344, E: 355, W: 353, U: 454, D: 254) 
- 		Coords: (-0.100000, 0.100000,-0.300000) 
-cell[355]
- 		Values: (N: 365, S: 345, E: 356, W: 354, U: 455, D: 255) 
- 		Coords: (0.100000, 0.100000,-0.300000) 
-cell[356]
- 		Values: (N: 366, S: 346, E: 357, W: 355, U: 456, D: 256) 
- 		Coords: (0.300000, 0.100000,-0.300000) 
-cell[357]
- 		Values: (N: 367, S: 347, E: 358, W: 356, U: 457, D: 257) 
- 		Coords: (0.500000, 0.100000,-0.300000) 
-cell[358]
- 		Values: (N: 368, S: 348, E: 359, W: 357, U: 458, D: 258) 
- 		Coords: (0.700000, 0.100000,-0.300000) 
-cell[359]
- 		Values: (N: 369, S: 349, E: -2, W: 358, U: 459, D: 259) 
- 		Coords: (0.900000, 0.100000,-0.300000) 
-cell[360]
- 		Values: (N: 370, S: 350, E: 361, W: -2, U: 460, D: 260) 
- 		Coords: (-0.900000, 0.300000,-0.300000) 
-cell[361]
- 		Values: (N: 371, S: 351, E: 362, W: 360, U: 461, D: 261) 
- 		Coords: (-0.700000, 0.300000,-0.300000) 
-cell[362]
- 		Values: (N: 372, S: 352, E: 363, W: 361, U: 462, D: 262) 
- 		Coords: (-0.500000, 0.300000,-0.300000) 
-cell[363]
- 		Values: (N: 373, S: 353, E: 364, W: 362, U: 463, D: 263) 
- 		Coords: (-0.300000, 0.300000,-0.300000) 
-cell[364]
- 		Values: (N: 374, S: 354, E: 365, W: 363, U: 464, D: 264) 
- 		Coords: (-0.100000, 0.300000,-0.300000) 
-cell[365]
- 		Values: (N: 375, S: 355, E: 366, W: 364, U: 465, D: 265) 
- 		Coords: (0.100000, 0.300000,-0.300000) 
-cell[366]
- 		Values: (N: 376, S: 356, E: 367, W: 365, U: 466, D: 266) 
- 		Coords: (0.300000, 0.300000,-0.300000) 
-cell[367]
- 		Values: (N: 377, S: 357, E: 368, W: 366, U: 467, D: 267) 
- 		Coords: (0.500000, 0.300000,-0.300000) 
-cell[368]
- 		Values: (N: 378, S: 358, E: 369, W: 367, U: 468, D: 268) 
- 		Coords: (0.700000, 0.300000,-0.300000) 
-cell[369]
- 		Values: (N: 379, S: 359, E: -2, W: 368, U: 469, D: 269) 
- 		Coords: (0.900000, 0.300000,-0.300000) 
-cell[370]
- 		Values: (N: 380, S: 360, E: 371, W: -2, U: 470, D: 270) 
- 		Coords: (-0.900000, 0.500000,-0.300000) 
-cell[371]
- 		Values: (N: 381, S: 361, E: 372, W: 370, U: 471, D: 271) 
- 		Coords: (-0.700000, 0.500000,-0.300000) 
-cell[372]
- 		Values: (N: 382, S: 362, E: 373, W: 371, U: 472, D: 272) 
- 		Coords: (-0.500000, 0.500000,-0.300000) 
-cell[373]
- 		Values: (N: 383, S: 363, E: 374, W: 372, U: 473, D: 273) 
- 		Coords: (-0.300000, 0.500000,-0.300000) 
-cell[374]
- 		Values: (N: 384, S: 364, E: 375, W: 373, U: 474, D: 274) 
- 		Coords: (-0.100000, 0.500000,-0.300000) 
-cell[375]
- 		Values: (N: 385, S: 365, E: 376, W: 374, U: 475, D: 275) 
- 		Coords: (0.100000, 0.500000,-0.300000) 
-cell[376]
- 		Values: (N: 386, S: 366, E: 377, W: 375, U: 476, D: 276) 
- 		Coords: (0.300000, 0.500000,-0.300000) 
-cell[377]
- 		Values: (N: 387, S: 367, E: 378, W: 376, U: 477, D: 277) 
- 		Coords: (0.500000, 0.500000,-0.300000) 
-cell[378]
- 		Values: (N: 388, S: 368, E: 379, W: 377, U: 478, D: 278) 
- 		Coords: (0.700000, 0.500000,-0.300000) 
-cell[379]
- 		Values: (N: 389, S: 369, E: -2, W: 378, U: 479, D: 279) 
- 		Coords: (0.900000, 0.500000,-0.300000) 
-cell[380]
- 		Values: (N: 390, S: 370, E: 381, W: -2, U: 480, D: 280) 
- 		Coords: (-0.900000, 0.700000,-0.300000) 
-cell[381]
- 		Values: (N: 391, S: 371, E: 382, W: 380, U: 481, D: 281) 
- 		Coords: (-0.700000, 0.700000,-0.300000) 
-cell[382]
- 		Values: (N: 392, S: 372, E: 383, W: 381, U: 482, D: 282) 
- 		Coords: (-0.500000, 0.700000,-0.300000) 
-cell[383]
- 		Values: (N: 393, S: 373, E: 384, W: 382, U: 483, D: 283) 
- 		Coords: (-0.300000, 0.700000,-0.300000) 
-cell[384]
- 		Values: (N: 394, S: 374, E: 385, W: 383, U: 484, D: 284) 
- 		Coords: (-0.100000, 0.700000,-0.300000) 
-cell[385]
- 		Values: (N: 395, S: 375, E: 386, W: 384, U: 485, D: 285) 
- 		Coords: (0.100000, 0.700000,-0.300000) 
-cell[386]
- 		Values: (N: 396, S: 376, E: 387, W: 385, U: 486, D: 286) 
- 		Coords: (0.300000, 0.700000,-0.300000) 
-cell[387]
- 		Values: (N: 397, S: 377, E: 388, W: 386, U: 487, D: 287) 
- 		Coords: (0.500000, 0.700000,-0.300000) 
-cell[388]
- 		Values: (N: 398, S: 378, E: 389, W: 387, U: 488, D: 288) 
- 		Coords: (0.700000, 0.700000,-0.300000) 
-cell[389]
- 		Values: (N: 399, S: 379, E: -2, W: 388, U: 489, D: 289) 
- 		Coords: (0.900000, 0.700000,-0.300000) 
-cell[390]
- 		Values: (N: -2, S: 380, E: 391, W: -2, U: 490, D: 290) 
- 		Coords: (-0.900000, 0.900000,-0.300000) 
-cell[391]
- 		Values: (N: -2, S: 381, E: 392, W: 390, U: 491, D: 291) 
- 		Coords: (-0.700000, 0.900000,-0.300000) 
-cell[392]
- 		Values: (N: -2, S: 382, E: 393, W: 391, U: 492, D: 292) 
- 		Coords: (-0.500000, 0.900000,-0.300000) 
-cell[393]
- 		Values: (N: -2, S: 383, E: 394, W: 392, U: 493, D: 293) 
- 		Coords: (-0.300000, 0.900000,-0.300000) 
-cell[394]
- 		Values: (N: -2, S: 384, E: 395, W: 393, U: 494, D: 294) 
- 		Coords: (-0.100000, 0.900000,-0.300000) 
-cell[395]
- 		Values: (N: -2, S: 385, E: 396, W: 394, U: 495, D: 295) 
- 		Coords: (0.100000, 0.900000,-0.300000) 
-cell[396]
- 		Values: (N: -2, S: 386, E: 397, W: 395, U: 496, D: 296) 
- 		Coords: (0.300000, 0.900000,-0.300000) 
-cell[397]
- 		Values: (N: -2, S: 387, E: 398, W: 396, U: 497, D: 297) 
- 		Coords: (0.500000, 0.900000,-0.300000) 
-cell[398]
- 		Values: (N: -2, S: 388, E: 399, W: 397, U: 498, D: 298) 
- 		Coords: (0.700000, 0.900000,-0.300000) 
-cell[399]
- 		Values: (N: -2, S: 389, E: -2, W: 398, U: 499, D: 299) 
- 		Coords: (0.900000, 0.900000,-0.300000) 
-cell[400]
- 		Values: (N: 410, S: -2, E: 401, W: -2, U: 500, D: 300) 
- 		Coords: (-0.900000, -0.900000,-0.100000) 
-cell[401]
- 		Values: (N: 411, S: -2, E: 402, W: 400, U: 501, D: 301) 
- 		Coords: (-0.700000, -0.900000,-0.100000) 
-cell[402]
- 		Values: (N: 412, S: -2, E: 403, W: 401, U: 502, D: 302) 
- 		Coords: (-0.500000, -0.900000,-0.100000) 
-cell[403]
- 		Values: (N: 413, S: -2, E: 404, W: 402, U: 503, D: 303) 
- 		Coords: (-0.300000, -0.900000,-0.100000) 
-cell[404]
- 		Values: (N: 414, S: -2, E: 405, W: 403, U: 504, D: 304) 
- 		Coords: (-0.100000, -0.900000,-0.100000) 
-cell[405]
- 		Values: (N: 415, S: -2, E: 406, W: 404, U: 505, D: 305) 
- 		Coords: (0.100000, -0.900000,-0.100000) 
-cell[406]
- 		Values: (N: 416, S: -2, E: 407, W: 405, U: 506, D: 306) 
- 		Coords: (0.300000, -0.900000,-0.100000) 
-cell[407]
- 		Values: (N: 417, S: -2, E: 408, W: 406, U: 507, D: 307) 
- 		Coords: (0.500000, -0.900000,-0.100000) 
-cell[408]
- 		Values: (N: 418, S: -2, E: 409, W: 407, U: 508, D: 308) 
- 		Coords: (0.700000, -0.900000,-0.100000) 
-cell[409]
- 		Values: (N: 419, S: -2, E: -2, W: 408, U: 509, D: 309) 
- 		Coords: (0.900000, -0.900000,-0.100000) 
-cell[410]
- 		Values: (N: 420, S: 400, E: 411, W: -2, U: 510, D: 310) 
- 		Coords: (-0.900000, -0.700000,-0.100000) 
-cell[411]
- 		Values: (N: 421, S: 401, E: 412, W: 410, U: 511, D: 311) 
- 		Coords: (-0.700000, -0.700000,-0.100000) 
-cell[412]
- 		Values: (N: 422, S: 402, E: 413, W: 411, U: 512, D: 312) 
- 		Coords: (-0.500000, -0.700000,-0.100000) 
-cell[413]
- 		Values: (N: 423, S: 403, E: 414, W: 412, U: 513, D: 313) 
- 		Coords: (-0.300000, -0.700000,-0.100000) 
-cell[414]
- 		Values: (N: 424, S: 404, E: 415, W: 413, U: 514, D: 314) 
- 		Coords: (-0.100000, -0.700000,-0.100000) 
-cell[415]
- 		Values: (N: 425, S: 405, E: 416, W: 414, U: 515, D: 315) 
- 		Coords: (0.100000, -0.700000,-0.100000) 
-cell[416]
- 		Values: (N: 426, S: 406, E: 417, W: 415, U: 516, D: 316) 
- 		Coords: (0.300000, -0.700000,-0.100000) 
-cell[417]
- 		Values: (N: 427, S: 407, E: 418, W: 416, U: 517, D: 317) 
- 		Coords: (0.500000, -0.700000,-0.100000) 
-cell[418]
- 		Values: (N: 428, S: 408, E: 419, W: 417, U: 518, D: 318) 
- 		Coords: (0.700000, -0.700000,-0.100000) 
-cell[419]
- 		Values: (N: 429, S: 409, E: -2, W: 418, U: 519, D: 319) 
- 		Coords: (0.900000, -0.700000,-0.100000) 
-cell[420]
- 		Values: (N: 430, S: 410, E: 421, W: -2, U: 520, D: 320) 
- 		Coords: (-0.900000, -0.500000,-0.100000) 
-cell[421]
- 		Values: (N: 431, S: 411, E: 422, W: 420, U: 521, D: 321) 
- 		Coords: (-0.700000, -0.500000,-0.100000) 
-cell[422]
- 		Values: (N: 432, S: 412, E: 423, W: 421, U: 522, D: 322) 
- 		Coords: (-0.500000, -0.500000,-0.100000) 
-cell[423]
- 		Values: (N: 433, S: 413, E: 424, W: 422, U: 523, D: 323) 
- 		Coords: (-0.300000, -0.500000,-0.100000) 
-cell[424]
- 		Values: (N: 434, S: 414, E: 425, W: 423, U: 524, D: 324) 
- 		Coords: (-0.100000, -0.500000,-0.100000) 
-cell[425]
- 		Values: (N: 435, S: 415, E: 426, W: 424, U: 525, D: 325) 
- 		Coords: (0.100000, -0.500000,-0.100000) 
-cell[426]
- 		Values: (N: 436, S: 416, E: 427, W: 425, U: 526, D: 326) 
- 		Coords: (0.300000, -0.500000,-0.100000) 
-cell[427]
- 		Values: (N: 437, S: 417, E: 428, W: 426, U: 527, D: 327) 
- 		Coords: (0.500000, -0.500000,-0.100000) 
-cell[428]
- 		Values: (N: 438, S: 418, E: 429, W: 427, U: 528, D: 328) 
- 		Coords: (0.700000, -0.500000,-0.100000) 
-cell[429]
- 		Values: (N: 439, S: 419, E: -2, W: 428, U: 529, D: 329) 
- 		Coords: (0.900000, -0.500000,-0.100000) 
-cell[430]
- 		Values: (N: 440, S: 420, E: 431, W: -2, U: 530, D: 330) 
- 		Coords: (-0.900000, -0.300000,-0.100000) 
-cell[431]
- 		Values: (N: 441, S: 421, E: 432, W: 430, U: 531, D: 331) 
- 		Coords: (-0.700000, -0.300000,-0.100000) 
-cell[432]
- 		Values: (N: 442, S: 422, E: 433, W: 431, U: 532, D: 332) 
- 		Coords: (-0.500000, -0.300000,-0.100000) 
-cell[433]
- 		Values: (N: 443, S: 423, E: 434, W: 432, U: 533, D: 333) 
- 		Coords: (-0.300000, -0.300000,-0.100000) 
-cell[434]
- 		Values: (N: 444, S: 424, E: 435, W: 433, U: 534, D: 334) 
- 		Coords: (-0.100000, -0.300000,-0.100000) 
-cell[435]
- 		Values: (N: 445, S: 425, E: 436, W: 434, U: 535, D: 335) 
- 		Coords: (0.100000, -0.300000,-0.100000) 
-cell[436]
- 		Values: (N: 446, S: 426, E: 437, W: 435, U: 536, D: 336) 
- 		Coords: (0.300000, -0.300000,-0.100000) 
-cell[437]
- 		Values: (N: 447, S: 427, E: 438, W: 436, U: 537, D: 337) 
- 		Coords: (0.500000, -0.300000,-0.100000) 
-cell[438]
- 		Values: (N: 448, S: 428, E: 439, W: 437, U: 538, D: 338) 
- 		Coords: (0.700000, -0.300000,-0.100000) 
-cell[439]
- 		Values: (N: 449, S: 429, E: -2, W: 438, U: 539, D: 339) 
- 		Coords: (0.900000, -0.300000,-0.100000) 
-cell[440]
- 		Values: (N: 450, S: 430, E: 441, W: -2, U: 540, D: 340) 
- 		Coords: (-0.900000, -0.100000,-0.100000) 
-cell[441]
- 		Values: (N: 451, S: 431, E: 442, W: 440, U: 541, D: 341) 
- 		Coords: (-0.700000, -0.100000,-0.100000) 
-cell[442]
- 		Values: (N: 452, S: 432, E: 443, W: 441, U: 542, D: 342) 
- 		Coords: (-0.500000, -0.100000,-0.100000) 
-cell[443]
- 		Values: (N: 453, S: 433, E: 444, W: 442, U: 543, D: 343) 
- 		Coords: (-0.300000, -0.100000,-0.100000) 
-cell[444]
- 		Values: (N: 454, S: 434, E: 445, W: 443, U: 544, D: 344) 
- 		Coords: (-0.100000, -0.100000,-0.100000) 
-cell[445]
- 		Values: (N: 455, S: 435, E: 446, W: 444, U: 545, D: 345) 
- 		Coords: (0.100000, -0.100000,-0.100000) 
-cell[446]
- 		Values: (N: 456, S: 436, E: 447, W: 445, U: 546, D: 346) 
- 		Coords: (0.300000, -0.100000,-0.100000) 
-cell[447]
- 		Values: (N: 457, S: 437, E: 448, W: 446, U: 547, D: 347) 
- 		Coords: (0.500000, -0.100000,-0.100000) 
-cell[448]
- 		Values: (N: 458, S: 438, E: 449, W: 447, U: 548, D: 348) 
- 		Coords: (0.700000, -0.100000,-0.100000) 
-cell[449]
- 		Values: (N: 459, S: 439, E: -2, W: 448, U: 549, D: 349) 
- 		Coords: (0.900000, -0.100000,-0.100000) 
-cell[450]
- 		Values: (N: 460, S: 440, E: 451, W: -2, U: 550, D: 350) 
- 		Coords: (-0.900000, 0.100000,-0.100000) 
-cell[451]
- 		Values: (N: 461, S: 441, E: 452, W: 450, U: 551, D: 351) 
- 		Coords: (-0.700000, 0.100000,-0.100000) 
-cell[452]
- 		Values: (N: 462, S: 442, E: 453, W: 451, U: 552, D: 352) 
- 		Coords: (-0.500000, 0.100000,-0.100000) 
-cell[453]
- 		Values: (N: 463, S: 443, E: 454, W: 452, U: 553, D: 353) 
- 		Coords: (-0.300000, 0.100000,-0.100000) 
-cell[454]
- 		Values: (N: 464, S: 444, E: 455, W: 453, U: 554, D: 354) 
- 		Coords: (-0.100000, 0.100000,-0.100000) 
-cell[455]
- 		Values: (N: 465, S: 445, E: 456, W: 454, U: 555, D: 355) 
- 		Coords: (0.100000, 0.100000,-0.100000) 
-cell[456]
- 		Values: (N: 466, S: 446, E: 457, W: 455, U: 556, D: 356) 
- 		Coords: (0.300000, 0.100000,-0.100000) 
-cell[457]
- 		Values: (N: 467, S: 447, E: 458, W: 456, U: 557, D: 357) 
- 		Coords: (0.500000, 0.100000,-0.100000) 
-cell[458]
- 		Values: (N: 468, S: 448, E: 459, W: 457, U: 558, D: 358) 
- 		Coords: (0.700000, 0.100000,-0.100000) 
-cell[459]
- 		Values: (N: 469, S: 449, E: -2, W: 458, U: 559, D: 359) 
- 		Coords: (0.900000, 0.100000,-0.100000) 
-cell[460]
- 		Values: (N: 470, S: 450, E: 461, W: -2, U: 560, D: 360) 
- 		Coords: (-0.900000, 0.300000,-0.100000) 
-cell[461]
- 		Values: (N: 471, S: 451, E: 462, W: 460, U: 561, D: 361) 
- 		Coords: (-0.700000, 0.300000,-0.100000) 
-cell[462]
- 		Values: (N: 472, S: 452, E: 463, W: 461, U: 562, D: 362) 
- 		Coords: (-0.500000, 0.300000,-0.100000) 
-cell[463]
- 		Values: (N: 473, S: 453, E: 464, W: 462, U: 563, D: 363) 
- 		Coords: (-0.300000, 0.300000,-0.100000) 
-cell[464]
- 		Values: (N: 474, S: 454, E: 465, W: 463, U: 564, D: 364) 
- 		Coords: (-0.100000, 0.300000,-0.100000) 
-cell[465]
- 		Values: (N: 475, S: 455, E: 466, W: 464, U: 565, D: 365) 
- 		Coords: (0.100000, 0.300000,-0.100000) 
-cell[466]
- 		Values: (N: 476, S: 456, E: 467, W: 465, U: 566, D: 366) 
- 		Coords: (0.300000, 0.300000,-0.100000) 
-cell[467]
- 		Values: (N: 477, S: 457, E: 468, W: 466, U: 567, D: 367) 
- 		Coords: (0.500000, 0.300000,-0.100000) 
-cell[468]
- 		Values: (N: 478, S: 458, E: 469, W: 467, U: 568, D: 368) 
- 		Coords: (0.700000, 0.300000,-0.100000) 
-cell[469]
- 		Values: (N: 479, S: 459, E: -2, W: 468, U: 569, D: 369) 
- 		Coords: (0.900000, 0.300000,-0.100000) 
-cell[470]
- 		Values: (N: 480, S: 460, E: 471, W: -2, U: 570, D: 370) 
- 		Coords: (-0.900000, 0.500000,-0.100000) 
-cell[471]
- 		Values: (N: 481, S: 461, E: 472, W: 470, U: 571, D: 371) 
- 		Coords: (-0.700000, 0.500000,-0.100000) 
-cell[472]
- 		Values: (N: 482, S: 462, E: 473, W: 471, U: 572, D: 372) 
- 		Coords: (-0.500000, 0.500000,-0.100000) 
-cell[473]
- 		Values: (N: 483, S: 463, E: 474, W: 472, U: 573, D: 373) 
- 		Coords: (-0.300000, 0.500000,-0.100000) 
-cell[474]
- 		Values: (N: 484, S: 464, E: 475, W: 473, U: 574, D: 374) 
- 		Coords: (-0.100000, 0.500000,-0.100000) 
-cell[475]
- 		Values: (N: 485, S: 465, E: 476, W: 474, U: 575, D: 375) 
- 		Coords: (0.100000, 0.500000,-0.100000) 
-cell[476]
- 		Values: (N: 486, S: 466, E: 477, W: 475, U: 576, D: 376) 
- 		Coords: (0.300000, 0.500000,-0.100000) 
-cell[477]
- 		Values: (N: 487, S: 467, E: 478, W: 476, U: 577, D: 377) 
- 		Coords: (0.500000, 0.500000,-0.100000) 
-cell[478]
- 		Values: (N: 488, S: 468, E: 479, W: 477, U: 578, D: 378) 
- 		Coords: (0.700000, 0.500000,-0.100000) 
-cell[479]
- 		Values: (N: 489, S: 469, E: -2, W: 478, U: 579, D: 379) 
- 		Coords: (0.900000, 0.500000,-0.100000) 
-cell[480]
- 		Values: (N: 490, S: 470, E: 481, W: -2, U: 580, D: 380) 
- 		Coords: (-0.900000, 0.700000,-0.100000) 
-cell[481]
- 		Values: (N: 491, S: 471, E: 482, W: 480, U: 581, D: 381) 
- 		Coords: (-0.700000, 0.700000,-0.100000) 
-cell[482]
- 		Values: (N: 492, S: 472, E: 483, W: 481, U: 582, D: 382) 
- 		Coords: (-0.500000, 0.700000,-0.100000) 
-cell[483]
- 		Values: (N: 493, S: 473, E: 484, W: 482, U: 583, D: 383) 
- 		Coords: (-0.300000, 0.700000,-0.100000) 
-cell[484]
- 		Values: (N: 494, S: 474, E: 485, W: 483, U: 584, D: 384) 
- 		Coords: (-0.100000, 0.700000,-0.100000) 
-cell[485]
- 		Values: (N: 495, S: 475, E: 486, W: 484, U: 585, D: 385) 
- 		Coords: (0.100000, 0.700000,-0.100000) 
-cell[486]
- 		Values: (N: 496, S: 476, E: 487, W: 485, U: 586, D: 386) 
- 		Coords: (0.300000, 0.700000,-0.100000) 
-cell[487]
- 		Values: (N: 497, S: 477, E: 488, W: 486, U: 587, D: 387) 
- 		Coords: (0.500000, 0.700000,-0.100000) 
-cell[488]
- 		Values: (N: 498, S: 478, E: 489, W: 487, U: 588, D: 388) 
- 		Coords: (0.700000, 0.700000,-0.100000) 
-cell[489]
- 		Values: (N: 499, S: 479, E: -2, W: 488, U: 589, D: 389) 
- 		Coords: (0.900000, 0.700000,-0.100000) 
-cell[490]
- 		Values: (N: -2, S: 480, E: 491, W: -2, U: 590, D: 390) 
- 		Coords: (-0.900000, 0.900000,-0.100000) 
-cell[491]
- 		Values: (N: -2, S: 481, E: 492, W: 490, U: 591, D: 391) 
- 		Coords: (-0.700000, 0.900000,-0.100000) 
-cell[492]
- 		Values: (N: -2, S: 482, E: 493, W: 491, U: 592, D: 392) 
- 		Coords: (-0.500000, 0.900000,-0.100000) 
-cell[493]
- 		Values: (N: -2, S: 483, E: 494, W: 492, U: 593, D: 393) 
- 		Coords: (-0.300000, 0.900000,-0.100000) 
-cell[494]
- 		Values: (N: -2, S: 484, E: 495, W: 493, U: 594, D: 394) 
- 		Coords: (-0.100000, 0.900000,-0.100000) 
-cell[495]
- 		Values: (N: -2, S: 485, E: 496, W: 494, U: 595, D: 395) 
- 		Coords: (0.100000, 0.900000,-0.100000) 
-cell[496]
- 		Values: (N: -2, S: 486, E: 497, W: 495, U: 596, D: 396) 
- 		Coords: (0.300000, 0.900000,-0.100000) 
-cell[497]
- 		Values: (N: -2, S: 487, E: 498, W: 496, U: 597, D: 397) 
- 		Coords: (0.500000, 0.900000,-0.100000) 
-cell[498]
- 		Values: (N: -2, S: 488, E: 499, W: 497, U: 598, D: 398) 
- 		Coords: (0.700000, 0.900000,-0.100000) 
-cell[499]
- 		Values: (N: -2, S: 489, E: -2, W: 498, U: 599, D: 399) 
- 		Coords: (0.900000, 0.900000,-0.100000) 
-cell[500]
- 		Values: (N: 510, S: -2, E: 501, W: -2, U: 600, D: 400) 
- 		Coords: (-0.900000, -0.900000,0.100000) 
-cell[501]
- 		Values: (N: 511, S: -2, E: 502, W: 500, U: 601, D: 401) 
- 		Coords: (-0.700000, -0.900000,0.100000) 
-cell[502]
- 		Values: (N: 512, S: -2, E: 503, W: 501, U: 602, D: 402) 
- 		Coords: (-0.500000, -0.900000,0.100000) 
-cell[503]
- 		Values: (N: 513, S: -2, E: 504, W: 502, U: 603, D: 403) 
- 		Coords: (-0.300000, -0.900000,0.100000) 
-cell[504]
- 		Values: (N: 514, S: -2, E: 505, W: 503, U: 604, D: 404) 
- 		Coords: (-0.100000, -0.900000,0.100000) 
-cell[505]
- 		Values: (N: 515, S: -2, E: 506, W: 504, U: 605, D: 405) 
- 		Coords: (0.100000, -0.900000,0.100000) 
-cell[506]
- 		Values: (N: 516, S: -2, E: 507, W: 505, U: 606, D: 406) 
- 		Coords: (0.300000, -0.900000,0.100000) 
-cell[507]
- 		Values: (N: 517, S: -2, E: 508, W: 506, U: 607, D: 407) 
- 		Coords: (0.500000, -0.900000,0.100000) 
-cell[508]
- 		Values: (N: 518, S: -2, E: 509, W: 507, U: 608, D: 408) 
- 		Coords: (0.700000, -0.900000,0.100000) 
-cell[509]
- 		Values: (N: 519, S: -2, E: -2, W: 508, U: 609, D: 409) 
- 		Coords: (0.900000, -0.900000,0.100000) 
-cell[510]
- 		Values: (N: 520, S: 500, E: 511, W: -2, U: 610, D: 410) 
- 		Coords: (-0.900000, -0.700000,0.100000) 
-cell[511]
- 		Values: (N: 521, S: 501, E: 512, W: 510, U: 611, D: 411) 
- 		Coords: (-0.700000, -0.700000,0.100000) 
-cell[512]
- 		Values: (N: 522, S: 502, E: 513, W: 511, U: 612, D: 412) 
- 		Coords: (-0.500000, -0.700000,0.100000) 
-cell[513]
- 		Values: (N: 523, S: 503, E: 514, W: 512, U: 613, D: 413) 
- 		Coords: (-0.300000, -0.700000,0.100000) 
-cell[514]
- 		Values: (N: 524, S: 504, E: 515, W: 513, U: 614, D: 414) 
- 		Coords: (-0.100000, -0.700000,0.100000) 
-cell[515]
- 		Values: (N: 525, S: 505, E: 516, W: 514, U: 615, D: 415) 
- 		Coords: (0.100000, -0.700000,0.100000) 
-cell[516]
- 		Values: (N: 526, S: 506, E: 517, W: 515, U: 616, D: 416) 
- 		Coords: (0.300000, -0.700000,0.100000) 
-cell[517]
- 		Values: (N: 527, S: 507, E: 518, W: 516, U: 617, D: 417) 
- 		Coords: (0.500000, -0.700000,0.100000) 
-cell[518]
- 		Values: (N: 528, S: 508, E: 519, W: 517, U: 618, D: 418) 
- 		Coords: (0.700000, -0.700000,0.100000) 
-cell[519]
- 		Values: (N: 529, S: 509, E: -2, W: 518, U: 619, D: 419) 
- 		Coords: (0.900000, -0.700000,0.100000) 
-cell[520]
- 		Values: (N: 530, S: 510, E: 521, W: -2, U: 620, D: 420) 
- 		Coords: (-0.900000, -0.500000,0.100000) 
-cell[521]
- 		Values: (N: 531, S: 511, E: 522, W: 520, U: 621, D: 421) 
- 		Coords: (-0.700000, -0.500000,0.100000) 
-cell[522]
- 		Values: (N: 532, S: 512, E: 523, W: 521, U: 622, D: 422) 
- 		Coords: (-0.500000, -0.500000,0.100000) 
-cell[523]
- 		Values: (N: 533, S: 513, E: 524, W: 522, U: 623, D: 423) 
- 		Coords: (-0.300000, -0.500000,0.100000) 
-cell[524]
- 		Values: (N: 534, S: 514, E: 525, W: 523, U: 624, D: 424) 
- 		Coords: (-0.100000, -0.500000,0.100000) 
-cell[525]
- 		Values: (N: 535, S: 515, E: 526, W: 524, U: 625, D: 425) 
- 		Coords: (0.100000, -0.500000,0.100000) 
-cell[526]
- 		Values: (N: 536, S: 516, E: 527, W: 525, U: 626, D: 426) 
- 		Coords: (0.300000, -0.500000,0.100000) 
-cell[527]
- 		Values: (N: 537, S: 517, E: 528, W: 526, U: 627, D: 427) 
- 		Coords: (0.500000, -0.500000,0.100000) 
-cell[528]
- 		Values: (N: 538, S: 518, E: 529, W: 527, U: 628, D: 428) 
- 		Coords: (0.700000, -0.500000,0.100000) 
-cell[529]
- 		Values: (N: 539, S: 519, E: -2, W: 528, U: 629, D: 429) 
- 		Coords: (0.900000, -0.500000,0.100000) 
-cell[530]
- 		Values: (N: 540, S: 520, E: 531, W: -2, U: 630, D: 430) 
- 		Coords: (-0.900000, -0.300000,0.100000) 
-cell[531]
- 		Values: (N: 541, S: 521, E: 532, W: 530, U: 631, D: 431) 
- 		Coords: (-0.700000, -0.300000,0.100000) 
-cell[532]
- 		Values: (N: 542, S: 522, E: 533, W: 531, U: 632, D: 432) 
- 		Coords: (-0.500000, -0.300000,0.100000) 
-cell[533]
- 		Values: (N: 543, S: 523, E: 534, W: 532, U: 633, D: 433) 
- 		Coords: (-0.300000, -0.300000,0.100000) 
-cell[534]
- 		Values: (N: 544, S: 524, E: 535, W: 533, U: 634, D: 434) 
- 		Coords: (-0.100000, -0.300000,0.100000) 
-cell[535]
- 		Values: (N: 545, S: 525, E: 536, W: 534, U: 635, D: 435) 
- 		Coords: (0.100000, -0.300000,0.100000) 
-cell[536]
- 		Values: (N: 546, S: 526, E: 537, W: 535, U: 636, D: 436) 
- 		Coords: (0.300000, -0.300000,0.100000) 
-cell[537]
- 		Values: (N: 547, S: 527, E: 538, W: 536, U: 637, D: 437) 
- 		Coords: (0.500000, -0.300000,0.100000) 
-cell[538]
- 		Values: (N: 548, S: 528, E: 539, W: 537, U: 638, D: 438) 
- 		Coords: (0.700000, -0.300000,0.100000) 
-cell[539]
- 		Values: (N: 549, S: 529, E: -2, W: 538, U: 639, D: 439) 
- 		Coords: (0.900000, -0.300000,0.100000) 
-cell[540]
- 		Values: (N: 550, S: 530, E: 541, W: -2, U: 640, D: 440) 
- 		Coords: (-0.900000, -0.100000,0.100000) 
-cell[541]
- 		Values: (N: 551, S: 531, E: 542, W: 540, U: 641, D: 441) 
- 		Coords: (-0.700000, -0.100000,0.100000) 
-cell[542]
- 		Values: (N: 552, S: 532, E: 543, W: 541, U: 642, D: 442) 
- 		Coords: (-0.500000, -0.100000,0.100000) 
-cell[543]
- 		Values: (N: 553, S: 533, E: 544, W: 542, U: 643, D: 443) 
- 		Coords: (-0.300000, -0.100000,0.100000) 
-cell[544]
- 		Values: (N: 554, S: 534, E: 545, W: 543, U: 644, D: 444) 
- 		Coords: (-0.100000, -0.100000,0.100000) 
-cell[545]
- 		Values: (N: 555, S: 535, E: 546, W: 544, U: 645, D: 445) 
- 		Coords: (0.100000, -0.100000,0.100000) 
-cell[546]
- 		Values: (N: 556, S: 536, E: 547, W: 545, U: 646, D: 446) 
- 		Coords: (0.300000, -0.100000,0.100000) 
-cell[547]
- 		Values: (N: 557, S: 537, E: 548, W: 546, U: 647, D: 447) 
- 		Coords: (0.500000, -0.100000,0.100000) 
-cell[548]
- 		Values: (N: 558, S: 538, E: 549, W: 547, U: 648, D: 448) 
- 		Coords: (0.700000, -0.100000,0.100000) 
-cell[549]
- 		Values: (N: 559, S: 539, E: -2, W: 548, U: 649, D: 449) 
- 		Coords: (0.900000, -0.100000,0.100000) 
-cell[550]
- 		Values: (N: 560, S: 540, E: 551, W: -2, U: 650, D: 450) 
- 		Coords: (-0.900000, 0.100000,0.100000) 
-cell[551]
- 		Values: (N: 561, S: 541, E: 552, W: 550, U: 651, D: 451) 
- 		Coords: (-0.700000, 0.100000,0.100000) 
-cell[552]
- 		Values: (N: 562, S: 542, E: 553, W: 551, U: 652, D: 452) 
- 		Coords: (-0.500000, 0.100000,0.100000) 
-cell[553]
- 		Values: (N: 563, S: 543, E: 554, W: 552, U: 653, D: 453) 
- 		Coords: (-0.300000, 0.100000,0.100000) 
-cell[554]
- 		Values: (N: 564, S: 544, E: 555, W: 553, U: 654, D: 454) 
- 		Coords: (-0.100000, 0.100000,0.100000) 
-cell[555]
- 		Values: (N: 565, S: 545, E: 556, W: 554, U: 655, D: 455) 
- 		Coords: (0.100000, 0.100000,0.100000) 
-cell[556]
- 		Values: (N: 566, S: 546, E: 557, W: 555, U: 656, D: 456) 
- 		Coords: (0.300000, 0.100000,0.100000) 
-cell[557]
- 		Values: (N: 567, S: 547, E: 558, W: 556, U: 657, D: 457) 
- 		Coords: (0.500000, 0.100000,0.100000) 
-cell[558]
- 		Values: (N: 568, S: 548, E: 559, W: 557, U: 658, D: 458) 
- 		Coords: (0.700000, 0.100000,0.100000) 
-cell[559]
- 		Values: (N: 569, S: 549, E: -2, W: 558, U: 659, D: 459) 
- 		Coords: (0.900000, 0.100000,0.100000) 
-cell[560]
- 		Values: (N: 570, S: 550, E: 561, W: -2, U: 660, D: 460) 
- 		Coords: (-0.900000, 0.300000,0.100000) 
-cell[561]
- 		Values: (N: 571, S: 551, E: 562, W: 560, U: 661, D: 461) 
- 		Coords: (-0.700000, 0.300000,0.100000) 
-cell[562]
- 		Values: (N: 572, S: 552, E: 563, W: 561, U: 662, D: 462) 
- 		Coords: (-0.500000, 0.300000,0.100000) 
-cell[563]
- 		Values: (N: 573, S: 553, E: 564, W: 562, U: 663, D: 463) 
- 		Coords: (-0.300000, 0.300000,0.100000) 
-cell[564]
- 		Values: (N: 574, S: 554, E: 565, W: 563, U: 664, D: 464) 
- 		Coords: (-0.100000, 0.300000,0.100000) 
-cell[565]
- 		Values: (N: 575, S: 555, E: 566, W: 564, U: 665, D: 465) 
- 		Coords: (0.100000, 0.300000,0.100000) 
-cell[566]
- 		Values: (N: 576, S: 556, E: 567, W: 565, U: 666, D: 466) 
- 		Coords: (0.300000, 0.300000,0.100000) 
-cell[567]
- 		Values: (N: 577, S: 557, E: 568, W: 566, U: 667, D: 467) 
- 		Coords: (0.500000, 0.300000,0.100000) 
-cell[568]
- 		Values: (N: 578, S: 558, E: 569, W: 567, U: 668, D: 468) 
- 		Coords: (0.700000, 0.300000,0.100000) 
-cell[569]
- 		Values: (N: 579, S: 559, E: -2, W: 568, U: 669, D: 469) 
- 		Coords: (0.900000, 0.300000,0.100000) 
-cell[570]
- 		Values: (N: 580, S: 560, E: 571, W: -2, U: 670, D: 470) 
- 		Coords: (-0.900000, 0.500000,0.100000) 
-cell[571]
- 		Values: (N: 581, S: 561, E: 572, W: 570, U: 671, D: 471) 
- 		Coords: (-0.700000, 0.500000,0.100000) 
-cell[572]
- 		Values: (N: 582, S: 562, E: 573, W: 571, U: 672, D: 472) 
- 		Coords: (-0.500000, 0.500000,0.100000) 
-cell[573]
- 		Values: (N: 583, S: 563, E: 574, W: 572, U: 673, D: 473) 
- 		Coords: (-0.300000, 0.500000,0.100000) 
-cell[574]
- 		Values: (N: 584, S: 564, E: 575, W: 573, U: 674, D: 474) 
- 		Coords: (-0.100000, 0.500000,0.100000) 
-cell[575]
- 		Values: (N: 585, S: 565, E: 576, W: 574, U: 675, D: 475) 
- 		Coords: (0.100000, 0.500000,0.100000) 
-cell[576]
- 		Values: (N: 586, S: 566, E: 577, W: 575, U: 676, D: 476) 
- 		Coords: (0.300000, 0.500000,0.100000) 
-cell[577]
- 		Values: (N: 587, S: 567, E: 578, W: 576, U: 677, D: 477) 
- 		Coords: (0.500000, 0.500000,0.100000) 
-cell[578]
- 		Values: (N: 588, S: 568, E: 579, W: 577, U: 678, D: 478) 
- 		Coords: (0.700000, 0.500000,0.100000) 
-cell[579]
- 		Values: (N: 589, S: 569, E: -2, W: 578, U: 679, D: 479) 
- 		Coords: (0.900000, 0.500000,0.100000) 
-cell[580]
- 		Values: (N: 590, S: 570, E: 581, W: -2, U: 680, D: 480) 
- 		Coords: (-0.900000, 0.700000,0.100000) 
-cell[581]
- 		Values: (N: 591, S: 571, E: 582, W: 580, U: 681, D: 481) 
- 		Coords: (-0.700000, 0.700000,0.100000) 
-cell[582]
- 		Values: (N: 592, S: 572, E: 583, W: 581, U: 682, D: 482) 
- 		Coords: (-0.500000, 0.700000,0.100000) 
-cell[583]
- 		Values: (N: 593, S: 573, E: 584, W: 582, U: 683, D: 483) 
- 		Coords: (-0.300000, 0.700000,0.100000) 
-cell[584]
- 		Values: (N: 594, S: 574, E: 585, W: 583, U: 684, D: 484) 
- 		Coords: (-0.100000, 0.700000,0.100000) 
-cell[585]
- 		Values: (N: 595, S: 575, E: 586, W: 584, U: 685, D: 485) 
- 		Coords: (0.100000, 0.700000,0.100000) 
-cell[586]
- 		Values: (N: 596, S: 576, E: 587, W: 585, U: 686, D: 486) 
- 		Coords: (0.300000, 0.700000,0.100000) 
-cell[587]
- 		Values: (N: 597, S: 577, E: 588, W: 586, U: 687, D: 487) 
- 		Coords: (0.500000, 0.700000,0.100000) 
-cell[588]
- 		Values: (N: 598, S: 578, E: 589, W: 587, U: 688, D: 488) 
- 		Coords: (0.700000, 0.700000,0.100000) 
-cell[589]
- 		Values: (N: 599, S: 579, E: -2, W: 588, U: 689, D: 489) 
- 		Coords: (0.900000, 0.700000,0.100000) 
-cell[590]
- 		Values: (N: -2, S: 580, E: 591, W: -2, U: 690, D: 490) 
- 		Coords: (-0.900000, 0.900000,0.100000) 
-cell[591]
- 		Values: (N: -2, S: 581, E: 592, W: 590, U: 691, D: 491) 
- 		Coords: (-0.700000, 0.900000,0.100000) 
-cell[592]
- 		Values: (N: -2, S: 582, E: 593, W: 591, U: 692, D: 492) 
- 		Coords: (-0.500000, 0.900000,0.100000) 
-cell[593]
- 		Values: (N: -2, S: 583, E: 594, W: 592, U: 693, D: 493) 
- 		Coords: (-0.300000, 0.900000,0.100000) 
-cell[594]
- 		Values: (N: -2, S: 584, E: 595, W: 593, U: 694, D: 494) 
- 		Coords: (-0.100000, 0.900000,0.100000) 
-cell[595]
- 		Values: (N: -2, S: 585, E: 596, W: 594, U: 695, D: 495) 
- 		Coords: (0.100000, 0.900000,0.100000) 
-cell[596]
- 		Values: (N: -2, S: 586, E: 597, W: 595, U: 696, D: 496) 
- 		Coords: (0.300000, 0.900000,0.100000) 
-cell[597]
- 		Values: (N: -2, S: 587, E: 598, W: 596, U: 697, D: 497) 
- 		Coords: (0.500000, 0.900000,0.100000) 
-cell[598]
- 		Values: (N: -2, S: 588, E: 599, W: 597, U: 698, D: 498) 
- 		Coords: (0.700000, 0.900000,0.100000) 
-cell[599]
- 		Values: (N: -2, S: 589, E: -2, W: 598, U: 699, D: 499) 
- 		Coords: (0.900000, 0.900000,0.100000) 
-cell[600]
- 		Values: (N: 610, S: -2, E: 601, W: -2, U: 700, D: 500) 
- 		Coords: (-0.900000, -0.900000,0.300000) 
-cell[601]
- 		Values: (N: 611, S: -2, E: 602, W: 600, U: 701, D: 501) 
- 		Coords: (-0.700000, -0.900000,0.300000) 
-cell[602]
- 		Values: (N: 612, S: -2, E: 603, W: 601, U: 702, D: 502) 
- 		Coords: (-0.500000, -0.900000,0.300000) 
-cell[603]
- 		Values: (N: 613, S: -2, E: 604, W: 602, U: 703, D: 503) 
- 		Coords: (-0.300000, -0.900000,0.300000) 
-cell[604]
- 		Values: (N: 614, S: -2, E: 605, W: 603, U: 704, D: 504) 
- 		Coords: (-0.100000, -0.900000,0.300000) 
-cell[605]
- 		Values: (N: 615, S: -2, E: 606, W: 604, U: 705, D: 505) 
- 		Coords: (0.100000, -0.900000,0.300000) 
-cell[606]
- 		Values: (N: 616, S: -2, E: 607, W: 605, U: 706, D: 506) 
- 		Coords: (0.300000, -0.900000,0.300000) 
-cell[607]
- 		Values: (N: 617, S: -2, E: 608, W: 606, U: 707, D: 507) 
- 		Coords: (0.500000, -0.900000,0.300000) 
-cell[608]
- 		Values: (N: 618, S: -2, E: 609, W: 607, U: 708, D: 508) 
- 		Coords: (0.700000, -0.900000,0.300000) 
-cell[609]
- 		Values: (N: 619, S: -2, E: -2, W: 608, U: 709, D: 509) 
- 		Coords: (0.900000, -0.900000,0.300000) 
-cell[610]
- 		Values: (N: 620, S: 600, E: 611, W: -2, U: 710, D: 510) 
- 		Coords: (-0.900000, -0.700000,0.300000) 
-cell[611]
- 		Values: (N: 621, S: 601, E: 612, W: 610, U: 711, D: 511) 
- 		Coords: (-0.700000, -0.700000,0.300000) 
-cell[612]
- 		Values: (N: 622, S: 602, E: 613, W: 611, U: 712, D: 512) 
- 		Coords: (-0.500000, -0.700000,0.300000) 
-cell[613]
- 		Values: (N: 623, S: 603, E: 614, W: 612, U: 713, D: 513) 
- 		Coords: (-0.300000, -0.700000,0.300000) 
-cell[614]
- 		Values: (N: 624, S: 604, E: 615, W: 613, U: 714, D: 514) 
- 		Coords: (-0.100000, -0.700000,0.300000) 
-cell[615]
- 		Values: (N: 625, S: 605, E: 616, W: 614, U: 715, D: 515) 
- 		Coords: (0.100000, -0.700000,0.300000) 
-cell[616]
- 		Values: (N: 626, S: 606, E: 617, W: 615, U: 716, D: 516) 
- 		Coords: (0.300000, -0.700000,0.300000) 
-cell[617]
- 		Values: (N: 627, S: 607, E: 618, W: 616, U: 717, D: 517) 
- 		Coords: (0.500000, -0.700000,0.300000) 
-cell[618]
- 		Values: (N: 628, S: 608, E: 619, W: 617, U: 718, D: 518) 
- 		Coords: (0.700000, -0.700000,0.300000) 
-cell[619]
- 		Values: (N: 629, S: 609, E: -2, W: 618, U: 719, D: 519) 
- 		Coords: (0.900000, -0.700000,0.300000) 
-cell[620]
- 		Values: (N: 630, S: 610, E: 621, W: -2, U: 720, D: 520) 
- 		Coords: (-0.900000, -0.500000,0.300000) 
-cell[621]
- 		Values: (N: 631, S: 611, E: 622, W: 620, U: 721, D: 521) 
- 		Coords: (-0.700000, -0.500000,0.300000) 
-cell[622]
- 		Values: (N: 632, S: 612, E: 623, W: 621, U: 722, D: 522) 
- 		Coords: (-0.500000, -0.500000,0.300000) 
-cell[623]
- 		Values: (N: 633, S: 613, E: 624, W: 622, U: 723, D: 523) 
- 		Coords: (-0.300000, -0.500000,0.300000) 
-cell[624]
- 		Values: (N: 634, S: 614, E: 625, W: 623, U: 724, D: 524) 
- 		Coords: (-0.100000, -0.500000,0.300000) 
-cell[625]
- 		Values: (N: 635, S: 615, E: 626, W: 624, U: 725, D: 525) 
- 		Coords: (0.100000, -0.500000,0.300000) 
-cell[626]
- 		Values: (N: 636, S: 616, E: 627, W: 625, U: 726, D: 526) 
- 		Coords: (0.300000, -0.500000,0.300000) 
-cell[627]
- 		Values: (N: 637, S: 617, E: 628, W: 626, U: 727, D: 527) 
- 		Coords: (0.500000, -0.500000,0.300000) 
-cell[628]
- 		Values: (N: 638, S: 618, E: 629, W: 627, U: 728, D: 528) 
- 		Coords: (0.700000, -0.500000,0.300000) 
-cell[629]
- 		Values: (N: 639, S: 619, E: -2, W: 628, U: 729, D: 529) 
- 		Coords: (0.900000, -0.500000,0.300000) 
-cell[630]
- 		Values: (N: 640, S: 620, E: 631, W: -2, U: 730, D: 530) 
- 		Coords: (-0.900000, -0.300000,0.300000) 
-cell[631]
- 		Values: (N: 641, S: 621, E: 632, W: 630, U: 731, D: 531) 
- 		Coords: (-0.700000, -0.300000,0.300000) 
-cell[632]
- 		Values: (N: 642, S: 622, E: 633, W: 631, U: 732, D: 532) 
- 		Coords: (-0.500000, -0.300000,0.300000) 
-cell[633]
- 		Values: (N: 643, S: 623, E: 634, W: 632, U: 733, D: 533) 
- 		Coords: (-0.300000, -0.300000,0.300000) 
-cell[634]
- 		Values: (N: 644, S: 624, E: 635, W: 633, U: 734, D: 534) 
- 		Coords: (-0.100000, -0.300000,0.300000) 
-cell[635]
- 		Values: (N: 645, S: 625, E: 636, W: 634, U: 735, D: 535) 
- 		Coords: (0.100000, -0.300000,0.300000) 
-cell[636]
- 		Values: (N: 646, S: 626, E: 637, W: 635, U: 736, D: 536) 
- 		Coords: (0.300000, -0.300000,0.300000) 
-cell[637]
- 		Values: (N: 647, S: 627, E: 638, W: 636, U: 737, D: 537) 
- 		Coords: (0.500000, -0.300000,0.300000) 
-cell[638]
- 		Values: (N: 648, S: 628, E: 639, W: 637, U: 738, D: 538) 
- 		Coords: (0.700000, -0.300000,0.300000) 
-cell[639]
- 		Values: (N: 649, S: 629, E: -2, W: 638, U: 739, D: 539) 
- 		Coords: (0.900000, -0.300000,0.300000) 
-cell[640]
- 		Values: (N: 650, S: 630, E: 641, W: -2, U: 740, D: 540) 
- 		Coords: (-0.900000, -0.100000,0.300000) 
-cell[641]
- 		Values: (N: 651, S: 631, E: 642, W: 640, U: 741, D: 541) 
- 		Coords: (-0.700000, -0.100000,0.300000) 
-cell[642]
- 		Values: (N: 652, S: 632, E: 643, W: 641, U: 742, D: 542) 
- 		Coords: (-0.500000, -0.100000,0.300000) 
-cell[643]
- 		Values: (N: 653, S: 633, E: 644, W: 642, U: 743, D: 543) 
- 		Coords: (-0.300000, -0.100000,0.300000) 
-cell[644]
- 		Values: (N: 654, S: 634, E: 645, W: 643, U: 744, D: 544) 
- 		Coords: (-0.100000, -0.100000,0.300000) 
-cell[645]
- 		Values: (N: 655, S: 635, E: 646, W: 644, U: 745, D: 545) 
- 		Coords: (0.100000, -0.100000,0.300000) 
-cell[646]
- 		Values: (N: 656, S: 636, E: 647, W: 645, U: 746, D: 546) 
- 		Coords: (0.300000, -0.100000,0.300000) 
-cell[647]
- 		Values: (N: 657, S: 637, E: 648, W: 646, U: 747, D: 547) 
- 		Coords: (0.500000, -0.100000,0.300000) 
-cell[648]
- 		Values: (N: 658, S: 638, E: 649, W: 647, U: 748, D: 548) 
- 		Coords: (0.700000, -0.100000,0.300000) 
-cell[649]
- 		Values: (N: 659, S: 639, E: -2, W: 648, U: 749, D: 549) 
- 		Coords: (0.900000, -0.100000,0.300000) 
-cell[650]
- 		Values: (N: 660, S: 640, E: 651, W: -2, U: 750, D: 550) 
- 		Coords: (-0.900000, 0.100000,0.300000) 
-cell[651]
- 		Values: (N: 661, S: 641, E: 652, W: 650, U: 751, D: 551) 
- 		Coords: (-0.700000, 0.100000,0.300000) 
-cell[652]
- 		Values: (N: 662, S: 642, E: 653, W: 651, U: 752, D: 552) 
- 		Coords: (-0.500000, 0.100000,0.300000) 
-cell[653]
- 		Values: (N: 663, S: 643, E: 654, W: 652, U: 753, D: 553) 
- 		Coords: (-0.300000, 0.100000,0.300000) 
-cell[654]
- 		Values: (N: 664, S: 644, E: 655, W: 653, U: 754, D: 554) 
- 		Coords: (-0.100000, 0.100000,0.300000) 
-cell[655]
- 		Values: (N: 665, S: 645, E: 656, W: 654, U: 755, D: 555) 
- 		Coords: (0.100000, 0.100000,0.300000) 
-cell[656]
- 		Values: (N: 666, S: 646, E: 657, W: 655, U: 756, D: 556) 
- 		Coords: (0.300000, 0.100000,0.300000) 
-cell[657]
- 		Values: (N: 667, S: 647, E: 658, W: 656, U: 757, D: 557) 
- 		Coords: (0.500000, 0.100000,0.300000) 
-cell[658]
- 		Values: (N: 668, S: 648, E: 659, W: 657, U: 758, D: 558) 
- 		Coords: (0.700000, 0.100000,0.300000) 
-cell[659]
- 		Values: (N: 669, S: 649, E: -2, W: 658, U: 759, D: 559) 
- 		Coords: (0.900000, 0.100000,0.300000) 
-cell[660]
- 		Values: (N: 670, S: 650, E: 661, W: -2, U: 760, D: 560) 
- 		Coords: (-0.900000, 0.300000,0.300000) 
-cell[661]
- 		Values: (N: 671, S: 651, E: 662, W: 660, U: 761, D: 561) 
- 		Coords: (-0.700000, 0.300000,0.300000) 
-cell[662]
- 		Values: (N: 672, S: 652, E: 663, W: 661, U: 762, D: 562) 
- 		Coords: (-0.500000, 0.300000,0.300000) 
-cell[663]
- 		Values: (N: 673, S: 653, E: 664, W: 662, U: 763, D: 563) 
- 		Coords: (-0.300000, 0.300000,0.300000) 
-cell[664]
- 		Values: (N: 674, S: 654, E: 665, W: 663, U: 764, D: 564) 
- 		Coords: (-0.100000, 0.300000,0.300000) 
-cell[665]
- 		Values: (N: 675, S: 655, E: 666, W: 664, U: 765, D: 565) 
- 		Coords: (0.100000, 0.300000,0.300000) 
-cell[666]
- 		Values: (N: 676, S: 656, E: 667, W: 665, U: 766, D: 566) 
- 		Coords: (0.300000, 0.300000,0.300000) 
-cell[667]
- 		Values: (N: 677, S: 657, E: 668, W: 666, U: 767, D: 567) 
- 		Coords: (0.500000, 0.300000,0.300000) 
-cell[668]
- 		Values: (N: 678, S: 658, E: 669, W: 667, U: 768, D: 568) 
- 		Coords: (0.700000, 0.300000,0.300000) 
-cell[669]
- 		Values: (N: 679, S: 659, E: -2, W: 668, U: 769, D: 569) 
- 		Coords: (0.900000, 0.300000,0.300000) 
-cell[670]
- 		Values: (N: 680, S: 660, E: 671, W: -2, U: 770, D: 570) 
- 		Coords: (-0.900000, 0.500000,0.300000) 
-cell[671]
- 		Values: (N: 681, S: 661, E: 672, W: 670, U: 771, D: 571) 
- 		Coords: (-0.700000, 0.500000,0.300000) 
-cell[672]
- 		Values: (N: 682, S: 662, E: 673, W: 671, U: 772, D: 572) 
- 		Coords: (-0.500000, 0.500000,0.300000) 
-cell[673]
- 		Values: (N: 683, S: 663, E: 674, W: 672, U: 773, D: 573) 
- 		Coords: (-0.300000, 0.500000,0.300000) 
-cell[674]
- 		Values: (N: 684, S: 664, E: 675, W: 673, U: 774, D: 574) 
- 		Coords: (-0.100000, 0.500000,0.300000) 
-cell[675]
- 		Values: (N: 685, S: 665, E: 676, W: 674, U: 775, D: 575) 
- 		Coords: (0.100000, 0.500000,0.300000) 
-cell[676]
- 		Values: (N: 686, S: 666, E: 677, W: 675, U: 776, D: 576) 
- 		Coords: (0.300000, 0.500000,0.300000) 
-cell[677]
- 		Values: (N: 687, S: 667, E: 678, W: 676, U: 777, D: 577) 
- 		Coords: (0.500000, 0.500000,0.300000) 
-cell[678]
- 		Values: (N: 688, S: 668, E: 679, W: 677, U: 778, D: 578) 
- 		Coords: (0.700000, 0.500000,0.300000) 
-cell[679]
- 		Values: (N: 689, S: 669, E: -2, W: 678, U: 779, D: 579) 
- 		Coords: (0.900000, 0.500000,0.300000) 
-cell[680]
- 		Values: (N: 690, S: 670, E: 681, W: -2, U: 780, D: 580) 
- 		Coords: (-0.900000, 0.700000,0.300000) 
-cell[681]
- 		Values: (N: 691, S: 671, E: 682, W: 680, U: 781, D: 581) 
- 		Coords: (-0.700000, 0.700000,0.300000) 
-cell[682]
- 		Values: (N: 692, S: 672, E: 683, W: 681, U: 782, D: 582) 
- 		Coords: (-0.500000, 0.700000,0.300000) 
-cell[683]
- 		Values: (N: 693, S: 673, E: 684, W: 682, U: 783, D: 583) 
- 		Coords: (-0.300000, 0.700000,0.300000) 
-cell[684]
- 		Values: (N: 694, S: 674, E: 685, W: 683, U: 784, D: 584) 
- 		Coords: (-0.100000, 0.700000,0.300000) 
-cell[685]
- 		Values: (N: 695, S: 675, E: 686, W: 684, U: 785, D: 585) 
- 		Coords: (0.100000, 0.700000,0.300000) 
-cell[686]
- 		Values: (N: 696, S: 676, E: 687, W: 685, U: 786, D: 586) 
- 		Coords: (0.300000, 0.700000,0.300000) 
-cell[687]
- 		Values: (N: 697, S: 677, E: 688, W: 686, U: 787, D: 587) 
- 		Coords: (0.500000, 0.700000,0.300000) 
-cell[688]
- 		Values: (N: 698, S: 678, E: 689, W: 687, U: 788, D: 588) 
- 		Coords: (0.700000, 0.700000,0.300000) 
-cell[689]
- 		Values: (N: 699, S: 679, E: -2, W: 688, U: 789, D: 589) 
- 		Coords: (0.900000, 0.700000,0.300000) 
-cell[690]
- 		Values: (N: -2, S: 680, E: 691, W: -2, U: 790, D: 590) 
- 		Coords: (-0.900000, 0.900000,0.300000) 
-cell[691]
- 		Values: (N: -2, S: 681, E: 692, W: 690, U: 791, D: 591) 
- 		Coords: (-0.700000, 0.900000,0.300000) 
-cell[692]
- 		Values: (N: -2, S: 682, E: 693, W: 691, U: 792, D: 592) 
- 		Coords: (-0.500000, 0.900000,0.300000) 
-cell[693]
- 		Values: (N: -2, S: 683, E: 694, W: 692, U: 793, D: 593) 
- 		Coords: (-0.300000, 0.900000,0.300000) 
-cell[694]
- 		Values: (N: -2, S: 684, E: 695, W: 693, U: 794, D: 594) 
- 		Coords: (-0.100000, 0.900000,0.300000) 
-cell[695]
- 		Values: (N: -2, S: 685, E: 696, W: 694, U: 795, D: 595) 
- 		Coords: (0.100000, 0.900000,0.300000) 
-cell[696]
- 		Values: (N: -2, S: 686, E: 697, W: 695, U: 796, D: 596) 
- 		Coords: (0.300000, 0.900000,0.300000) 
-cell[697]
- 		Values: (N: -2, S: 687, E: 698, W: 696, U: 797, D: 597) 
- 		Coords: (0.500000, 0.900000,0.300000) 
-cell[698]
- 		Values: (N: -2, S: 688, E: 699, W: 697, U: 798, D: 598) 
- 		Coords: (0.700000, 0.900000,0.300000) 
-cell[699]
- 		Values: (N: -2, S: 689, E: -2, W: 698, U: 799, D: 599) 
- 		Coords: (0.900000, 0.900000,0.300000) 
-cell[700]
- 		Values: (N: 710, S: -2, E: 701, W: -2, U: 800, D: 600) 
- 		Coords: (-0.900000, -0.900000,0.500000) 
-cell[701]
- 		Values: (N: 711, S: -2, E: 702, W: 700, U: 801, D: 601) 
- 		Coords: (-0.700000, -0.900000,0.500000) 
-cell[702]
- 		Values: (N: 712, S: -2, E: 703, W: 701, U: 802, D: 602) 
- 		Coords: (-0.500000, -0.900000,0.500000) 
-cell[703]
- 		Values: (N: 713, S: -2, E: 704, W: 702, U: 803, D: 603) 
- 		Coords: (-0.300000, -0.900000,0.500000) 
-cell[704]
- 		Values: (N: 714, S: -2, E: 705, W: 703, U: 804, D: 604) 
- 		Coords: (-0.100000, -0.900000,0.500000) 
-cell[705]
- 		Values: (N: 715, S: -2, E: 706, W: 704, U: 805, D: 605) 
- 		Coords: (0.100000, -0.900000,0.500000) 
-cell[706]
- 		Values: (N: 716, S: -2, E: 707, W: 705, U: 806, D: 606) 
- 		Coords: (0.300000, -0.900000,0.500000) 
-cell[707]
- 		Values: (N: 717, S: -2, E: 708, W: 706, U: 807, D: 607) 
- 		Coords: (0.500000, -0.900000,0.500000) 
-cell[708]
- 		Values: (N: 718, S: -2, E: 709, W: 707, U: 808, D: 608) 
- 		Coords: (0.700000, -0.900000,0.500000) 
-cell[709]
- 		Values: (N: 719, S: -2, E: -2, W: 708, U: 809, D: 609) 
- 		Coords: (0.900000, -0.900000,0.500000) 
-cell[710]
- 		Values: (N: 720, S: 700, E: 711, W: -2, U: 810, D: 610) 
- 		Coords: (-0.900000, -0.700000,0.500000) 
-cell[711]
- 		Values: (N: 721, S: 701, E: 712, W: 710, U: 811, D: 611) 
- 		Coords: (-0.700000, -0.700000,0.500000) 
-cell[712]
- 		Values: (N: 722, S: 702, E: 713, W: 711, U: 812, D: 612) 
- 		Coords: (-0.500000, -0.700000,0.500000) 
-cell[713]
- 		Values: (N: 723, S: 703, E: 714, W: 712, U: 813, D: 613) 
- 		Coords: (-0.300000, -0.700000,0.500000) 
-cell[714]
- 		Values: (N: 724, S: 704, E: 715, W: 713, U: 814, D: 614) 
- 		Coords: (-0.100000, -0.700000,0.500000) 
-cell[715]
- 		Values: (N: 725, S: 705, E: 716, W: 714, U: 815, D: 615) 
- 		Coords: (0.100000, -0.700000,0.500000) 
-cell[716]
- 		Values: (N: 726, S: 706, E: 717, W: 715, U: 816, D: 616) 
- 		Coords: (0.300000, -0.700000,0.500000) 
-cell[717]
- 		Values: (N: 727, S: 707, E: 718, W: 716, U: 817, D: 617) 
- 		Coords: (0.500000, -0.700000,0.500000) 
-cell[718]
- 		Values: (N: 728, S: 708, E: 719, W: 717, U: 818, D: 618) 
- 		Coords: (0.700000, -0.700000,0.500000) 
-cell[719]
- 		Values: (N: 729, S: 709, E: -2, W: 718, U: 819, D: 619) 
- 		Coords: (0.900000, -0.700000,0.500000) 
-cell[720]
- 		Values: (N: 730, S: 710, E: 721, W: -2, U: 820, D: 620) 
- 		Coords: (-0.900000, -0.500000,0.500000) 
-cell[721]
- 		Values: (N: 731, S: 711, E: 722, W: 720, U: 821, D: 621) 
- 		Coords: (-0.700000, -0.500000,0.500000) 
-cell[722]
- 		Values: (N: 732, S: 712, E: 723, W: 721, U: 822, D: 622) 
- 		Coords: (-0.500000, -0.500000,0.500000) 
-cell[723]
- 		Values: (N: 733, S: 713, E: 724, W: 722, U: 823, D: 623) 
- 		Coords: (-0.300000, -0.500000,0.500000) 
-cell[724]
- 		Values: (N: 734, S: 714, E: 725, W: 723, U: 824, D: 624) 
- 		Coords: (-0.100000, -0.500000,0.500000) 
-cell[725]
- 		Values: (N: 735, S: 715, E: 726, W: 724, U: 825, D: 625) 
- 		Coords: (0.100000, -0.500000,0.500000) 
-cell[726]
- 		Values: (N: 736, S: 716, E: 727, W: 725, U: 826, D: 626) 
- 		Coords: (0.300000, -0.500000,0.500000) 
-cell[727]
- 		Values: (N: 737, S: 717, E: 728, W: 726, U: 827, D: 627) 
- 		Coords: (0.500000, -0.500000,0.500000) 
-cell[728]
- 		Values: (N: 738, S: 718, E: 729, W: 727, U: 828, D: 628) 
- 		Coords: (0.700000, -0.500000,0.500000) 
-cell[729]
- 		Values: (N: 739, S: 719, E: -2, W: 728, U: 829, D: 629) 
- 		Coords: (0.900000, -0.500000,0.500000) 
-cell[730]
- 		Values: (N: 740, S: 720, E: 731, W: -2, U: 830, D: 630) 
- 		Coords: (-0.900000, -0.300000,0.500000) 
-cell[731]
- 		Values: (N: 741, S: 721, E: 732, W: 730, U: 831, D: 631) 
- 		Coords: (-0.700000, -0.300000,0.500000) 
-cell[732]
- 		Values: (N: 742, S: 722, E: 733, W: 731, U: 832, D: 632) 
- 		Coords: (-0.500000, -0.300000,0.500000) 
-cell[733]
- 		Values: (N: 743, S: 723, E: 734, W: 732, U: 833, D: 633) 
- 		Coords: (-0.300000, -0.300000,0.500000) 
-cell[734]
- 		Values: (N: 744, S: 724, E: 735, W: 733, U: 834, D: 634) 
- 		Coords: (-0.100000, -0.300000,0.500000) 
-cell[735]
- 		Values: (N: 745, S: 725, E: 736, W: 734, U: 835, D: 635) 
- 		Coords: (0.100000, -0.300000,0.500000) 
-cell[736]
- 		Values: (N: 746, S: 726, E: 737, W: 735, U: 836, D: 636) 
- 		Coords: (0.300000, -0.300000,0.500000) 
-cell[737]
- 		Values: (N: 747, S: 727, E: 738, W: 736, U: 837, D: 637) 
- 		Coords: (0.500000, -0.300000,0.500000) 
-cell[738]
- 		Values: (N: 748, S: 728, E: 739, W: 737, U: 838, D: 638) 
- 		Coords: (0.700000, -0.300000,0.500000) 
-cell[739]
- 		Values: (N: 749, S: 729, E: -2, W: 738, U: 839, D: 639) 
- 		Coords: (0.900000, -0.300000,0.500000) 
-cell[740]
- 		Values: (N: 750, S: 730, E: 741, W: -2, U: 840, D: 640) 
- 		Coords: (-0.900000, -0.100000,0.500000) 
-cell[741]
- 		Values: (N: 751, S: 731, E: 742, W: 740, U: 841, D: 641) 
- 		Coords: (-0.700000, -0.100000,0.500000) 
-cell[742]
- 		Values: (N: 752, S: 732, E: 743, W: 741, U: 842, D: 642) 
- 		Coords: (-0.500000, -0.100000,0.500000) 
-cell[743]
- 		Values: (N: 753, S: 733, E: 744, W: 742, U: 843, D: 643) 
- 		Coords: (-0.300000, -0.100000,0.500000) 
-cell[744]
- 		Values: (N: 754, S: 734, E: 745, W: 743, U: 844, D: 644) 
- 		Coords: (-0.100000, -0.100000,0.500000) 
-cell[745]
- 		Values: (N: 755, S: 735, E: 746, W: 744, U: 845, D: 645) 
- 		Coords: (0.100000, -0.100000,0.500000) 
-cell[746]
- 		Values: (N: 756, S: 736, E: 747, W: 745, U: 846, D: 646) 
- 		Coords: (0.300000, -0.100000,0.500000) 
-cell[747]
- 		Values: (N: 757, S: 737, E: 748, W: 746, U: 847, D: 647) 
- 		Coords: (0.500000, -0.100000,0.500000) 
-cell[748]
- 		Values: (N: 758, S: 738, E: 749, W: 747, U: 848, D: 648) 
- 		Coords: (0.700000, -0.100000,0.500000) 
-cell[749]
- 		Values: (N: 759, S: 739, E: -2, W: 748, U: 849, D: 649) 
- 		Coords: (0.900000, -0.100000,0.500000) 
-cell[750]
- 		Values: (N: 760, S: 740, E: 751, W: -2, U: 850, D: 650) 
- 		Coords: (-0.900000, 0.100000,0.500000) 
-cell[751]
- 		Values: (N: 761, S: 741, E: 752, W: 750, U: 851, D: 651) 
- 		Coords: (-0.700000, 0.100000,0.500000) 
-cell[752]
- 		Values: (N: 762, S: 742, E: 753, W: 751, U: 852, D: 652) 
- 		Coords: (-0.500000, 0.100000,0.500000) 
-cell[753]
- 		Values: (N: 763, S: 743, E: 754, W: 752, U: 853, D: 653) 
- 		Coords: (-0.300000, 0.100000,0.500000) 
-cell[754]
- 		Values: (N: 764, S: 744, E: 755, W: 753, U: 854, D: 654) 
- 		Coords: (-0.100000, 0.100000,0.500000) 
-cell[755]
- 		Values: (N: 765, S: 745, E: 756, W: 754, U: 855, D: 655) 
- 		Coords: (0.100000, 0.100000,0.500000) 
-cell[756]
- 		Values: (N: 766, S: 746, E: 757, W: 755, U: 856, D: 656) 
- 		Coords: (0.300000, 0.100000,0.500000) 
-cell[757]
- 		Values: (N: 767, S: 747, E: 758, W: 756, U: 857, D: 657) 
- 		Coords: (0.500000, 0.100000,0.500000) 
-cell[758]
- 		Values: (N: 768, S: 748, E: 759, W: 757, U: 858, D: 658) 
- 		Coords: (0.700000, 0.100000,0.500000) 
-cell[759]
- 		Values: (N: 769, S: 749, E: -2, W: 758, U: 859, D: 659) 
- 		Coords: (0.900000, 0.100000,0.500000) 
-cell[760]
- 		Values: (N: 770, S: 750, E: 761, W: -2, U: 860, D: 660) 
- 		Coords: (-0.900000, 0.300000,0.500000) 
-cell[761]
- 		Values: (N: 771, S: 751, E: 762, W: 760, U: 861, D: 661) 
- 		Coords: (-0.700000, 0.300000,0.500000) 
-cell[762]
- 		Values: (N: 772, S: 752, E: 763, W: 761, U: 862, D: 662) 
- 		Coords: (-0.500000, 0.300000,0.500000) 
-cell[763]
- 		Values: (N: 773, S: 753, E: 764, W: 762, U: 863, D: 663) 
- 		Coords: (-0.300000, 0.300000,0.500000) 
-cell[764]
- 		Values: (N: 774, S: 754, E: 765, W: 763, U: 864, D: 664) 
- 		Coords: (-0.100000, 0.300000,0.500000) 
-cell[765]
- 		Values: (N: 775, S: 755, E: 766, W: 764, U: 865, D: 665) 
- 		Coords: (0.100000, 0.300000,0.500000) 
-cell[766]
- 		Values: (N: 776, S: 756, E: 767, W: 765, U: 866, D: 666) 
- 		Coords: (0.300000, 0.300000,0.500000) 
-cell[767]
- 		Values: (N: 777, S: 757, E: 768, W: 766, U: 867, D: 667) 
- 		Coords: (0.500000, 0.300000,0.500000) 
-cell[768]
- 		Values: (N: 778, S: 758, E: 769, W: 767, U: 868, D: 668) 
- 		Coords: (0.700000, 0.300000,0.500000) 
-cell[769]
- 		Values: (N: 779, S: 759, E: -2, W: 768, U: 869, D: 669) 
- 		Coords: (0.900000, 0.300000,0.500000) 
-cell[770]
- 		Values: (N: 780, S: 760, E: 771, W: -2, U: 870, D: 670) 
- 		Coords: (-0.900000, 0.500000,0.500000) 
-cell[771]
- 		Values: (N: 781, S: 761, E: 772, W: 770, U: 871, D: 671) 
- 		Coords: (-0.700000, 0.500000,0.500000) 
-cell[772]
- 		Values: (N: 782, S: 762, E: 773, W: 771, U: 872, D: 672) 
- 		Coords: (-0.500000, 0.500000,0.500000) 
-cell[773]
- 		Values: (N: 783, S: 763, E: 774, W: 772, U: 873, D: 673) 
- 		Coords: (-0.300000, 0.500000,0.500000) 
-cell[774]
- 		Values: (N: 784, S: 764, E: 775, W: 773, U: 874, D: 674) 
- 		Coords: (-0.100000, 0.500000,0.500000) 
-cell[775]
- 		Values: (N: 785, S: 765, E: 776, W: 774, U: 875, D: 675) 
- 		Coords: (0.100000, 0.500000,0.500000) 
-cell[776]
- 		Values: (N: 786, S: 766, E: 777, W: 775, U: 876, D: 676) 
- 		Coords: (0.300000, 0.500000,0.500000) 
-cell[777]
- 		Values: (N: 787, S: 767, E: 778, W: 776, U: 877, D: 677) 
+ 		Values: (N: -2, S: 5, E: -2, W: 6, U: -2, D: 3) 
  		Coords: (0.500000, 0.500000,0.500000) 
-cell[778]
- 		Values: (N: 788, S: 768, E: 779, W: 777, U: 878, D: 678) 
- 		Coords: (0.700000, 0.500000,0.500000) 
-cell[779]
- 		Values: (N: 789, S: 769, E: -2, W: 778, U: 879, D: 679) 
- 		Coords: (0.900000, 0.500000,0.500000) 
-cell[780]
- 		Values: (N: 790, S: 770, E: 781, W: -2, U: 880, D: 680) 
- 		Coords: (-0.900000, 0.700000,0.500000) 
-cell[781]
- 		Values: (N: 791, S: 771, E: 782, W: 780, U: 881, D: 681) 
- 		Coords: (-0.700000, 0.700000,0.500000) 
-cell[782]
- 		Values: (N: 792, S: 772, E: 783, W: 781, U: 882, D: 682) 
- 		Coords: (-0.500000, 0.700000,0.500000) 
-cell[783]
- 		Values: (N: 793, S: 773, E: 784, W: 782, U: 883, D: 683) 
- 		Coords: (-0.300000, 0.700000,0.500000) 
-cell[784]
- 		Values: (N: 794, S: 774, E: 785, W: 783, U: 884, D: 684) 
- 		Coords: (-0.100000, 0.700000,0.500000) 
-cell[785]
- 		Values: (N: 795, S: 775, E: 786, W: 784, U: 885, D: 685) 
- 		Coords: (0.100000, 0.700000,0.500000) 
-cell[786]
- 		Values: (N: 796, S: 776, E: 787, W: 785, U: 886, D: 686) 
- 		Coords: (0.300000, 0.700000,0.500000) 
-cell[787]
- 		Values: (N: 797, S: 777, E: 788, W: 786, U: 887, D: 687) 
- 		Coords: (0.500000, 0.700000,0.500000) 
-cell[788]
- 		Values: (N: 798, S: 778, E: 789, W: 787, U: 888, D: 688) 
- 		Coords: (0.700000, 0.700000,0.500000) 
-cell[789]
- 		Values: (N: 799, S: 779, E: -2, W: 788, U: 889, D: 689) 
- 		Coords: (0.900000, 0.700000,0.500000) 
-cell[790]
- 		Values: (N: -2, S: 780, E: 791, W: -2, U: 890, D: 690) 
- 		Coords: (-0.900000, 0.900000,0.500000) 
-cell[791]
- 		Values: (N: -2, S: 781, E: 792, W: 790, U: 891, D: 691) 
- 		Coords: (-0.700000, 0.900000,0.500000) 
-cell[792]
- 		Values: (N: -2, S: 782, E: 793, W: 791, U: 892, D: 692) 
- 		Coords: (-0.500000, 0.900000,0.500000) 
-cell[793]
- 		Values: (N: -2, S: 783, E: 794, W: 792, U: 893, D: 693) 
- 		Coords: (-0.300000, 0.900000,0.500000) 
-cell[794]
- 		Values: (N: -2, S: 784, E: 795, W: 793, U: 894, D: 694) 
- 		Coords: (-0.100000, 0.900000,0.500000) 
-cell[795]
- 		Values: (N: -2, S: 785, E: 796, W: 794, U: 895, D: 695) 
- 		Coords: (0.100000, 0.900000,0.500000) 
-cell[796]
- 		Values: (N: -2, S: 786, E: 797, W: 795, U: 896, D: 696) 
- 		Coords: (0.300000, 0.900000,0.500000) 
-cell[797]
- 		Values: (N: -2, S: 787, E: 798, W: 796, U: 897, D: 697) 
- 		Coords: (0.500000, 0.900000,0.500000) 
-cell[798]
- 		Values: (N: -2, S: 788, E: 799, W: 797, U: 898, D: 698) 
- 		Coords: (0.700000, 0.900000,0.500000) 
-cell[799]
- 		Values: (N: -2, S: 789, E: -2, W: 798, U: 899, D: 699) 
- 		Coords: (0.900000, 0.900000,0.500000) 
-cell[800]
- 		Values: (N: 810, S: -2, E: 801, W: -2, U: 900, D: 700) 
- 		Coords: (-0.900000, -0.900000,0.700000) 
-cell[801]
- 		Values: (N: 811, S: -2, E: 802, W: 800, U: 901, D: 701) 
- 		Coords: (-0.700000, -0.900000,0.700000) 
-cell[802]
- 		Values: (N: 812, S: -2, E: 803, W: 801, U: 902, D: 702) 
- 		Coords: (-0.500000, -0.900000,0.700000) 
-cell[803]
- 		Values: (N: 813, S: -2, E: 804, W: 802, U: 903, D: 703) 
- 		Coords: (-0.300000, -0.900000,0.700000) 
-cell[804]
- 		Values: (N: 814, S: -2, E: 805, W: 803, U: 904, D: 704) 
- 		Coords: (-0.100000, -0.900000,0.700000) 
-cell[805]
- 		Values: (N: 815, S: -2, E: 806, W: 804, U: 905, D: 705) 
- 		Coords: (0.100000, -0.900000,0.700000) 
-cell[806]
- 		Values: (N: 816, S: -2, E: 807, W: 805, U: 906, D: 706) 
- 		Coords: (0.300000, -0.900000,0.700000) 
-cell[807]
- 		Values: (N: 817, S: -2, E: 808, W: 806, U: 907, D: 707) 
- 		Coords: (0.500000, -0.900000,0.700000) 
-cell[808]
- 		Values: (N: 818, S: -2, E: 809, W: 807, U: 908, D: 708) 
- 		Coords: (0.700000, -0.900000,0.700000) 
-cell[809]
- 		Values: (N: 819, S: -2, E: -2, W: 808, U: 909, D: 709) 
- 		Coords: (0.900000, -0.900000,0.700000) 
-cell[810]
- 		Values: (N: 820, S: 800, E: 811, W: -2, U: 910, D: 710) 
- 		Coords: (-0.900000, -0.700000,0.700000) 
-cell[811]
- 		Values: (N: 821, S: 801, E: 812, W: 810, U: 911, D: 711) 
- 		Coords: (-0.700000, -0.700000,0.700000) 
-cell[812]
- 		Values: (N: 822, S: 802, E: 813, W: 811, U: 912, D: 712) 
- 		Coords: (-0.500000, -0.700000,0.700000) 
-cell[813]
- 		Values: (N: 823, S: 803, E: 814, W: 812, U: 913, D: 713) 
- 		Coords: (-0.300000, -0.700000,0.700000) 
-cell[814]
- 		Values: (N: 824, S: 804, E: 815, W: 813, U: 914, D: 714) 
- 		Coords: (-0.100000, -0.700000,0.700000) 
-cell[815]
- 		Values: (N: 825, S: 805, E: 816, W: 814, U: 915, D: 715) 
- 		Coords: (0.100000, -0.700000,0.700000) 
-cell[816]
- 		Values: (N: 826, S: 806, E: 817, W: 815, U: 916, D: 716) 
- 		Coords: (0.300000, -0.700000,0.700000) 
-cell[817]
- 		Values: (N: 827, S: 807, E: 818, W: 816, U: 917, D: 717) 
- 		Coords: (0.500000, -0.700000,0.700000) 
-cell[818]
- 		Values: (N: 828, S: 808, E: 819, W: 817, U: 918, D: 718) 
- 		Coords: (0.700000, -0.700000,0.700000) 
-cell[819]
- 		Values: (N: 829, S: 809, E: -2, W: 818, U: 919, D: 719) 
- 		Coords: (0.900000, -0.700000,0.700000) 
-cell[820]
- 		Values: (N: 830, S: 810, E: 821, W: -2, U: 920, D: 720) 
- 		Coords: (-0.900000, -0.500000,0.700000) 
-cell[821]
- 		Values: (N: 831, S: 811, E: 822, W: 820, U: 921, D: 721) 
- 		Coords: (-0.700000, -0.500000,0.700000) 
-cell[822]
- 		Values: (N: 832, S: 812, E: 823, W: 821, U: 922, D: 722) 
- 		Coords: (-0.500000, -0.500000,0.700000) 
-cell[823]
- 		Values: (N: 833, S: 813, E: 824, W: 822, U: 923, D: 723) 
- 		Coords: (-0.300000, -0.500000,0.700000) 
-cell[824]
- 		Values: (N: 834, S: 814, E: 825, W: 823, U: 924, D: 724) 
- 		Coords: (-0.100000, -0.500000,0.700000) 
-cell[825]
- 		Values: (N: 835, S: 815, E: 826, W: 824, U: 925, D: 725) 
- 		Coords: (0.100000, -0.500000,0.700000) 
-cell[826]
- 		Values: (N: 836, S: 816, E: 827, W: 825, U: 926, D: 726) 
- 		Coords: (0.300000, -0.500000,0.700000) 
-cell[827]
- 		Values: (N: 837, S: 817, E: 828, W: 826, U: 927, D: 727) 
- 		Coords: (0.500000, -0.500000,0.700000) 
-cell[828]
- 		Values: (N: 838, S: 818, E: 829, W: 827, U: 928, D: 728) 
- 		Coords: (0.700000, -0.500000,0.700000) 
-cell[829]
- 		Values: (N: 839, S: 819, E: -2, W: 828, U: 929, D: 729) 
- 		Coords: (0.900000, -0.500000,0.700000) 
-cell[830]
- 		Values: (N: 840, S: 820, E: 831, W: -2, U: 930, D: 730) 
- 		Coords: (-0.900000, -0.300000,0.700000) 
-cell[831]
- 		Values: (N: 841, S: 821, E: 832, W: 830, U: 931, D: 731) 
- 		Coords: (-0.700000, -0.300000,0.700000) 
-cell[832]
- 		Values: (N: 842, S: 822, E: 833, W: 831, U: 932, D: 732) 
- 		Coords: (-0.500000, -0.300000,0.700000) 
-cell[833]
- 		Values: (N: 843, S: 823, E: 834, W: 832, U: 933, D: 733) 
- 		Coords: (-0.300000, -0.300000,0.700000) 
-cell[834]
- 		Values: (N: 844, S: 824, E: 835, W: 833, U: 934, D: 734) 
- 		Coords: (-0.100000, -0.300000,0.700000) 
-cell[835]
- 		Values: (N: 845, S: 825, E: 836, W: 834, U: 935, D: 735) 
- 		Coords: (0.100000, -0.300000,0.700000) 
-cell[836]
- 		Values: (N: 846, S: 826, E: 837, W: 835, U: 936, D: 736) 
- 		Coords: (0.300000, -0.300000,0.700000) 
-cell[837]
- 		Values: (N: 847, S: 827, E: 838, W: 836, U: 937, D: 737) 
- 		Coords: (0.500000, -0.300000,0.700000) 
-cell[838]
- 		Values: (N: 848, S: 828, E: 839, W: 837, U: 938, D: 738) 
- 		Coords: (0.700000, -0.300000,0.700000) 
-cell[839]
- 		Values: (N: 849, S: 829, E: -2, W: 838, U: 939, D: 739) 
- 		Coords: (0.900000, -0.300000,0.700000) 
-cell[840]
- 		Values: (N: 850, S: 830, E: 841, W: -2, U: 940, D: 740) 
- 		Coords: (-0.900000, -0.100000,0.700000) 
-cell[841]
- 		Values: (N: 851, S: 831, E: 842, W: 840, U: 941, D: 741) 
- 		Coords: (-0.700000, -0.100000,0.700000) 
-cell[842]
- 		Values: (N: 852, S: 832, E: 843, W: 841, U: 942, D: 742) 
- 		Coords: (-0.500000, -0.100000,0.700000) 
-cell[843]
- 		Values: (N: 853, S: 833, E: 844, W: 842, U: 943, D: 743) 
- 		Coords: (-0.300000, -0.100000,0.700000) 
-cell[844]
- 		Values: (N: 854, S: 834, E: 845, W: 843, U: 944, D: 744) 
- 		Coords: (-0.100000, -0.100000,0.700000) 
-cell[845]
- 		Values: (N: 855, S: 835, E: 846, W: 844, U: 945, D: 745) 
- 		Coords: (0.100000, -0.100000,0.700000) 
-cell[846]
- 		Values: (N: 856, S: 836, E: 847, W: 845, U: 946, D: 746) 
- 		Coords: (0.300000, -0.100000,0.700000) 
-cell[847]
- 		Values: (N: 857, S: 837, E: 848, W: 846, U: 947, D: 747) 
- 		Coords: (0.500000, -0.100000,0.700000) 
-cell[848]
- 		Values: (N: 858, S: 838, E: 849, W: 847, U: 948, D: 748) 
- 		Coords: (0.700000, -0.100000,0.700000) 
-cell[849]
- 		Values: (N: 859, S: 839, E: -2, W: 848, U: 949, D: 749) 
- 		Coords: (0.900000, -0.100000,0.700000) 
-cell[850]
- 		Values: (N: 860, S: 840, E: 851, W: -2, U: 950, D: 750) 
- 		Coords: (-0.900000, 0.100000,0.700000) 
-cell[851]
- 		Values: (N: 861, S: 841, E: 852, W: 850, U: 951, D: 751) 
- 		Coords: (-0.700000, 0.100000,0.700000) 
-cell[852]
- 		Values: (N: 862, S: 842, E: 853, W: 851, U: 952, D: 752) 
- 		Coords: (-0.500000, 0.100000,0.700000) 
-cell[853]
- 		Values: (N: 863, S: 843, E: 854, W: 852, U: 953, D: 753) 
- 		Coords: (-0.300000, 0.100000,0.700000) 
-cell[854]
- 		Values: (N: 864, S: 844, E: 855, W: 853, U: 954, D: 754) 
- 		Coords: (-0.100000, 0.100000,0.700000) 
-cell[855]
- 		Values: (N: 865, S: 845, E: 856, W: 854, U: 955, D: 755) 
- 		Coords: (0.100000, 0.100000,0.700000) 
-cell[856]
- 		Values: (N: 866, S: 846, E: 857, W: 855, U: 956, D: 756) 
- 		Coords: (0.300000, 0.100000,0.700000) 
-cell[857]
- 		Values: (N: 867, S: 847, E: 858, W: 856, U: 957, D: 757) 
- 		Coords: (0.500000, 0.100000,0.700000) 
-cell[858]
- 		Values: (N: 868, S: 848, E: 859, W: 857, U: 958, D: 758) 
- 		Coords: (0.700000, 0.100000,0.700000) 
-cell[859]
- 		Values: (N: 869, S: 849, E: -2, W: 858, U: 959, D: 759) 
- 		Coords: (0.900000, 0.100000,0.700000) 
-cell[860]
- 		Values: (N: 870, S: 850, E: 861, W: -2, U: 960, D: 760) 
- 		Coords: (-0.900000, 0.300000,0.700000) 
-cell[861]
- 		Values: (N: 871, S: 851, E: 862, W: 860, U: 961, D: 761) 
- 		Coords: (-0.700000, 0.300000,0.700000) 
-cell[862]
- 		Values: (N: 872, S: 852, E: 863, W: 861, U: 962, D: 762) 
- 		Coords: (-0.500000, 0.300000,0.700000) 
-cell[863]
- 		Values: (N: 873, S: 853, E: 864, W: 862, U: 963, D: 763) 
- 		Coords: (-0.300000, 0.300000,0.700000) 
-cell[864]
- 		Values: (N: 874, S: 854, E: 865, W: 863, U: 964, D: 764) 
- 		Coords: (-0.100000, 0.300000,0.700000) 
-cell[865]
- 		Values: (N: 875, S: 855, E: 866, W: 864, U: 965, D: 765) 
- 		Coords: (0.100000, 0.300000,0.700000) 
-cell[866]
- 		Values: (N: 876, S: 856, E: 867, W: 865, U: 966, D: 766) 
- 		Coords: (0.300000, 0.300000,0.700000) 
-cell[867]
- 		Values: (N: 877, S: 857, E: 868, W: 866, U: 967, D: 767) 
- 		Coords: (0.500000, 0.300000,0.700000) 
-cell[868]
- 		Values: (N: 878, S: 858, E: 869, W: 867, U: 968, D: 768) 
- 		Coords: (0.700000, 0.300000,0.700000) 
-cell[869]
- 		Values: (N: 879, S: 859, E: -2, W: 868, U: 969, D: 769) 
- 		Coords: (0.900000, 0.300000,0.700000) 
-cell[870]
- 		Values: (N: 880, S: 860, E: 871, W: -2, U: 970, D: 770) 
- 		Coords: (-0.900000, 0.500000,0.700000) 
-cell[871]
- 		Values: (N: 881, S: 861, E: 872, W: 870, U: 971, D: 771) 
- 		Coords: (-0.700000, 0.500000,0.700000) 
-cell[872]
- 		Values: (N: 882, S: 862, E: 873, W: 871, U: 972, D: 772) 
- 		Coords: (-0.500000, 0.500000,0.700000) 
-cell[873]
- 		Values: (N: 883, S: 863, E: 874, W: 872, U: 973, D: 773) 
- 		Coords: (-0.300000, 0.500000,0.700000) 
-cell[874]
- 		Values: (N: 884, S: 864, E: 875, W: 873, U: 974, D: 774) 
- 		Coords: (-0.100000, 0.500000,0.700000) 
-cell[875]
- 		Values: (N: 885, S: 865, E: 876, W: 874, U: 975, D: 775) 
- 		Coords: (0.100000, 0.500000,0.700000) 
-cell[876]
- 		Values: (N: 886, S: 866, E: 877, W: 875, U: 976, D: 776) 
- 		Coords: (0.300000, 0.500000,0.700000) 
-cell[877]
- 		Values: (N: 887, S: 867, E: 878, W: 876, U: 977, D: 777) 
- 		Coords: (0.500000, 0.500000,0.700000) 
-cell[878]
- 		Values: (N: 888, S: 868, E: 879, W: 877, U: 978, D: 778) 
- 		Coords: (0.700000, 0.500000,0.700000) 
-cell[879]
- 		Values: (N: 889, S: 869, E: -2, W: 878, U: 979, D: 779) 
- 		Coords: (0.900000, 0.500000,0.700000) 
-cell[880]
- 		Values: (N: 890, S: 870, E: 881, W: -2, U: 980, D: 780) 
- 		Coords: (-0.900000, 0.700000,0.700000) 
-cell[881]
- 		Values: (N: 891, S: 871, E: 882, W: 880, U: 981, D: 781) 
- 		Coords: (-0.700000, 0.700000,0.700000) 
-cell[882]
- 		Values: (N: 892, S: 872, E: 883, W: 881, U: 982, D: 782) 
- 		Coords: (-0.500000, 0.700000,0.700000) 
-cell[883]
- 		Values: (N: 893, S: 873, E: 884, W: 882, U: 983, D: 783) 
- 		Coords: (-0.300000, 0.700000,0.700000) 
-cell[884]
- 		Values: (N: 894, S: 874, E: 885, W: 883, U: 984, D: 784) 
- 		Coords: (-0.100000, 0.700000,0.700000) 
-cell[885]
- 		Values: (N: 895, S: 875, E: 886, W: 884, U: 985, D: 785) 
- 		Coords: (0.100000, 0.700000,0.700000) 
-cell[886]
- 		Values: (N: 896, S: 876, E: 887, W: 885, U: 986, D: 786) 
- 		Coords: (0.300000, 0.700000,0.700000) 
-cell[887]
- 		Values: (N: 897, S: 877, E: 888, W: 886, U: 987, D: 787) 
- 		Coords: (0.500000, 0.700000,0.700000) 
-cell[888]
- 		Values: (N: 898, S: 878, E: 889, W: 887, U: 988, D: 788) 
- 		Coords: (0.700000, 0.700000,0.700000) 
-cell[889]
- 		Values: (N: 899, S: 879, E: -2, W: 888, U: 989, D: 789) 
- 		Coords: (0.900000, 0.700000,0.700000) 
-cell[890]
- 		Values: (N: -2, S: 880, E: 891, W: -2, U: 990, D: 790) 
- 		Coords: (-0.900000, 0.900000,0.700000) 
-cell[891]
- 		Values: (N: -2, S: 881, E: 892, W: 890, U: 991, D: 791) 
- 		Coords: (-0.700000, 0.900000,0.700000) 
-cell[892]
- 		Values: (N: -2, S: 882, E: 893, W: 891, U: 992, D: 792) 
- 		Coords: (-0.500000, 0.900000,0.700000) 
-cell[893]
- 		Values: (N: -2, S: 883, E: 894, W: 892, U: 993, D: 793) 
- 		Coords: (-0.300000, 0.900000,0.700000) 
-cell[894]
- 		Values: (N: -2, S: 884, E: 895, W: 893, U: 994, D: 794) 
- 		Coords: (-0.100000, 0.900000,0.700000) 
-cell[895]
- 		Values: (N: -2, S: 885, E: 896, W: 894, U: 995, D: 795) 
- 		Coords: (0.100000, 0.900000,0.700000) 
-cell[896]
- 		Values: (N: -2, S: 886, E: 897, W: 895, U: 996, D: 796) 
- 		Coords: (0.300000, 0.900000,0.700000) 
-cell[897]
- 		Values: (N: -2, S: 887, E: 898, W: 896, U: 997, D: 797) 
- 		Coords: (0.500000, 0.900000,0.700000) 
-cell[898]
- 		Values: (N: -2, S: 888, E: 899, W: 897, U: 998, D: 798) 
- 		Coords: (0.700000, 0.900000,0.700000) 
-cell[899]
- 		Values: (N: -2, S: 889, E: -2, W: 898, U: 999, D: 799) 
- 		Coords: (0.900000, 0.900000,0.700000) 
-cell[900]
- 		Values: (N: 910, S: -2, E: 901, W: -2, U: -2, D: 800) 
- 		Coords: (-0.900000, -0.900000,0.900000) 
-cell[901]
- 		Values: (N: 911, S: -2, E: 902, W: 900, U: -2, D: 801) 
- 		Coords: (-0.700000, -0.900000,0.900000) 
-cell[902]
- 		Values: (N: 912, S: -2, E: 903, W: 901, U: -2, D: 802) 
- 		Coords: (-0.500000, -0.900000,0.900000) 
-cell[903]
- 		Values: (N: 913, S: -2, E: 904, W: 902, U: -2, D: 803) 
- 		Coords: (-0.300000, -0.900000,0.900000) 
-cell[904]
- 		Values: (N: 914, S: -2, E: 905, W: 903, U: -2, D: 804) 
- 		Coords: (-0.100000, -0.900000,0.900000) 
-cell[905]
- 		Values: (N: 915, S: -2, E: 906, W: 904, U: -2, D: 805) 
- 		Coords: (0.100000, -0.900000,0.900000) 
-cell[906]
- 		Values: (N: 916, S: -2, E: 907, W: 905, U: -2, D: 806) 
- 		Coords: (0.300000, -0.900000,0.900000) 
-cell[907]
- 		Values: (N: 917, S: -2, E: 908, W: 906, U: -2, D: 807) 
- 		Coords: (0.500000, -0.900000,0.900000) 
-cell[908]
- 		Values: (N: 918, S: -2, E: 909, W: 907, U: -2, D: 808) 
- 		Coords: (0.700000, -0.900000,0.900000) 
-cell[909]
- 		Values: (N: 919, S: -2, E: -2, W: 908, U: -2, D: 809) 
- 		Coords: (0.900000, -0.900000,0.900000) 
-cell[910]
- 		Values: (N: 920, S: 900, E: 911, W: -2, U: -2, D: 810) 
- 		Coords: (-0.900000, -0.700000,0.900000) 
-cell[911]
- 		Values: (N: 921, S: 901, E: 912, W: 910, U: -2, D: 811) 
- 		Coords: (-0.700000, -0.700000,0.900000) 
-cell[912]
- 		Values: (N: 922, S: 902, E: 913, W: 911, U: -2, D: 812) 
- 		Coords: (-0.500000, -0.700000,0.900000) 
-cell[913]
- 		Values: (N: 923, S: 903, E: 914, W: 912, U: -2, D: 813) 
- 		Coords: (-0.300000, -0.700000,0.900000) 
-cell[914]
- 		Values: (N: 924, S: 904, E: 915, W: 913, U: -2, D: 814) 
- 		Coords: (-0.100000, -0.700000,0.900000) 
-cell[915]
- 		Values: (N: 925, S: 905, E: 916, W: 914, U: -2, D: 815) 
- 		Coords: (0.100000, -0.700000,0.900000) 
-cell[916]
- 		Values: (N: 926, S: 906, E: 917, W: 915, U: -2, D: 816) 
- 		Coords: (0.300000, -0.700000,0.900000) 
-cell[917]
- 		Values: (N: 927, S: 907, E: 918, W: 916, U: -2, D: 817) 
- 		Coords: (0.500000, -0.700000,0.900000) 
-cell[918]
- 		Values: (N: 928, S: 908, E: 919, W: 917, U: -2, D: 818) 
- 		Coords: (0.700000, -0.700000,0.900000) 
-cell[919]
- 		Values: (N: 929, S: 909, E: -2, W: 918, U: -2, D: 819) 
- 		Coords: (0.900000, -0.700000,0.900000) 
-cell[920]
- 		Values: (N: 930, S: 910, E: 921, W: -2, U: -2, D: 820) 
- 		Coords: (-0.900000, -0.500000,0.900000) 
-cell[921]
- 		Values: (N: 931, S: 911, E: 922, W: 920, U: -2, D: 821) 
- 		Coords: (-0.700000, -0.500000,0.900000) 
-cell[922]
- 		Values: (N: 932, S: 912, E: 923, W: 921, U: -2, D: 822) 
- 		Coords: (-0.500000, -0.500000,0.900000) 
-cell[923]
- 		Values: (N: 933, S: 913, E: 924, W: 922, U: -2, D: 823) 
- 		Coords: (-0.300000, -0.500000,0.900000) 
-cell[924]
- 		Values: (N: 934, S: 914, E: 925, W: 923, U: -2, D: 824) 
- 		Coords: (-0.100000, -0.500000,0.900000) 
-cell[925]
- 		Values: (N: 935, S: 915, E: 926, W: 924, U: -2, D: 825) 
- 		Coords: (0.100000, -0.500000,0.900000) 
-cell[926]
- 		Values: (N: 936, S: 916, E: 927, W: 925, U: -2, D: 826) 
- 		Coords: (0.300000, -0.500000,0.900000) 
-cell[927]
- 		Values: (N: 937, S: 917, E: 928, W: 926, U: -2, D: 827) 
- 		Coords: (0.500000, -0.500000,0.900000) 
-cell[928]
- 		Values: (N: 938, S: 918, E: 929, W: 927, U: -2, D: 828) 
- 		Coords: (0.700000, -0.500000,0.900000) 
-cell[929]
- 		Values: (N: 939, S: 919, E: -2, W: 928, U: -2, D: 829) 
- 		Coords: (0.900000, -0.500000,0.900000) 
-cell[930]
- 		Values: (N: 940, S: 920, E: 931, W: -2, U: -2, D: 830) 
- 		Coords: (-0.900000, -0.300000,0.900000) 
-cell[931]
- 		Values: (N: 941, S: 921, E: 932, W: 930, U: -2, D: 831) 
- 		Coords: (-0.700000, -0.300000,0.900000) 
-cell[932]
- 		Values: (N: 942, S: 922, E: 933, W: 931, U: -2, D: 832) 
- 		Coords: (-0.500000, -0.300000,0.900000) 
-cell[933]
- 		Values: (N: 943, S: 923, E: 934, W: 932, U: -2, D: 833) 
- 		Coords: (-0.300000, -0.300000,0.900000) 
-cell[934]
- 		Values: (N: 944, S: 924, E: 935, W: 933, U: -2, D: 834) 
- 		Coords: (-0.100000, -0.300000,0.900000) 
-cell[935]
- 		Values: (N: 945, S: 925, E: 936, W: 934, U: -2, D: 835) 
- 		Coords: (0.100000, -0.300000,0.900000) 
-cell[936]
- 		Values: (N: 946, S: 926, E: 937, W: 935, U: -2, D: 836) 
- 		Coords: (0.300000, -0.300000,0.900000) 
-cell[937]
- 		Values: (N: 947, S: 927, E: 938, W: 936, U: -2, D: 837) 
- 		Coords: (0.500000, -0.300000,0.900000) 
-cell[938]
- 		Values: (N: 948, S: 928, E: 939, W: 937, U: -2, D: 838) 
- 		Coords: (0.700000, -0.300000,0.900000) 
-cell[939]
- 		Values: (N: 949, S: 929, E: -2, W: 938, U: -2, D: 839) 
- 		Coords: (0.900000, -0.300000,0.900000) 
-cell[940]
- 		Values: (N: 950, S: 930, E: 941, W: -2, U: -2, D: 840) 
- 		Coords: (-0.900000, -0.100000,0.900000) 
-cell[941]
- 		Values: (N: 951, S: 931, E: 942, W: 940, U: -2, D: 841) 
- 		Coords: (-0.700000, -0.100000,0.900000) 
-cell[942]
- 		Values: (N: 952, S: 932, E: 943, W: 941, U: -2, D: 842) 
- 		Coords: (-0.500000, -0.100000,0.900000) 
-cell[943]
- 		Values: (N: 953, S: 933, E: 944, W: 942, U: -2, D: 843) 
- 		Coords: (-0.300000, -0.100000,0.900000) 
-cell[944]
- 		Values: (N: 954, S: 934, E: 945, W: 943, U: -2, D: 844) 
- 		Coords: (-0.100000, -0.100000,0.900000) 
-cell[945]
- 		Values: (N: 955, S: 935, E: 946, W: 944, U: -2, D: 845) 
- 		Coords: (0.100000, -0.100000,0.900000) 
-cell[946]
- 		Values: (N: 956, S: 936, E: 947, W: 945, U: -2, D: 846) 
- 		Coords: (0.300000, -0.100000,0.900000) 
-cell[947]
- 		Values: (N: 957, S: 937, E: 948, W: 946, U: -2, D: 847) 
- 		Coords: (0.500000, -0.100000,0.900000) 
-cell[948]
- 		Values: (N: 958, S: 938, E: 949, W: 947, U: -2, D: 848) 
- 		Coords: (0.700000, -0.100000,0.900000) 
-cell[949]
- 		Values: (N: 959, S: 939, E: -2, W: 948, U: -2, D: 849) 
- 		Coords: (0.900000, -0.100000,0.900000) 
-cell[950]
- 		Values: (N: 960, S: 940, E: 951, W: -2, U: -2, D: 850) 
- 		Coords: (-0.900000, 0.100000,0.900000) 
-cell[951]
- 		Values: (N: 961, S: 941, E: 952, W: 950, U: -2, D: 851) 
- 		Coords: (-0.700000, 0.100000,0.900000) 
-cell[952]
- 		Values: (N: 962, S: 942, E: 953, W: 951, U: -2, D: 852) 
- 		Coords: (-0.500000, 0.100000,0.900000) 
-cell[953]
- 		Values: (N: 963, S: 943, E: 954, W: 952, U: -2, D: 853) 
- 		Coords: (-0.300000, 0.100000,0.900000) 
-cell[954]
- 		Values: (N: 964, S: 944, E: 955, W: 953, U: -2, D: 854) 
- 		Coords: (-0.100000, 0.100000,0.900000) 
-cell[955]
- 		Values: (N: 965, S: 945, E: 956, W: 954, U: -2, D: 855) 
- 		Coords: (0.100000, 0.100000,0.900000) 
-cell[956]
- 		Values: (N: 966, S: 946, E: 957, W: 955, U: -2, D: 856) 
- 		Coords: (0.300000, 0.100000,0.900000) 
-cell[957]
- 		Values: (N: 967, S: 947, E: 958, W: 956, U: -2, D: 857) 
- 		Coords: (0.500000, 0.100000,0.900000) 
-cell[958]
- 		Values: (N: 968, S: 948, E: 959, W: 957, U: -2, D: 858) 
- 		Coords: (0.700000, 0.100000,0.900000) 
-cell[959]
- 		Values: (N: 969, S: 949, E: -2, W: 958, U: -2, D: 859) 
- 		Coords: (0.900000, 0.100000,0.900000) 
-cell[960]
- 		Values: (N: 970, S: 950, E: 961, W: -2, U: -2, D: 860) 
- 		Coords: (-0.900000, 0.300000,0.900000) 
-cell[961]
- 		Values: (N: 971, S: 951, E: 962, W: 960, U: -2, D: 861) 
- 		Coords: (-0.700000, 0.300000,0.900000) 
-cell[962]
- 		Values: (N: 972, S: 952, E: 963, W: 961, U: -2, D: 862) 
- 		Coords: (-0.500000, 0.300000,0.900000) 
-cell[963]
- 		Values: (N: 973, S: 953, E: 964, W: 962, U: -2, D: 863) 
- 		Coords: (-0.300000, 0.300000,0.900000) 
-cell[964]
- 		Values: (N: 974, S: 954, E: 965, W: 963, U: -2, D: 864) 
- 		Coords: (-0.100000, 0.300000,0.900000) 
-cell[965]
- 		Values: (N: 975, S: 955, E: 966, W: 964, U: -2, D: 865) 
- 		Coords: (0.100000, 0.300000,0.900000) 
-cell[966]
- 		Values: (N: 976, S: 956, E: 967, W: 965, U: -2, D: 866) 
- 		Coords: (0.300000, 0.300000,0.900000) 
-cell[967]
- 		Values: (N: 977, S: 957, E: 968, W: 966, U: -2, D: 867) 
- 		Coords: (0.500000, 0.300000,0.900000) 
-cell[968]
- 		Values: (N: 978, S: 958, E: 969, W: 967, U: -2, D: 868) 
- 		Coords: (0.700000, 0.300000,0.900000) 
-cell[969]
- 		Values: (N: 979, S: 959, E: -2, W: 968, U: -2, D: 869) 
- 		Coords: (0.900000, 0.300000,0.900000) 
-cell[970]
- 		Values: (N: 980, S: 960, E: 971, W: -2, U: -2, D: 870) 
- 		Coords: (-0.900000, 0.500000,0.900000) 
-cell[971]
- 		Values: (N: 981, S: 961, E: 972, W: 970, U: -2, D: 871) 
- 		Coords: (-0.700000, 0.500000,0.900000) 
-cell[972]
- 		Values: (N: 982, S: 962, E: 973, W: 971, U: -2, D: 872) 
- 		Coords: (-0.500000, 0.500000,0.900000) 
-cell[973]
- 		Values: (N: 983, S: 963, E: 974, W: 972, U: -2, D: 873) 
- 		Coords: (-0.300000, 0.500000,0.900000) 
-cell[974]
- 		Values: (N: 984, S: 964, E: 975, W: 973, U: -2, D: 874) 
- 		Coords: (-0.100000, 0.500000,0.900000) 
-cell[975]
- 		Values: (N: 985, S: 965, E: 976, W: 974, U: -2, D: 875) 
- 		Coords: (0.100000, 0.500000,0.900000) 
-cell[976]
- 		Values: (N: 986, S: 966, E: 977, W: 975, U: -2, D: 876) 
- 		Coords: (0.300000, 0.500000,0.900000) 
-cell[977]
- 		Values: (N: 987, S: 967, E: 978, W: 976, U: -2, D: 877) 
- 		Coords: (0.500000, 0.500000,0.900000) 
-cell[978]
- 		Values: (N: 988, S: 968, E: 979, W: 977, U: -2, D: 878) 
- 		Coords: (0.700000, 0.500000,0.900000) 
-cell[979]
- 		Values: (N: 989, S: 969, E: -2, W: 978, U: -2, D: 879) 
- 		Coords: (0.900000, 0.500000,0.900000) 
-cell[980]
- 		Values: (N: 990, S: 970, E: 981, W: -2, U: -2, D: 880) 
- 		Coords: (-0.900000, 0.700000,0.900000) 
-cell[981]
- 		Values: (N: 991, S: 971, E: 982, W: 980, U: -2, D: 881) 
- 		Coords: (-0.700000, 0.700000,0.900000) 
-cell[982]
- 		Values: (N: 992, S: 972, E: 983, W: 981, U: -2, D: 882) 
- 		Coords: (-0.500000, 0.700000,0.900000) 
-cell[983]
- 		Values: (N: 993, S: 973, E: 984, W: 982, U: -2, D: 883) 
- 		Coords: (-0.300000, 0.700000,0.900000) 
-cell[984]
- 		Values: (N: 994, S: 974, E: 985, W: 983, U: -2, D: 884) 
- 		Coords: (-0.100000, 0.700000,0.900000) 
-cell[985]
- 		Values: (N: 995, S: 975, E: 986, W: 984, U: -2, D: 885) 
- 		Coords: (0.100000, 0.700000,0.900000) 
-cell[986]
- 		Values: (N: 996, S: 976, E: 987, W: 985, U: -2, D: 886) 
- 		Coords: (0.300000, 0.700000,0.900000) 
-cell[987]
- 		Values: (N: 997, S: 977, E: 988, W: 986, U: -2, D: 887) 
- 		Coords: (0.500000, 0.700000,0.900000) 
-cell[988]
- 		Values: (N: 998, S: 978, E: 989, W: 987, U: -2, D: 888) 
- 		Coords: (0.700000, 0.700000,0.900000) 
-cell[989]
- 		Values: (N: 999, S: 979, E: -2, W: 988, U: -2, D: 889) 
- 		Coords: (0.900000, 0.700000,0.900000) 
-cell[990]
- 		Values: (N: -2, S: 980, E: 991, W: -2, U: -2, D: 890) 
- 		Coords: (-0.900000, 0.900000,0.900000) 
-cell[991]
- 		Values: (N: -2, S: 981, E: 992, W: 990, U: -2, D: 891) 
- 		Coords: (-0.700000, 0.900000,0.900000) 
-cell[992]
- 		Values: (N: -2, S: 982, E: 993, W: 991, U: -2, D: 892) 
- 		Coords: (-0.500000, 0.900000,0.900000) 
-cell[993]
- 		Values: (N: -2, S: 983, E: 994, W: 992, U: -2, D: 893) 
- 		Coords: (-0.300000, 0.900000,0.900000) 
-cell[994]
- 		Values: (N: -2, S: 984, E: 995, W: 993, U: -2, D: 894) 
- 		Coords: (-0.100000, 0.900000,0.900000) 
-cell[995]
- 		Values: (N: -2, S: 985, E: 996, W: 994, U: -2, D: 895) 
- 		Coords: (0.100000, 0.900000,0.900000) 
-cell[996]
- 		Values: (N: -2, S: 986, E: 997, W: 995, U: -2, D: 896) 
- 		Coords: (0.300000, 0.900000,0.900000) 
-cell[997]
- 		Values: (N: -2, S: 987, E: 998, W: 996, U: -2, D: 897) 
- 		Coords: (0.500000, 0.900000,0.900000) 
-cell[998]
- 		Values: (N: -2, S: 988, E: 999, W: 997, U: -2, D: 898) 
- 		Coords: (0.700000, 0.900000,0.900000) 
-cell[999]
- 		Values: (N: -2, S: 989, E: -2, W: 998, U: -2, D: 899) 
- 		Coords: (0.900000, 0.900000,0.900000) 
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/expected/DVCWeightsSuite_testConstructGrid2D.txt
--- a/Weights/tests/expected/DVCWeightsSuite_testConstructGrid2D.txt	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/expected/DVCWeightsSuite_testConstructGrid2D.txt	Tue Feb 02 16:55:08 2010 +1100
@@ -1,300 +1,12 @@ cell[0]
 cell[0]
- 		Values: (N: 10, S: -2, E: 1, W: -2) 
- 		Coords: (-0.900000, -0.900000) 
+ 		Values: (N: 2, S: -2, E: 1, W: -2) 
+ 		Coords: (-0.500000, -0.500000)
 cell[1]
- 		Values: (N: 11, S: -2, E: 2, W: 0) 
- 		Coords: (-0.700000, -0.900000) 
+ 		Values: (N: 3, S: -2, E: -2, W: 0) 
+ 		Coords: (0.500000, -0.500000)
 cell[2]
- 		Values: (N: 12, S: -2, E: 3, W: 1) 
- 		Coords: (-0.500000, -0.900000) 
+ 		Values: (N: -2, S: 0, E: 3, W: -2) 
+ 		Coords: (-0.500000, 0.500000)
 cell[3]
- 		Values: (N: 13, S: -2, E: 4, W: 2) 
- 		Coords: (-0.300000, -0.900000) 
-cell[4]
- 		Values: (N: 14, S: -2, E: 5, W: 3) 
- 		Coords: (-0.100000, -0.900000) 
-cell[5]
- 		Values: (N: 15, S: -2, E: 6, W: 4) 
- 		Coords: (0.100000, -0.900000) 
-cell[6]
- 		Values: (N: 16, S: -2, E: 7, W: 5) 
- 		Coords: (0.300000, -0.900000) 
-cell[7]
- 		Values: (N: 17, S: -2, E: 8, W: 6) 
- 		Coords: (0.500000, -0.900000) 
-cell[8]
- 		Values: (N: 18, S: -2, E: 9, W: 7) 
- 		Coords: (0.700000, -0.900000) 
-cell[9]
- 		Values: (N: 19, S: -2, E: -2, W: 8) 
- 		Coords: (0.900000, -0.900000) 
-cell[10]
- 		Values: (N: 20, S: 0, E: 11, W: -2) 
- 		Coords: (-0.900000, -0.700000) 
-cell[11]
- 		Values: (N: 21, S: 1, E: 12, W: 10) 
- 		Coords: (-0.700000, -0.700000) 
-cell[12]
- 		Values: (N: 22, S: 2, E: 13, W: 11) 
- 		Coords: (-0.500000, -0.700000) 
-cell[13]
- 		Values: (N: 23, S: 3, E: 14, W: 12) 
- 		Coords: (-0.300000, -0.700000) 
-cell[14]
- 		Values: (N: 24, S: 4, E: 15, W: 13) 
- 		Coords: (-0.100000, -0.700000) 
-cell[15]
- 		Values: (N: 25, S: 5, E: 16, W: 14) 
- 		Coords: (0.100000, -0.700000) 
-cell[16]
- 		Values: (N: 26, S: 6, E: 17, W: 15) 
- 		Coords: (0.300000, -0.700000) 
-cell[17]
- 		Values: (N: 27, S: 7, E: 18, W: 16) 
- 		Coords: (0.500000, -0.700000) 
-cell[18]
- 		Values: (N: 28, S: 8, E: 19, W: 17) 
- 		Coords: (0.700000, -0.700000) 
-cell[19]
- 		Values: (N: 29, S: 9, E: -2, W: 18) 
- 		Coords: (0.900000, -0.700000) 
-cell[20]
- 		Values: (N: 30, S: 10, E: 21, W: -2) 
- 		Coords: (-0.900000, -0.500000) 
-cell[21]
- 		Values: (N: 31, S: 11, E: 22, W: 20) 
- 		Coords: (-0.700000, -0.500000) 
-cell[22]
- 		Values: (N: 32, S: 12, E: 23, W: 21) 
- 		Coords: (-0.500000, -0.500000) 
-cell[23]
- 		Values: (N: 33, S: 13, E: 24, W: 22) 
- 		Coords: (-0.300000, -0.500000) 
-cell[24]
- 		Values: (N: 34, S: 14, E: 25, W: 23) 
- 		Coords: (-0.100000, -0.500000) 
-cell[25]
- 		Values: (N: 35, S: 15, E: 26, W: 24) 
- 		Coords: (0.100000, -0.500000) 
-cell[26]
- 		Values: (N: 36, S: 16, E: 27, W: 25) 
- 		Coords: (0.300000, -0.500000) 
-cell[27]
- 		Values: (N: 37, S: 17, E: 28, W: 26) 
- 		Coords: (0.500000, -0.500000) 
-cell[28]
- 		Values: (N: 38, S: 18, E: 29, W: 27) 
- 		Coords: (0.700000, -0.500000) 
-cell[29]
- 		Values: (N: 39, S: 19, E: -2, W: 28) 
- 		Coords: (0.900000, -0.500000) 
-cell[30]
- 		Values: (N: 40, S: 20, E: 31, W: -2) 
- 		Coords: (-0.900000, -0.300000) 
-cell[31]
- 		Values: (N: 41, S: 21, E: 32, W: 30) 
- 		Coords: (-0.700000, -0.300000) 
-cell[32]
- 		Values: (N: 42, S: 22, E: 33, W: 31) 
- 		Coords: (-0.500000, -0.300000) 
-cell[33]
- 		Values: (N: 43, S: 23, E: 34, W: 32) 
- 		Coords: (-0.300000, -0.300000) 
-cell[34]
- 		Values: (N: 44, S: 24, E: 35, W: 33) 
- 		Coords: (-0.100000, -0.300000) 
-cell[35]
- 		Values: (N: 45, S: 25, E: 36, W: 34) 
- 		Coords: (0.100000, -0.300000) 
-cell[36]
- 		Values: (N: 46, S: 26, E: 37, W: 35) 
- 		Coords: (0.300000, -0.300000) 
-cell[37]
- 		Values: (N: 47, S: 27, E: 38, W: 36) 
- 		Coords: (0.500000, -0.300000) 
-cell[38]
- 		Values: (N: 48, S: 28, E: 39, W: 37) 
- 		Coords: (0.700000, -0.300000) 
-cell[39]
- 		Values: (N: 49, S: 29, E: -2, W: 38) 
- 		Coords: (0.900000, -0.300000) 
-cell[40]
- 		Values: (N: 50, S: 30, E: 41, W: -2) 
- 		Coords: (-0.900000, -0.100000) 
-cell[41]
- 		Values: (N: 51, S: 31, E: 42, W: 40) 
- 		Coords: (-0.700000, -0.100000) 
-cell[42]
- 		Values: (N: 52, S: 32, E: 43, W: 41) 
- 		Coords: (-0.500000, -0.100000) 
-cell[43]
- 		Values: (N: 53, S: 33, E: 44, W: 42) 
- 		Coords: (-0.300000, -0.100000) 
-cell[44]
- 		Values: (N: 54, S: 34, E: 45, W: 43) 
- 		Coords: (-0.100000, -0.100000) 
-cell[45]
- 		Values: (N: 55, S: 35, E: 46, W: 44) 
- 		Coords: (0.100000, -0.100000) 
-cell[46]
- 		Values: (N: 56, S: 36, E: 47, W: 45) 
- 		Coords: (0.300000, -0.100000) 
-cell[47]
- 		Values: (N: 57, S: 37, E: 48, W: 46) 
- 		Coords: (0.500000, -0.100000) 
-cell[48]
- 		Values: (N: 58, S: 38, E: 49, W: 47) 
- 		Coords: (0.700000, -0.100000) 
-cell[49]
- 		Values: (N: 59, S: 39, E: -2, W: 48) 
- 		Coords: (0.900000, -0.100000) 
-cell[50]
- 		Values: (N: 60, S: 40, E: 51, W: -2) 
- 		Coords: (-0.900000, 0.100000) 
-cell[51]
- 		Values: (N: 61, S: 41, E: 52, W: 50) 
- 		Coords: (-0.700000, 0.100000) 
-cell[52]
- 		Values: (N: 62, S: 42, E: 53, W: 51) 
- 		Coords: (-0.500000, 0.100000) 
-cell[53]
- 		Values: (N: 63, S: 43, E: 54, W: 52) 
- 		Coords: (-0.300000, 0.100000) 
-cell[54]
- 		Values: (N: 64, S: 44, E: 55, W: 53) 
- 		Coords: (-0.100000, 0.100000) 
-cell[55]
- 		Values: (N: 65, S: 45, E: 56, W: 54) 
- 		Coords: (0.100000, 0.100000) 
-cell[56]
- 		Values: (N: 66, S: 46, E: 57, W: 55) 
- 		Coords: (0.300000, 0.100000) 
-cell[57]
- 		Values: (N: 67, S: 47, E: 58, W: 56) 
- 		Coords: (0.500000, 0.100000) 
-cell[58]
- 		Values: (N: 68, S: 48, E: 59, W: 57) 
- 		Coords: (0.700000, 0.100000) 
-cell[59]
- 		Values: (N: 69, S: 49, E: -2, W: 58) 
- 		Coords: (0.900000, 0.100000) 
-cell[60]
- 		Values: (N: 70, S: 50, E: 61, W: -2) 
- 		Coords: (-0.900000, 0.300000) 
-cell[61]
- 		Values: (N: 71, S: 51, E: 62, W: 60) 
- 		Coords: (-0.700000, 0.300000) 
-cell[62]
- 		Values: (N: 72, S: 52, E: 63, W: 61) 
- 		Coords: (-0.500000, 0.300000) 
-cell[63]
- 		Values: (N: 73, S: 53, E: 64, W: 62) 
- 		Coords: (-0.300000, 0.300000) 
-cell[64]
- 		Values: (N: 74, S: 54, E: 65, W: 63) 
- 		Coords: (-0.100000, 0.300000) 
-cell[65]
- 		Values: (N: 75, S: 55, E: 66, W: 64) 
- 		Coords: (0.100000, 0.300000) 
-cell[66]
- 		Values: (N: 76, S: 56, E: 67, W: 65) 
- 		Coords: (0.300000, 0.300000) 
-cell[67]
- 		Values: (N: 77, S: 57, E: 68, W: 66) 
- 		Coords: (0.500000, 0.300000) 
-cell[68]
- 		Values: (N: 78, S: 58, E: 69, W: 67) 
- 		Coords: (0.700000, 0.300000) 
-cell[69]
- 		Values: (N: 79, S: 59, E: -2, W: 68) 
- 		Coords: (0.900000, 0.300000) 
-cell[70]
- 		Values: (N: 80, S: 60, E: 71, W: -2) 
- 		Coords: (-0.900000, 0.500000) 
-cell[71]
- 		Values: (N: 81, S: 61, E: 72, W: 70) 
- 		Coords: (-0.700000, 0.500000) 
-cell[72]
- 		Values: (N: 82, S: 62, E: 73, W: 71) 
- 		Coords: (-0.500000, 0.500000) 
-cell[73]
- 		Values: (N: 83, S: 63, E: 74, W: 72) 
- 		Coords: (-0.300000, 0.500000) 
-cell[74]
- 		Values: (N: 84, S: 64, E: 75, W: 73) 
- 		Coords: (-0.100000, 0.500000) 
-cell[75]
- 		Values: (N: 85, S: 65, E: 76, W: 74) 
- 		Coords: (0.100000, 0.500000) 
-cell[76]
- 		Values: (N: 86, S: 66, E: 77, W: 75) 
- 		Coords: (0.300000, 0.500000) 
-cell[77]
- 		Values: (N: 87, S: 67, E: 78, W: 76) 
- 		Coords: (0.500000, 0.500000) 
-cell[78]
- 		Values: (N: 88, S: 68, E: 79, W: 77) 
- 		Coords: (0.700000, 0.500000) 
-cell[79]
- 		Values: (N: 89, S: 69, E: -2, W: 78) 
- 		Coords: (0.900000, 0.500000) 
-cell[80]
- 		Values: (N: 90, S: 70, E: 81, W: -2) 
- 		Coords: (-0.900000, 0.700000) 
-cell[81]
- 		Values: (N: 91, S: 71, E: 82, W: 80) 
- 		Coords: (-0.700000, 0.700000) 
-cell[82]
- 		Values: (N: 92, S: 72, E: 83, W: 81) 
- 		Coords: (-0.500000, 0.700000) 
-cell[83]
- 		Values: (N: 93, S: 73, E: 84, W: 82) 
- 		Coords: (-0.300000, 0.700000) 
-cell[84]
- 		Values: (N: 94, S: 74, E: 85, W: 83) 
- 		Coords: (-0.100000, 0.700000) 
-cell[85]
- 		Values: (N: 95, S: 75, E: 86, W: 84) 
- 		Coords: (0.100000, 0.700000) 
-cell[86]
- 		Values: (N: 96, S: 76, E: 87, W: 85) 
- 		Coords: (0.300000, 0.700000) 
-cell[87]
- 		Values: (N: 97, S: 77, E: 88, W: 86) 
- 		Coords: (0.500000, 0.700000) 
-cell[88]
- 		Values: (N: 98, S: 78, E: 89, W: 87) 
- 		Coords: (0.700000, 0.700000) 
-cell[89]
- 		Values: (N: 99, S: 79, E: -2, W: 88) 
- 		Coords: (0.900000, 0.700000) 
-cell[90]
- 		Values: (N: -2, S: 80, E: 91, W: -2) 
- 		Coords: (-0.900000, 0.900000) 
-cell[91]
- 		Values: (N: -2, S: 81, E: 92, W: 90) 
- 		Coords: (-0.700000, 0.900000) 
-cell[92]
- 		Values: (N: -2, S: 82, E: 93, W: 91) 
- 		Coords: (-0.500000, 0.900000) 
-cell[93]
- 		Values: (N: -2, S: 83, E: 94, W: 92) 
- 		Coords: (-0.300000, 0.900000) 
-cell[94]
- 		Values: (N: -2, S: 84, E: 95, W: 93) 
- 		Coords: (-0.100000, 0.900000) 
-cell[95]
- 		Values: (N: -2, S: 85, E: 96, W: 94) 
- 		Coords: (0.100000, 0.900000) 
-cell[96]
- 		Values: (N: -2, S: 86, E: 97, W: 95) 
- 		Coords: (0.300000, 0.900000) 
-cell[97]
- 		Values: (N: -2, S: 87, E: 98, W: 96) 
- 		Coords: (0.500000, 0.900000) 
-cell[98]
- 		Values: (N: -2, S: 88, E: 99, W: 97) 
- 		Coords: (0.700000, 0.900000) 
-cell[99]
- 		Values: (N: -2, S: 89, E: -2, W: 98) 
- 		Coords: (0.900000, 0.900000) 
+ 		Values: (N: -2, S: 1, E: -2, W: 2) 
+ 		Coords: (0.500000, 0.500000)
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/expected/DVCWeightsSuite_testGetCentroids.txt
--- a/Weights/tests/expected/DVCWeightsSuite_testGetCentroids.txt	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/expected/DVCWeightsSuite_testGetCentroids.txt	Tue Feb 02 16:55:08 2010 +1100
@@ -1,40 +1,32 @@ data->pList[0]:
 data->pList[0]:
-                 coords: (x, y, z) = (-0.643209, -0.200645, -0.666802)
-                 centroids: (cx, cy, cz) = (-0.805556, -0.088889, -0.577778)
-                 weight = 0.288000
+		 coords: (x, y, z) = (0.333333, 0.333333, 0.333333)
+		 centroids: (cx, cy, cz) = (-0.500000, -0.500000, -0.500000)
+		 weight = 1.000000
 data->pList[1]:
-                 coords: (x, y, z) = (-0.575756, -0.876129, -0.891700)
-                 centroids: (cx, cy, cz) = (-0.220000, -0.900000, -0.840000)
-                 weight = 0.080000
+		 coords: (x, y, z) = (0.333333, 0.333333, 0.666667)
+		 centroids: (cx, cy, cz) = (-0.500000, -0.500000, 0.500000)
+		 weight = 1.000000
 data->pList[2]:
-                 coords: (x, y, z) = (-0.448669, -0.904486, -0.357934)
-                 centroids: (cx, cy, cz) = (-0.109023, -0.766165, -0.096992)
-                 weight = 1.064000
+		 coords: (x, y, z) = (0.333333, 0.666667, 0.333333)
+		 centroids: (cx, cy, cz) = (-0.500000, 0.500000, -0.500000)
+		 weight = 1.000000
 data->pList[3]:
-                 coords: (x, y, z) = (-0.454533, -0.264526, -0.555267)
-                 centroids: (cx, cy, cz) = (-0.046939, -0.291837, -0.387755)
-                 weight = 0.784000
+		 coords: (x, y, z) = (0.333333, 0.666667, 0.666667)
+		 centroids: (cx, cy, cz) = (-0.500000, 0.500000, 0.500000)
+		 weight = 1.000000
 data->pList[4]:
-                 coords: (x, y, z) = (-0.560686, -0.596525, -0.911769)
-                 centroids: (cx, cy, cz) = (-0.194118, -0.605882, -0.852941)
-                 weight = 0.136000
+		 coords: (x, y, z) = (0.666667, 0.333333, 0.333333)
+		 centroids: (cx, cy, cz) = (0.500000, -0.500000, -0.500000)
+		 weight = 1.000000
 data->pList[5]:
-                 coords: (x, y, z) = (-0.312160, 0.295308, -0.701072)
-                 centroids: (cx, cy, cz) = (0.097222, 0.455556, -0.575926)
-                 weight = 1.728000
+		 coords: (x, y, z) = (0.666667, 0.333333, 0.666667)
+		 centroids: (cx, cy, cz) = (0.500000, -0.500000, 0.500000)
+		 weight = 1.000000
 data->pList[6]:
-                 coords: (x, y, z) = (-0.940665, 0.756987, 0.310837)
-                 centroids: (cx, cy, cz) = (-0.666337, 0.579208, 0.341584)
-                 weight = 0.808000
+		 coords: (x, y, z) = (0.666667, 0.666667, 0.333333)
+		 centroids: (cx, cy, cz) = (0.500000, 0.500000, -0.500000)
+		 weight = 1.000000
 data->pList[7]:
-                 coords: (x, y, z) = (0.055288, 0.011714, 0.831384)
-                 centroids: (cx, cy, cz) = (-0.076404, -0.313483, 0.630337)
-                 weight = 1.424000
-data->pList[8]:
-                 coords: (x, y, z) = (-0.623830, -0.761688, -0.883806)
-                 centroids: (cx, cy, cz) = (-0.800000, -0.750000, -0.750000)
-                 weight = 0.064000
-data->pList[9]:
-                 coords: (x, y, z) = (0.439858, 0.275070, 0.761692)
-                 centroids: (cx, cy, cz) = (0.590640, 0.285222, 0.385714)
-                 weight = 1.624000
+		 coords: (x, y, z) = (0.666667, 0.666667, 0.666667)
+		 centroids: (cx, cy, cz) = (0.500000, 0.500000, 0.500000)
+		 weight = 1.000000
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/expected/DVCWeightsSuite_testGetCentroids2D.txt
--- a/Weights/tests/expected/DVCWeightsSuite_testGetCentroids2D.txt	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/expected/DVCWeightsSuite_testGetCentroids2D.txt	Tue Feb 02 16:55:08 2010 +1100
@@ -1,40 +1,16 @@ data->pList[0]:
-data->pList[0]:
-		 coords: (x, y) = (-0.553764, -0.566408)
-		 centroids: (cx, cy) = (-0.500000, -0.700000)
-		 weight = 0.280000
-data->pList[1]:
-		 coords: (x, y) = (-0.104882, -0.014767)
-		 centroids: (cx, cy) = (-0.161538, 0.330769)
-		 weight = 0.520000
-data->pList[2]:
-		 coords: (x, y) = (0.138730, -0.052425)
-		 centroids: (cx, cy) = (0.313333, 0.073333)
-		 weight = 0.600000
-data->pList[3]:
-		 coords: (x, y) = (-0.050163, -0.932681)
-		 centroids: (cx, cy) = (-0.100000, -0.850000)
-		 weight = 0.160000
-data->pList[4]:
-		 coords: (x, y) = (0.908082, 0.917005)
-		 centroids: (cx, cy) = (0.614286, 0.671429)
-		 weight = 0.560000
-data->pList[5]:
-		 coords: (x, y) = (-0.692166, -0.477833)
-		 centroids: (cx, cy) = (-0.860000, -0.580000)
-		 weight = 0.200000
-data->pList[6]:
-		 coords: (x, y) = (-0.620519, -0.278449)
-		 centroids: (cx, cy) = (-0.540000, -0.220000)
-		 weight = 0.200000
-data->pList[7]:
-		 coords: (x, y) = (0.245160, -0.666263)
-		 centroids: (cx, cy) = (0.277778, -0.655556)
-		 weight = 0.360000
-data->pList[8]:
-		 coords: (x, y) = (-0.831957, 0.179689)
-		 centroids: (cx, cy) = (-0.688235, 0.488235)
-		 weight = 0.680000
-data->pList[9]:
-		 coords: (x, y) = (0.922606, -0.581363)
-		 centroids: (cx, cy) = (0.809091, -0.445455)
-		 weight = 0.440000
+data->pList2D[0]:
+		 coords: (x, y) = (0.333333, 0.333333)
+		 centroids: (cx, cy) = (-0.500000, -0.500000)
+		 weight = 1.000000
+data->pList2D[1]:
+		 coords: (x, y) = (0.333333, 0.666667)
+		 centroids: (cx, cy) = (-0.500000, 0.500000)
+		 weight = 1.000000
+data->pList2D[2]:
+		 coords: (x, y) = (0.666667, 0.333333)
+		 centroids: (cx, cy) = (0.500000, -0.500000)
+		 weight = 1.000000
+data->pList2D[3]:
+		 coords: (x, y) = (0.666667, 0.666667)
+		 centroids: (cx, cy) = (0.500000, 0.500000)
+		 weight = 1.000000
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/input/testConstantWeights.xml
--- a/Weights/tests/input/testConstantWeights.xml	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/input/testConstantWeights.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -3,13 +3,13 @@
 
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 	
+	<list name="import" mergeType="merge">
+		<param>PICellerator</param>
+	</list>
+
 	<include>testElementIntegral.xml</include>
 	
 	<struct name="components" mergeType="merge">
-		<struct name="context">
-			<param name="Type">PICelleratorContext</param>
-		</struct>
-
 		<struct name="weights">
 			<param name="Type">ConstantWeights</param>
 		</struct>		
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/input/testDVCWeights.xml
--- a/Weights/tests/input/testDVCWeights.xml	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/input/testDVCWeights.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -10,10 +10,6 @@
 	<include>testElementIntegral.xml</include>
 	
 	<struct name="components" mergeType="merge">
-		<struct name="context">
-			<param name="Type">DomainContext</param>
-		</struct>
-
 		<struct name="weights">
 			<param name="Type">DVCWeights</param>
 		</struct>		
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/input/testElementIntegral.xml
--- a/Weights/tests/input/testElementIntegral.xml	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/input/testElementIntegral.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -8,13 +8,6 @@
 	<include>StgFEM/TimeIntegrator.xml</include>
 	
 	<struct name="components" mergeType="merge">
-		<struct name="everywhere">
-			<param name="Type">Everywhere</param>
-		</struct>
-		<struct name="material">
-			<param name="Type">Material</param>
-			<param name="Shape">everywhere</param>
-		</struct>
 		<struct name="elementCellLayout">
 			<param name="Type">ElementCellLayout</param>
 			<param name="Mesh">linearMesh</param>
@@ -56,7 +49,7 @@
 		</struct>
 	</struct>
 	
-	<param name="dim"> 2 </param>
+   <param name="dim"> 2 </param>
 	<param name="particleCount"> 20 </param>
 
 	<param name="maxTimeSteps"> 1 </param>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/input/testIterativeWeights.xml
--- a/Weights/tests/input/testIterativeWeights.xml	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/input/testIterativeWeights.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -3,13 +3,13 @@
 
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 	
+	<list name="import" mergeType="merge">
+		<param>PICellerator</param>
+	</list>
+
 	<include>testElementIntegral.xml</include>
 	
 	<struct name="components" mergeType="merge">
-		<struct name="context">
-			<param name="Type">PICelleratorContext</param>
-		</struct>
-
 		<struct name="weights">
 			<param name="Type">IterativeWeights</param>
 			<param name="maxIterations">100</param>
diff -r 4ca4356447d8 -r 42d3a58b6ff9 Weights/tests/input/testMomentBalanceWeights.xml
--- a/Weights/tests/input/testMomentBalanceWeights.xml	Tue Feb 02 16:36:14 2010 +1100
+++ b/Weights/tests/input/testMomentBalanceWeights.xml	Tue Feb 02 16:55:08 2010 +1100
@@ -3,13 +3,13 @@
 
 <StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
 	
+	<list name="import" mergeType="merge">
+		<param>PICellerator</param>
+	</list>
+
 	<include>testElementIntegral.xml</include>
 	
 	<struct name="components" mergeType="merge">
-		<struct name="context">
-			<param name="Type">PICelleratorContext</param>
-		</struct>		
-
 		<struct name="weights">
 			<param name="Type">MomentBalanceWeights</param>
 		</struct>		
diff -r 4ca4356447d8 -r 42d3a58b6ff9 libPICellerator/Toolbox/Toolbox.c
--- a/libPICellerator/Toolbox/Toolbox.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/libPICellerator/Toolbox/Toolbox.c	Tue Feb 02 16:55:08 2010 +1100
@@ -49,14 +49,53 @@
 
 const Type PICellerator_Toolbox_Type = "PICellerator_Toolbox";
 
-void _PICellerator_Toolbox_AssignFromXML( void* component, Stg_ComponentFactory* cf, void* data ) {
+void _PICellerator_Toolbox_Construct( void* component, Stg_ComponentFactory* cf, void* ptrToContext ) {
+	PICelleratorContext*		context;
+	AbstractContext**		ptrToSelf;
+	AbstractContext*		curContext;
+ 
+	/* Get the existing context, as defined by StGermain, or an alternative toolbox. */
+	ptrToSelf = (AbstractContext**)ptrToContext;
+	curContext = (AbstractContext*)Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, ptrToSelf ); 
+
+
+	/* Only need to initialise a new context, and copy all relevant registers over IF this is the first toolbox */
+        /* to be constructed. */
+        /* The first toolbox to be constructed is Guaranteed to have the 'largest' context. */
+        /*                       (ie is an inherited child of ALL other toolbox about to be loaded) */
+        if( curContext->type == AbstractContext_Type ) {
+		/* Create a new, empty FiniteElementContext. */
+		context = PICelleratorContext_New( curContext->name, 0, 0, curContext->communicator, curContext->dictionary );
+		Memory_CountInc( context );
+
+                context->dictionary = curContext->dictionary;
+                /* Need to get the old CF from curContext, and use that in my new context. */
+                /* Now I CANNOT delete this curContext or I'll lose the CF. :( */
+                context->CF = curContext->CF;
+
+                /* 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*) curContext)->name,
+			KEEP,
+			(Stg_Component*) context);
+
+                /* Recreate the registerRegister link in CF. */
+                context->CF->registerRegister = context->register_Register;
+        } /* close of if( prevContext->type == AbstractContext_Type) */
+	else { /* curContext was NOT an abstract context -> that is does NOT need to be replaced */
+		context = (PICelleratorContext*)curContext;
+	}
+	
+	*ptrToSelf = (AbstractContext*)context;
 }
 
 void* _PICellerator_Toolbox_DefaultNew( Name name ) {
 	return Codelet_New(
 			PICellerator_Toolbox_Type,
 			_PICellerator_Toolbox_DefaultNew,
-			_PICellerator_Toolbox_AssignFromXML,
+			_PICellerator_Toolbox_Construct,
 			_Codelet_Build,
 			_Codelet_Initialise,
 			_Codelet_Execute,
@@ -71,12 +110,10 @@ void PICellerator_Toolbox_Finalise( Plug
 void PICellerator_Toolbox_Finalise( PluginsManager* pluginsManager ) {
 	PICellerator_Finalise();
 	
-	Journal_RPrintf( Journal_Register( Info_Type, (Name)PICellerator_Toolbox_Type  ), "Finalised: PICellerator Toolbox.\n" );
+	Journal_RPrintf( Journal_Register( Info_Type, PICellerator_Toolbox_Type ), "Finalised: PICellerator Toolbox.\n" );
 }
 
 Index PICellerator_Toolbox_Register( PluginsManager* pluginsManager ) {
-	return PluginsManager_Submit( pluginsManager, PICellerator_Toolbox_Type, (Name)"0", _PICellerator_Toolbox_DefaultNew  );
+	return PluginsManager_Submit( pluginsManager, PICellerator_Toolbox_Type, "0", _PICellerator_Toolbox_DefaultNew );
 }
 
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 libPICellerator/src/Finalise.c
--- a/libPICellerator/src/Finalise.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/libPICellerator/src/Finalise.c	Tue Feb 02 16:55:08 2010 +1100
@@ -52,8 +52,8 @@
 #include <stdio.h>
 
 Bool PICellerator_Finalise( void ) {
-	if( ToolboxesManager_IsInitialised( stgToolboxesManager, "PICellerator" ) ) {
-		Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	if( !ToolboxesManager_IsInitialised( stgToolboxesManager, "PICellerator" ) ) {
+		Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
 		
 		PICellerator_Utils_Finalise();
 		PICellerator_MaterialPoints_Finalise();
@@ -65,5 +65,3 @@ Bool PICellerator_Finalise( void ) {
 		return False;
 	}
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 libPICellerator/src/Init.c
--- a/libPICellerator/src/Init.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/libPICellerator/src/Init.c	Tue Feb 02 16:55:08 2010 +1100
@@ -65,14 +65,14 @@ Bool PICellerator_Init( int* argc, char*
 		PICellerator_MaterialPoints_Init( argc, argv );
 		PICellerator_Utils_Init( argc, argv );
 	
-		Journal_Printf( Journal_Register( DebugStream_Type, (Name)"Context"  ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
-		tmp = Stream_GetPrintingRank( Journal_Register( InfoStream_Type, (Name)"Context" )  );
-		Stream_SetPrintingRank( Journal_Register( InfoStream_Type, (Name)"Context"  ), 0 );
+		Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+		tmp = Stream_GetPrintingRank( Journal_Register( InfoStream_Type, "Context" ) );
+		Stream_SetPrintingRank( Journal_Register( InfoStream_Type, "Context" ), 0 );
 		Journal_Printf( /* DO NOT CHANGE OR REMOVE */
-			Journal_Register( InfoStream_Type, (Name)"Context"  ), 
+			Journal_Register( InfoStream_Type, "Context" ), 
 			"Particle-In-Cellerator (FEM/PIC framework) revision %s. Copyright (C) 2005 VPAC & Monash Cluster Computing.\n", VERSION );
-		Stream_Flush( Journal_Register( InfoStream_Type, (Name)"Context" )  );
-		Stream_SetPrintingRank( Journal_Register( InfoStream_Type, (Name)"Context"  ), tmp );
+		Stream_Flush( Journal_Register( InfoStream_Type, "Context" ) );
+		Stream_SetPrintingRank( Journal_Register( InfoStream_Type, "Context" ), tmp );
 
 		/* Add the PICellerator path to the global xml path dictionary */
 		directory = Memory_Alloc_Array( char, 200, "xmlDirectory" ) ;
@@ -88,5 +88,3 @@ Bool PICellerator_Init( int* argc, char*
 	}
 	return False;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 libPICellerator/tests/LibPICelleratorSuite.c
--- a/libPICellerator/tests/LibPICelleratorSuite.c	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#include <mpi.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "pcu/pcu.h"
-#include <StGermain/StGermain.h>
-#include "StgDomain/StgDomain.h"
-#include <StgFEM/StgFEM.h>
-
-#include "PICellerator/PICellerator.h"
-#include "PICellerator/Init.h"
-#include "PICellerator/Finalise.h"
-
-#include "LibPICelleratorSuite.h"
-
-typedef struct {
-} LibPICelleratorSuiteData;
-
-void LibPICelleratorSuite_Setup( LibPICelleratorSuiteData* data ) {
-}
-
-void LibPICelleratorSuite_Teardown( LibPICelleratorSuiteData* data ) {
-}
-
-void LibPICelleratorSuite_TestDirectoryStGermain( LibPICelleratorSuiteData* data ) {
-    Stg_Object* testDirectoryStGermain;
-    testDirectoryStGermain = Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StGermain" );
-    pcu_check_true( testDirectoryStGermain != NULL );
-}
-
-void LibPICelleratorSuite_TestDirectoryStgFEM( LibPICelleratorSuiteData * data  ) {
-    Stg_Object* testDirectoryStGermain;
-    Stg_Object* testDirectoryStgFEM;
-
-    testDirectoryStGermain = Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StGermain"  );
-    testDirectoryStgFEM= Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StgFEM" );
-
-    pcu_check_true( ( strcmp((char* )LIB_DIR, (char*)testDirectoryStGermain) ) || ( testDirectoryStgFEM != NULL ) );
-}
-
-void LibPICelleratorSuite_TestDirectoryPICellerator( LibPICelleratorSuiteData * data ) {
-    Stg_Object* testDirectoryStGermain;
-    Stg_Object* testDirectoryPICellerator;
-
-    testDirectoryStGermain = Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"StGermain"  );
-    testDirectoryPICellerator= Stg_ObjectList_Get( Project_XMLSearchPaths, (Name)"PICellerator" );
-
-    pcu_check_true( ( strcmp((char* )LIB_DIR, (char*)testDirectoryStGermain) ) || ( testDirectoryPICellerator != NULL ) );
-}
-
-void LibPICelleratorSuite( pcu_suite_t* suite ) {
-
-    pcu_suite_setData( suite, LibPICelleratorSuiteData );
-    pcu_suite_setFixtures( suite, LibPICelleratorSuite_Setup, LibPICelleratorSuite_Teardown);
-
-    pcu_suite_addTest( suite, LibPICelleratorSuite_TestDirectoryStGermain );
-    pcu_suite_addTest( suite, LibPICelleratorSuite_TestDirectoryStgFEM);
-    pcu_suite_addTest( suite, LibPICelleratorSuite_TestDirectoryPICellerator);
-}
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 libPICellerator/tests/LibPICelleratorSuite.h
--- a/libPICellerator/tests/LibPICelleratorSuite.h	Tue Feb 02 16:36:14 2010 +1100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-#ifndef PICellerator_LibPICelleratorSuite_h
-#define PICellerator_LibPICelleratorSuite_h
-
-void LibPICelleratorSuite( pcu_suite_t* suite );
-
-#endif
diff -r 4ca4356447d8 -r 42d3a58b6ff9 libPICellerator/tests/expected/testLibPICellerator.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/tests/expected/testLibPICellerator.0of1.expected	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,11 @@
+StGermain Framework revision 4012. Copyright (C) 2003-2005 VPAC.
+StGermain Finite Element Framework revision 747. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Discretisation Framework revision 747. Copyright (C) 2003-2005 VPAC.
+StGermain SLE Library revision 747. Copyright (C) 2003-2005 VPAC.
+StGermain PETSc-LinearAlgebra Interface revision 747. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Assembly Library revision 747. Copyright (C) 2003-2005 VPAC.
+Particle-In-Cellerator (FEM/PIC framework) revision 426. Copyright (C) 2005 VPAC & Monash Cluster Computing.
+Watching rank: 0
+StGermain XML library Path found.
+StgFEM XML library Path found.
+PICellerator XML library Path found.
diff -r 4ca4356447d8 -r 42d3a58b6ff9 libPICellerator/tests/testLibPICellerator.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/tests/testLibPICellerator.0of1.sh	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,49 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+##	Melbourne, 3053, Australia.
+##
+## Primary Contributing Organisations:
+##	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+##	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+##	Monash Cluster Computing - http://www.mcc.monash.edu.au
+##	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
+##
+## Contributors:
+##	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+##	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+##	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+##	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: testLibStgFEM.0of1.sh 656 2006-10-18 06:45:50Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "testLibPICellerator " "$0" "$@"
diff -r 4ca4356447d8 -r 42d3a58b6ff9 libPICellerator/tests/testLibPICellerator.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/tests/testLibPICellerator.c	Tue Feb 02 16:55:08 2010 +1100
@@ -0,0 +1,134 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**	Computational Infrastructure for Geodynamics - http://www.geodynamics.org
+**
+** Contributors:
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testLibStgFEM.c 656 2006-10-18 06:45:50Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PICellerator.h>
+#include "PICellerator/Init.h"
+#include "PICellerator/Finalise.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main( int argc, char* argv[] ) {
+	MPI_Comm		CommWorld;
+	int			rank;
+	int			numProcessors;
+	int			procToWatch;
+	
+	/* Initialise MPI, get world info */
+	MPI_Init( &argc, &argv );
+	MPI_Comm_dup( MPI_COMM_WORLD, &CommWorld );
+	MPI_Comm_size( CommWorld, &numProcessors );
+	MPI_Comm_rank( CommWorld, &rank );
+	/* Read input */
+
+	if( !StGermain_Init( &argc, &argv ) ) {
+		fprintf( stderr, "Error initialising StGermain, exiting.\n" );
+		exit( EXIT_FAILURE );
+	}
+	if (!StgFEM_Init( &argc, &argv ) ) {
+		fprintf( stderr, "Error initialising StgFEM, exiting.\n" );
+		exit( EXIT_FAILURE );
+	}		
+	PICellerator_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+
+	if( argc >= 2 ) {
+		procToWatch = atoi( argv[1] );
+	}
+	else {
+		procToWatch = 0;
+	}
+	if( rank == procToWatch ) {
+		Stg_Object* testDirectory;
+
+		printf( "Watching rank: %i\n", rank );
+		/* Testing entries in xmlSearchPaths */
+		testDirectory = Stg_ObjectList_Get( xmlSearchPaths,"StGermain" );
+		if (testDirectory != NULL) {
+			printf("StGermain XML library Path found.\n");
+		}
+		else {
+			printf("StGermain XML library Path not found.\n"); 
+		}
+		/* For build in the same build directory */
+		if (strcmp((char*)LIB_DIR, (char*)testDirectory)) {
+			printf("StgFEM XML library Path found.\n");
+		}
+		/* For build in separate directories */
+		else{
+			testDirectory = Stg_ObjectList_Get( xmlSearchPaths,"StgFEM" );
+			if (testDirectory != NULL) {
+				printf("StgFEM XML library Path found.\n");
+			}
+			else {
+				printf("StgFEM XML library Path not found.\n"); 
+			}
+		}
+		/* For build in the same build directory */
+		if (strcmp((char*)LIB_DIR, (char*)testDirectory)) {
+			printf("PICellerator XML library Path found.\n");
+		}
+		/* For build in separate directories */
+		else{
+			testDirectory = Stg_ObjectList_Get( xmlSearchPaths,"PICellerator" );
+			if (testDirectory != NULL) {
+				printf("PICellerator XML library Path found.\n");
+			}
+			else {
+				printf("PICellerator XML library Path not found.\n"); 
+			}
+		}
+	}
+	
+	PICellerator_Finalise(); 
+	StgFEM_Finalise();
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+
+	return 0; /* success */
+}
diff -r 4ca4356447d8 -r 42d3a58b6ff9 plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.c
--- a/plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.c	Tue Feb 02 16:55:08 2010 +1100
@@ -55,35 +55,42 @@
 
 const Type PICellerator_CalculateParticleDisplacement_Type = "PICellerator_CalculateParticleDisplacement";
 
-void _PICellerator_CalculateParticleDisplacement_AssignFromXML( void* component, Stg_ComponentFactory* cf, void* data ) {
+void _PICellerator_CalculateParticleDisplacement_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
 	CalculateParticleDisplacementPlugin*  self = (CalculateParticleDisplacementPlugin*)component;
 	DomainContext*                context;
 	MaterialPointsSwarm*                  materialPointsSwarm;
 	StandardParticle                      particle;
 	ParticleDisplacementInfo*             particleExt;
 	
-	context = (DomainContext*)Stg_ComponentFactory_ConstructByName( cf, (Name)"context", DomainContext, True, data  );
+	context = (DomainContext*)Stg_ComponentFactory_ConstructByName( cf, "context", DomainContext, True, data );
 
 	ContextEP_Append( context, AbstractContext_EP_Initialise, _PICellerator_CalculateParticleDisplacement_StoreOriginalPos );
 	ContextEP_Append( context, AbstractContext_EP_Step, _PICellerator_CalculateParticleDisplacement_UpdateDisplacement );
 
 	/* Extend particle with original pos */
-	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialSwarm" );
-	assert( materialPointsSwarm  );
-	self->particleDisplacementInfo_Handle = ExtensionManager_Add( materialPointsSwarm->particleExtensionMgr, (Name)CURR_MODULE_NAME, sizeof( ParticleDisplacementInfo )  );
+	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, "materialSwarm" );
+	assert( materialPointsSwarm );
+	self->particleDisplacementInfo_Handle = ExtensionManager_Add( materialPointsSwarm->particleExtensionMgr, CURR_MODULE_NAME,
+		sizeof( ParticleDisplacementInfo ) );
 
 	/* now register these guys as swarm variables */
 	particleExt = ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr, &particle,
 		self->particleDisplacementInfo_Handle );
 
-	self->particleOriginalCoordSwarmVariable = Swarm_NewVectorVariable( materialPointsSwarm, (Name)"OriginalCoord", (ArithPointer) &particleExt->originalCoord - (ArithPointer) &particle,
+	self->particleOriginalCoordSwarmVariable = Swarm_NewVectorVariable(
+		materialPointsSwarm,
+		"OriginalCoord",
+		(ArithPointer) &particleExt->originalCoord - (ArithPointer) &particle,
 		Variable_DataType_Double,
 		materialPointsSwarm->dim,
 		"OriginalCoordX",
 		"OriginalCoordY",
 		"OriginalCoordZ" );
 		
-	self->particleDisplacementSwarmVariable = Swarm_NewVectorVariable( materialPointsSwarm, (Name)"Displacement", (ArithPointer) &particleExt->displacement - (ArithPointer) &particle,
+	self->particleDisplacementSwarmVariable = Swarm_NewVectorVariable(
+		materialPointsSwarm,
+		"Displacement",
+		(ArithPointer) &particleExt->displacement - (ArithPointer) &particle,
 		Variable_DataType_Double,
 		materialPointsSwarm->dim,
 		"DisplacementX",
@@ -96,7 +103,6 @@ void _PICellerator_CalculateParticleDisp
 	you give, so we have to add it manually here */
 	self->particleDisplacementMagSwarmVariable = OperatorSwarmVariable_NewUnary(
 		"materialSwarm-DisplacementMagnitude",
-		(AbstractContext*)context, 
 		self->particleDisplacementSwarmVariable,
 		"Magnitude" );
 	
@@ -112,13 +118,14 @@ void _PICellerator_CalculateParticleDisp
 	ParticleDisplacementInfo*             particleDisplacementInfo; 
 	Particle_Index                        lParticle_I;
 
-	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialSwarm" );
+	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, "materialSwarm" );
 	assert( materialPointsSwarm );
-	self = (CalculateParticleDisplacementPlugin* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"PICellerator_CalculateParticleDisplacement" );
+	self = (CalculateParticleDisplacementPlugin*) LiveComponentRegister_Get( context->CF->LCRegister,
+		"PICellerator_CalculateParticleDisplacement" );
 	assert( self );
 
 	for ( lParticle_I = 0 ; lParticle_I < materialPointsSwarm->particleLocalCount ; lParticle_I++ ) {
-		particle = (GlobalParticle* )Swarm_ParticleAt( materialPointsSwarm, lParticle_I );
+		particle = (GlobalParticle*)Swarm_ParticleAt( materialPointsSwarm, lParticle_I );
 		particleDisplacementInfo = ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr,
 			particle, self->particleDisplacementInfo_Handle );
 		originalCoord = particleDisplacementInfo->originalCoord;
@@ -140,13 +147,14 @@ void _PICellerator_CalculateParticleDisp
 	Dimension_Index                       dim_I;
 
 	/* Add original pos to particle */
-	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"materialSwarm" );
+	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, "materialSwarm" );
 	assert( materialPointsSwarm );
-	self = (CalculateParticleDisplacementPlugin* ) LiveComponentRegister_Get( context->CF->LCRegister, (Name)"PICellerator_CalculateParticleDisplacement" );
+	self = (CalculateParticleDisplacementPlugin*) LiveComponentRegister_Get( context->CF->LCRegister,
+		"PICellerator_CalculateParticleDisplacement" );
 	assert( self );
 
 	for ( lParticle_I = 0 ; lParticle_I < materialPointsSwarm->particleLocalCount ; lParticle_I++ ) {
-		particle      = (GlobalParticle* )Swarm_ParticleAt( materialPointsSwarm, lParticle_I );
+		particle      = (GlobalParticle*)Swarm_ParticleAt( materialPointsSwarm, lParticle_I );
 		coord         = particle->coord;
 		particleDisplacementInfo = ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr, particle,
 			self->particleDisplacementInfo_Handle );
@@ -160,32 +168,27 @@ void _PICellerator_CalculateParticleDisp
 
 
 void* _PICellerator_CalculateParticleDisplacement_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof( CalculateParticleDisplacementPlugin );
-	Type                                                      type = PICellerator_CalculateParticleDisplacement_Type;
-	Stg_Class_DeleteFunction*                              _delete = _Codelet_Delete;
-	Stg_Class_PrintFunction*                                _print = _Codelet_Print;
-	Stg_Class_CopyFunction*                                  _copy = _Codelet_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _PICellerator_CalculateParticleDisplacement_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _PICellerator_CalculateParticleDisplacement_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _Codelet_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _Codelet_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _Codelet_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _Codelet_Destroy;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return _Codelet_New(  CODELET_PASSARGS  );
+	return _Codelet_New(
+			sizeof( CalculateParticleDisplacementPlugin ),
+			PICellerator_CalculateParticleDisplacement_Type,
+			_Codelet_Delete,
+			_Codelet_Print,
+			_Codelet_Copy,
+			_PICellerator_CalculateParticleDisplacement_DefaultNew,
+			_PICellerator_CalculateParticleDisplacement_Construct,
+			_Codelet_Build,
+			_Codelet_Initialise,
+			_Codelet_Execute,
+			_Codelet_Destroy,
+			name );
 }
 
 
 Index PICellerator_CalculateParticleDisplacement_Register( PluginsManager* pluginsManager ) {
 	Index result;
 
-	result = PluginsManager_Submit( pluginsManager, PICellerator_CalculateParticleDisplacement_Type, (Name)"0", _PICellerator_CalculateParticleDisplacement_DefaultNew  );
+	result = PluginsManager_Submit( pluginsManager, PICellerator_CalculateParticleDisplacement_Type, "0",
+		_PICellerator_CalculateParticleDisplacement_DefaultNew );
 
 	return result;
 }
-
-
diff -r 4ca4356447d8 -r 42d3a58b6ff9 plugins/Output/MaterialCentroid/MaterialCentroid.c
--- a/plugins/Output/MaterialCentroid/MaterialCentroid.c	Tue Feb 02 16:36:14 2010 +1100
+++ b/plugins/Output/MaterialCentroid/MaterialCentroid.c	Tue Feb 02 16:55:08 2010 +1100
@@ -57,23 +57,23 @@ void MaterialCentroid( PICelleratorConte
 	Coord                       centroid;
 	double                      volume;
 	static Bool                 beenHere              = False;
-	Stream*                     stream                = Journal_Register( Info_Type, (Name)"MaterialCentroid" );
+	Stream*                     stream                = Journal_Register( Info_Type, "MaterialCentroid" );
 
-	if (!beenHere ) {
+	if (!beenHere) {
 		Name                 swarmName;
 		Name                 materialName;
 		Name                 filename;
       Bool                 fileOpened;
-      Stream*              errorStream  = Journal_Register( Error_Type, (Name)CURR_MODULE_NAME  );
+      Stream*              errorStream  = Journal_Register( Error_Type, CURR_MODULE_NAME );
 
 		swarmName = Dictionary_GetString_WithDefault( context->dictionary, "MaterialCentroid_Swarm", "picIntegrationPoints" );
 		
 		/* Get Swarm */
-		swarm = (IntegrationPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, (Name)swarmName );
-		assert( swarm  );
+		swarm = (IntegrationPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, swarmName );
+		assert( swarm );
 	
 		/* Get Material */
-		materialName = Dictionary_GetString( context->dictionary, (Dictionary_Entry_Key)"CentroidMaterial"  );
+		materialName = Dictionary_GetString( context->dictionary, "CentroidMaterial" );
 		material = Materials_Register_GetByName( swarm->materials_Register, materialName );
 		assert( material );
 		
@@ -109,42 +109,37 @@ void MaterialCentroid( PICelleratorConte
 }
 
 
-void _PICellerator_MaterialCentroid_AssignFromXML( void* component, Stg_ComponentFactory* cf, void* data ) {
+void _PICellerator_MaterialCentroid_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
 
 	AbstractContext* context;
 
-	context = Stg_ComponentFactory_ConstructByName( cf, (Name)"context", AbstractContext, True, data  ); 
+	context = Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data ); 
 	ContextEP_Append( context, AbstractContext_EP_FrequentOutput, MaterialCentroid );
 }
 
 
 void* _PICellerator_MaterialCentroid_DefaultNew( Name name ) {
-	/* Variables set in this function */
-	SizeT                                              _sizeOfSelf = sizeof( Codelet );
-	Type                                                      type = PICellerator_MaterialCentroid_Type;
-	Stg_Class_DeleteFunction*                              _delete = _Codelet_Delete;
-	Stg_Class_PrintFunction*                                _print = _Codelet_Print;
-	Stg_Class_CopyFunction*                                  _copy = _Codelet_Copy;
-	Stg_Component_DefaultConstructorFunction*  _defaultConstructor = _PICellerator_MaterialCentroid_DefaultNew;
-	Stg_Component_ConstructFunction*                    _construct = _PICellerator_MaterialCentroid_AssignFromXML;
-	Stg_Component_BuildFunction*                            _build = _Codelet_Build;
-	Stg_Component_InitialiseFunction*                  _initialise = _Codelet_Initialise;
-	Stg_Component_ExecuteFunction*                        _execute = _Codelet_Execute;
-	Stg_Component_DestroyFunction*                        _destroy = _Codelet_Destroy;
-
-	/* Variables that are set to ZERO are variables that will be set either by the current _New function or another parent _New function further up the hierachy */
-	AllocationType  nameAllocationType = NON_GLOBAL /* default value NON_GLOBAL */;
-
-	return _Codelet_New(  CODELET_PASSARGS  );
+	return _Codelet_New(
+			sizeof( Codelet ),
+			PICellerator_MaterialCentroid_Type,
+			_Codelet_Delete,
+			_Codelet_Print,
+			_Codelet_Copy,
+			_PICellerator_MaterialCentroid_DefaultNew,
+			_PICellerator_MaterialCentroid_Construct,
+			_Codelet_Build,
+			_Codelet_Initialise,
+			_Codelet_Execute,
+			_Codelet_Destroy,
+			name );
 }
 
 
 Index PICellerator_MaterialCentroid_Register( PluginsManager* pluginsManager ) {
 	Index result;
 
-	result = PluginsManager_Submit( pluginsManager, PICellerator_MaterialCentroid_Type, (Name)"0", _PICellerator_MaterialCentroid_DefaultNew  );
+	result = PluginsManager_Submit( pluginsManager, PICellerator_MaterialCentroid_Type, "0",
+		_PICellerator_MaterialCentroid_DefaultNew );
 
 	return result;
 }
-
-



More information about the CIG-COMMITS mailing list