[cig-commits] commit: Tailorization

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


changeset:   1:31abbeebf74e
user:        tailor at csd.vpac.org
date:        Mon Mar 26 09:24:36 2007 +0000
files:       Apps/BuoyancyBenchmark/BuoyancyExample.xml Apps/BuoyancyBenchmark/PressureVP.xml Apps/BuoyancyBenchmark/demo.xml Apps/BuoyancyBenchmark/makefile Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c Apps/BuoyancyBenchmark/tests/AnalyticPressure/makefile Apps/BuoyancyBenchmark/tests/AnalyticPressureVP.xml Apps/BuoyancyBenchmark/tests/AnalyticViewports.xml Apps/BuoyancyBenchmark/tests/PressureErrorVP.xml Apps/BuoyancyBenchmark/tests/expected/testBuoyancy.0of1.PressureField-ErrorFile.expected Apps/BuoyancyBenchmark/tests/makefile Apps/BuoyancyBenchmark/tests/testBuoyancy.0of1.sh Apps/BuoyancyBenchmark/tests/testBuoyancy.xml Apps/BuoyancyBenchmark/velocityBCs.freeslip.xml Apps/BuoyancyBenchmark/window.xml Apps/LidDrivenPIC/AnalyticViewport.xml Apps/LidDrivenPIC/ErrorViewport.xml Apps/LidDrivenPIC/LidDrivenPIC.xml Apps/LidDrivenPIC/Viewport.xml Apps/LidDrivenPIC/demo.xml Apps/LidDrivenPIC/lidDrivenAnalytic.xml Apps/LidDrivenPIC/lidDrivenVelocityBCs.xml Apps/LidDrivenPIC/makefile Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of1.PressureField-ErrorFile.expected Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of1.VelocityField-ErrorFile.expected Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of2.PressureField-ErrorFile.expected Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of2.VelocityField-ErrorFile.expected Apps/LidDrivenPIC/tests/makefile Apps/LidDrivenPIC/tests/testLidDrivenPIC-Analytic-2D.0of1.sh Apps/LidDrivenPIC/tests/testLidDrivenPIC-Analytic-2D.0of2.sh Apps/LidDrivenPIC/window.xml Apps/PIC_Components/AllowOutflow.xml Apps/PIC_Components/MaterialPointSwarm-flip1.xml Apps/PIC_Components/MaterialPointSwarm-test1.xml Apps/PIC_Components/MaterialPointSwarm.xml Apps/PIC_Components/MaterialPointSwarmW.xml Apps/PIC_Components/PeriodicBCsManager.I_AXIS.xml Apps/PIC_Components/PeriodicBCsManager.J_AXIS.xml Apps/PIC_Components/PeriodicBCsManager.K_AXIS.xml Apps/PIC_Components/PopulationControl.xml Apps/PIC_Components/StokesFlowUzawa-flip1.xml Apps/PIC_Components/StokesFlowUzawa-test1.xml Apps/PIC_Components/StokesFlowUzawa.xml Apps/PIC_Components/makefile Apps/RayleighTaylor/DenseMaterialVP.xml Apps/RayleighTaylor/ParticleDensityVP.xml Apps/RayleighTaylor/ParticleDisplacementVP.xml Apps/RayleighTaylor/PressureVP.xml Apps/RayleighTaylor/RayTay_Example-flip1.xml Apps/RayleighTaylor/RayTay_Example-test1.xml Apps/RayleighTaylor/RayTay_Example.xml Apps/RayleighTaylor/VelocityMagnitudeVP.xml Apps/RayleighTaylor/demo.xml Apps/RayleighTaylor/makefile Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c Apps/RayleighTaylor/tests/AnalyticBlock/makefile Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c Apps/RayleighTaylor/tests/AnalyticColumn/makefile Apps/RayleighTaylor/tests/AnalyticPressureVP.xml Apps/RayleighTaylor/tests/AnalyticVelocityMagnitudeVP.xml Apps/RayleighTaylor/tests/AnalyticViewports.xml Apps/RayleighTaylor/tests/PressureErrorVP.xml Apps/RayleighTaylor/tests/VelocityErrorMagnitudeVP.xml Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of1.PressureField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of1.VelocityField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of2.PressureField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of2.VelocityField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of1.PressureField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of1.VelocityField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of2.PressureField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of2.VelocityField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testAnalyticColumn3D.0of1.PressureField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testAnalyticColumn3D.0of1.VelocityField-ErrorFile.expected Apps/RayleighTaylor/tests/expected/testRayTay2D-i686.0of1.denseMaterialCentroid.dat.expected Apps/RayleighTaylor/tests/expected/testRayTay2D.0of1.denseMaterialCentroid.dat.expected Apps/RayleighTaylor/tests/expected/testRayTay3D.0of1.denseMaterialCentroid.dat.expected Apps/RayleighTaylor/tests/expected/testRayTaySuperimposedBall2D-invert.0of1.lightMaterialCentroid.dat.expected Apps/RayleighTaylor/tests/expected/testRayTaySuperimposedBall2D.0of1.denseMaterialCentroid.dat.expected Apps/RayleighTaylor/tests/makefile Apps/RayleighTaylor/tests/testAnalyticBlock.0of1.sh Apps/RayleighTaylor/tests/testAnalyticBlock.0of2.sh Apps/RayleighTaylor/tests/testAnalyticBlock.xml Apps/RayleighTaylor/tests/testAnalyticColumn.0of1.sh Apps/RayleighTaylor/tests/testAnalyticColumn.0of2.sh Apps/RayleighTaylor/tests/testAnalyticColumn.xml Apps/RayleighTaylor/tests/testAnalyticColumn3D.0of1.sh Apps/RayleighTaylor/tests/testRayTay.xml Apps/RayleighTaylor/tests/testRayTay2D-i686.0of1.sh Apps/RayleighTaylor/tests/testRayTay2D.0of1.sh Apps/RayleighTaylor/tests/testRayTay3D.0of1.sh Apps/RayleighTaylor/tests/testRayTaySuperimposedBall-invert.xml Apps/RayleighTaylor/tests/testRayTaySuperimposedBall.xml Apps/RayleighTaylor/tests/testRayTaySuperimposedBall2D-invert.0of1.sh Apps/RayleighTaylor/tests/testRayTaySuperimposedBall2D.0of1.sh Apps/RayleighTaylor/velocityBCs.freeslip.xml Apps/RayleighTaylor/velocityBCs.freeslipSides.xml Apps/RayleighTaylor/window.xml Apps/ThermoChem/Makefile.def Apps/ThermoChem/ParticleDensityVP.xml Apps/ThermoChem/TemperatureAndVelocityArrowsVP.xml Apps/ThermoChem/ThermoChem.xml Apps/ThermoChem/demo.xml Apps/ThermoChem/makefile Apps/ThermoChem/temperatureBCs.xml Apps/ThermoChem/temperatureICs.xml Apps/ThermoChem/velocityFreeslipBCs.xml Apps/ThermoChem/window.xml Apps/makefile Apps/src COPYING Makefile.vmake MaterialPoints/makefile MaterialPoints/src/BackgroundParticleLayout.c MaterialPoints/src/BackgroundParticleLayout.h MaterialPoints/src/BackgroundParticleLayout.meta MaterialPoints/src/CoincidentMapper.c MaterialPoints/src/CoincidentMapper.h MaterialPoints/src/CoincidentMapper.meta MaterialPoints/src/Context.c MaterialPoints/src/Context.h MaterialPoints/src/Context.meta MaterialPoints/src/Finalise.c MaterialPoints/src/Finalise.h MaterialPoints/src/GaussMapper.c MaterialPoints/src/GaussMapper.h MaterialPoints/src/GaussMapper.meta MaterialPoints/src/IPMapper.meta MaterialPoints/src/Init.c MaterialPoints/src/Init.h MaterialPoints/src/IntegrationPointMapper.c MaterialPoints/src/IntegrationPointMapper.h MaterialPoints/src/IntegrationPointMapper.meta MaterialPoints/src/IntegrationPointsSwarm.c MaterialPoints/src/IntegrationPointsSwarm.h MaterialPoints/src/IntegrationPointsSwarm.meta MaterialPoints/src/ManyToOneMapper.c MaterialPoints/src/ManyToOneMapper.h MaterialPoints/src/ManyToOneMapper.meta MaterialPoints/src/MappedParticleLayout.c MaterialPoints/src/MappedParticleLayout.h MaterialPoints/src/MappedParticleLayout.meta MaterialPoints/src/Material.c MaterialPoints/src/Material.h MaterialPoints/src/Material.meta MaterialPoints/src/MaterialFeVariable.c MaterialPoints/src/MaterialFeVariable.h MaterialPoints/src/MaterialFeVariable.meta MaterialPoints/src/MaterialPoint.c MaterialPoints/src/MaterialPoint.h MaterialPoints/src/MaterialPoints.h MaterialPoints/src/MaterialPointsSwarm.c MaterialPoints/src/MaterialPointsSwarm.h MaterialPoints/src/MaterialPointsSwarm.meta MaterialPoints/src/MaterialSwarm.meta MaterialPoints/src/Materials_Register.c MaterialPoints/src/Materials_Register.h MaterialPoints/src/OneToOneMapper.c MaterialPoints/src/OneToOneMapper.h MaterialPoints/src/OneToOneMapper.meta MaterialPoints/src/ParticleFeVariable.c MaterialPoints/src/ParticleFeVariable.h MaterialPoints/src/ParticleFeVariable.meta MaterialPoints/src/PeriodicBoundariesManager.c MaterialPoints/src/PeriodicBoundariesManager.h MaterialPoints/src/PeriodicBoundariesManager.meta MaterialPoints/src/SingleMaterialMapper.meta MaterialPoints/src/SwarmAdvector.c MaterialPoints/src/SwarmAdvector.h MaterialPoints/src/SwarmAdvector.meta MaterialPoints/src/SwarmAdvectorD.c MaterialPoints/src/SwarmAdvectorD.h MaterialPoints/src/SwarmAdvectorD.meta MaterialPoints/src/SwarmAdvectorW.c MaterialPoints/src/SwarmAdvectorW.h MaterialPoints/src/SwarmAdvectorW.meta MaterialPoints/src/makefile MaterialPoints/src/types.h 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/makefile MaterialPoints/tests/plugins/makefile MaterialPoints/tests/plugins/testAdvection.c MaterialPoints/tests/plugins/testMaterialFeVariable.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/testMaterialFeVariable.0of1.sh MaterialPoints/tests/testMaterialFeVariable.0of2.sh MaterialPoints/tests/testMaterialFeVariable.xml MaterialPoints/tests/testPeriodicBCs.0of1.sh MaterialPoints/tests/testPeriodicBCs.0of2.sh MaterialPoints/tests/testPeriodicBCs.1of2.sh MaterialPoints/tests/testPeriodicBCs.c 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/makefile PopulationControl/src/DiscreteVoronoiRemove.c PopulationControl/src/DiscreteVoronoiRemove.h PopulationControl/src/DiscreteVoronoiRemove.meta PopulationControl/src/DiscreteVoronoiSplitting.c PopulationControl/src/DiscreteVoronoiSplitting.h PopulationControl/src/DiscreteVoronoiSplitting.meta PopulationControl/src/EscapedRoutine.c PopulationControl/src/EscapedRoutine.h PopulationControl/src/EscapedRoutine.meta PopulationControl/src/Finalise.c PopulationControl/src/Finalise.h PopulationControl/src/Init.c PopulationControl/src/Init.h PopulationControl/src/PopulationControl.h PopulationControl/src/RemovalRoutine.c PopulationControl/src/RemovalRoutine.h PopulationControl/src/RemovalRoutine.meta PopulationControl/src/ReseedSplitting.c PopulationControl/src/ReseedSplitting.h PopulationControl/src/ReseedSplitting.meta PopulationControl/src/SplittingRoutine.c PopulationControl/src/SplittingRoutine.h PopulationControl/src/SplittingRoutine.meta PopulationControl/src/makefile PopulationControl/src/types.h PopulationControl/tests/expected/testDiscreteVoronoiRemove.0of1.discrepancy.dat.expected PopulationControl/tests/expected/testDiscreteVoronoiSplitting.0of1.discrepancy.dat.expected PopulationControl/tests/expected/testReseedSplitting.0of1.discrepancy.dat.expected PopulationControl/tests/makefile PopulationControl/tests/plugins/makefile PopulationControl/tests/plugins/testDiscrepancy.c PopulationControl/tests/plugins/testParticleCoords.c PopulationControl/tests/testDiscreteVoronoiRemove.0of1.sh PopulationControl/tests/testDiscreteVoronoiRemove.xml PopulationControl/tests/testDiscreteVoronoiSplitting.0of1.sh PopulationControl/tests/testDiscreteVoronoiSplitting.xml PopulationControl/tests/testPopulationControl.xml PopulationControl/tests/testReseedSplitting.0of1.sh PopulationControl/tests/testReseedSplitting.xml Templates/PICelleratorLicense.makefile.txt Templates/PICelleratorLicense.txt Templates/license.c_suffix.txt Templates/license.h_suffix.txt Templates/license.makefile_suffix.txt Utils/makefile Utils/src/BuoyancyForceTerm.c Utils/src/BuoyancyForceTerm.h Utils/src/BuoyancyForceTerm.meta Utils/src/BuoyancyForceTermThermoChem.c Utils/src/BuoyancyForceTermThermoChem.h Utils/src/BuoyancyForceTermThermoChem.meta Utils/src/Finalise.c Utils/src/Finalise.h Utils/src/Init.c Utils/src/Init.h Utils/src/MaterialSwarmVariable.c Utils/src/MaterialSwarmVariable.h Utils/src/MaterialSwarmVariable.meta Utils/src/PCDVC.c Utils/src/PCDVC.h Utils/src/PCDVC.meta Utils/src/Utils.h Utils/src/makefile Utils/src/types.h Utils/tests/expected/testPCDVC_Circle.0of1.output.dat.expected Utils/tests/expected/testPCDVC_ExpIface.0of1.output.dat.expected Utils/tests/expected/testPCDVC_Poly.0of1.output.dat.expected Utils/tests/makefile 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 Voronoi/makefile Voronoi/src/AdaptiveVoronoi.c Voronoi/src/AdaptiveVoronoi.h Voronoi/src/AdaptiveVoronoi.meta Voronoi/src/CellularAutomataVoronoi.c Voronoi/src/CellularAutomataVoronoi.h Voronoi/src/CellularAutomataVoronoi.meta Voronoi/src/DiscreteVoronoi.c Voronoi/src/DiscreteVoronoi.h Voronoi/src/DiscreteVoronoi.meta Voronoi/src/Finalise.c Voronoi/src/Finalise.h Voronoi/src/Init.c Voronoi/src/Init.h Voronoi/src/Voronoi.h Voronoi/src/makefile Voronoi/src/types.h Voronoi/tests/expected/testAdaptiveVoronoi2D.0of1.output.dat.expected Voronoi/tests/expected/testCellularAutomataVoronoi2D.0of1.output.dat.expected Voronoi/tests/makefile Voronoi/tests/plugins/makefile Voronoi/tests/plugins/testDiscreteVoronoi.c Voronoi/tests/testAdaptiveVoronoi.xml Voronoi/tests/testAdaptiveVoronoi2D.0of1.sh Voronoi/tests/testCellularAutomataVoronoi.xml Voronoi/tests/testCellularAutomataVoronoi2D.0of1.sh Voronoi/tests/testDiscreteVoronoi.xml Weights/makefile Weights/src/ConstantWeights.c Weights/src/ConstantWeights.h Weights/src/ConstantWeights.meta Weights/src/DVCWeights.c Weights/src/DVCWeights.h Weights/src/DVCWeights.meta Weights/src/DiscreteVoronoiWeights.c Weights/src/DiscreteVoronoiWeights.h Weights/src/DiscreteVoronoiWeights.meta Weights/src/Finalise.c Weights/src/Finalise.h Weights/src/Init.c Weights/src/Init.h Weights/src/IterativeWeights.c Weights/src/IterativeWeights.h Weights/src/IterativeWeights.meta Weights/src/MomentBalanceWeights.c Weights/src/MomentBalanceWeights.h Weights/src/MomentBalanceWeights.meta Weights/src/VolumeWeights.c Weights/src/VolumeWeights.h Weights/src/VolumeWeights.meta Weights/src/Weights.h Weights/src/WeightsCalculator.c Weights/src/WeightsCalculator.h Weights/src/WeightsCalculator.meta Weights/src/makefile Weights/src/types.h Weights/tests/expected/testConstantWeightsCircle.0of1.output.dat.expected Weights/tests/expected/testConstantWeightsExpIface.0of1.output.dat.expected Weights/tests/expected/testConstantWeightsPoly.0of1.output.dat.expected Weights/tests/expected/testDVCWeightsCircle.0of1.output.dat.expected Weights/tests/expected/testDVCWeightsExpIface.0of1.output.dat.expected Weights/tests/expected/testDVCWeightsPoly.0of1.output.dat.expected Weights/tests/expected/testDiscreteVoronoiWeightsCircle.0of1.output.dat.expected Weights/tests/expected/testDiscreteVoronoiWeightsExpIface.0of1.output.dat.expected Weights/tests/expected/testDiscreteVoronoiWeightsPoly.0of1.output.dat.expected Weights/tests/expected/testIterativeWeightsCircle.0of1.output.dat.expected Weights/tests/expected/testIterativeWeightsExpIface.0of1.output.dat.expected Weights/tests/expected/testIterativeWeightsPoly.0of1.output.dat.expected Weights/tests/expected/testMomentBalanceWeightsCircle.0of1.output.dat.expected Weights/tests/expected/testMomentBalanceWeightsExpIface.0of1.output.dat.expected Weights/tests/expected/testMomentBalanceWeightsPoly.0of1.output.dat.expected Weights/tests/graphs/CircleInterface-ConstantWeights.dat Weights/tests/graphs/CircleInterface-DiscreteVoronoiWeights.dat Weights/tests/graphs/CircleInterface-IterativeVoronoiWeights.dat Weights/tests/graphs/CircleInterface-IterativeWeights.dat Weights/tests/graphs/CircleInterface-MomentBalanceWeights.dat Weights/tests/graphs/CircleInterface.gnu Weights/tests/graphs/CircleInterface.png Weights/tests/graphs/ConstantFunction-ConstantWeights.dat Weights/tests/graphs/ConstantFunction-DiscreteVoronoiWeights.dat Weights/tests/graphs/ConstantFunction-IterativeVoronoiWeights.dat Weights/tests/graphs/ConstantFunction-IterativeWeights.dat Weights/tests/graphs/ConstantFunction-MomentBalanceWeights.dat Weights/tests/graphs/ConstantFunction.gnu Weights/tests/graphs/ConstantFunction.png Weights/tests/graphs/ExponentialFunction-ConstantWeights.dat Weights/tests/graphs/ExponentialFunction-DiscreteVoronoiWeights.dat Weights/tests/graphs/ExponentialFunction-IterativeVoronoiWeights.dat Weights/tests/graphs/ExponentialFunction-IterativeWeights.dat Weights/tests/graphs/ExponentialFunction-MomentBalanceWeights.dat Weights/tests/graphs/ExponentialFunction.gnu Weights/tests/graphs/ExponentialFunction.png Weights/tests/graphs/ExponentialInterface-ConstantWeights.dat Weights/tests/graphs/ExponentialInterface-DiscreteVoronoiWeights.dat Weights/tests/graphs/ExponentialInterface-IterativeVoronoiWeights.dat Weights/tests/graphs/ExponentialInterface-IterativeWeights.dat Weights/tests/graphs/ExponentialInterface-MomentBalanceWeights.dat Weights/tests/graphs/ExponentialInterface.gnu Weights/tests/graphs/ExponentialInterface.png Weights/tests/graphs/LinearFunction-ConstantWeights.dat Weights/tests/graphs/LinearFunction-DiscreteVoronoiWeights.dat Weights/tests/graphs/LinearFunction-IterativeVoronoiWeights.dat Weights/tests/graphs/LinearFunction-IterativeWeights.dat Weights/tests/graphs/LinearFunction-MomentBalanceWeights.dat Weights/tests/graphs/LinearFunction.gnu Weights/tests/graphs/LinearFunction.png Weights/tests/graphs/PolynomialFunction-ConstantWeights.dat Weights/tests/graphs/PolynomialFunction-DiscreteVoronoiWeights.dat Weights/tests/graphs/PolynomialFunction-IterativeVoronoiWeights.dat Weights/tests/graphs/PolynomialFunction-IterativeWeights.dat Weights/tests/graphs/PolynomialFunction-MomentBalanceWeights.dat Weights/tests/graphs/PolynomialFunction.gnu Weights/tests/graphs/PolynomialFunction.png Weights/tests/graphs/QuadraticFunction-ConstantWeights.dat Weights/tests/graphs/QuadraticFunction-DiscreteVoronoiWeights.dat Weights/tests/graphs/QuadraticFunction-IterativeVoronoiWeights.dat Weights/tests/graphs/QuadraticFunction-IterativeWeights.dat Weights/tests/graphs/QuadraticFunction-MomentBalanceWeights.dat Weights/tests/graphs/QuadraticFunction.gnu Weights/tests/graphs/QuadraticFunction.png Weights/tests/graphs/ShapeFunction-ConstantWeights.dat Weights/tests/graphs/ShapeFunction-DiscreteVoronoiWeights.dat Weights/tests/graphs/ShapeFunction-IterativeVoronoiWeights.dat Weights/tests/graphs/ShapeFunction-IterativeWeights.dat Weights/tests/graphs/ShapeFunction-MomentBalanceWeights.dat Weights/tests/graphs/ShapeFunction.gnu Weights/tests/graphs/ShapeFunction.png Weights/tests/makefile Weights/tests/plugins/makefile Weights/tests/plugins/testElementIntegral.c Weights/tests/scripts/makeAllGraphs Weights/tests/scripts/makeAllGraphsForAllWeights Weights/tests/scripts/makeGnuplotFiles Weights/tests/scripts/makeGraph Weights/tests/testConstantWeights.xml Weights/tests/testConstantWeightsCircle.0of1.sh Weights/tests/testConstantWeightsExpIface.0of1.sh Weights/tests/testConstantWeightsPoly.0of1.sh Weights/tests/testDVCWeights.0of1.expected Weights/tests/testDVCWeights.0of1.sh Weights/tests/testDVCWeights.c Weights/tests/testDVCWeights.xml Weights/tests/testDVCWeightsCircle.0of1.sh Weights/tests/testDVCWeightsExpIface.0of1.sh Weights/tests/testDVCWeightsPoly.0of1.sh Weights/tests/testDiscreteVoronoiWeights.xml Weights/tests/testDiscreteVoronoiWeightsCircle.0of1.sh Weights/tests/testDiscreteVoronoiWeightsExpIface.0of1.sh Weights/tests/testDiscreteVoronoiWeightsPoly.0of1.sh Weights/tests/testElementIntegral.xml Weights/tests/testIterativeVoronoiWeights.xml Weights/tests/testIterativeWeights.xml Weights/tests/testIterativeWeightsCircle.0of1.sh Weights/tests/testIterativeWeightsExpIface.0of1.sh Weights/tests/testIterativeWeightsPoly.0of1.sh Weights/tests/testMomentBalanceWeights.xml Weights/tests/testMomentBalanceWeightsCircle.0of1.sh Weights/tests/testMomentBalanceWeightsExpIface.0of1.sh Weights/tests/testMomentBalanceWeightsPoly.0of1.sh build-functions.sh configure.sh doc/C_full.doxyconf.in doc/Makefile.def doc/doxygen.css doc/footer.html doc/generateForWeb.sh doc/header.html doc/makefile doc/web.doxyconf.in libPICellerator/Makefile.def libPICellerator/makefile libPICellerator/src/Finalise.c libPICellerator/src/Finalise.h libPICellerator/src/Init.c libPICellerator/src/Init.h libPICellerator/src/PICellerator.h libPICellerator/src/makefile libPICellerator/tests/expected/testLibPICellerator.0of1.expected libPICellerator/tests/makefile libPICellerator/tests/testLibPICellerator.0of1.sh libPICellerator/tests/testLibPICellerator.c makefile plugins/Application/Application.c plugins/Application/Application.h plugins/Application/makefile plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.c plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.h plugins/CalculateParticleDisplacement/makefile plugins/Output/MaterialCentroid/MaterialCentroid.c plugins/Output/MaterialCentroid/makefile plugins/Output/makefile plugins/makefile project-config.sh src/Makefile.def src/main.c src/makefile
description:
Tailorization
Import of the upstream sources from
 Repository: https://csd.vpac.org/svn/CM/PICellerator
       Kind: svn
     Module: /trunk
   Revision: 446


diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/BuoyancyExample.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/BuoyancyExample.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,121 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	<list name="plugins" mergeType="Replace">
+		<!--param>Underworld_MovingMesh</param-->
+		<param>StgFEM_StandardConditionFunctions</param>	
+		<!--param>ExperimentalUnderworld_PressureCalibration</param-->	
+	</list>
+
+	<!--param name="extensionReferenceHeight">maxY</param-->
+
+	<!-- Component Stuff -->
+	<include>StgFEM/ElementLayout.xml        </include>
+	<include>StgFEM/ConstantMesh.xml           </include>
+	<include>StgFEM/LinearMesh.xml             </include>
+	<include>StgFEM/VelocityField.xml          </include>
+	<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>
+	<!--include>Underworld/StokesFlowUzawaCompressible.xml </include-->
+	<!--include>PICellerator/PopulationControl.xml </include-->
+
+	<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="buoyancyForceTerm">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="TemperatureField">TemperatureField</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="gravity">gravity</param>
+		</struct>
+					
+		<!-- Background Material Stuff -->
+		<!--struct name="backgroundShape">
+			<param name="Type">Everywhere</param>
+		</struct>	
+		<struct name="backgroundViscosity">
+			<param name="Type">MaterialViscosity</param>
+			<param name="eta0">1.0</param>
+		</struct>	
+		<struct name="compressible">
+			<param name="Type">Compressible</param>
+			<param name="GeometryMesh">mesh-linear</param>
+			<param name="StiffnessMatrix">c_matrix</param>
+			<param name="Swarm">picIntegrationPoints</param>	
+			<param name="oneOnLambda">10.0</param>
+		</struct>	
+
+		<struct name="background">
+			<param name="Type">RheologyMaterial</param>
+			<param name="Shape">backgroundShape</param>
+			<param name="Compressible">compressible</param>
+			<param name="density">0.0</param>
+			<param name="Rheology">backgroundViscosity</param>
+		</struct-->
+
+		<struct name="layerShape">
+			<param name="Type">Box</param>
+			<param name="startX"> minX </param> <param name="endX"> maxX </param>
+			<param name="startY"> minY </param> <param name="endY"> maxY </param>
+			<param name="startZ"> minZ </param> <param name="endZ"> maxZ </param>
+		</struct>
+
+		<struct name="layer">
+			<param name="Type">Material</param>
+			<param name="Shape">layerShape</param>
+			<param name="density">1.36</param>
+		</struct>
+
+                <struct name="materialSwarmParticleLayout" mergeType="replace">
+		         <param name="Type">GaussParticleLayout</param>
+		</struct>
+										
+	</struct>
+
+	<!-- Simulation control -->
+	<param name="maxTimeSteps"> 1 </param>
+	<param name="outputPath"> ./output </param>
+	<param name="dumpEvery"> 1 </param>	
+
+	<param name="particlesPerCell"> 20 </param>
+
+	<!-- Non-linear stuff -->
+	<param name="nonLinearMaxIterations"> 20 </param>	
+	
+        <!-- Journal Control -->
+	<param name="journal.info.Context-verbose">True</param>
+	<param name="journal-level.info.Stg_ComponentFactory">2</param>
+	<param name="journal.debug">t</param>
+	<param name="journal-enable-branch.debug.StgFEM">t</param>
+	<param name="journal-level-branch.debug.StgFEM"> 2 </param>	
+	
+	<!-- Geometry & Mesh setup -->
+	<param name="dim"> 2 </param>
+	<param name="elementResI"> 50</param>
+	<param name="elementResJ"> 50 </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"> 1.0 </param>
+	<param name="maxY"> 0.8 </param>
+	<param name="maxZ"> 1 </param>
+	<param name="allowUnbalancing"> True </param>
+
+	<!-- Set up BCs and ICs -->
+        <include>velocityBCs.freeslip.xml</include>
+	
+</StGermainData>
+
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/PressureVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/PressureVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="camera" mergeType="replace">
+			<param name="Type">lucCamera</param>
+			<param name="CentreFieldVariable">PressureField</param>
+			<param name="coordZ">3.5</param>
+		</struct>
+		<struct name="pressureColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Black Purple DarkRed Orange Yellow</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="pressureMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">PressureField</param>
+			<param name="ColourMap">pressureColourMap</param>
+		</struct>
+		<struct name="border" mergeType="replace">
+			<param name="Type">lucFieldVariableBorder</param>
+			<param name="FieldVariable">PressureField</param>
+		</struct>
+		<struct name="pressureColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">pressureColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="PressureVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>pressureMap</param>
+				<param>border</param>
+				<param>pressureColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/demo.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/demo.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 	
+	<include>BuoyancyExample.xml</include>
+	<include>PressureVP.xml</include>
+	<include>window.xml</include>
+	<struct name="components" mergeType="merge">
+		<struct name="window" mergeType="merge">
+			<param name="Viewport">PressureVP</param>
+		</struct>
+	</struct>
+	<param name="outputPath">./output</param>
+	
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,78 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+subdirs = tests
+
+modName := $(shell basename `pwd` )
+mod = ${PROJECT}_${modName}
+includes = ${PROJECT}/${modName}
+
+SRCS = $(wildcard *.c)
+HDRS = $(wildcard *.h)
+
+XMLS_TARGET_DIR = ${EXAMPLES_DIR}/${modName}
+XMLS = $(wildcard *.xml)
+
+PROJ_LIBS = lib${PROJECT}Update.so lib${PROJECT}Materials.so
+EXTERNAL_INCLUDES = ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${PETSC_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} 
+EXTERNAL_LIBS = \
+	${STGFEM_RPATH} ${STGFEM_LIBS} \
+	${STGFEM_RPATH} ${STGERMAIN_LIBS} \
+	${PETSC_RPATH} ${PETSC_LIBS} \
+	${MPI_RPATH} ${MPI_LIBS} \
+	${XML_LIBS} 
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+examples_xml = demo.xml
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/AnalyticPressure/AnalyticPressure.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,110 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PICellerator.h>
+
+#include <assert.h>
+
+const Type AnalyticPressure_Type = "AnalyticPressure";
+
+typedef struct {
+	__AnalyticSolution
+	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;
+	FeVariable*              pressureField;
+
+	/* Construct Parent */
+	_AnalyticSolution_Construct( self, cf, data );
+
+	/* Create Analytic Fields */
+	pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
+	AnalyticSolution_CreateAnalyticField( self, pressureField, _AnalyticPressure_PressureFunction );
+	
+	self->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_DefaultNew( Name name ) {
+	return _AnalyticSolution_New(
+			sizeof(AnalyticPressure),
+			AnalyticPressure_Type,
+			_AnalyticSolution_Delete,
+			_AnalyticSolution_Print,
+			_AnalyticSolution_Copy,
+			_AnalyticPressure_DefaultNew,
+			_AnalyticPressure_Construct,
+			_AnalyticSolution_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 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/tests/AnalyticPressure/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/AnalyticPressure/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,71 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := $(shell find * -type d -prune ! -name .svn ) 
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# What to call the plugin
+modName := $(shell basename `pwd`)
+mod = ${PROJECT}_${modName}
+
+# Where to put header files
+includes = ${PROJECT}/${modName}
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN PETSC MPI XML 
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/tests/AnalyticPressureVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/AnalyticPressureVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="analyticPressureColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Black Purple DarkRed Orange Yellow</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="analyticPressureMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">PressureField-Analytic</param>
+			<param name="ColourMap">analyticPressureColourMap</param>
+		</struct>
+		<struct name="analyticPressureColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">analyticPressureColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="AnalyticPressureVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>analyticPressureMap</param>
+				<param>border</param>
+				<param>analyticPressureColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/tests/AnalyticViewports.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/AnalyticViewports.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,18 @@
+<!-- Rayleigh-Taylor app input file -->
+
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>../PressureVP.xml</include>
+	<include>AnalyticPressureVP.xml</include>
+	<include>PressureErrorVP.xml</include>
+	<include>../window.xml</include>
+	<struct name="components" mergeType="merge">
+		<struct name="window" mergeType="merge">
+			<list name="Viewport">
+				<param>PressureVP AnalyticPressureVP PressureErrorVP</param>
+			</list>
+		</struct>
+	</struct>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/tests/PressureErrorVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/PressureErrorVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="pressureErrorColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Purple Blue Green Yellow Orange Red Black</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="pressureErrorMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">PressureField-ErrorField</param>
+			<param name="ColourMap">pressureErrorColourMap</param>
+			<param name="resolution">128</param>
+		</struct>
+		<struct name="pressureErrorColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">pressureErrorColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="PressureErrorVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>pressureErrorMap</param>
+				<param>border</param>
+				<param>pressureErrorColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,63 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+subdirs = AnalyticPressure
+
+modName = $(shell basename `pwd | sed s/tests//g`)
+checks = $(wildcard *.sh)
+
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT} 
+
+XMLS_TARGET_DIR = ${EXAMPLES_DIR}/${modName}/tests
+XMLS = $(wildcard *.xml)
+
+packages = STGERMAIN PETSC MPI XML MATH DL HYPRE
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/tests/testBuoyancy.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/testBuoyancy.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 306 2006-05-17 08:22:48Z VincentLemiale $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator ./testBuoyancy.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/tests/testBuoyancy.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/tests/testBuoyancy.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,15 @@
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>../BuoyancyExample.xml</include>
+	
+	<!--include>AnalyticViewports.xml</include-->
+
+	<list name="plugins" mergeType="merge">
+		<param>PICellerator_AnalyticPressure</param>
+	</list>
+	<!-- Making a fairly tight tolerance for Gauss points model
+		given test runs gave value of order 10 ^-6 -->
+	<param name="PressureField-Tolerance">1.5e-6</param>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/velocityBCs.freeslip.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/velocityBCs.freeslip.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e Apps/BuoyancyBenchmark/window.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/BuoyancyBenchmark/window.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 	
+	<list name="plugins" mergeType="merge">
+		<param>lucPlugin</param>
+	</list>
+	<struct name="components" mergeType="merge">
+		<struct name="renderingEngine">
+			<param name="Type">lucRenderingEngineGL</param>
+		</struct>
+		<struct name="imageOutput">
+			<param name="Type">lucOutputPNG</param>
+		</struct>
+		<struct name="window">
+			<param name="Type">lucDefaultWindow</param>
+			<param name="RenderingEngine">renderingEngine</param>
+			<list name="OutputFormat">
+				<param>imageOutput</param>
+			</list>
+			<param name="height">400</param>
+			<param name="width">800</param>
+			<param name="interactive">t</param>
+			<param name="backgroundColour">white</param>
+		</struct>
+		<struct name="movie">
+			<param name="Type">lucEncoderLibfame</param>
+			<param name="Window">window</param>
+		</struct>	
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/AnalyticViewport.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/AnalyticViewport.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,48 @@
+<!-- Rayleigh-Taylor lucifer viewports -->
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<!-- Drawing Objects -->
+		<struct name="analyticPressureMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">AnalyticPressureField</param>
+			<param name="ColourMap">pressureColourMap</param>
+		</struct>
+		<struct name="analyticVelocityArrows">
+			<param name="Type">lucVectorArrows</param>
+			<param name="VectorVariable">AnalyticVelocityField</param>
+			<param name="Colour">black</param>
+			<param name="arrowHeadSize">0.15</param>	
+			<param name="lengthScale">0.15</param>	
+		</struct>		
+		<!-- Viewport -->
+		<struct name="AnalyticViewport">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>analyticPressureMap</param>
+				<param>analyticVelocityArrows</param>
+				<param>border</param>
+				<param>pressureColourBar</param>
+			</list>
+		</struct>
+		<!-- Other Stuff -->
+		<struct name="analyticWindow">
+			<param name="Type">lucDefaultWindow</param>
+			<param name="RenderingEngine">renderingEngine</param>
+			<list name="OutputFormat">
+				<param>imageOutput</param>
+			</list>
+			<param name="height">592</param>
+			<param name="width">592</param>
+			<param name="interactive">t</param>
+			<param name="backgroundColour">white</param>
+			<list name="Viewport">
+				<param>AnalyticViewport</param>
+			</list>
+		</struct>
+	</struct>
+
+	
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/ErrorViewport.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/ErrorViewport.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,67 @@
+<!-- Rayleigh-Taylor lucifer viewports -->
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<struct name="components" mergeType="merge">
+	<struct name="ErrorVelocityField">
+		<param name="Type">OperatorFeVariable</param>
+		<param name="Operator">VectorSubtraction</param>
+		<param name="fieldComponentCount">dim</param>
+		<list name="FeVariables">
+			<param>VelocityField</param>
+			<param>AnalyticVelocityField</param>
+		</list>
+	</struct>
+	<struct name="ErrorVelocityFieldMagnitude">
+		<param name="Type">OperatorFeVariable</param>
+		<param name="Operator">VectorMag</param>
+		<param name="fieldComponentCount">1</param>
+		<param name="FeVariable">ErrorVelocityField</param>
+	</struct>	
+</struct>
+
+	<struct name="components" mergeType="merge">
+		<struct name="errorColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Purple Blue Green Yellow Orange Red Black</param>
+			<param name="dynamicRange">true</param>
+		</struct>	
+		<!-- Drawing Objects -->
+		<struct name="errorColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">errorColourMap</param>
+		</struct>			
+		<struct name="errorMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">ErrorVelocityFieldMagnitude</param>
+			<param name="ColourMap">errorColourMap</param>
+		</struct>
+		<!-- Viewport -->
+		<struct name="ErrorViewport">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>errorMap</param>
+				<param>border</param>
+				<param>errorColourBar</param>
+			</list>
+		</struct>
+		<!-- Other Stuff -->
+		<struct name="errorWindow">
+			<param name="Type">lucDefaultWindow</param>
+			<param name="RenderingEngine">renderingEngine</param>
+			<list name="OutputFormat">
+				<param>imageOutput</param>
+			</list>
+			<param name="height">592</param>
+			<param name="width">592</param>
+			<param name="interactive">t</param>
+			<param name="backgroundColour">white</param>
+			<list name="Viewport">
+				<param>ErrorViewport</param>
+			</list>
+		</struct>
+	</struct>
+
+	
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/LidDrivenPIC.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/LidDrivenPIC.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,74 @@
+<!-- Rayleigh-Taylor app input file -->
+
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>StgFEM/ElementLayout.xml          </include>
+	<include>StgFEM/ConstantMesh.xml           </include>
+	<include>StgFEM/LinearMesh.xml             </include>
+	<include>StgFEM/VelocityField.xml          </include>
+	<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 -->
+		<param>StgFEM_FrequentOutput</param>	
+		<param>StgFEM_CPUTime</param>
+		<param>StgFEM_StandardConditionFunctions</param>
+	</list>
+
+	<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">f</param>
+	<param name="journal-level-branch.debug.StgFEM"> 1 </param>
+
+	<!-- Geometry & mesh setup -->
+	<param name="dim"> 2 </param>
+	<!-- Remember in StGermain these currently refer to _node_ counts rather than elements... -->
+	<param name="elementResI"> 7 </param>
+	<param name="elementResJ"> 7 </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"> 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 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/Viewport.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/Viewport.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,59 @@
+<!-- Rayleigh-Taylor lucifer viewports -->
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<!-- Viewport stuff -->
+	<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>
+		<struct name="pressureColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Black Grey White Orange Red</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="pressureColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">pressureColourMap</param>
+		</struct>			
+		<struct name="pressureMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">PressureField</param>
+			<param name="ColourMap">pressureColourMap</param>
+		</struct>
+		<struct name="velocityArrows">
+			<param name="Type">lucVectorArrows</param>
+			<param name="VectorVariable">VelocityField</param>
+			<param name="Colour">black</param>
+			<param name="arrowHeadSize">0.15</param>	
+			<param name="lengthScale">0.15</param>	
+		</struct>		
+		<struct name="particleDots" mergeType="replace">
+			<param name="Type">lucSwarmViewer</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="colour">black</param>
+			<param name="pointSize">2.0</param>
+		</struct>		
+		<struct name="border">
+			<param name="Type">lucFieldVariableBorder</param>
+			<param name="FieldVariable">VelocityField</param>
+		</struct>
+		<!-- Viewport -->
+		<struct name="SolutionViewport">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>pressureMap</param>
+				<param>velocityArrows</param>
+				<param>particleDots</param>
+				<param>border</param>
+				<param>pressureColourBar</param>
+			</list>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/demo.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/demo.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 	
+	<include>./LidDrivenPIC.xml</include>
+	<include>./Viewport.xml</include>
+	<include>./window.xml</include>
+	<struct name="components" mergeType="merge">
+		<struct name="window" mergeType="merge">
+			<param name="Viewport">SolutionViewport</param>
+		</struct>
+	</struct>
+	<param name="outputPath">./output</param>
+	
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/lidDrivenAnalytic.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/lidDrivenAnalytic.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,97 @@
+<?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">
+		<param>StgFEM_LidDrivenIsoviscousAnalytic</param>
+	</list>
+
+	<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 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/lidDrivenVelocityBCs.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/lidDrivenVelocityBCs.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,64 @@
+<?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 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,78 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+subdirs = tests
+
+modName := $(shell basename `pwd` )
+mod = ${PROJECT}_${modName}
+includes = ${PROJECT}/${modName}
+
+SRCS = $(wildcard *.c)
+HDRS = $(wildcard *.h)
+
+XMLS_TARGET_DIR = ${EXAMPLES_DIR}/${modName}
+XMLS = $(wildcard *.xml)
+
+PROJ_LIBS = lib${PROJECT}Update.so lib${PROJECT}Materials.so
+EXTERNAL_INCLUDES = ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${PETSC_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} 
+EXTERNAL_LIBS = \
+	${STGFEM_RPATH} ${STGFEM_LIBS} \
+	${STGFEM_RPATH} ${STGERMAIN_LIBS} \
+	${PETSC_RPATH} ${PETSC_LIBS} \
+	${MPI_RPATH} ${MPI_LIBS} \
+	${XML_LIBS}
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+examples_xml = demo.xml
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of1.PressureField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of1.PressureField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,11 @@
+Timestep 0: Total integrated value of 'PressureField-ErrorMagnitudeField' is outside a tolerance 0.15.
+Timestep 1: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 2: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 3: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 4: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 5: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 6: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 7: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 8: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 9: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 10: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of1.VelocityField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of1.VelocityField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,11 @@
+Timestep 0: Total integrated value of 'VelocityField-ErrorMagnitudeField' is outside a tolerance 0.015.
+Timestep 1: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 2: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 3: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 4: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 5: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 6: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 7: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 8: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 9: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 10: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of2.PressureField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of2.PressureField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,3 @@
+Timestep 0: Total integrated value of 'PressureField-ErrorMagnitudeField' is outside a tolerance 0.15.
+Timestep 1: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
+Timestep 2: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.15.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of2.VelocityField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/tests/expected/testLidDrivenPIC-Analytic-2D.0of2.VelocityField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,3 @@
+Timestep 0: Total integrated value of 'VelocityField-ErrorMagnitudeField' is outside a tolerance 0.015.
+Timestep 1: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
+Timestep 2: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.015.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/tests/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 409 2007-01-17 13:01:26Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+modName = $(shell basename `pwd | sed s/tests//g`)
+checks = $(wildcard *.sh)
+
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT} 
+
+XMLS_TARGET_DIR = ${EXAMPLES_DIR}/${modName}/tests
+XMLS = $(wildcard *.xml)
+
+packages = STGERMAIN PETSC MPI XML MATH DL HYPRE
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/tests/testLidDrivenPIC-Analytic-2D.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/tests/testLidDrivenPIC-Analytic-2D.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testLidDrivenPIC-Analytic-2D.0of1.sh 287 2006-04-24 07:32:07Z RobertTurnbull $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator ../LidDrivenPIC.xml ../lidDrivenAnalytic.xml --AnalyticVelocityWavenumber=1 --maxTimeSteps=10" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/tests/testLidDrivenPIC-Analytic-2D.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/tests/testLidDrivenPIC-Analytic-2D.0of2.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testLidDrivenPIC-Analytic-2D.0of2.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 "PICellerator ../LidDrivenPIC.xml ../lidDrivenAnalytic.xml --AnalyticVelocityWavenumber=1 --journal-level.info.StG_FEM_CompareFeVariables=1 --maxTimeSteps=2" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/LidDrivenPIC/window.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/LidDrivenPIC/window.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 	
+	<list name="plugins" mergeType="merge">
+		<param>lucPlugin</param>
+	</list>
+	<struct name="components" mergeType="merge">
+		<struct name="renderingEngine">
+			<param name="Type">lucRenderingEngineGL</param>
+		</struct>
+		<struct name="imageOutput">
+			<param name="Type">lucOutputPNG</param>
+		</struct>
+		<struct name="window">
+			<param name="Type">lucDefaultWindow</param>
+			<param name="RenderingEngine">renderingEngine</param>
+			<list name="OutputFormat">
+				<param>imageOutput</param>
+			</list>
+			<param name="height">592</param>
+			<param name="width">592</param>
+			<param name="interactive">t</param>
+			<param name="backgroundColour">white</param>
+		</struct>
+		<struct name="movie">
+			<param name="Type">lucEncoderLibfame</param>
+			<param name="Window">window</param>
+		</struct>	
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/AllowOutflow.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/AllowOutflow.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,13 @@
+<?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">
+	
+	<struct name="components" mergeType="merge">
+		<struct name="escapedRoutine">
+			<param name="Type">EscapedRoutine</param> 
+		</struct> 
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/MaterialPointSwarm-flip1.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/MaterialPointSwarm-flip1.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,93 @@
+<?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">
+	
+	<struct name="components" mergeType="merge">
+		<struct name="elementCellLayout">
+			<param name="Type">ElementCellLayout</param>
+			<param name="Mesh">mesh-linear</param>
+		</struct>
+		<struct name="discreteVoronoi">
+			<param name="Type">CellularAutomataVoronoi</param>
+			<param name="resolution">10</param>
+			<param name="diagonalNeighbours">true</param>
+		</struct>		
+		<struct name="weights">
+			<param name="Type">VolumeWeights</param>
+			<param name="Shape">ball</param>
+			<param name="Mesh">mesh-linear</param>
+<!--
+			<param name="Type">DiscreteVoronoiWeights</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+-->
+		</struct>
+		<struct name="localLayout">
+			<param name="Type">MappedParticleLayout</param>
+		</struct>
+		<struct name="picIntegrationPoints">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">localLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</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">picIntegrationPoints</param>
+			<param name="MaterialPointsSwarm">materialSwarm</param>
+		</struct>
+		<struct name="picIntegrationPointsParticleLayout">
+			<param name="Type">WithinShapeParticleLayout</param>
+			<param name="averageInitialParticlesPerCell">particlesPerCell</param>
+			<param name="shape">ball</param>
+		</struct>
+		<struct name="materialSwarm">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">picIntegrationPointsParticleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+
+			<!-- These guys may or may not be created -->
+			<param name="SwarmAdvector">materialSwarmAdvector</param>
+			<param name="Material">lightMaterial</param>
+		</struct>
+		<struct name="materialSwarmAdvector">
+			<param name="Type">SwarmAdvector</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="VelocityField">VelocityField</param>
+			<!--param name="PeriodicBCsManager">periodicBCsManager</param-->
+		</struct>
+
+		<struct name="backgroundIntegration">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">cellLayout</param>
+			<param name="ParticleLayout">particleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="IntegrationPointMapper">backgroundMapper</param>
+		</struct>
+		<struct name="backgroundMapper">
+			<param name="Type">GaussMapper</param>
+			<param name="IntegrationPointsSwarm">backgroundIntegration</param>
+			<param name="MaterialPointsSwarm">backgroundMaterial</param>
+		</struct>
+		<struct name="backgroundLayout">
+			<param name="Type">BackgroundParticleLayout</param>
+		</struct>
+		<struct name="backgroundMaterial">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">cellLayout</param>
+			<param name="ParticleLayout">backgroundLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="Material">denseMaterial</param>
+		</struct>
+
+	</struct>
+
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/MaterialPointSwarm-test1.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/MaterialPointSwarm-test1.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,94 @@
+<?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">
+	
+	<struct name="components" mergeType="merge">
+		<struct name="elementCellLayout">
+			<param name="Type">ElementCellLayout</param>
+			<param name="Mesh">mesh-linear</param>
+		</struct>
+		<struct name="discreteVoronoi">
+			<param name="Type">CellularAutomataVoronoi</param>
+			<param name="resolution">10</param>
+			<param name="diagonalNeighbours">true</param>
+		</struct>		
+		<struct name="weights">
+			<param name="Type">VolumeWeights</param>
+			<param name="Shape">ball</param>
+			<param name="Mesh">mesh-linear</param>
+<!--
+			<param name="Type">DiscreteVoronoiWeights</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+-->
+		</struct>
+		<struct name="localLayout">
+			<param name="Type">MappedParticleLayout</param>
+		</struct>
+		<struct name="picIntegrationPoints">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">localLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="WeightsCalculator">weights</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="IntegrationPointMapper">mapper</param>
+			<param name="recalculateWeights">False</param>
+		</struct>
+		<struct name="mapper">
+			<param name="Type">CoincidentMapper</param>
+			<param name="IntegrationPointsSwarm">picIntegrationPoints</param>
+			<param name="MaterialPointsSwarm">materialSwarm</param>
+		</struct>
+		<struct name="picIntegrationPointsParticleLayout">
+			<param name="Type">WithinShapeParticleLayout</param>
+			<param name="averageInitialParticlesPerCell">particlesPerCell</param>
+			<param name="shape">ball</param>
+		</struct>
+		<struct name="materialSwarm">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">picIntegrationPointsParticleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+
+			<!-- These guys may or may not be created -->
+			<param name="SwarmAdvector">materialSwarmAdvector</param>
+			<param name="Material">denseMaterial</param>
+		</struct>
+		<struct name="materialSwarmAdvector">
+			<param name="Type">SwarmAdvector</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="VelocityField">VelocityField</param>
+			<!--param name="PeriodicBCsManager">periodicBCsManager</param-->
+		</struct>
+
+		<struct name="backgroundIntegration">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">cellLayout</param>
+			<param name="ParticleLayout">particleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="IntegrationPointMapper">backgroundMapper</param>
+		</struct>
+		<struct name="backgroundMapper">
+			<param name="Type">GaussMapper</param>
+			<param name="IntegrationPointsSwarm">backgroundIntegration</param>
+			<param name="MaterialPointsSwarm">backgroundMaterial</param>
+		</struct>
+		<struct name="backgroundLayout">
+			<param name="Type">BackgroundParticleLayout</param>
+		</struct>
+		<struct name="backgroundMaterial">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">cellLayout</param>
+			<param name="ParticleLayout">backgroundLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="Material">lightMaterial</param>
+		</struct>
+
+	</struct>
+
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/MaterialPointSwarm.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/MaterialPointSwarm.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,94 @@
+<?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">
+	
+	<struct name="components" mergeType="merge">
+		<struct name="elementCellLayout">
+			<param name="Type">ElementCellLayout</param>
+			<param name="Mesh">mesh-linear</param>
+		</struct>
+		<!--struct name="discreteVoronoi">
+			<param name="Type">CellularAutomataVoronoi</param>
+			<param name="resolution">10</param>
+			<param name="diagonalNeighbours">true</param>
+		</struct-->		
+		<!--
+		<struct name="weights">
+			<param name="Type">ConstantWeights</param>
+		</struct>
+		-->
+		<!--struct name="weights">
+			<param name="Type">DiscreteVoronoiWeights</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+		</struct-->
+
+		<!--
+		<struct name="weights">
+			<param name="Type">ConstantWeights</param>
+		</struct>	
+		-->
+		
+		<struct name="weights">
+  			<param name="Type">DVCWeights</param>
+ 			 <param name="resolution">10</param>
+		</struct>
+		
+		<!-- struct name="weights">
+  			<param name="Type">PCDVC</param>
+		   <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">materialSwarm</param>
+		</struct-->
+		
+		<struct name="localLayout">
+			<param name="Type">MappedParticleLayout</param>
+		</struct>
+		<struct name="picIntegrationPoints">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">localLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</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">picIntegrationPoints</param>
+			<param name="MaterialPointsSwarm">materialSwarm</param>
+		</struct>
+		<struct name="materialSwarmParticleLayout">
+			<param name="Type">SpaceFillerParticleLayout</param>
+			<param name="averageInitialParticlesPerCell">particlesPerCell</param>
+		</struct>
+		<struct name="materialSwarm">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">materialSwarmParticleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+
+			<!-- These guys may or may not be created -->
+			<param name="SplittingRoutine">splittingRoutine</param>
+			<param name="RemovalRoutine">removalRoutine</param>
+			<param name="EscapedRoutine">escapedRoutine</param>
+		</struct>
+		<struct name="materialSwarmAdvector">
+			<param name="Type">SwarmAdvector</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="VelocityField">VelocityField</param>
+			<param name="PeriodicBCsManager">periodicBCsManager</param>
+			<!-- For moving mesh or problems involving outflow, need the following
+			enabled -->
+			<param name="allowFallbackToFirstOrder">True</param>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/MaterialPointSwarmW.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/MaterialPointSwarmW.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,75 @@
+<?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">
+	
+	<struct name="components" mergeType="merge">
+		<struct name="elementCellLayout">
+			<param name="Type">ElementCellLayout</param>
+			<param name="Mesh">mesh-linear</param>
+		</struct>
+		<struct name="discreteVoronoi">
+			<param name="Type">CellularAutomataVoronoi</param>
+			<param name="resolution">10</param>
+			<param name="diagonalNeighbours">true</param>
+		</struct>		
+		<!--
+		<struct name="weights">
+			<param name="Type">ConstantWeights</param>
+		</struct>
+		-->
+		<struct name="weights">
+			<param name="Type">DiscreteVoronoiWeights</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+		</struct>
+		<!--
+		<struct name="weights">
+			<param name="Type">ConstantWeights</param>
+		</struct>	
+		-->
+		<struct name="localLayout">
+			<param name="Type">MappedParticleLayout</param>
+		</struct>
+		<struct name="picIntegrationPoints">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">localLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</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">picIntegrationPoints</param>
+			<param name="MaterialPointsSwarm">materialSwarm</param>
+		</struct>
+		<struct name="materialSwarmParticleLayout">
+			<param name="Type">SpaceFillerParticleLayout</param>
+			<param name="averageInitialParticlesPerCell">particlesPerCell</param>
+		</struct>
+		<struct name="materialSwarm">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">materialSwarmParticleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+
+			<!-- These guys may or may not be created -->
+			<param name="SplittingRoutine">splittingRoutine</param>
+			<param name="RemovalRoutine">removalRoutine</param>
+			<param name="EscapedRoutine">escapedRoutine</param>
+		</struct>
+		<struct name="materialSwarmAdvector">
+			<param name="Type">SwarmAdvectorW</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="VelocityField">VelocityField</param>
+			<param name="PeriodicBCsManager">periodicBCsManager</param>
+			<!-- For moving mesh or problems involving outflow, need the following
+			enabled -->
+			<param name="allowFallbackToFirstOrder">True</param>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/PeriodicBCsManager.I_AXIS.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/PeriodicBCsManager.I_AXIS.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,20 @@
+<?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">
+
+	<!-- Periodic boundary conditions manager for particles -->
+	<struct name="components" mergeType="merge">
+		<struct name="periodicBCsManager">
+			<param name="Type">PeriodicBoundariesManager</param>
+			<param name="Geometry">geometry</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<list name="PeriodicBoundaries">
+				<param>I_AXIS</param>
+			</list>	
+		</struct>
+	</struct>
+	<param name="isPeriodicI"> t </param>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/PeriodicBCsManager.J_AXIS.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/PeriodicBCsManager.J_AXIS.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,20 @@
+<?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">
+
+	<!-- Periodic boundary conditions manager for particles -->
+	<struct name="components" mergeType="merge">
+		<struct name="periodicBCsManager">
+			<param name="Type">PeriodicBoundariesManager</param>
+			<param name="Geometry">geometry</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<list name="PeriodicBoundaries">
+				<param>J_AXIS</param>
+			</list>	
+		</struct>
+	</struct>
+	<param name="isPeriodicJ"> t </param>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/PeriodicBCsManager.K_AXIS.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/PeriodicBCsManager.K_AXIS.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,20 @@
+<?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">
+
+	<!-- Periodic boundary conditions manager for particles -->
+	<struct name="components" mergeType="merge">
+		<struct name="periodicBCsManager">
+			<param name="Type">PeriodicBoundariesManager</param>
+			<param name="Geometry">geometry</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<list name="PeriodicBoundaries">
+				<param>K_AXIS</param>
+			</list>	
+		</struct>
+	</struct>
+	<param name="isPeriodicK"> t </param>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/PopulationControl.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/PopulationControl.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,20 @@
+<?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">
+	
+	<struct name="components" mergeType="merge">
+		<struct name="removalRoutine">
+			<param name="Type">DiscreteVoronoiRemove</param> 
+			<param name="idealParticleCount">particlesPerCell</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+		</struct> 
+		<struct name="splittingRoutine"> 
+			<param name="Type">ReseedSplitting</param>
+			<param name="idealParticleCount">particlesPerCell</param> 
+			<param name="DiscreteVoronoi">discreteVoronoi</param> 
+		</struct>	
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/StokesFlowUzawa-flip1.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/StokesFlowUzawa-flip1.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,42 @@
+<?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">
+
+	<include>StgFEM/StokesFlowUzawa.xml</include>
+
+	<!-- Stokes Flow Stuff -->
+	<struct name="components" mergeType="merge">
+		<!--
+		<struct name="isoviscousStressTensorTerm2" mergeType="replace">
+			<param name="Type">IsoviscousStressTensorTerm</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="viscosity">1.0</param>
+			<param name="StiffnessMatrix">k_matrix</param>
+		</struct>
+		-->
+		<!--
+		<struct name="isoviscousStressTensorTerm2">
+			<param name="Type">IsoviscousStressTensorTerm</param>
+			<param name="Swarm">backgroundIntegration</param>
+			<param name="viscosity">1.0</param>
+			<param name="StiffnessMatrix">k_matrix</param>
+		</struct>
+		-->
+		<!--
+		<struct name="preconditionerTerm2">
+			<param name="Type">UzawaPreconditionerTerm</param>
+			<param name="Swarm">backgroundIntegration</param>
+			<param name="StiffnessMatrix">preconditioner</param>
+		</struct>
+		-->
+		<struct name="buoyancyForceTerm2">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="Swarm">backgroundIntegration</param>
+			<param name="gravity">gravity</param>
+		</struct>
+	</struct>	
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/StokesFlowUzawa-test1.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/StokesFlowUzawa-test1.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,42 @@
+<?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">
+
+	<include>StgFEM/StokesFlowUzawa.xml</include>
+
+	<!-- Stokes Flow Stuff -->
+	<struct name="components" mergeType="merge">
+		<!--
+		<struct name="isoviscousStressTensorTerm2" mergeType="replace">
+			<param name="Type">IsoviscousStressTensorTerm</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="viscosity">1.0</param>
+			<param name="StiffnessMatrix">k_matrix</param>
+		</struct>
+		-->
+		<!--
+		<struct name="isoviscousStressTensorTerm2">
+			<param name="Type">IsoviscousStressTensorTerm</param>
+			<param name="Swarm">backgroundIntegration</param>
+			<param name="viscosity">1.0</param>
+			<param name="StiffnessMatrix">k_matrix</param>
+		</struct>
+		-->
+		<!--
+		<struct name="preconditionerTerm2">
+			<param name="Type">UzawaPreconditionerTerm</param>
+			<param name="Swarm">backgroundIntegration</param>
+			<param name="StiffnessMatrix">preconditioner</param>
+		</struct>
+		-->
+		<struct name="buoyancyForceTerm2">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="Swarm">backgroundIntegration</param>
+			<param name="gravity">gravity</param>
+		</struct>
+	</struct>	
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/StokesFlowUzawa.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/StokesFlowUzawa.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,23 @@
+<?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">
+
+	<include>StgFEM/StokesFlowUzawa.xml</include>
+
+	<!-- Stokes Flow Stuff -->
+	<struct name="components" mergeType="merge">
+		<struct name="isoviscousStressTensorTerm" mergeType="replace">
+			<param name="Type">IsoviscousStressTensorTerm</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="viscosity">1.0</param>
+			<param name="StiffnessMatrix">k_matrix</param>
+		</struct>
+		<struct name="preconditionerTerm" mergeType="replace">
+			<param name="Type">UzawaPreconditionerTerm</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="StiffnessMatrix">preconditioner</param>
+		</struct>		
+	</struct>	
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/PIC_Components/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/PIC_Components/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,54 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+XMLS_TARGET_DIR = ${EXPORT_INCLUDE_DIR}
+XMLS = $(wildcard *.xml)
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/DenseMaterialVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/DenseMaterialVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,37 @@
+<!-- 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="denseParticleDots">
+			<param name="Type">lucSwarmViewer</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="colour">blue</param>
+			<param name="MaskVariable">materialSwarm-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>denseParticleDots</param>
+				<param>border</param>
+			</list>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/ParticleDensityVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/ParticleDensityVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,54 @@
+<!-- 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>
+		<struct name="densityColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Red Green Blue</param>
+			<param name="dynamicRange">False</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="title" mergeType="replace">
+			<param name="Type">lucTitle</param>
+			<param name="string">Particle dots - light is red, heavy blue</param>
+		</struct>
+		<struct name="meshView">
+			<param name="Type">lucMeshViewer</param>
+			<param name="Mesh">mesh-linear</param>
+		</struct>
+		<struct name="velocityArrows">
+			<param name="Type">lucVectorArrows</param>
+			<param name="Mesh">mesh-linear</param>
+			<param name="VectorVariable">VelocityField</param>
+			<param name="Colour">black</param>
+			<param name="arrowHeadSize">0.15</param>	
+			<param name="lengthScale">0.15</param>	
+		</struct>
+		<struct name="particleDots">
+			<param name="Type">lucSwarmViewer</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="ColourVariable">materialSwarm-Density</param>
+			<param name="ColourMap">densityColourMap</param>
+			<param name="pointSize">5.0</param>
+		</struct>		
+		<!-- Viewport -->
+		<struct name="ParticleDensityVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>title</param>
+				<param>velocityArrows</param>
+				<param>particleDots</param>
+				<param>meshView</param>
+			</list>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/ParticleDisplacementVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/ParticleDisplacementVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,76 @@
+<!-- Rayleigh-Taylor lucifer viewports -->
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<list name="plugins" mergeType="merge">
+		<param>PICellerator_CalculateParticleDisplacement</param>
+	</list>
+
+	<struct name="components" mergeType="merge">
+		<!--
+		<struct name="materialSwarm-DisplacementMagnitude">
+			<param name="Type">OperatorSwarmVariable</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="Operator">Magnitude</param>
+			<param name="SwarmVariable">materialSwarm-Displacement</param>
+		</struct>
+		-->
+		<!-- 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>
+		<struct name="displacementColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">White LightBlue Green Yellow DarkRed</param>
+			<param name="dynamicRange">False</param>
+			<param name="minimum">0</param>
+			<param name="maximum">0.6</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="displacementColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">displacementColourMap</param>
+		</struct>
+		<struct name="title" mergeType="replace">
+			<param name="Type">lucTitle</param>
+			<param name="string">Particle displacement</param>
+		</struct>
+		<struct name="meshView" mergeType="replace">
+			<param name="Type">lucMeshViewer</param>
+			<param name="Mesh">mesh-linear</param>
+		</struct>
+		<struct name="displacementArrows">
+			<param name="Type">lucSwarmVectors</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="DirectionVariable">materialSwarm-Displacement</param>
+			<param name="Colour">black</param>
+			<param name="arrowHeadSize">0.05</param>	
+			<param name="LengthVariable">materialSwarm-DisplacementMagnitude</param>	
+			<param name="thickness">2.0</param>	
+		</struct>
+		<struct name="displacementParticleDots">
+			<param name="Type">lucSwarmViewer</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="ColourVariable">materialSwarm-DisplacementMagnitude</param>
+			<param name="ColourMap">displacementColourMap</param>
+			<param name="pointSize">5.0</param>
+		</struct>		
+		<!-- Viewport -->
+		<struct name="ParticleDisplacementVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>title</param>
+				<!--
+				<param>displacementArrows</param>
+				-->
+				<param>displacementParticleDots</param>
+				<param>displacementColourBar</param>
+				<param>meshView</param>
+			</list>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/PressureVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/PressureVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="camera" mergeType="replace">
+			<param name="Type">lucCamera</param>
+			<param name="CentreFieldVariable">PressureField</param>
+			<param name="coordZ">1.5</param>
+		</struct>
+		<struct name="pressureColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Black Purple DarkRed Orange Yellow</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="pressureMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">PressureField</param>
+			<param name="ColourMap">pressureColourMap</param>
+		</struct>
+		<struct name="border" mergeType="replace">
+			<param name="Type">lucFieldVariableBorder</param>
+			<param name="FieldVariable">PressureField</param>
+		</struct>
+		<struct name="pressureColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">pressureColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="PressureVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>pressureMap</param>
+				<param>border</param>
+				<param>pressureColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/RayTay_Example-flip1.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/RayTay_Example-flip1.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,94 @@
+<!-- Rayleigh-Taylor app input file -->
+
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>StgFEM/ElementLayout.xml          </include>
+	<include>StgFEM/ConstantMesh.xml           </include>
+	<include>StgFEM/LinearMesh.xml             </include>
+	<include>StgFEM/VelocityField.xml          </include>
+	<include>StgFEM/PressureField.xml          </include>
+	<include>StgFEM/GaussSwarm.xml             </include>
+	<include>StgFEM/TimeIntegrator.xml         </include>
+	<include>PICellerator/MaterialPointSwarm-flip1.xml        </include>
+	<include>PICellerator/StokesFlowUzawa-flip1.xml           </include>
+
+	<list name="plugins">
+		<!-- Output Plugins -->
+		<param>StgFEM_FrequentOutput</param>	
+		<param>StgFEM_CPUTime</param>
+	</list>
+
+	<struct name="components" mergeType="merge">
+		<struct name="buoyancyForceTerm">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="gravity">gravity</param>
+		</struct>
+		<struct name="everywhere">
+			<param name="Type">Everywhere</param>
+		</struct>
+		<struct name="ball">
+			<param name="Type">Sphere</param>
+			<param name="radius"> 0.15 </param>
+			<param name="CentreX"> 0.5 </param>
+			<param name="CentreY"> 0.5 </param>
+			<param name="CentreZ"> 0.5 </param>
+			<param name="invert">true</param>
+		</struct>
+		<struct name="lightMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">ball</param>
+			<param name="density">-1.0</param>
+		</struct>		
+		<struct name="denseMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">everywhere</param>
+			<param name="density">2.0</param>
+		</struct>		
+	</struct>
+
+	<param name="journal.info.Context-verbose">true</param>
+	<param name="journal.debug">f</param>
+	<param name="journal-enable-branch.debug.StgFEM">t</param>
+	<param name="journal-level-branch.debug.StgFEM"> 2 </param>
+	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
+	
+	<param name="gravity"> 1.0 </param>
+
+	<!-- general simulation parameters -->
+	<param name="maxTimeSteps"> 50 </param>
+	<param name="dumpEvery"> 5 </param>
+	<param name="outputPath"> ./flip1 </param>
+	
+
+	<!-- general decomposition parameters -->
+	<param name="dim"> 2 </param>
+	<!-- mesh parameters -->
+	<param name="elementResI"> 10 </param>
+	<param name="elementResJ"> 10 </param>
+	<param name="elementResK"> 10 </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>
+	<param name="buildElementNodeTbl"> True </param>
+
+	<!-- gauss integration point swarm parameters -->
+	<param name="gaussParticlesX"> 2 </param>
+	<param name="gaussParticlesY"> 2 </param>
+	<param name="gaussParticlesZ"> 2 </param>
+	
+	<!-- Swarm parameters -->
+	<param name="particlesPerCell"> 40 </param>
+	<param name="seed"> 13 </param>
+
+	<include>velocityBCs.freeslipSides.xml</include>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/RayTay_Example-test1.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/RayTay_Example-test1.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,92 @@
+<!-- Rayleigh-Taylor app input file -->
+
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>StgFEM/ElementLayout.xml          </include>
+	<include>StgFEM/ConstantMesh.xml           </include>
+	<include>StgFEM/LinearMesh.xml             </include>
+	<include>StgFEM/VelocityField.xml          </include>
+	<include>StgFEM/PressureField.xml          </include>
+	<include>StgFEM/GaussSwarm.xml             </include>
+	<include>StgFEM/TimeIntegrator.xml         </include>
+	<include>PICellerator/MaterialPointSwarm-test1.xml        </include>
+	<include>PICellerator/StokesFlowUzawa-test1.xml           </include>
+
+	<list name="plugins">
+		<!-- Output Plugins -->
+		<param>StgFEM_FrequentOutput</param>	
+		<param>StgFEM_CPUTime</param>
+	</list>
+
+	<struct name="components" mergeType="merge">
+		<struct name="buoyancyForceTerm">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="gravity">gravity</param>
+		</struct>
+		<struct name="everywhere">
+			<param name="Type">Everywhere</param>
+		</struct>
+		<struct name="ball">
+			<param name="Type">Sphere</param>
+			<param name="radius"> 0.15 </param>
+			<param name="CentreX"> 0.5 </param>
+			<param name="CentreY"> 0.5 </param>
+			<param name="CentreZ"> 0.5 </param>
+		</struct>
+		<struct name="lightMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">everywhere</param>
+			<param name="density">1.0</param>
+		</struct>		
+		<struct name="denseMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">ball</param>
+			<param name="density">1.0</param>
+		</struct>		
+	</struct>
+
+	<param name="journal.info.Context-verbose">true</param>
+	<param name="journal.debug">f</param>
+	<param name="journal-enable-branch.debug.StgFEM">t</param>
+	<param name="journal-level-branch.debug.StgFEM"> 2 </param>
+	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
+	
+	<param name="gravity"> 1.0 </param>
+
+	<!-- general simulation parameters -->
+	<param name="maxTimeSteps"> 50 </param>
+	<param name="dumpEvery"> 5 </param>
+	<param name="outputPath"> ./test1</param>
+
+	<!-- general decomposition parameters -->
+	<param name="dim"> 2 </param>
+	<!-- mesh parameters -->
+	<param name="elementResI"> 10 </param>
+	<param name="elementResJ"> 10 </param>
+	<param name="elementResK"> 10 </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>
+	<param name="buildElementNodeTbl"> True </param>
+
+	<!-- gauss integration point swarm parameters -->
+	<param name="gaussParticlesX"> 2 </param>
+	<param name="gaussParticlesY"> 2 </param>
+	<param name="gaussParticlesZ"> 2 </param>
+	
+	<!-- Swarm parameters -->
+	<param name="particlesPerCell"> 20 </param>
+	<param name="seed"> 13 </param>
+
+	<include>velocityBCs.freeslipSides.xml</include>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/RayTay_Example.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/RayTay_Example.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,92 @@
+<!-- Rayleigh-Taylor app input file -->
+
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>StgFEM/ElementLayout.xml          </include>
+	<include>StgFEM/ConstantMesh.xml           </include>
+	<include>StgFEM/LinearMesh.xml             </include>
+	<include>StgFEM/VelocityField.xml          </include>
+	<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>
+
+	<list name="plugins">
+		<!-- Output Plugins -->
+		<param>StgFEM_FrequentOutput</param>	
+		<param>StgFEM_CPUTime</param>
+	</list>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="buoyancyForceTerm">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="gravity">gravity</param>
+		</struct>
+		<struct name="everywhere">
+			<param name="Type">Everywhere</param>
+		</struct>
+		<struct name="ball">
+			<param name="Type">Sphere</param>
+			<param name="radius"> 0.15 </param>
+			<param name="CentreX"> 0.5 </param>
+			<param name="CentreY"> 0.5 </param>
+			<param name="CentreZ"> 0.5 </param>
+		</struct>
+		<struct name="lightMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">everywhere</param>
+			<param name="density">0.0</param>
+		</struct>		
+		<struct name="denseMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">ball</param>
+			<param name="density">1.0</param>
+		</struct>		
+	</struct>
+
+	<param name="journal.info.Context-verbose">true</param>
+	<param name="journal.debug">f</param>
+	<param name="journal-enable-branch.debug.StgFEM">t</param>
+	<param name="journal-level-branch.debug.StgFEM"> 2 </param>
+	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
+	
+	<param name="gravity"> 1.0 </param>
+
+	<!-- general simulation parameters -->
+	<param name="maxTimeSteps"> 50 </param>
+	<param name="dumpEvery"> 5 </param>
+	<param name="outputPath"> ./output </param>
+
+	<!-- general decomposition parameters -->
+	<param name="dim"> 2 </param>
+	<!-- mesh parameters -->
+	<param name="elementResI"> 10 </param>
+	<param name="elementResJ"> 10 </param>
+	<param name="elementResK"> 10 </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>
+	<param name="buildElementNodeTbl"> True </param>
+
+	<!-- gauss integration point swarm parameters -->
+	<param name="gaussParticlesX"> 2 </param>
+	<param name="gaussParticlesY"> 2 </param>
+	<param name="gaussParticlesZ"> 2 </param>
+	
+	<!-- Swarm parameters -->
+	<param name="particlesPerCell"> 20 </param>
+	<param name="seed"> 13 </param>
+
+	<include>velocityBCs.freeslipSides.xml</include>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/VelocityMagnitudeVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/VelocityMagnitudeVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="camera" mergeType="replace">
+			<param name="Type">lucCamera</param>
+			<param name="CentreFieldVariable">VelocityMagnitudeField</param>
+			<param name="coordZ">1.5</param>
+		</struct>
+		<struct name="velocityMagnitudeColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Purple Blue Green Yellow Orange Red Black</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="velocityMagnitudeMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">VelocityMagnitudeField</param>
+			<param name="ColourMap">velocityMagnitudeColourMap</param>
+			<param name="resolution">128</param>
+		</struct>
+		<struct name="velocityArrows">
+			<param name="Type">lucVectorArrows</param>
+			<param name="VectorVariable">VelocityField</param>
+			<param name="Colour">black</param>
+			<param name="arrowHeadSize">0.15</param>	
+			<param name="lengthScale">0.15</param>	
+		</struct>
+		<struct name="border" mergeType="replace">
+			<param name="Type">lucFieldVariableBorder</param>
+			<param name="FieldVariable">VelocityMagnitudeField</param>
+		</struct>
+		<struct name="velocityMagnitudeColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">velocityMagnitudeColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="VelocityMagnitudeVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>velocityMagnitudeMap</param>
+				<param>border</param>
+				<param>velocityArrows</param>
+				<param>velocityMagnitudeColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/demo.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/demo.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 	
+	<include>./RayTay_Example.xml</include>
+	<include>./ParticleDensityVP.xml</include>
+	<include>./ParticleDisplacementVP.xml</include>
+	<include>./window.xml</include>
+	<struct name="components" mergeType="merge">
+		<struct name="window" mergeType="merge">
+			<param name="Viewport">ParticleDensityVP ParticleDisplacementVP</param>
+		</struct>
+	</struct>
+	<param name="outputPath">./output</param>
+	<param name="interactive">True</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,78 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+subdirs = tests
+
+modName := $(shell basename `pwd` )
+mod = ${PROJECT}_${modName}
+includes = ${PROJECT}/${modName}
+
+SRCS = $(wildcard *.c)
+HDRS = $(wildcard *.h)
+
+XMLS_TARGET_DIR = ${EXAMPLES_DIR}/${modName}
+XMLS = $(wildcard *.xml)
+
+PROJ_LIBS = lib${PROJECT}Update.so lib${PROJECT}Materials.so
+EXTERNAL_INCLUDES = ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${PETSC_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} 
+EXTERNAL_LIBS = \
+	${STGFEM_RPATH} ${STGFEM_LIBS} \
+	${STGFEM_RPATH} ${STGERMAIN_LIBS} \
+	${PETSC_RPATH} ${PETSC_LIBS} \
+	${MPI_RPATH} ${MPI_LIBS} \
+	${XML_LIBS} 
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+examples_xml = demo.xml
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/AnalyticBlock/AnalyticBlock.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1759 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: AnalyticBlock.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#define MAX_FOURIER_TERMS 45
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PICellerator.h>
+
+#include <assert.h>
+
+const Type AnalyticBlock_Type = "AnalyticBlock";
+
+typedef struct {
+	__AnalyticSolution
+	double startBlockX;
+	double endBlockX;
+	double startBlockY;
+} AnalyticBlock;
+
+void _AnalyticBlock_VelocityFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* velocity ) {
+	AnalyticBlock*          self           = (AnalyticBlock*)analyticSolution;
+	double                  n;
+	double                  x, y;
+	double                  viscosity      = 1.0;
+	double                  deltaRho       = 1.0;
+	double                  startBlockX    = self->startBlockX;
+	double                  endBlockX      = self->endBlockX;
+	double                  startBlockY    = self->startBlockY;
+	double                  x0;
+	double                  dx;
+	double                  u1, u2;
+	double                  u1a, u1b;
+	double                  u2a, u2b;
+	double t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40;
+	double t41,t42,t44,t45,t46,t47,t48,t49,t50,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79,t80;
+	double t81,t82,t83,t84,t85,t86,t87,t88,t90,t91,t92,t93,t95,t96,t97,t98,t99,t100,t101,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t115,t116,t117,t118,t119,t120;
+	double t121,t122,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t135,t136,t137,t138,t140,t141,t142,t143,t144,t145,t146,t149,t150,t151,t153,t154,t155,t156,t157,t158,t159,t160;
+	double t161,t162,t163,t165,t166,t167,t168,t169,t170,t171,t172,t173,t175,t176,t177,t178,t179,t180,t181,t182,t183,t185,t186,t187,t188,t189,t190,t191,t192,t193,t194,t195,t197,t198,t199;
+	double t202,t203,t204,t206,t207,t208,t209,t210,t211,t212,t213,t214,t215,t216,t217,t218,t220,t221,t224,t225,t226,t227,t229,t230,t232,t233,t235,t236,t238,t239,t240;
+	double t241,t243,t244,t247,t248,t249,t250,t251,t252,t253,t254,t255,t256,t258,t259,t260,t262,t263,t264,t265,t266,t268,t270,t271,t272,t273,t275,t276,t279,t280;
+	double t281,t282,t283,t284,t285,t286,t287,t288,t290,t291,t293,t294,t295,t296,t297,t298,t299,t300,t301,t303,t304,t305,t307,t308,t309,t310,t313,t314,t316,t317,t319;
+	double t321,t322,t323,t326,t327,t328,t330,t333,t334,t335,t337,t338,t339,t341,t342,t343,t344,t346,t347,t348,t349,t351,t353,t355,t357,t360;
+	double t364,t365,t370,t371,t372,t373,t374,t379,t383,t384,t387,t388,t390,t394,t395,t396;
+	double t401,t402,t403,t404,t406,t408,t409,t410,t411,t413,t414,t416,t421,t424,t425,t429,t430,t431,t435;
+	double t441,t444,t446,t447,t449,t450,t453,t455,t459,t460,t462,t463,t464,t465,t467,t469,t471,t474,t479;
+	double t481,t483,t484,t485,t490,t491,t492,t494,t496,t501,t507,t512,t518,t519;
+	double t521,t522,t526,t535,t540,t542,t550,t557,t559;
+	double t567,t569,t572,t577,t582,t587,t594,t598,t600;
+	double t609,t610,t611,t613,t614,t615,t616,t618,t623,t628,t631,t634,t636,t637,t639,t640;
+	double t641,t642,t645,t650,t654,t658,t659,t661,t670,t673;
+	double t682,t685,t688,t701,t702,t705,t713,t716,t717,t719;
+	double t721,t726,t728,t731,t734,t735,t740,t742,t744,t745,t747,t749,t753,t757;
+	double t761,t771,t773,t779,t786;
+	double t801,t803,t812,t813,t827,t830;
+	double t853,t854,t863;
+	double t883,t886,t892,t899,t907,t910,t917,t920;
+	double t936,t947,t957;
+	double t969,t973,t974,t978,t982,t997;
+	double t1016;
+	double t1041,t1051,t1059,t1072;
+	double t1084,t1089,t1093,t1097;
+	
+	/* Find coordinate of node */
+	x = coord[ I_AXIS ];
+	y = coord[ J_AXIS ];
+
+	x0 = 0.0;
+	dx = endBlockX - startBlockX;
+
+	/* Initialise */
+	velocity[ I_AXIS ] = 0.0;
+	velocity[ J_AXIS ] = 0.0;
+
+	for( n = 1.0 ; n < MAX_FOURIER_TERMS ; n++ ) {
+		t1 = n * M_PI;
+		t2 = 0.1e1 / cosh(t1);
+		t3 = startBlockY * n;
+		t4 = t3 * M_PI;
+		t5 = tanh(t4);
+		t6 = t2 * t5;
+		t7 = 0.1e1 / cosh(t4);
+		t8 = tanh(t1);
+		t9 = t8 * t7;
+		t13 = sin(t1 * dx);
+		t15 = y * n;
+		t16 = t15 * M_PI;
+		t17 = tanh(t16);
+		t18 = t17 * t17;
+		t19 = t18 * n;
+		t20 = M_PI * t2;
+		t21 = t20 * t8;
+		t24 = t18 * t2;
+		t25 = t8 * t5;
+		t26 = t24 * t25;
+		t29 = t2 * t2;
+		t30 = t29 * t2;
+		t32 = 0.1e1 / cosh(t16);
+		t33 = t32 * t32;
+		t35 = t33 * t8 * t7;
+		t38 = t33 * t2;
+		t39 = t38 * t5;
+		t41 = t18 * t30;
+		t42 = t41 * t5;
+		t45 = t17 * t8 * t7;
+		t47 = t38 * t8;
+		t52 = t24 * startBlockY;
+		t53 = t8 * t8;
+		t54 = t53 * t5;
+		t55 = t1 * t54;
+		t57 = M_PI * t33;
+		t60 = t53 * t8;
+		t62 = t18 * t60 * t7;
+		t64 = -0.4e1 * t19 * t21 + 0.2e1 * t16 * t26 + 0.2e1 * t30 - 0.3e1 * t16 * t35 + t16 * t39 - t16 * t42 + 0.12e2 * t45 + 0.2e1 * t16 * t47 - 0.2e1 * t33 * t7 + t52 * t55 - t15 * t57 * t30 - t16 * t62;
+		t65 = t38 * startBlockY;
+		t66 = t1 * t8;
+		t71 = t33 * t30;
+		t73 = t19 * M_PI;
+		t74 = startBlockY * t29;
+		t75 = t74 * t7;
+		t77 = t74 * t9;
+		t80 = t1 * t5;
+		t82 = t17 * t30;
+		t84 = M_PI * t18;
+		t90 = t33 * n;
+		t91 = t90 * M_PI;
+		t93 = t29 * t8 * t7;
+		t96 = t17 * n;
+		t98 = M_PI * t29 * t7;
+		t101 = -0.2e1 * t65 * t66 + 0.4e1 * t17 * t7 - 0.2e1 * t71 - t73 * t75 - t73 * t77 - 0.2e1 * t24 + t52 * t80 + 0.4e1 * t82 - t15 * t84 * t7 - t41 * startBlockY * t80 - 0.2e1 * t2 - 0.2e1 * t91 * t93 + 0.4e1 * t96 * t98;
+		t104 = t1 * t53;
+		t106 = t2 * t53;
+		t107 = t106 * t5;
+		t112 = t2 * t8;
+		t113 = t112 * t5;
+		t116 = t17 * t2;
+		t117 = t116 * t53;
+		t121 = t116 * t5;
+		t124 = t1 * t25;
+		t129 = t18 * startBlockY;
+		t130 = t1 * t7;
+		t132 = -0.2e1 * t6 - t65 * t104 - 0.2e1 * t73 * t107 + 0.4e1 * t90 * t21 - 0.4e1 * t73 * t113 - 0.4e1 * t117 + 0.4e1 * t47 - 0.6e1 * t35 + 0.2e1 * t16 * t121 + 0.2e1 * t52 * t124 + 0.2e1 * t19 * t98 + t129 * t130;
+		t133 = t24 * t5;
+		t137 = t20 * t53;
+		t140 = t17 * t29;
+		t141 = t140 * t9;
+		t143 = t38 * t53;
+		t146 = t18 * t53 * t7;
+		t150 = t20 * t5;
+		t153 = t140 * t7;
+		t158 = M_PI * t8;
+		t159 = t158 * t7;
+		t162 = t16 * t133 + 0.2e1 * t15 * t21 + 0.2e1 * t90 * t137 - 0.4e1 * t141 + t16 * t143 + 0.6e1 * t146 + 0.2e1 * t42 - 0.2e1 * t93 - 0.2e1 * t19 * t150 + 0.2e1 * t16 * t153 + 0.2e1 * t38 + t15 * t150 - 0.3e1 * t15 * t159;
+		t165 = t129 * n;
+		t167 = M_PI * t60 * t7;
+		t173 = t38 * t54;
+		t179 = M_PI * t53;
+		t180 = t179 * t7;
+		t183 = t24 * t8;
+		t187 = t33 * t29;
+		t188 = t187 * t9;
+		t190 = t17 * startBlockY;
+		t191 = t190 * n;
+		t195 = t165 * t167 + 0.2e1 * t73 * t93 + 0.2e1 * t16 * t117 + 0.2e1 * t173 + 0.3e1 * t165 * t159 - t15 * t84 * t30 + 0.3e1 * t165 * t180 + 0.2e1 * t16 * t183 + 0.2e1 * t7 + 0.2e1 * t188 + 0.2e1 * t191 * t167 + 0.2e1 * t39;
+		t197 = t33 * t60 * t7;
+		t199 = t187 * t7;
+		t204 = t33 * t53 * t7;
+		t207 = t33 * startBlockY;
+		t208 = t207 * n;
+		t213 = t116 * t8;
+		t216 = t24 * t53;
+		t221 = t17 * t60 * t7;
+		t224 = -0.2e1 * t197 + 0.2e1 * t199 - 0.2e1 * t19 * t137 - 0.3e1 * t16 * t204 - t208 * t167 - 0.3e1 * t208 * t159 + 0.6e1 * t9 + 0.4e1 * t16 * t213 + t16 * t216 - 0.4e1 * t121 - 0.4e1 * t153 + 0.4e1 * t221 + 0.2e1 * t41;
+		t227 = t71 * t5;
+		t238 = t17 * t53 * t7;
+		t240 = t82 * t5;
+		t247 = -0.8e1 * t213 - 0.2e1 * t227 - 0.6e1 * t204 + 0.6e1 * t191 * t159 + t16 * t188 - 0.6e1 * t16 * t45 + t15 * t84 * t2 + 0.12e2 * t238 + 0.4e1 * t240 - 0.2e1 * t65 * t124 - t65 * t55 - 0.3e1 * t208 * t180;
+		t248 = t96 * M_PI;
+		t254 = M_PI * t17;
+		t262 = t116 * startBlockY;
+		t266 = t38 * t25;
+		t271 = t29 * t7;
+		t275 = -0.4e1 * t248 * t107 - 0.2e1 * t106 + t91 * t75 - 0.4e1 * t112 + 0.2e1 * t15 * t254 * t2 - 0.8e1 * t248 * t113 + 0.6e1 * t191 * t180 + 0.2e1 * t262 * t55 + t16 * t173 + 0.2e1 * t16 * t266 + 0.2e1 * t90 * t20 - 0.2e1 * t271 + 0.2e1 * t262 * t80;
+		t283 = t18 * t29;
+		t284 = t283 * t9;
+		t293 = t2 * startBlockY;
+		t300 = -0.3e1 * t16 * t146 - 0.2e1 * t248 * t75 + t16 * t284 + 0.4e1 * t262 * t124 - t15 * t57 * t7 + t15 * t57 * t2 + t16 * t93 + 0.2e1 * t293 * t66 - t16 * t227 + t293 * t104 + t16 * t199 + t16 * t107;
+		t305 = t24 * t54;
+		t313 = t283 * t7;
+		t322 = -0.2e1 * t248 * t77 + 0.2e1 * t60 * t7 + t16 * t305 - 0.2e1 * t1 * t2 + 0.2e1 * t30 * t5 + t24 * t4 - 0.4e1 * t113 + t16 * t313 + 0.6e1 * t53 * t7 + t91 * t77 - t1 * t75 + 0.2e1 * t16 * t113 - t4 * t93;
+		t327 = M_PI * t30;
+		t335 = t30 * startBlockY;
+		t347 = 0.4e1 * t248 * t93 + t15 * t98 - t15 * t327 * t5 - 0.4e1 * t96 * t137 + 0.2e1 * t116 * t4 - t16 * t197 - t335 * t80 - 0.2e1 * t82 * startBlockY * t80 - 0.2e1 * t90 * t98 - t41 * t4 - 0.2e1 * t1 * t107 - 0.2e1 * t16 * t221;
+		t360 = t116 * t25;
+		t370 = 0.2e1 * t1 * t93 + t3 * t167 - 0.6e1 * t16 * t238 + 0.2e1 * t18 * t7 + t52 * t104 + 0.2e1 * t52 * t66 + 0.3e1 * t3 * t159 + 0.4e1 * t16 * t360 + 0.3e1 * t3 * t180 - t15 * t167 - 0.2e1 * t107 + 0.2e1 * t143 - 0.2e1 * t82 * t4;
+		t373 = t293 * n;
+		t384 = t18 * t8 * t7;
+		t395 = t373 * t179 * t5 - 0.4e1 * t1 * t113 + 0.2e1 * t16 * t141 + t293 * t80 - 0.4e1 * t183 - 0.2e1 * t216 + 0.6e1 * t384 + 0.2e1 * t373 * t158 * t5 - 0.3e1 * t15 * t180 + 0.2e1 * t262 * t104 - t65 * t80 - 0.2e1 * t133;
+		t408 = t116 * t54;
+		t414 = M_PI * t7;
+		t416 = -0.2e1 * t313 + 0.2e1 * t62 - t207 * t130 - 0.3e1 * t16 * t384 - 0.2e1 * t305 - 0.2e1 * t284 - 0.2e1 * t19 * t20 - 0.8e1 * t360 - 0.2e1 * t16 * t240 + 0.2e1 * t16 * t408 - 0.4e1 * t26 - 0.2e1 * t1 * t6 + t3 * t414;
+		t435 = -t335 * t1 + t293 * t1 - 0.2e1 * t1 * t106 - 0.4e1 * t1 * t112 + 0.2e1 * t1 * t271 + 0.2e1 * t190 * t130 - t15 * t327 + 0.4e1 * t266 - t15 * t414 - t38 * t4 - 0.4e1 * t408 - 0.4e1 * t96 * t20;
+		t460 = t15 * t20 - 0.2e1 * t15 * t254 * t30 + t71 * startBlockY * t80 + 0.2e1 * t90 * t150 - 0.2e1 * t15 * t254 * t7 - 0.8e1 * t96 * t21 + t15 * t137 - 0.4e1 * t96 * t150 + 0.2e1 * t91 * t107 + 0.4e1 * t262 * t66 + t71 * t4 + 0.4e1 * t91 * t113 - 0.4e1 * t116;
+		t471 = n * n;
+		t474 = M_PI * M_PI;
+		t479 = pow(t2 + 0.1e1 + t8, 0.2e1);
+		t483 = pow(t2 - 0.1e1 - t8, 0.2e1);
+
+		u1a = (t2 + t6 - t7 - t9) * deltaRho * t13 * (t64 + t101 + t132 + t162 + t195 + t224 + t247 + t275 + t300 + t322 + t347 + t370 + t395 + t416 + t435 + t460) / t7 / (0.1e1 + t5) / t471 / n / t474 / M_PI / t479 / t483 / t32 / viscosity / (0.1e1 + t17) / 0.2e1;
+
+		t1 = n * M_PI;
+		t3 = sin(t1 * dx);
+		t5 = y * n;
+		t6 = t5 * M_PI;
+		t7 = 0.1e1 / cosh(t6);
+		t8 = startBlockY * n;
+		t9 = t8 * M_PI;
+		t10 = 0.1e1 / cosh(t9);
+		t11 = t7 * t10;
+		t12 = tanh(t1);
+		t13 = t12 * t12;
+		t14 = t13 * t13;
+		t15 = tanh(t9);
+		t19 = tanh(t6);
+		t20 = t19 * t19;
+		t21 = t20 * startBlockY;
+		t22 = t21 * n;
+		t23 = M_PI * t12;
+		t24 = 0.1e1 / cosh(t1);
+		t25 = t24 * t24;
+		t26 = t15 * t25;
+		t27 = t23 * t26;
+		t30 = t20 * t24;
+		t31 = t12 * t10;
+		t32 = t31 * t15;
+		t35 = t7 * t7;
+		t36 = t15 * t15;
+		t37 = t35 * t36;
+		t38 = t25 * t13;
+		t39 = t37 * t38;
+		t41 = t25 * t12;
+		t42 = t37 * t41;
+		t44 = t25 * t24;
+		t45 = t19 * t44;
+		t46 = t45 * t31;
+		t48 = t19 * t24;
+		t49 = t10 * t15;
+		t50 = t48 * t49;
+		t52 = t35 * startBlockY;
+		t55 = t25 * t25;
+		t56 = t55 * t15;
+		t59 = t19 * t15;
+		t60 = t59 * t41;
+		t62 = t48 * t10;
+		t65 = t10 * t10;
+		t66 = t35 * t65;
+		t67 = t66 * t38;
+		t69 = t19 * t36;
+		t70 = t69 * t38;
+		t73 = t66 * t41;
+		t75 = -0.4e1 * t11 * t14 * t15 + 0.4e1 * t22 * t27 + 0.12e2 * t30 * t32 - 0.2e1 * t39 - 0.4e1 * t42 - 0.8e1 * t46 + 0.8e1 * t50 - t52 * t1 * t36 - 0.4e1 * t11 * t56 - 0.16e2 * t60 - 0.4e1 * t6 * t62 - 0.2e1 * t67 + 0.2e1 * t6 * t70 - 0.4e1 * t73;
+		t79 = t35 * t24;
+		t80 = t13 * t10;
+		t81 = t79 * t80;
+		t83 = t69 * t41;
+		t85 = t19 * n;
+		t86 = t85 * M_PI;
+		t87 = t24 * t12;
+		t88 = t87 * t49;
+		t91 = t52 * n;
+		t92 = M_PI * t65;
+		t93 = t92 * t25;
+		t95 = t20 * n;
+		t97 = M_PI * t44 * t10;
+		t100 = t35 * n;
+		t101 = t100 * M_PI;
+		t106 = t13 * t12;
+		t107 = t24 * t106;
+		t108 = t107 * t49;
+		t111 = t20 * t44;
+		t112 = t111 * t31;
+		t115 = t7 * t19;
+		t116 = t10 * t14;
+		t119 = t87 * t10;
+		t122 = t19 * t65;
+		t123 = t122 * t41;
+		t126 = 0.8e1 * t11 * t38 + 0.2e1 * t37 - 0.12e2 * t81 - 0.8e1 * t83 + 0.12e2 * t86 * t88 - t91 * t93 + 0.2e1 * t95 * t97 - 0.6e1 * t101 * t88 + 0.8e1 * t11 * t26 - 0.2e1 * t101 * t108 + 0.2e1 * t6 * t112 - 0.4e1 * t115 * t116 + 0.6e1 * t1 * t119 - 0.8e1 * t123 - 0.4e1 * t70;
+		t128 = t95 * M_PI;
+		t129 = t44 * t10;
+		t130 = t129 * t15;
+		t133 = t30 * t31;
+		t138 = t10 * t106;
+		t141 = M_PI * t35;
+		t142 = t5 * t141;
+		t143 = t24 * t13;
+		t144 = t143 * t49;
+		t150 = t35 * t15;
+		t151 = t150 * t41;
+		t154 = t69 * t25;
+		t157 = M_PI * t19;
+		t158 = t5 * t157;
+		t168 = t20 * t55;
+		t169 = t168 * t65;
+		t171 = 0.2e1 * t128 * t130 + 0.12e2 * t133 - 0.4e1 * t91 * t23 * t36 - 0.16e2 * t115 * t138 - 0.6e1 * t142 * t144 - 0.4e1 * t41 + 0.4e1 * t91 * t27 - 0.4e1 * t6 * t151 + 0.2e1 * t6 * t154 - 0.12e2 * t158 * t144 - 0.24e2 * t11 * t13 * t15 - 0.2e1 * t101 * t130 - 0.6e1 * t6 * t81 - t6 * t169;
+		t172 = t26 * t12;
+		t175 = M_PI * t13;
+		t176 = t175 * t25;
+		t178 = M_PI * t55;
+		t179 = t178 * t36;
+		t181 = t178 * t15;
+		t185 = t44 * t12;
+		t186 = t185 * t10;
+		t188 = t35 * t14;
+		t189 = t188 * t36;
+		t191 = t35 * t106;
+		t192 = t191 * t36;
+		t194 = t19 * t25;
+		t195 = t194 * t12;
+		t197 = t35 * t25;
+		t198 = t197 * t12;
+		t202 = M_PI * t36;
+		t203 = t202 * t25;
+		t211 = -0.16e2 * t86 * t172 + t91 * t176 - t8 * t179 - 0.2e1 * t8 * t181 - 0.4e1 * t130 - 0.4e1 * t186 + 0.2e1 * t189 + 0.8e1 * t192 - 0.8e1 * t195 - 0.4e1 * t198 - 0.2e1 * t101 * t186 + t91 * t203 + t5 * t141 * t36 - 0.6e1 * t6 * t119 + t5 * t141 * t65;
+		t214 = t35 * t13;
+		t215 = t214 * t65;
+		t226 = t19 * startBlockY;
+		t227 = t226 * n;
+		t230 = t20 * t25;
+		t232 = t20 * t36;
+		t233 = t232 * t41;
+		t235 = M_PI * t25;
+		t238 = t20 * t15;
+		t239 = t238 * t41;
+		t243 = t20 * t65;
+		t244 = t243 * t41;
+		t247 = t243 * t38;
+		t251 = t36 * t25;
+		t252 = t251 * t13;
+		t255 = 0.6e1 * t6 * t215 + 0.6e1 * t5 * t141 * t13 + 0.2e1 * t128 * t186 - 0.16e2 * t11 * t12 * t15 - 0.2e1 * t227 * t179 - 0.2e1 * t230 - 0.4e1 * t233 + 0.2e1 * t100 * t235 - 0.8e1 * t239 - 0.6e1 * t101 * t144 + 0.2e1 * t6 * t244 + t6 * t247 - 0.6e1 * t101 * t119 + 0.2e1 * t101 * t252;
+		t259 = t235 * t15;
+		t265 = t35 * t44;
+		t266 = t265 * t31;
+		t279 = t80 * t15;
+		t282 = t115 * t10;
+		t283 = t26 * t13;
+		t286 = t191 * t15;
+		t290 = -0.2e1 * t247 - 0.2e1 * t95 * t176 + 0.4e1 * t100 * t259 - 0.4e1 * t26 + 0.24e2 * t48 * t32 + 0.2e1 * t6 * t266 + 0.4e1 * t6 * t239 + 0.2e1 * t5 * t141 * t15 + 0.2e1 * t66 - 0.2e1 * t6 * t108 - 0.2e1 * t128 * t252 + 0.12e2 * t30 * t279 + 0.8e1 * t282 * t283 + 0.8e1 * t6 * t286 + t22 * t203;
+		t295 = M_PI * t24 * t10;
+		t299 = t168 * t36;
+		t303 = t24 * t10;
+		t308 = t185 * t49;
+		t310 = t303 * t15;
+		t313 = t48 * t138;
+		t316 = t202 * t41;
+		t319 = M_PI * t20;
+		t322 = t65 * t25;
+		t323 = t322 * t12;
+		t326 = t188 * t65;
+		t330 = 0.2e1 * t9 * t283 + 0.2e1 * t95 * t295 + 0.8e1 * t191 - t6 * t299 + 0.2e1 * t227 * t203 + 0.2e1 * t1 * t303 - 0.2e1 * t22 * t181 - 0.4e1 * t308 - 0.2e1 * t101 * t310 - 0.4e1 * t6 * t313 + 0.2e1 * t91 * t316 + t5 * t319 * t25 + 0.4e1 * t101 * t323 + t6 * t326 - 0.2e1 * t100 * t295;
+		t337 = t178 * t65;
+		t346 = t30 * t138;
+		t349 = t66 * t25;
+		t351 = t143 * t10;
+		t353 = t107 * t10;
+		t355 = t230 * t13;
+		t357 = t30 * t10;
+		t360 = -0.4e1 * t1 * t283 + 0.2e1 * t55 * t36 - 0.2e1 * t101 * t308 - t5 * t337 - 0.2e1 * t5 * t295 + 0.4e1 * t108 + 0.4e1 * t6 * t46 + 0.2e1 * t128 * t310 - 0.2e1 * t6 * t346 - t6 * t349 + 0.12e2 * t351 + 0.4e1 * t353 - 0.2e1 * t355 + 0.4e1 * t357 + 0.2e1 * t326;
+		t364 = t214 * t36;
+		t370 = t168 * t15;
+		t383 = t232 * t38;
+		t387 = 0.12e2 * t364 + 0.8e1 * t11 * t25 + 0.2e1 * t299 + 0.4e1 * t310 + 0.4e1 * t370 - 0.4e1 * t11 * t55 + 0.4e1 * t85 * t97 - 0.4e1 * t1 * t26 + 0.12e2 * t144 - 0.2e1 * t1 * t251 + 0.2e1 * t6 * t233 + t6 * t383 - t8 * t178 + 0.4e1 * t56;
+		t388 = t150 * t38;
+		t396 = t238 * t38;
+		t401 = t175 * t26;
+		t406 = t138 * t15;
+		t409 = M_PI * t106;
+		t413 = t122 * t25;
+		t421 = t92 * t41;
+		t424 = -0.2e1 * t6 * t388 - 0.4e1 * t11 + 0.8e1 * t227 * t27 + 0.2e1 * t1 * t129 + 0.2e1 * t6 * t396 - 0.4e1 * t128 * t283 + 0.2e1 * t22 * t401 + 0.2e1 * t100 * t176 + 0.4e1 * t30 * t406 + 0.4e1 * t91 * t409 * t65 + 0.2e1 * t6 * t413 - 0.2e1 * t25 + 0.2e1 * t6 * t323 - 0.4e1 * t85 * t93 - 0.2e1 * t22 * t421;
+		t431 = t322 * t13;
+		t435 = t10 * t25;
+		t446 = t79 * t49;
+		t459 = -0.12e2 * t91 * t175 * t15 + 0.2e1 * t6 * t130 + t6 * t431 - 0.24e2 * t115 * t80 + 0.16e2 * t115 * t435 * t12 - t5 * t319 * t55 - 0.4e1 * t115 * t116 * t15 - 0.16e2 * t115 * t406 - 0.2e1 * t6 * t446 - 0.4e1 * t91 * t409 * t36 - 0.2e1 * t6 * t357 - t8 * t93 - 0.2e1 * t142 * t108 + 0.4e1 * t85 * t295;
+		t462 = t111 * t10;
+		t465 = t232 * t25;
+		t469 = t30 * t49;
+		t474 = t265 * t10;
+		t481 = t188 * t15;
+		t484 = startBlockY * t25;
+		t485 = t484 * t12;
+		t490 = t92 * t38;
+		t492 = t202 * t38;
+		t494 = t243 * t25;
+		t496 = -0.2e1 * t6 * t73 + 0.2e1 * t6 * t462 + t6 * t465 + 0.4e1 * t101 * t283 - 0.2e1 * t6 * t469 - 0.12e2 * t158 * t88 + 0.2e1 * t6 * t474 - 0.16e2 * t115 * t32 + 0.2e1 * t6 * t308 + 0.2e1 * t6 * t481 + 0.2e1 * t1 * t485 + 0.16e2 * t282 * t172 - t91 * t490 + t91 * t492 + t6 * t494;
+		t507 = t79 * t31;
+		t521 = t235 * t12;
+		t526 = -0.2e1 * t101 * t353 - 0.8e1 * t85 * t259 - 0.2e1 * t5 * t181 - 0.2e1 * t1 * t322 - 0.6e1 * t6 * t507 + 0.12e2 * t88 - 0.4e1 * t227 * t421 + t5 * t235 + 0.16e2 * t11 * t41 - 0.24e2 * t115 * t279 - 0.6e1 * t6 * t133 + t8 * t203 + 0.4e1 * t100 * t521 - 0.4e1 * t79 * t406;
+		t535 = M_PI * t14;
+		t542 = t59 * t25;
+		t559 = 0.24e2 * t48 * t279 + 0.6e1 * t91 * t175 * t65 + 0.4e1 * t5 * t141 * t106 - 0.2e1 * t91 * t535 * t15 + 0.4e1 * t227 * t316 + t6 * t355 + 0.4e1 * t6 * t542 - 0.4e1 * t52 * t1 * t106 + 0.12e2 * t214 - 0.4e1 * t115 * t49 - 0.16e2 * t115 * t31 - 0.4e1 * t128 * t323 - t6 * t67 - 0.4e1 * t244 + 0.2e1 * t101 * t431;
+		t569 = t111 * t49;
+		t572 = t10 * t55;
+		t577 = t194 * t13;
+		t587 = t48 * t80;
+		t594 = -0.2e1 * t322 - 0.4e1 * t52 * t1 * t12 + 0.4e1 * t6 * t123 - 0.8e1 * t86 * t323 + 0.2e1 * t6 * t569 - 0.4e1 * t115 * t572 + 0.2e1 * t22 * t316 + 0.2e1 * t6 * t577 + 0.2e1 * t168 - 0.2e1 * t6 * t370 - 0.4e1 * t86 * t252 - 0.12e2 * t79 * t32 - 0.12e2 * t6 * t587 - 0.2e1 * t1 * t431 + 0.2e1 * t1 * t353;
+		t600 = t35 * t12;
+		t610 = t265 * t49;
+		t613 = t230 * t12;
+		t616 = t5 * t319;
+		t623 = 0.2e1 * t91 * t401 + 0.2e1 * t5 * t157 * t25 + 0.8e1 * t600 - 0.2e1 * t251 + t142 - 0.12e2 * t79 * t279 - 0.8e1 * t86 * t283 + 0.4e1 * t150 + 0.8e1 * t48 * t406 + 0.2e1 * t6 * t610 + 0.2e1 * t6 * t613 - 0.2e1 * t616 * t108 + 0.4e1 * t469 + t8 * t337 + 0.8e1 * t11 * t283;
+		t628 = t37 * t25;
+		t631 = t79 * t10;
+		t636 = t30 * t80;
+		t641 = t251 * t12;
+		t650 = t197 * t13;
+		t658 = -t6 * t628 + 0.4e1 * t346 - 0.2e1 * t6 * t631 + 0.2e1 * t55 * t65 + 0.12e2 * t636 - 0.2e1 * t5 * t157 * t55 - 0.4e1 * t1 * t641 - 0.2e1 * t95 * t203 - 0.8e1 * t45 * t32 - 0.6e1 * t142 * t88 - t6 * t650 - 0.8e1 * t1 * t172 + 0.2e1 * t227 * t337 + 0.16e2 * t11 * t172;
+		t659 = t122 * t38;
+		t661 = t59 * t38;
+		t670 = t238 * t25;
+		t685 = -0.4e1 * t659 - 0.8e1 * t661 - 0.2e1 * t128 * t431 - t52 * t1 * t14 + t22 * t176 - 0.4e1 * t111 * t32 + 0.2e1 * t6 * t670 - t9 * t431 + 0.24e2 * t587 - 0.4e1 * t396 + 0.4e1 * t265 * t32 + 0.4e1 * t86 * t485 + 0.2e1 * t100 * t93 + 0.2e1 * t128 * t308 - t5 * t178;
+		t688 = M_PI * startBlockY * t25;
+		t701 = t45 * t49;
+		t713 = t1 * t24;
+		t716 = t95 * t688 - 0.8e1 * t91 * t23 * t15 + t5 * t141 * t14 - 0.2e1 * t383 - 0.4e1 * t6 * t50 + 0.4e1 * t266 - 0.8e1 * t85 * t521 - 0.8e1 * t701 + 0.2e1 * t128 * t353 - 0.8e1 * t86 * t641 + 0.4e1 * t86 * t108 - 0.2e1 * t9 * t323 + t52 * t1 * t65 + 0.2e1 * t713 * t406;
+		t717 = t1 * t55;
+		t721 = t150 * t25;
+		t745 = -t21 * t717 + 0.8e1 * t6 * t60 - 0.2e1 * t6 * t721 + 0.4e1 * t101 * t641 - 0.6e1 * t91 * t175 * t36 + 0.2e1 * t1 * t130 + 0.2e1 * t9 * t641 - 0.8e1 * t151 + 0.4e1 * t610 + 0.4e1 * t6 * t192 + t8 * t176 + 0.8e1 * t115 * t435 + 0.2e1 * t227 * t176 + 0.2e1 * t616 * t308 + t5 * t203;
+		t749 = t214 * t15;
+		t757 = t45 * t10;
+		t773 = -0.4e1 * t388 + 0.12e2 * t6 * t749 + 0.12e2 * t86 * t119 + 0.6e1 * t713 * t32 - 0.2e1 * t197 + 0.4e1 * t6 * t757 - 0.4e1 * t446 + 0.2e1 * t6 * t659 + t5 * t176 + 0.4e1 * t86 * t130 - 0.4e1 * t1 * t323 - 0.2e1 * t6 * t310 - 0.12e2 * t507 - 0.6e1 * t6 * t351;
+		t786 = t79 * t138;
+		t803 = 0.2e1 * t5 * t521 - 0.4e1 * t128 * t641 + 0.2e1 * t22 * t259 + 0.4e1 * t91 * t23 * t65 - 0.4e1 * t85 * t176 - t22 * t179 - 0.4e1 * t786 - 0.6e1 * t616 * t144 - t5 * t141 * t25 - 0.4e1 * t158 * t108 + 0.2e1 * t6 * t641 + t6 * t252 + 0.4e1 * t6 * t661 - 0.6e1 * t6 * t88 - 0.4e1 * t95 * t521;
+		t812 = t19 * t55;
+		t813 = t812 * t15;
+		t827 = -0.4e1 * t323 - 0.2e1 * t431 - 0.2e1 * t465 - 0.2e1 * t494 - 0.4e1 * t670 - 0.4e1 * t154 - 0.4e1 * t413 + 0.8e1 * t813 - 0.4e1 * t11 * t14 - 0.16e2 * t11 * t106 - 0.24e2 * t11 * t13 - 0.4e1 * t11 * t15 - 0.16e2 * t11 * t12 - 0.8e1 * t542 + 0.12e2 * t119;
+		t853 = -0.6e1 * t6 * t144 + t91 * t535 * t65 - 0.2e1 * t100 * t97 - 0.8e1 * t128 * t172 + 0.2e1 * t128 * t108 + 0.2e1 * t5 * t97 + 0.4e1 * t158 * t308 + t9 * t252 + 0.2e1 * t188 + t1 * t484 + 0.6e1 * t128 * t351 - 0.2e1 * t38 - 0.4e1 * t227 * t181 - 0.4e1 * t194 - 0.2e1 * t1 * t38;
+		t863 = t600 * t36;
+		t886 = -0.2e1 * t6 * t198 + 0.4e1 * t86 * t310 - 0.4e1 * t6 * t813 + 0.4e1 * t6 * t863 + 0.2e1 * t8 * t259 + 0.2e1 * t1 * t310 + 0.6e1 * t1 * t351 + 0.4e1 * t303 + 0.2e1 * t142 * t308 + 0.2e1 * t227 * t492 + 0.4e1 * t6 * t172 - 0.4e1 * t95 * t259 - 0.8e1 * t91 * t409 * t15 + 0.4e1 * t227 * t259;
+		t892 = t191 * t65;
+		t899 = t812 * t36;
+		t907 = t812 * t65;
+		t917 = t48 * t31;
+		t920 = -0.16e2 * t11 * t106 * t15 - 0.2e1 * t6 * t353 + 0.4e1 * t6 * t892 + 0.12e2 * t86 * t351 + 0.6e1 * t128 * t88 - 0.2e1 * t6 * t899 + 0.8e1 * t115 * t435 * t13 + 0.4e1 * t6 * t83 - 0.2e1 * t6 * t907 + 0.2e1 * t35 - t6 * t39 + t5 * t93 + 0.2e1 * t128 * t485 + 0.12e2 * t86 * t144 - 0.12e2 * t6 * t917;
+		t947 = 0.2e1 * t5 * t259 - 0.4e1 * t85 * t203 + 0.2e1 * t100 * t203 - 0.2e1 * t6 * t786 - 0.2e1 * t1 * t252 - 0.2e1 * t226 * t717 + 0.6e1 * t128 * t144 - 0.2e1 * t227 * t93 + 0.4e1 * t86 * t308 - 0.6e1 * t616 * t88 + t100 * t688 + 0.8e1 * t313 - 0.6e1 * t6 * t636 - 0.4e1 * t112;
+		t973 = -0.4e1 * t85 * t235 + 0.24e2 * t917 + 0.2e1 * t91 * t259 + 0.4e1 * t86 * t186 - 0.4e1 * t569 - t22 * t93 + t6 * t189 - 0.6e1 * t52 * t1 * t13 + 0.4e1 * t9 * t172 + t22 * t337 - t22 * t490 - 0.2e1 * t52 * t1 * t15 + 0.2e1 * t6 * t186 - t52 * t1 + 0.2e1 * t6 * t283;
+		t997 = 0.8e1 * t101 * t172 + t22 * t492 + 0.6e1 * t713 * t279 - 0.2e1 * t95 * t235 + 0.8e1 * t62 - 0.2e1 * t628 - 0.2e1 * t349 - 0.2e1 * t650 + 0.8e1 * t892 + 0.12e2 * t215 + 0.4e1 * t481 + 0.2e1 * t85 * t688 + 0.4e1 * t5 * t141 * t12 - 0.2e1 * t95 * t93;
+		t1016 = -0.4e1 * t1 * t41 - t5 * t179 - 0.4e1 * t721 - 0.4e1 * t577 - 0.4e1 * t283 - 0.8e1 * t172 - 0.4e1 * t462 + 0.16e2 * t286 + 0.4e1 * t899 + 0.4e1 * t907 + 0.2e1 * t169 - 0.8e1 * t757 - 0.4e1 * t631 + 0.2e1 * t1 * t186 + 0.4e1 * t6 * t195;
+		t1041 = t600 * t65;
+		t1051 = -0.2e1 * t227 * t490 + 0.4e1 * t227 * t401 + 0.4e1 * t6 * t701 - 0.6e1 * t101 * t351 - t91 * t535 * t36 - 0.4e1 * t129 + 0.6e1 * t6 * t364 + 0.2e1 * t1 * t44 * t32 + 0.6e1 * t128 * t119 - 0.2e1 * t6 * t42 + 0.8e1 * t115 * t49 * t25 + 0.4e1 * t6 * t1041 - 0.2e1 * t91 * t421 - 0.4e1 * t115 * t572 * t15 + 0.4e1 * t86 * t353;
+		t1059 = t600 * t15;
+		t1072 = 0.2e1 * t55 + 0.2e1 * t101 * t485 + 0.4e1 * t812 - 0.4e1 * t86 * t431 - 0.4e1 * t613 + 0.16e2 * t1059 + 0.24e2 * t749 + 0.4e1 * t474 + 0.8e1 * t1041 + 0.8e1 * t863 - 0.2e1 * t1 * t25 - 0.4e1 * t282 - 0.2e1 * t252 - 0.4e1 * t641 + 0.8e1 * t6 * t1059;
+		t1084 = pow(t24 + 0.1e1 + t12, 0.2e1);
+		t1089 = pow(t24 - 0.1e1 - t12, 0.2e1);
+		t1093 = n * n;
+		t1097 = M_PI * M_PI;
+
+		u1b = deltaRho * t3 * (t1051 + t459 + t387 + t330 + t658 + t496 + t947 + t126 + t594 + t886 + t803 + t920 + t75 + t973 + t997 + t171 + t211 + t716 + t360 + t424 + t1072 + t559 + t745 + t1016 + t623 + t853 + t773 + t255 + t526 + t827 + t290 + t685) / t10 / (0.1e1 + t15) / t1084 / t1089 / t7 / t1093 / n / t1097 / M_PI / viscosity / (0.1e1 + t19) / 0.2e1;
+		
+		t1 = n * M_PI;
+		t2 = 0.1e1 / cosh(t1);
+		t3 = startBlockY * n;
+		t4 = t3 * M_PI;
+		t5 = tanh(t4);
+		t6 = t2 * t5;
+		t7 = 0.1e1 / cosh(t4);
+		t8 = tanh(t1);
+		t9 = t8 * t7;
+		t13 = sin(t1 * dx);
+		t15 = y * n;
+		t16 = t15 * M_PI;
+		t17 = tanh(t16);
+		t19 = t17 * t8 * t7;
+		t22 = t17 * t2;
+		t25 = t17 * n;
+		t26 = M_PI * t2;
+		t27 = t8 * t8;
+		t28 = t26 * t27;
+		t31 = t2 * startBlockY;
+		t32 = t1 * t5;
+		t34 = t17 * t17;
+		t35 = t34 * t2;
+		t37 = 0.1e1 / cosh(t16);
+		t38 = t37 * t37;
+		t39 = t38 * n;
+		t40 = t39 * M_PI;
+		t41 = t2 * t8;
+		t42 = t41 * t5;
+		t45 = t38 * t2;
+		t46 = t27 * t5;
+		t47 = t45 * t46;
+		t48 = t2 * t2;
+		t49 = t38 * t48;
+		t50 = t49 * t9;
+		t53 = t8 * t5;
+		t54 = t22 * t53;
+		t56 = t48 * t2;
+		t57 = t17 * t56;
+		t60 = t17 * t48;
+		t61 = t60 * t9;
+		t63 = 0.6e1 * t16 * t19 - 0.2e1 * t22 * t4 + 0.4e1 * t25 * t28 - t31 * t32 - t35 * t4 + 0.4e1 * t40 * t42 + t47 + t50 + 0.2e1 * t39 * t26 + 0.4e1 * t54 + 0.2e1 * t57 * t4 + 0.2e1 * t61;
+		t64 = t34 * n;
+		t67 = t34 * t56;
+		t69 = t35 * t53;
+		t71 = t35 * t46;
+		t72 = t34 * t48;
+		t73 = t72 * t9;
+		t74 = t22 * startBlockY;
+		t75 = t1 * t27;
+		t78 = t48 * t7;
+		t83 = M_PI * t7;
+		t85 = t56 * startBlockY;
+		t88 = t2 * t27;
+		t93 = 0.2e1 * t64 * t26 + t67 * t4 + 0.2e1 * t69 + t71 + t73 - 0.2e1 * t74 * t75 - 0.2e1 * t1 * t78 + 0.2e1 * t1 * t6 - t3 * t83 + t85 * t1 - t31 * t1 + 0.2e1 * t1 * t88 + 0.4e1 * t1 * t41;
+		t98 = t31 * n;
+		t99 = t8 * M_PI;
+		t104 = t17 * startBlockY;
+		t105 = t1 * t7;
+		t108 = M_PI * t56;
+		t110 = t45 * t53;
+		t113 = t22 * t46;
+		t117 = t38 * t56;
+		t118 = t117 * t5;
+		t120 = t26 * t5;
+		t123 = 0.4e1 * t25 * t26 - t15 * t26 - 0.2e1 * t98 * t99 * t5 + t15 * t83 - 0.2e1 * t104 * t105 + t15 * t108 + 0.2e1 * t110 + t85 * t32 + 0.2e1 * t113 + 0.2e1 * t16 * t110 - t16 * t118 + 0.4e1 * t25 * t120;
+		t125 = t34 * t27 * t7;
+		t128 = t48 * t8 * t7;
+		t129 = t88 * t5;
+		t130 = t45 * t27;
+		t131 = t67 * t5;
+		t133 = t49 * t7;
+		t135 = M_PI * t38;
+		t140 = t26 * t8;
+		t143 = t104 * n;
+		t144 = t27 * t8;
+		t146 = M_PI * t144 * t7;
+		t149 = t99 * t7;
+		t153 = M_PI * t48 * t7;
+		t156 = -0.3e1 * t125 + t128 + t129 + t130 - t131 - t15 * t28 + t16 * t133 - t15 * t135 * t7 + t15 * t135 * t2 - 0.2e1 * t15 * t140 - 0.2e1 * t143 * t146 - 0.6e1 * t143 * t149 - 0.2e1 * t39 * t153;
+		t159 = t45 * startBlockY;
+		t160 = t1 * t46;
+		t162 = M_PI * t27;
+		t163 = t162 * t7;
+		t166 = t38 * startBlockY;
+		t170 = M_PI * t25;
+		t171 = startBlockY * t48;
+		t172 = t171 * t7;
+		t177 = t35 * t8;
+		t182 = t171 * t9;
+		t186 = t34 * t8 * t7;
+		t191 = -t159 * t160 - 0.6e1 * t143 * t163 - t166 * t105 + 0.2e1 * t39 * t120 + 0.2e1 * t170 * t172 + 0.2e1 * t1 * t129 - 0.2e1 * t16 * t177 - 0.2e1 * t40 * t128 + 0.2e1 * t170 * t182 + 0.3e1 * t16 * t186 + t117 * t4 - t45 * t4;
+		t192 = t35 * t5;
+		t194 = t166 * n;
+		t199 = t1 * t8;
+		t206 = t57 * t5;
+		t210 = t38 * t27 * t7;
+		t217 = -t16 * t192 - t194 * t146 + 0.2e1 * t57 * startBlockY * t32 - 0.4e1 * t74 * t199 - t56 - 0.4e1 * t16 * t54 - 0.3e1 * t9 - 0.2e1 * t57 + 0.2e1 * t16 * t206 - 0.3e1 * t210 + 0.2e1 * t1 * t2 - 0.4e1 * t25 * t153 + t16 * t131;
+		t225 = M_PI * t17;
+		t236 = t38 * t8 * t7;
+		t239 = t45 * t5;
+		t241 = t45 * t8;
+		t244 = -0.2e1 * t16 * t69 - 0.2e1 * t159 * t199 - 0.2e1 * t1 * t128 + 0.2e1 * t15 * t225 * t56 + t35 - 0.2e1 * t17 * t7 + 0.2e1 * t15 * t225 * t7 - t159 * t75 - 0.3e1 * t16 * t236 - t117 + t16 * t239 + 0.2e1 * t16 * t241;
+		t249 = t64 * M_PI;
+		t253 = t38 * t144 * t7;
+		t258 = t22 * t5;
+		t264 = -t38 * t7 + t6 - 0.3e1 * t194 * t163 + t40 * t172 + t249 * t172 - t3 * t146 - t16 * t253 - t15 * t135 * t56 - t159 * t32 + t2 - 0.2e1 * t16 * t258 + t249 * t182 + t67 * startBlockY * t32;
+		t270 = t60 * t7;
+		t275 = t17 * t144 * t7;
+		t279 = t72 * t7;
+		t282 = t34 * t144 * t7;
+		t284 = t35 * t27;
+		t286 = 0.4e1 * t64 * t140 - 0.2e1 * t16 * t270 + t16 * t130 + 0.2e1 * t16 * t275 + t40 * t182 - t16 * t279 + t16 * t282 + t284 - 0.3e1 * t186 + t192 + t279 - t282;
+		t287 = t35 * startBlockY;
+		t295 = t22 * t27;
+		t299 = t22 * t8;
+		t304 = t17 * t27 * t7;
+		t307 = -0.2e1 * t287 * t199 + 0.2e1 * t249 * t129 - t34 * t7 + 0.4e1 * t249 * t42 + 0.2e1 * t295 + 0.2e1 * t241 - 0.3e1 * t236 + t239 - t253 + 0.4e1 * t299 - t118 - 0.2e1 * t64 * t153 + 0.6e1 * t16 * t304;
+		t309 = t34 * startBlockY;
+		t317 = M_PI * t34;
+		t328 = t309 * n;
+		t330 = -t309 * t105 + t117 * startBlockY * t32 - t7 + 0.4e1 * t39 * t140 + 0.2e1 * t64 * t120 + t45 + t15 * t317 * t7 - 0.2e1 * t249 * t128 - 0.3e1 * t3 * t149 + 0.2e1 * t39 * t28 - 0.3e1 * t194 * t149 - t328 * t146;
+		t342 = t1 * t53;
+		t349 = -0.3e1 * t328 * t149 + t15 * t317 * t56 - t67 - t16 * t284 - 0.3e1 * t328 * t163 + 0.2e1 * t64 * t28 - t15 * t317 * t2 - 0.2e1 * t159 * t342 - t287 * t160 + t133 + 0.2e1 * t258 + 0.2e1 * t270 - 0.2e1 * t275;
+		t371 = -0.6e1 * t304 - t287 * t75 + 0.2e1 * t177 + 0.4e1 * t170 * t129 - 0.2e1 * t15 * t225 * t2 - t287 * t32 - 0.3e1 * t3 * t163 - 0.2e1 * t287 * t342 - 0.2e1 * t16 * t295 + 0.8e1 * t170 * t42 + t88 - 0.2e1 * t16 * t61;
+		t390 = -0.2e1 * t206 + 0.2e1 * t42 - 0.6e1 * t19 - 0.2e1 * t74 * t160 + 0.3e1 * t16 * t125 - 0.2e1 * t74 * t32 - 0.4e1 * t74 * t342 + 0.3e1 * t15 * t149 + 0.2e1 * t41 - t16 * t128 - 0.4e1 * t170 * t128 - t15 * t120 + t78;
+		t411 = -t16 * t129 - 0.2e1 * t16 * t42 - 0.4e1 * t16 * t299 - t16 * t73 + t15 * t108 * t5 - 0.3e1 * t16 * t210 + 0.4e1 * t1 * t42 + t16 * t50 + t15 * t146 - t15 * t153 - 0.2e1 * t31 * t199 - 0.2e1 * t16 * t113;
+		t430 = -t31 * t75 - t16 * t71 - t144 * t7 + 0.3e1 * t15 * t163 + t16 * t47 - t56 * t5 + 0.8e1 * t25 * t140 - t98 * t162 * t5 - 0.3e1 * t27 * t7 + t1 * t172 + t4 * t128 + 0.2e1 * t40 * t129 + 0.2e1 * t22;
+		t441 = n * n;
+		t444 = M_PI * M_PI;
+		t449 = pow(t2 + 0.1e1 + t8, 0.2e1);
+		t453 = pow(t2 - 0.1e1 - t8, 0.2e1);
+
+		u2a = (t2 + t6 - t7 - t9) * deltaRho * t13 * (t63 + t93 + t123 + t156 + t191 + t217 + t244 + t264 + t286 + t307 + t330 + t349 + t371 + t390 + t411 + t430) / t7 / (0.1e1 + t5) / t441 / n / t444 / M_PI / t449 / t453 / t37 / viscosity / (0.1e1 + t17) / 0.2e1;
+
+		t1 = n * M_PI;
+		t3 = sin(t1 * dx);
+		t5 = 0.1e1 / cosh(t1);
+		t6 = t5 * t5;
+		t7 = t6 * t6;
+		t8 = startBlockY * n;
+		t9 = t8 * M_PI;
+		t10 = 0.1e1 / cosh(t9);
+		t11 = t10 * t10;
+		t13 = y * n;
+		t14 = t13 * M_PI;
+		t15 = tanh(t14);
+		t16 = t15 * n;
+		t17 = t16 * M_PI;
+		t18 = t6 * t5;
+		t19 = tanh(t1);
+		t20 = t18 * t19;
+		t21 = tanh(t9);
+		t22 = t10 * t21;
+		t23 = t20 * t22;
+		t26 = 0.1e1 / cosh(t14);
+		t27 = t26 * t26;
+		t28 = t27 * t11;
+		t29 = t28 * t6;
+		t30 = t15 * t15;
+		t31 = t30 * t5;
+		t32 = t19 * t19;
+		t33 = t32 * t10;
+		t34 = t31 * t33;
+		t37 = t27 * n;
+		t38 = t37 * M_PI;
+		t39 = t32 * t19;
+		t40 = t5 * t39;
+		t41 = t40 * t10;
+		t44 = t20 * t10;
+		t47 = t21 * t21;
+		t48 = t27 * t47;
+		t49 = t48 * t6;
+		t50 = t6 * t19;
+		t52 = t15 * t6;
+		t53 = t52 * t19;
+		t56 = t30 * startBlockY;
+		t57 = t56 * n;
+		t58 = M_PI * t19;
+		t59 = t21 * t6;
+		t60 = t58 * t59;
+		t64 = t19 * t10;
+		t65 = t64 * t21;
+		t68 = t27 * t18;
+		t71 = t68 * t22;
+		t74 = -t7 * t11 - 0.4e1 * t17 * t23 - t29 + 0.6e1 * t14 * t34 - 0.2e1 * t38 * t41 - 0.2e1 * t1 * t44 - t49 + 0.2e1 * t50 - 0.4e1 * t14 * t53 - 0.4e1 * t57 * t60 - 0.2e1 * t1 * t18 * t65 + 0.2e1 * t68 * t65 + 0.2e1 * t14 * t71;
+		t75 = t30 * t18;
+		t76 = t75 * t22;
+		t78 = startBlockY * t6;
+		t79 = t78 * t19;
+		t84 = t15 * t18;
+		t85 = t84 * t22;
+		t87 = t27 * startBlockY;
+		t91 = M_PI * t32;
+		t92 = t91 * t59;
+		t95 = t15 * t5;
+		t96 = t39 * t10;
+		t97 = t95 * t96;
+		t99 = t95 * t64;
+		t101 = M_PI * t6;
+		t104 = t75 * t64;
+		t106 = t30 * t11;
+		t107 = t106 * t50;
+		t109 = t15 * startBlockY;
+		t110 = t109 * n;
+		t111 = M_PI * t11;
+		t112 = t6 * t32;
+		t113 = t111 * t112;
+		t116 = M_PI * t27;
+		t117 = t13 * t116;
+		t118 = t87 * n;
+		t121 = 0.2e1 * t76 - 0.4e1 * t17 * t79 - 0.2e1 * t7 * t21 + 0.4e1 * t85 - 0.6e1 * t87 * t1 * t32 - 0.2e1 * t57 * t92 - 0.4e1 * t97 - 0.12e2 * t99 + 0.4e1 * t16 * t101 + 0.2e1 * t104 + 0.2e1 * t107 + 0.2e1 * t110 * t113 + t117 + 0.4e1 * t118 * t60;
+		t123 = t11 * t6;
+		t126 = t5 * t19;
+		t127 = t126 * t22;
+		t130 = M_PI * t7;
+		t132 = t18 * t10;
+		t135 = t27 * t5;
+		t136 = t135 * t10;
+		t138 = t68 * t64;
+		t143 = t130 * t47;
+		t145 = t30 * t7;
+		t146 = t145 * t11;
+		t150 = t5 * t32;
+		t151 = t150 * t22;
+		t155 = 0.2e1 * t1 * t123 - 0.6e1 * t127 - t13 * t101 + t8 * t130 - 0.2e1 * t1 * t132 - 0.2e1 * t136 + 0.2e1 * t138 + 0.6e1 * t118 * t91 * t11 + t57 * t143 + t14 * t146 - 0.4e1 * t17 * t41 - 0.6e1 * t151 + 0.4e1 * t1 * t59;
+		t156 = t47 * t6;
+		t159 = t95 * t10;
+		t161 = M_PI * t47;
+		t162 = t161 * t112;
+		t165 = t40 * t22;
+		t175 = t130 * t11;
+		t177 = t91 * t6;
+		t183 = 0.2e1 * t1 * t156 - 0.4e1 * t159 - 0.2e1 * t110 * t162 - 0.2e1 * t38 * t165 - 0.2e1 * t165 - t7 + 0.2e1 * t110 * t143 + 0.2e1 * t118 * t92 + 0.2e1 * t38 * t79 + t13 * t175 - t57 * t177 + t118 * t177 - t14 * t49 - 0.12e2 * t95 * t65;
+		t186 = t59 * t19;
+		t189 = t32 * t32;
+		t190 = M_PI * t189;
+		t193 = t95 * t22;
+		t199 = t5 * t10;
+		t202 = t30 * t21;
+		t203 = t202 * t6;
+		t206 = t135 * t96;
+		t209 = t135 * t22;
+		t212 = t95 * t33;
+		t214 = t106 * t112;
+		t218 = t31 * t64;
+		t220 = 0.16e2 * t17 * t186 + t118 * t190 * t11 + 0.4e1 * t14 * t193 - 0.6e1 * t31 * t65 + 0.2e1 * t23 - 0.2e1 * t1 * t199 - 0.2e1 * t14 * t203 - 0.2e1 * t14 * t206 - 0.2e1 * t14 * t209 - 0.12e2 * t212 + t214 + 0.2e1 * t13 * t116 * t21 - 0.6e1 * t218;
+		t226 = t202 * t50;
+		t229 = t30 * t47;
+		t230 = t229 * t50;
+		t233 = t68 * t10;
+		t236 = t31 * t96;
+		t241 = t111 * t50;
+		t244 = t101 * t11;
+		t247 = t123 * t32;
+		t250 = t156 * t19;
+		t253 = t57 * t113 + t28 + 0.12e2 * t14 * t99 + 0.2e1 * t37 * t101 - 0.4e1 * t14 * t226 + 0.2e1 * t230 + 0.4e1 * t226 + 0.2e1 * t14 * t233 + 0.2e1 * t14 * t236 + 0.4e1 * t1 * t50 + 0.4e1 * t110 * t241 + 0.4e1 * t16 * t244 + 0.4e1 * t17 * t247 - 0.2e1 * t14 * t250;
+		t256 = t161 * t50;
+		t260 = t101 * t21;
+		t263 = t123 * t19;
+		t268 = t31 * t22;
+		t272 = t229 * t112;
+		t273 = t84 * t64;
+		t275 = M_PI * t30;
+		t276 = t13 * t275;
+		t280 = t15 * t21;
+		t281 = t280 * t50;
+		t283 = t118 * t162 - 0.4e1 * t110 * t256 - t118 * t113 + 0.4e1 * t37 * t260 - 0.2e1 * t14 * t263 - 0.4e1 * t14 * t85 - 0.2e1 * t268 - 0.2e1 * t14 * t136 + t272 + 0.4e1 * t273 + 0.2e1 * t276 * t165 - 0.4e1 * t193 + 0.8e1 * t281;
+		t285 = t30 * t6;
+		t286 = t285 * t32;
+		t288 = t156 * t32;
+		t291 = t101 * t19;
+		t294 = t48 * t50;
+		t296 = t30 * n;
+		t297 = t296 * M_PI;
+		t298 = t132 * t21;
+		t301 = t28 * t50;
+		t303 = t48 * t112;
+		t305 = t28 * t112;
+		t310 = -t8 * t175 - t14 * t286 + 0.2e1 * t1 * t288 + 0.8e1 * t16 * t291 - 0.2e1 * t294 + t156 - 0.2e1 * t297 * t298 - 0.2e1 * t301 - t303 - 0.2e1 * t199 - t305 + 0.2e1 * t71 - 0.2e1 * t276 * t23 - t9 * t288;
+		t314 = t59 * t32;
+		t321 = t135 * t33;
+		t326 = t33 * t21;
+		t333 = t27 * t21;
+		t334 = t333 * t50;
+		t338 = t15 * t11;
+		t339 = t338 * t50;
+		t341 = t27 * t189;
+		t342 = 0.4e1 * t1 * t314 - 0.2e1 * t87 * t1 * t21 - t7 * t47 - 0.6e1 * t321 - 0.4e1 * t87 * t1 * t39 - 0.6e1 * t135 * t326 - t14 * t247 + 0.2e1 * t14 * t165 - 0.2e1 * t236 - 0.4e1 * t334 + 0.2e1 * t57 * t241 + 0.4e1 * t339 + t341;
+		t343 = t15 * t47;
+		t344 = t343 * t112;
+		t346 = t343 * t50;
+		t348 = M_PI * t15;
+		t349 = t13 * t348;
+		t365 = t161 * t6;
+		t372 = M_PI * startBlockY * t6;
+		t374 = 0.2e1 * t344 + 0.4e1 * t346 + 0.12e2 * t349 * t151 - 0.2e1 * t14 * t44 - 0.2e1 * t57 * t256 + 0.4e1 * t1 * t250 + 0.8e1 * t1 * t186 + 0.8e1 * t17 * t263 - 0.2e1 * t57 * t260 - 0.6e1 * t34 - t13 * t365 - 0.2e1 * t1 * t41 - 0.2e1 * t14 * t107 - t296 * t372;
+		t379 = t150 * t10;
+		t388 = t341 * t47;
+		t390 = t96 * t21;
+		t394 = M_PI * t18 * t10;
+		t402 = -0.2e1 * t14 * t23 + t57 * t244 - 0.6e1 * t297 * t379 + 0.2e1 * t296 * t244 - 0.2e1 * t297 * t23 - t1 * t78 + 0.2e1 * t59 + t14 * t388 - 0.2e1 * t135 * t390 - 0.2e1 * t296 * t394 - 0.2e1 * t110 * t175 - t87 * t1 - 0.2e1 * t297 * t44;
+		t403 = t27 * t39;
+		t404 = t403 * t47;
+		t409 = t15 * t7;
+		t410 = t409 * t47;
+		t414 = t333 * t112;
+		t425 = t130 * t21;
+		t429 = t341 * t11;
+		t431 = 0.4e1 * t14 * t404 + 0.2e1 * t296 * t365 - 0.2e1 * t410 - 0.2e1 * t16 * t372 - 0.2e1 * t414 - 0.4e1 * t17 * t165 + t112 + t8 * t143 - 0.6e1 * t38 * t379 - t14 * t214 + 0.4e1 * t13 * t116 * t19 + 0.2e1 * t8 * t425 + 0.2e1 * t132 + t14 * t429;
+		t447 = t126 * t10;
+		t450 = t199 * t21;
+		t455 = M_PI * t5 * t10;
+		t460 = t1 * t5;
+		t463 = -0.6e1 * t118 * t91 * t47 - 0.6e1 * t38 * t151 - 0.2e1 * t297 * t41 - 0.4e1 * t17 * t298 - 0.6e1 * t297 * t151 + t48 - 0.6e1 * t135 * t65 - 0.6e1 * t38 * t447 - 0.2e1 * t1 * t450 + t9 * t247 - 0.2e1 * t37 * t455 - 0.6e1 * t1 * t379 - 0.6e1 * t460 * t326;
+		t464 = t135 * t64;
+		t467 = t403 * t21;
+		t491 = -0.6e1 * t464 + t37 * t372 + 0.8e1 * t467 - 0.6e1 * t1 * t447 - 0.4e1 * t14 * t273 + 0.2e1 * t296 * t177 + 0.2e1 * t37 * t244 - 0.6e1 * t460 * t65 + 0.6e1 * t14 * t151 + 0.8e1 * t16 * t260 - 0.2e1 * t460 * t390 + 0.4e1 * t296 * t291 - 0.12e2 * t95 * t326 - 0.2e1 * t37 * t394;
+		t501 = t202 * t112;
+		t512 = t1 * t7;
+		t518 = t27 * t19;
+		t519 = t518 * t11;
+		t522 = -0.4e1 * t16 * t394 - 0.4e1 * t110 * t260 - 0.4e1 * t95 * t390 - 0.2e1 * t1 * t79 - 0.2e1 * t14 * t501 + 0.2e1 * t297 * t288 - 0.2e1 * t14 * t314 + 0.4e1 * t84 * t65 + 0.6e1 * t276 * t127 + t56 * t512 - 0.2e1 * t38 * t298 + 0.2e1 * t37 * t365 + 0.4e1 * t14 * t519;
+		t540 = t84 * t10;
+		t550 = -0.6e1 * t14 * t464 - t8 * t177 + 0.2e1 * t110 * t244 - 0.4e1 * t14 * t339 - 0.2e1 * t1 * t298 + 0.12e2 * t14 * t212 - 0.2e1 * t38 * t44 - t13 * t177 - 0.4e1 * t87 * t1 * t19 + 0.4e1 * t540 - 0.2e1 * t297 * t165 + 0.2e1 * t296 * t101 - 0.2e1 * t13 * t394 - 0.2e1 * t9 * t314;
+		t557 = t338 * t112;
+		t567 = t518 * t21;
+		t582 = -0.4e1 * t17 * t450 - 0.2e1 * t14 * t557 + 0.4e1 * t110 * t425 + 0.2e1 * t14 * t268 + 0.2e1 * t38 * t247 + t13 * t143 + 0.8e1 * t14 * t567 - 0.4e1 * t9 * t186 + 0.2e1 * t13 * t348 * t7 - 0.2e1 * t209 + 0.4e1 * t14 * t97 + 0.2e1 * t57 * t425 - 0.12e2 * t17 * t379;
+		t587 = t145 * t47;
+		t598 = t145 * t21;
+		t609 = -t57 * t162 - 0.4e1 * t14 * t334 - t57 * t175 + t14 * t587 - 0.4e1 * t14 * t540 - 0.12e2 * t17 * t151 - t146 + 0.2e1 * t14 * t410 - 0.12e2 * t118 * t91 * t21 + 0.2e1 * t14 * t598 + 0.4e1 * t38 * t263 - 0.2e1 * t297 * t450 + 0.4e1 * t14 * t159 + 0.2e1 * t38 * t288;
+		t611 = t52 * t32;
+		t614 = t27 * t32;
+		t615 = t614 * t21;
+		t618 = M_PI * t39;
+		t634 = t285 * t19;
+		t637 = t280 * t112;
+		t639 = t27 * t6;
+		t640 = t639 * t32;
+		t642 = t280 * t6;
+		t645 = -0.2e1 * t14 * t611 + 0.12e2 * t14 * t615 + 0.4e1 * t118 * t618 * t11 - 0.2e1 * t118 * t241 - t145 + 0.4e1 * t118 * t58 * t11 + 0.2e1 * t118 * t256 - 0.2e1 * t14 * t414 + 0.4e1 * t13 * t116 * t39 - 0.2e1 * t14 * t634 + 0.4e1 * t637 - t14 * t640 - 0.4e1 * t14 * t642;
+		t654 = t333 * t6;
+		t673 = -0.2e1 * t13 * t260 - t13 * t275 * t6 + 0.4e1 * t296 * t260 - 0.6e1 * t117 * t151 - 0.2e1 * t14 * t654 + 0.6e1 * t14 * t218 + 0.4e1 * t349 * t165 + 0.4e1 * t38 * t314 - 0.12e2 * t17 * t447 - 0.12e2 * t17 * t127 + 0.2e1 * t13 * t455 + t27 - 0.4e1 * t349 * t23 - 0.6e1 * t31 * t326;
+		t682 = t409 * t11;
+		t702 = t13 * t275 * t7 - 0.2e1 * t117 * t165 + 0.6e1 * t276 * t151 - 0.2e1 * t682 - 0.8e1 * t14 * t281 + 0.2e1 * t297 * t247 - 0.2e1 * t110 * t365 - 0.2e1 * t14 * t230 - 0.4e1 * t14 * t637 + 0.4e1 * t38 * t250 - t87 * t1 * t47 + 0.2e1 * t117 * t23 - 0.2e1 * t8 * t260;
+		t705 = t518 * t47;
+		t716 = t343 * t6;
+		t719 = t614 * t11;
+		t721 = t403 * t11;
+		t726 = t409 * t21;
+		t728 = t338 * t6;
+		t731 = 0.2e1 * t13 * t425 + 0.4e1 * t14 * t705 - t13 * t116 * t6 - 0.8e1 * t110 * t60 - 0.4e1 * t16 * t455 - 0.2e1 * t14 * t76 - 0.2e1 * t14 * t716 + 0.6e1 * t719 + 0.4e1 * t721 + 0.4e1 * t297 * t314 + 0.4e1 * t642 - 0.4e1 * t726 + 0.2e1 * t728 + 0.2e1 * t716;
+		t734 = t106 * t6;
+		t735 = t229 * t6;
+		t740 = t614 * t47;
+		t742 = t31 * t10;
+		t744 = 0.2e1 * t203 + t734 + t735 + t247 + 0.2e1 * t263 - 0.2e1 * t598 - 0.2e1 * t450 - t587 - t14 * t272 + 0.6e1 * t740 + t429 - 0.2e1 * t742 + t286;
+		t747 = t75 * t10;
+		t753 = t341 * t21;
+		t761 = -0.2e1 * t41 - 0.6e1 * t379 + 0.2e1 * t747 + 0.4e1 * t186 + 0.2e1 * t314 + 0.2e1 * t611 - 0.2e1 * t654 + 0.2e1 * t753 - t14 * t735 + 0.2e1 * t250 + t288 + 0.2e1 * t1 * t6 + 0.4e1 * t705 + 0.4e1 * t519;
+		t771 = t639 * t19;
+		t779 = 0.2e1 * t233 + 0.12e2 * t615 + 0.8e1 * t567 + 0.6e1 * t14 * t127 + 0.2e1 * t634 - 0.2e1 * t771 + 0.4e1 * t53 + 0.4e1 * t404 + t388 + 0.2e1 * t44 + 0.8e1 * t38 * t186 + 0.2e1 * t298 + t123;
+		t801 = -0.4e1 * t14 * t346 - 0.6e1 * t447 - 0.6e1 * t38 * t127 + 0.6e1 * t14 * t740 - t14 * t29 + 0.2e1 * t1 * t247 - t14 * t734 - 0.4e1 * t17 * t44 - t640 + t8 * t244 - 0.2e1 * t14 * t344 - 0.4e1 * t110 * t92 + 0.2e1 * t557 - 0.2e1 * t31 * t390;
+		t830 = -0.4e1 * t118 * t58 * t47 - 0.4e1 * t14 * t186 + 0.2e1 * t9 * t263 - 0.2e1 * t9 * t250 + 0.2e1 * t14 * t138 - 0.2e1 * t14 * t104 + 0.4e1 * t17 * t288 + 0.2e1 * t501 + 0.6e1 * t13 * t116 * t32 + 0.2e1 * t37 * t177 + 0.6e1 * t14 * t379 + 0.2e1 * t14 * t41 - t118 * t190 * t47;
+		t854 = -t87 * t1 * t189 - 0.6e1 * t14 * t321 + 0.2e1 * t333 + t13 * t130 + 0.2e1 * t75 * t65 + 0.8e1 * t17 * t314 + 0.2e1 * t109 * t512 + 0.4e1 * t297 * t250 - t8 * t365 + 0.4e1 * t14 * t721 + t6 + 0.4e1 * t16 * t365 - 0.6e1 * t297 * t447 - 0.2e1 * t14 * t301;
+		t883 = 0.4e1 * t37 * t291 - 0.2e1 * t296 * t455 + 0.8e1 * t17 * t250 - 0.2e1 * t118 * t190 * t21 + t87 * t1 * t11 + 0.12e2 * t349 * t127 + 0.6e1 * t14 * t719 + 0.2e1 * t52 + 0.2e1 * t14 * t450 - 0.2e1 * t38 * t23 + 0.4e1 * t297 * t263 + 0.2e1 * t1 * t112 - 0.2e1 * t297 * t79;
+		t910 = -0.2e1 * t13 * t291 - 0.6e1 * t117 * t127 + t285 - 0.2e1 * t13 * t348 * t6 + 0.8e1 * t297 * t186 - t13 * t244 - t57 * t365 - 0.4e1 * t118 * t618 * t47 + 0.2e1 * t14 * t753 + t13 * t116 * t11 + 0.2e1 * t118 * t260 + 0.6e1 * t14 * t447 - 0.2e1 * t206 - 0.8e1 * t118 * t618 * t21;
+		t936 = -0.2e1 * t14 * t771 + 0.2e1 * t14 * t742 + t13 * t116 * t47 - 0.6e1 * t297 * t127 - 0.2e1 * t14 * t728 - t14 * t288 - 0.2e1 * t38 * t450 + 0.6e1 * t614 - 0.2e1 * t14 * t294 + 0.4e1 * t518 - 0.2e1 * t110 * t177 - 0.2e1 * t14 * t747 - 0.8e1 * t118 * t58 * t21;
+		t957 = 0.2e1 * t14 * t682 + 0.4e1 * t14 * t726 + 0.4e1 * t16 * t177 + t13 * t116 * t189 + 0.4e1 * t403 - 0.2e1 * t14 * t298 - t14 * t303 - t118 * t244 - t639 + 0.4e1 * t1 * t263 - 0.2e1 * t409 + t118 * t365 - t14 * t305 + 0.8e1 * t14 * t467;
+		t969 = pow(t5 + 0.1e1 + t19, 0.2e1);
+		t974 = pow(t5 - 0.1e1 - t19, 0.2e1);
+		t978 = n * n;
+		t982 = M_PI * M_PI;
+
+		u2b = deltaRho * t3 * (t910 + t74 + t582 + t310 + t830 + t491 + t883 + t645 + t342 + t957 + t283 + t673 + t220 + t121 + t183 + t609 + t550 + t731 + t374 + t702 + t402 + t431 + t854 + t522 + t761 + t744 + t779 + t463 + t155 + t253 + t936 + t801) / t10 / (0.1e1 + t21) / t969 / t974 / t26 / t978 / n / t982 / M_PI / viscosity / (0.1e1 + t15) / 0.2e1;
+
+		if ( y > startBlockY ) {
+			u1=u1b; u2=u2b;
+		}
+		else {
+			u1 = u1a; u2=u2a;
+		}
+
+		u1 *= cos(n*M_PI*x);
+		velocity[ J_AXIS ] += u1;
+		u2 *= sin(n*M_PI*x);
+		velocity[ I_AXIS ] += u2;
+	}
+}
+
+
+void _AnalyticBlock_PressureFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* pressure ) {
+	AnalyticBlock*          self           = (AnalyticBlock*)analyticSolution;
+	double                  n;
+	double                  x, y;
+	double                  viscosity      = 1.0;
+	double                  deltaRho       = 1.0;
+	double                  startBlockX    = self->startBlockX;
+	double                  endBlockX      = self->endBlockX;
+	double                  startBlockY    = self->startBlockY;
+	double                  x0;
+	double                  dx;
+	double                  u2, u3, u5;
+	double                  u2a, u2b;
+	double                  u3a, u3b;
+	double t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40;
+	double t41,t42,t44,t45,t46,t47,t48,t49,t50,t51,t52,t53,t54,t55,t56,t57,t58,t59,t60,t61,t62,t63,t64,t65,t66,t67,t68,t69,t70,t71,t72,t73,t74,t75,t76,t77,t78,t79;
+	double t82,t83,t84,t85,t86,t87,t88,t89,t90,t91,t92,t93,t94,t95,t96,t97,t98,t99,t100,t101,t102,t103,t104,t105,t106,t107,t108,t109,t110,t111,t112,t113,t114,t115,t116,t117,t118,t119,t120;
+	double t121,t123,t124,t125,t126,t127,t128,t129,t130,t131,t132,t133,t134,t135,t136,t138,t139,t140,t141,t143,t144,t145,t146,t148,t149,t150,t151,t153,t154,t155,t156,t157,t159,t160;
+	double t161,t162,t163,t164,t165,t166,t167,t169,t170,t171,t172,t173,t174,t175,t177,t178,t179,t180,t182,t183,t184,t186,t188,t189,t190,t191,t192,t193,t194,t196,t197,t199;
+	double t201,t202,t203,t205,t206,t208,t209,t210,t211,t212,t214,t216,t217,t218,t219,t220,t222,t225,t226,t228,t229,t230,t231,t233,t234,t235,t236,t238,t239;
+	double t241,t244,t247,t248,t249,t250,t252,t253,t255,t256,t257,t258,t259,t260,t262,t263,t264,t265,t266,t267,t268,t269,t270,t272,t273,t275,t276,t277,t279,t280;
+	double t281,t282,t283,t284,t285,t286,t287,t288,t289,t291,t294,t295,t296,t297,t298,t299,t300,t301,t303,t304,t305,t307,t308,t309,t310,t313,t314,t317;
+	double t321,t324,t326,t328,t329,t330,t331,t333,t334,t336,t338,t339,t341,t342,t343,t344,t346,t347,t348,t349,t350,t352,t353,t356,t359;
+	double t362,t365,t366,t367,t369,t370,t371,t372,t374,t376,t378,t379,t380,t382,t385,t387,t388,t389,t390,t392,t393,t394,t396,t399;
+	double t402,t403,t404,t405,t408,t409,t410,t411,t412,t414,t415,t416,t421,t422,t423,t425,t428,t429,t430,t431;
+	double t441,t442,t444,t447,t449,t450,t452,t453,t455,t460,t461,t463,t464,t467,t471,t473,t474,t476,t479;
+	double t483,t484,t485,t491,t492,t500,t501,t511,t512,t517,t518,t519;
+	double t522,t529,t536,t537,t540,t544,t550,t551,t553,t556,t557;
+	double t567,t573,t580,t582,t587,t598,t600;
+	double t605,t609,t611,t614,t615,t618,t626,t634,t637,t638,t639,t640;
+	double t642,t645,t646,t651,t652,t654,t657,t659,t662,t664,t673;
+	double t682,t699,t702,t705,t716,t719;
+	double t721,t726,t727,t728,t730,t731,t734,t735,t740,t742,t744,t747,t753,t755,t756;
+	double t761,t771,t779,t783,t795;
+	double t801,t806,t809,t811,t816,t823,t828,t830;
+	double t849,t854,t877;
+	double t883,t904,t910;
+	double t933,t936,t957;
+	double t962,t969,t974,t978,t982,t988;
+	double t1001,t1004,t1011,t1015;
+
+	
+	/* Find coordinate of node */
+	x = coord[ I_AXIS ];
+	y = coord[ J_AXIS ];
+
+	x0 = 0.0;
+	dx = endBlockX - startBlockX;
+
+	/* Initialise */
+	*pressure = 0.0;
+
+	for( n = 1.0 ; n < MAX_FOURIER_TERMS ; n++ ) {
+
+
+		t1 = n * M_PI;
+		t2 = 0.1e1 / cosh(t1);
+		t3 = startBlockY * n;
+		t4 = t3 * M_PI;
+		t5 = tanh(t4);
+		t6 = t2 * t5;
+		t7 = 0.1e1 / cosh(t4);
+		t8 = tanh(t1);
+		t9 = t8 * t7;
+		t13 = sin(t1 * dx);
+		t15 = y * n;
+		t16 = t15 * M_PI;
+		t17 = tanh(t16);
+		t19 = t17 * t8 * t7;
+		t22 = t17 * t2;
+		t25 = t17 * n;
+		t26 = M_PI * t2;
+		t27 = t8 * t8;
+		t28 = t26 * t27;
+		t31 = t2 * startBlockY;
+		t32 = t1 * t5;
+		t34 = t17 * t17;
+		t35 = t34 * t2;
+		t37 = 0.1e1 / cosh(t16);
+		t38 = t37 * t37;
+		t39 = t38 * n;
+		t40 = t39 * M_PI;
+		t41 = t2 * t8;
+		t42 = t41 * t5;
+		t45 = t38 * t2;
+		t46 = t27 * t5;
+		t47 = t45 * t46;
+		t48 = t2 * t2;
+		t49 = t38 * t48;
+		t50 = t49 * t9;
+		t53 = t8 * t5;
+		t54 = t22 * t53;
+		t56 = t48 * t2;
+		t57 = t17 * t56;
+		t60 = t17 * t48;
+		t61 = t60 * t9;
+		t63 = 0.6e1 * t16 * t19 - 0.2e1 * t22 * t4 + 0.4e1 * t25 * t28 - t31 * t32 - t35 * t4 + 0.4e1 * t40 * t42 + t47 + t50 + 0.2e1 * t39 * t26 + 0.4e1 * t54 + 0.2e1 * t57 * t4 + 0.2e1 * t61;
+		t64 = t34 * n;
+		t67 = t34 * t56;
+		t69 = t35 * t53;
+		t71 = t35 * t46;
+		t72 = t34 * t48;
+		t73 = t72 * t9;
+		t74 = t22 * startBlockY;
+		t75 = t1 * t27;
+		t78 = t48 * t7;
+		t83 = M_PI * t7;
+		t85 = t56 * startBlockY;
+		t88 = t2 * t27;
+		t93 = 0.2e1 * t64 * t26 + t67 * t4 + 0.2e1 * t69 + t71 + t73 - 0.2e1 * t74 * t75 - 0.2e1 * t1 * t78 + 0.2e1 * t1 * t6 - t3 * t83 + t85 * t1 - t31 * t1 + 0.2e1 * t1 * t88 + 0.4e1 * t1 * t41;
+		t98 = t31 * n;
+		t99 = t8 * M_PI;
+		t104 = t17 * startBlockY;
+		t105 = t1 * t7;
+		t108 = M_PI * t56;
+		t110 = t45 * t53;
+		t113 = t22 * t46;
+		t117 = t38 * t56;
+		t118 = t117 * t5;
+		t120 = t26 * t5;
+		t123 = 0.4e1 * t25 * t26 - t15 * t26 - 0.2e1 * t98 * t99 * t5 + t15 * t83 - 0.2e1 * t104 * t105 + t15 * t108 + 0.2e1 * t110 + t85 * t32 + 0.2e1 * t113 + 0.2e1 * t16 * t110 - t16 * t118 + 0.4e1 * t25 * t120;
+		t125 = t34 * t27 * t7;
+		t128 = t48 * t8 * t7;
+		t129 = t88 * t5;
+		t130 = t45 * t27;
+		t131 = t67 * t5;
+		t133 = t49 * t7;
+		t135 = M_PI * t38;
+		t140 = t26 * t8;
+		t143 = t104 * n;
+		t144 = t27 * t8;
+		t146 = M_PI * t144 * t7;
+		t149 = t99 * t7;
+		t153 = M_PI * t48 * t7;
+		t156 = -0.3e1 * t125 + t128 + t129 + t130 - t131 - t15 * t28 + t16 * t133 - t15 * t135 * t7 + t15 * t135 * t2 - 0.2e1 * t15 * t140 - 0.2e1 * t143 * t146 - 0.6e1 * t143 * t149 - 0.2e1 * t39 * t153;
+		t159 = t45 * startBlockY;
+		t160 = t1 * t46;
+		t162 = M_PI * t27;
+		t163 = t162 * t7;
+		t166 = t38 * startBlockY;
+		t170 = M_PI * t25;
+		t171 = startBlockY * t48;
+		t172 = t171 * t7;
+		t177 = t35 * t8;
+		t182 = t171 * t9;
+		t186 = t34 * t8 * t7;
+		t191 = -t159 * t160 - 0.6e1 * t143 * t163 - t166 * t105 + 0.2e1 * t39 * t120 + 0.2e1 * t170 * t172 + 0.2e1 * t1 * t129 - 0.2e1 * t16 * t177 - 0.2e1 * t40 * t128 + 0.2e1 * t170 * t182 + 0.3e1 * t16 * t186 + t117 * t4 - t45 * t4;
+		t192 = t35 * t5;
+		t194 = t166 * n;
+		t199 = t1 * t8;
+		t206 = t57 * t5;
+		t210 = t38 * t27 * t7;
+		t217 = -t16 * t192 - t194 * t146 + 0.2e1 * t57 * startBlockY * t32 - 0.4e1 * t74 * t199 - t56 - 0.4e1 * t16 * t54 - 0.3e1 * t9 - 0.2e1 * t57 + 0.2e1 * t16 * t206 - 0.3e1 * t210 + 0.2e1 * t1 * t2 - 0.4e1 * t25 * t153 + t16 * t131;
+		t225 = M_PI * t17;
+		t236 = t38 * t8 * t7;
+		t239 = t45 * t5;
+		t241 = t45 * t8;
+		t244 = -0.2e1 * t16 * t69 - 0.2e1 * t159 * t199 - 0.2e1 * t1 * t128 + 0.2e1 * t15 * t225 * t56 + t35 - 0.2e1 * t17 * t7 + 0.2e1 * t15 * t225 * t7 - t159 * t75 - 0.3e1 * t16 * t236 - t117 + t16 * t239 + 0.2e1 * t16 * t241;
+		t249 = t64 * M_PI;
+		t253 = t38 * t144 * t7;
+		t258 = t22 * t5;
+		t264 = -t38 * t7 + t6 - 0.3e1 * t194 * t163 + t40 * t172 + t249 * t172 - t3 * t146 - t16 * t253 - t15 * t135 * t56 - t159 * t32 + t2 - 0.2e1 * t16 * t258 + t249 * t182 + t67 * startBlockY * t32;
+		t270 = t60 * t7;
+		t275 = t17 * t144 * t7;
+		t279 = t72 * t7;
+		t282 = t34 * t144 * t7;
+		t284 = t35 * t27;
+		t286 = 0.4e1 * t64 * t140 - 0.2e1 * t16 * t270 + t16 * t130 + 0.2e1 * t16 * t275 + t40 * t182 - t16 * t279 + t16 * t282 + t284 - 0.3e1 * t186 + t192 + t279 - t282;
+		t287 = t35 * startBlockY;
+		t295 = t22 * t27;
+		t299 = t22 * t8;
+		t304 = t17 * t27 * t7;
+		t307 = -0.2e1 * t287 * t199 + 0.2e1 * t249 * t129 - t34 * t7 + 0.4e1 * t249 * t42 + 0.2e1 * t295 + 0.2e1 * t241 - 0.3e1 * t236 + t239 - t253 + 0.4e1 * t299 - t118 - 0.2e1 * t64 * t153 + 0.6e1 * t16 * t304;
+		t309 = t34 * startBlockY;
+		t317 = M_PI * t34;
+		t328 = t309 * n;
+		t330 = -t309 * t105 + t117 * startBlockY * t32 - t7 + 0.4e1 * t39 * t140 + 0.2e1 * t64 * t120 + t45 + t15 * t317 * t7 - 0.2e1 * t249 * t128 - 0.3e1 * t3 * t149 + 0.2e1 * t39 * t28 - 0.3e1 * t194 * t149 - t328 * t146;
+		t342 = t1 * t53;
+		t349 = -0.3e1 * t328 * t149 + t15 * t317 * t56 - t67 - t16 * t284 - 0.3e1 * t328 * t163 + 0.2e1 * t64 * t28 - t15 * t317 * t2 - 0.2e1 * t159 * t342 - t287 * t160 + t133 + 0.2e1 * t258 + 0.2e1 * t270 - 0.2e1 * t275;
+		t371 = -0.6e1 * t304 - t287 * t75 + 0.2e1 * t177 + 0.4e1 * t170 * t129 - 0.2e1 * t15 * t225 * t2 - t287 * t32 - 0.3e1 * t3 * t163 - 0.2e1 * t287 * t342 - 0.2e1 * t16 * t295 + 0.8e1 * t170 * t42 + t88 - 0.2e1 * t16 * t61;
+		t390 = -0.2e1 * t206 + 0.2e1 * t42 - 0.6e1 * t19 - 0.2e1 * t74 * t160 + 0.3e1 * t16 * t125 - 0.2e1 * t74 * t32 - 0.4e1 * t74 * t342 + 0.3e1 * t15 * t149 + 0.2e1 * t41 - t16 * t128 - 0.4e1 * t170 * t128 - t15 * t120 + t78;
+		t411 = -t16 * t129 - 0.2e1 * t16 * t42 - 0.4e1 * t16 * t299 - t16 * t73 + t15 * t108 * t5 - 0.3e1 * t16 * t210 + 0.4e1 * t1 * t42 + t16 * t50 + t15 * t146 - t15 * t153 - 0.2e1 * t31 * t199 - 0.2e1 * t16 * t113;
+		t430 = -t31 * t75 - t16 * t71 - t144 * t7 + 0.3e1 * t15 * t163 + t16 * t47 - t56 * t5 + 0.8e1 * t25 * t140 - t98 * t162 * t5 - 0.3e1 * t27 * t7 + t1 * t172 + t4 * t128 + 0.2e1 * t40 * t129 + 0.2e1 * t22;
+		t441 = n * n;
+		t444 = M_PI * M_PI;
+		t449 = pow(t2 + 0.1e1 + t8, 0.2e1);
+		t453 = pow(t2 - 0.1e1 - t8, 0.2e1);
+
+		u2a = (t2 + t6 - t7 - t9) * deltaRho * t13 * (t63 + t93 + t123 + t156 + t191 + t217 + t244 + t264 + t286 + t307 + t330 + t349 + t371 + t390 + t411 + t430) / t7 / (0.1e1 + t5) / t441 / n / t444 / M_PI / t449 / t453 / t37 / viscosity / (0.1e1 + t17) / 0.2e1;
+
+		t1 = n * M_PI;
+		t3 = sin(t1 * dx);
+		t5 = 0.1e1 / cosh(t1);
+		t6 = t5 * t5;
+		t7 = t6 * t6;
+		t8 = startBlockY * n;
+		t9 = t8 * M_PI;
+		t10 = 0.1e1 / cosh(t9);
+		t11 = t10 * t10;
+		t13 = y * n;
+		t14 = t13 * M_PI;
+		t15 = tanh(t14);
+		t16 = t15 * n;
+		t17 = t16 * M_PI;
+		t18 = t6 * t5;
+		t19 = tanh(t1);
+		t20 = t18 * t19;
+		t21 = tanh(t9);
+		t22 = t10 * t21;
+		t23 = t20 * t22;
+		t26 = 0.1e1 / cosh(t14);
+		t27 = t26 * t26;
+		t28 = t27 * t11;
+		t29 = t28 * t6;
+		t30 = t15 * t15;
+		t31 = t30 * t5;
+		t32 = t19 * t19;
+		t33 = t32 * t10;
+		t34 = t31 * t33;
+		t37 = t27 * n;
+		t38 = t37 * M_PI;
+		t39 = t32 * t19;
+		t40 = t5 * t39;
+		t41 = t40 * t10;
+		t44 = t20 * t10;
+		t47 = t21 * t21;
+		t48 = t27 * t47;
+		t49 = t48 * t6;
+		t50 = t6 * t19;
+		t52 = t15 * t6;
+		t53 = t52 * t19;
+		t56 = t30 * startBlockY;
+		t57 = t56 * n;
+		t58 = M_PI * t19;
+		t59 = t21 * t6;
+		t60 = t58 * t59;
+		t64 = t19 * t10;
+		t65 = t64 * t21;
+		t68 = t27 * t18;
+		t71 = t68 * t22;
+		t74 = -t7 * t11 - 0.4e1 * t17 * t23 - t29 + 0.6e1 * t14 * t34 - 0.2e1 * t38 * t41 - 0.2e1 * t1 * t44 - t49 + 0.2e1 * t50 - 0.4e1 * t14 * t53 - 0.4e1 * t57 * t60 - 0.2e1 * t1 * t18 * t65 + 0.2e1 * t68 * t65 + 0.2e1 * t14 * t71;
+		t75 = t30 * t18;
+		t76 = t75 * t22;
+		t78 = startBlockY * t6;
+		t79 = t78 * t19;
+		t84 = t15 * t18;
+		t85 = t84 * t22;
+		t87 = t27 * startBlockY;
+		t91 = M_PI * t32;
+		t92 = t91 * t59;
+		t95 = t15 * t5;
+		t96 = t39 * t10;
+		t97 = t95 * t96;
+		t99 = t95 * t64;
+		t101 = M_PI * t6;
+		t104 = t75 * t64;
+		t106 = t30 * t11;
+		t107 = t106 * t50;
+		t109 = t15 * startBlockY;
+		t110 = t109 * n;
+		t111 = M_PI * t11;
+		t112 = t6 * t32;
+		t113 = t111 * t112;
+		t116 = M_PI * t27;
+		t117 = t13 * t116;
+		t118 = t87 * n;
+		t121 = 0.2e1 * t76 - 0.4e1 * t17 * t79 - 0.2e1 * t7 * t21 + 0.4e1 * t85 - 0.6e1 * t87 * t1 * t32 - 0.2e1 * t57 * t92 - 0.4e1 * t97 - 0.12e2 * t99 + 0.4e1 * t16 * t101 + 0.2e1 * t104 + 0.2e1 * t107 + 0.2e1 * t110 * t113 + t117 + 0.4e1 * t118 * t60;
+		t123 = t11 * t6;
+		t126 = t5 * t19;
+		t127 = t126 * t22;
+		t130 = M_PI * t7;
+		t132 = t18 * t10;
+		t135 = t27 * t5;
+		t136 = t135 * t10;
+		t138 = t68 * t64;
+		t143 = t130 * t47;
+		t145 = t30 * t7;
+		t146 = t145 * t11;
+		t150 = t5 * t32;
+		t151 = t150 * t22;
+		t155 = 0.2e1 * t1 * t123 - 0.6e1 * t127 - t13 * t101 + t8 * t130 - 0.2e1 * t1 * t132 - 0.2e1 * t136 + 0.2e1 * t138 + 0.6e1 * t118 * t91 * t11 + t57 * t143 + t14 * t146 - 0.4e1 * t17 * t41 - 0.6e1 * t151 + 0.4e1 * t1 * t59;
+		t156 = t47 * t6;
+		t159 = t95 * t10;
+		t161 = M_PI * t47;
+		t162 = t161 * t112;
+		t165 = t40 * t22;
+		t175 = t130 * t11;
+		t177 = t91 * t6;
+		t183 = 0.2e1 * t1 * t156 - 0.4e1 * t159 - 0.2e1 * t110 * t162 - 0.2e1 * t38 * t165 - 0.2e1 * t165 - t7 + 0.2e1 * t110 * t143 + 0.2e1 * t118 * t92 + 0.2e1 * t38 * t79 + t13 * t175 - t57 * t177 + t118 * t177 - t14 * t49 - 0.12e2 * t95 * t65;
+		t186 = t59 * t19;
+		t189 = t32 * t32;
+		t190 = M_PI * t189;
+		t193 = t95 * t22;
+		t199 = t5 * t10;
+		t202 = t30 * t21;
+		t203 = t202 * t6;
+		t206 = t135 * t96;
+		t209 = t135 * t22;
+		t212 = t95 * t33;
+		t214 = t106 * t112;
+		t218 = t31 * t64;
+		t220 = 0.16e2 * t17 * t186 + t118 * t190 * t11 + 0.4e1 * t14 * t193 - 0.6e1 * t31 * t65 + 0.2e1 * t23 - 0.2e1 * t1 * t199 - 0.2e1 * t14 * t203 - 0.2e1 * t14 * t206 - 0.2e1 * t14 * t209 - 0.12e2 * t212 + t214 + 0.2e1 * t13 * t116 * t21 - 0.6e1 * t218;
+		t226 = t202 * t50;
+		t229 = t30 * t47;
+		t230 = t229 * t50;
+		t233 = t68 * t10;
+		t236 = t31 * t96;
+		t241 = t111 * t50;
+		t244 = t101 * t11;
+		t247 = t123 * t32;
+		t250 = t156 * t19;
+		t253 = t57 * t113 + t28 + 0.12e2 * t14 * t99 + 0.2e1 * t37 * t101 - 0.4e1 * t14 * t226 + 0.2e1 * t230 + 0.4e1 * t226 + 0.2e1 * t14 * t233 + 0.2e1 * t14 * t236 + 0.4e1 * t1 * t50 + 0.4e1 * t110 * t241 + 0.4e1 * t16 * t244 + 0.4e1 * t17 * t247 - 0.2e1 * t14 * t250;
+		t256 = t161 * t50;
+		t260 = t101 * t21;
+		t263 = t123 * t19;
+		t268 = t31 * t22;
+		t272 = t229 * t112;
+		t273 = t84 * t64;
+		t275 = M_PI * t30;
+		t276 = t13 * t275;
+		t280 = t15 * t21;
+		t281 = t280 * t50;
+		t283 = t118 * t162 - 0.4e1 * t110 * t256 - t118 * t113 + 0.4e1 * t37 * t260 - 0.2e1 * t14 * t263 - 0.4e1 * t14 * t85 - 0.2e1 * t268 - 0.2e1 * t14 * t136 + t272 + 0.4e1 * t273 + 0.2e1 * t276 * t165 - 0.4e1 * t193 + 0.8e1 * t281;
+		t285 = t30 * t6;
+		t286 = t285 * t32;
+		t288 = t156 * t32;
+		t291 = t101 * t19;
+		t294 = t48 * t50;
+		t296 = t30 * n;
+		t297 = t296 * M_PI;
+		t298 = t132 * t21;
+		t301 = t28 * t50;
+		t303 = t48 * t112;
+		t305 = t28 * t112;
+		t310 = -t8 * t175 - t14 * t286 + 0.2e1 * t1 * t288 + 0.8e1 * t16 * t291 - 0.2e1 * t294 + t156 - 0.2e1 * t297 * t298 - 0.2e1 * t301 - t303 - 0.2e1 * t199 - t305 + 0.2e1 * t71 - 0.2e1 * t276 * t23 - t9 * t288;
+		t314 = t59 * t32;
+		t321 = t135 * t33;
+		t326 = t33 * t21;
+		t333 = t27 * t21;
+		t334 = t333 * t50;
+		t338 = t15 * t11;
+		t339 = t338 * t50;
+		t341 = t27 * t189;
+		t342 = 0.4e1 * t1 * t314 - 0.2e1 * t87 * t1 * t21 - t7 * t47 - 0.6e1 * t321 - 0.4e1 * t87 * t1 * t39 - 0.6e1 * t135 * t326 - t14 * t247 + 0.2e1 * t14 * t165 - 0.2e1 * t236 - 0.4e1 * t334 + 0.2e1 * t57 * t241 + 0.4e1 * t339 + t341;
+		t343 = t15 * t47;
+		t344 = t343 * t112;
+		t346 = t343 * t50;
+		t348 = M_PI * t15;
+		t349 = t13 * t348;
+		t365 = t161 * t6;
+		t372 = M_PI * startBlockY * t6;
+		t374 = 0.2e1 * t344 + 0.4e1 * t346 + 0.12e2 * t349 * t151 - 0.2e1 * t14 * t44 - 0.2e1 * t57 * t256 + 0.4e1 * t1 * t250 + 0.8e1 * t1 * t186 + 0.8e1 * t17 * t263 - 0.2e1 * t57 * t260 - 0.6e1 * t34 - t13 * t365 - 0.2e1 * t1 * t41 - 0.2e1 * t14 * t107 - t296 * t372;
+		t379 = t150 * t10;
+		t388 = t341 * t47;
+		t390 = t96 * t21;
+		t394 = M_PI * t18 * t10;
+		t402 = -0.2e1 * t14 * t23 + t57 * t244 - 0.6e1 * t297 * t379 + 0.2e1 * t296 * t244 - 0.2e1 * t297 * t23 - t1 * t78 + 0.2e1 * t59 + t14 * t388 - 0.2e1 * t135 * t390 - 0.2e1 * t296 * t394 - 0.2e1 * t110 * t175 - t87 * t1 - 0.2e1 * t297 * t44;
+		t403 = t27 * t39;
+		t404 = t403 * t47;
+		t409 = t15 * t7;
+		t410 = t409 * t47;
+		t414 = t333 * t112;
+		t425 = t130 * t21;
+		t429 = t341 * t11;
+		t431 = 0.4e1 * t14 * t404 + 0.2e1 * t296 * t365 - 0.2e1 * t410 - 0.2e1 * t16 * t372 - 0.2e1 * t414 - 0.4e1 * t17 * t165 + t112 + t8 * t143 - 0.6e1 * t38 * t379 - t14 * t214 + 0.4e1 * t13 * t116 * t19 + 0.2e1 * t8 * t425 + 0.2e1 * t132 + t14 * t429;
+		t447 = t126 * t10;
+		t450 = t199 * t21;
+		t455 = M_PI * t5 * t10;
+		t460 = t1 * t5;
+		t463 = -0.6e1 * t118 * t91 * t47 - 0.6e1 * t38 * t151 - 0.2e1 * t297 * t41 - 0.4e1 * t17 * t298 - 0.6e1 * t297 * t151 + t48 - 0.6e1 * t135 * t65 - 0.6e1 * t38 * t447 - 0.2e1 * t1 * t450 + t9 * t247 - 0.2e1 * t37 * t455 - 0.6e1 * t1 * t379 - 0.6e1 * t460 * t326;
+		t464 = t135 * t64;
+		t467 = t403 * t21;
+		t491 = -0.6e1 * t464 + t37 * t372 + 0.8e1 * t467 - 0.6e1 * t1 * t447 - 0.4e1 * t14 * t273 + 0.2e1 * t296 * t177 + 0.2e1 * t37 * t244 - 0.6e1 * t460 * t65 + 0.6e1 * t14 * t151 + 0.8e1 * t16 * t260 - 0.2e1 * t460 * t390 + 0.4e1 * t296 * t291 - 0.12e2 * t95 * t326 - 0.2e1 * t37 * t394;
+		t501 = t202 * t112;
+		t512 = t1 * t7;
+		t518 = t27 * t19;
+		t519 = t518 * t11;
+		t522 = -0.4e1 * t16 * t394 - 0.4e1 * t110 * t260 - 0.4e1 * t95 * t390 - 0.2e1 * t1 * t79 - 0.2e1 * t14 * t501 + 0.2e1 * t297 * t288 - 0.2e1 * t14 * t314 + 0.4e1 * t84 * t65 + 0.6e1 * t276 * t127 + t56 * t512 - 0.2e1 * t38 * t298 + 0.2e1 * t37 * t365 + 0.4e1 * t14 * t519;
+		t540 = t84 * t10;
+		t550 = -0.6e1 * t14 * t464 - t8 * t177 + 0.2e1 * t110 * t244 - 0.4e1 * t14 * t339 - 0.2e1 * t1 * t298 + 0.12e2 * t14 * t212 - 0.2e1 * t38 * t44 - t13 * t177 - 0.4e1 * t87 * t1 * t19 + 0.4e1 * t540 - 0.2e1 * t297 * t165 + 0.2e1 * t296 * t101 - 0.2e1 * t13 * t394 - 0.2e1 * t9 * t314;
+		t557 = t338 * t112;
+		t567 = t518 * t21;
+		t582 = -0.4e1 * t17 * t450 - 0.2e1 * t14 * t557 + 0.4e1 * t110 * t425 + 0.2e1 * t14 * t268 + 0.2e1 * t38 * t247 + t13 * t143 + 0.8e1 * t14 * t567 - 0.4e1 * t9 * t186 + 0.2e1 * t13 * t348 * t7 - 0.2e1 * t209 + 0.4e1 * t14 * t97 + 0.2e1 * t57 * t425 - 0.12e2 * t17 * t379;
+		t587 = t145 * t47;
+		t598 = t145 * t21;
+		t609 = -t57 * t162 - 0.4e1 * t14 * t334 - t57 * t175 + t14 * t587 - 0.4e1 * t14 * t540 - 0.12e2 * t17 * t151 - t146 + 0.2e1 * t14 * t410 - 0.12e2 * t118 * t91 * t21 + 0.2e1 * t14 * t598 + 0.4e1 * t38 * t263 - 0.2e1 * t297 * t450 + 0.4e1 * t14 * t159 + 0.2e1 * t38 * t288;
+		t611 = t52 * t32;
+		t614 = t27 * t32;
+		t615 = t614 * t21;
+		t618 = M_PI * t39;
+		t634 = t285 * t19;
+		t637 = t280 * t112;
+		t639 = t27 * t6;
+		t640 = t639 * t32;
+		t642 = t280 * t6;
+		t645 = -0.2e1 * t14 * t611 + 0.12e2 * t14 * t615 + 0.4e1 * t118 * t618 * t11 - 0.2e1 * t118 * t241 - t145 + 0.4e1 * t118 * t58 * t11 + 0.2e1 * t118 * t256 - 0.2e1 * t14 * t414 + 0.4e1 * t13 * t116 * t39 - 0.2e1 * t14 * t634 + 0.4e1 * t637 - t14 * t640 - 0.4e1 * t14 * t642;
+		t654 = t333 * t6;
+		t673 = -0.2e1 * t13 * t260 - t13 * t275 * t6 + 0.4e1 * t296 * t260 - 0.6e1 * t117 * t151 - 0.2e1 * t14 * t654 + 0.6e1 * t14 * t218 + 0.4e1 * t349 * t165 + 0.4e1 * t38 * t314 - 0.12e2 * t17 * t447 - 0.12e2 * t17 * t127 + 0.2e1 * t13 * t455 + t27 - 0.4e1 * t349 * t23 - 0.6e1 * t31 * t326;
+		t682 = t409 * t11;
+		t702 = t13 * t275 * t7 - 0.2e1 * t117 * t165 + 0.6e1 * t276 * t151 - 0.2e1 * t682 - 0.8e1 * t14 * t281 + 0.2e1 * t297 * t247 - 0.2e1 * t110 * t365 - 0.2e1 * t14 * t230 - 0.4e1 * t14 * t637 + 0.4e1 * t38 * t250 - t87 * t1 * t47 + 0.2e1 * t117 * t23 - 0.2e1 * t8 * t260;
+		t705 = t518 * t47;
+		t716 = t343 * t6;
+		t719 = t614 * t11;
+		t721 = t403 * t11;
+		t726 = t409 * t21;
+		t728 = t338 * t6;
+		t731 = 0.2e1 * t13 * t425 + 0.4e1 * t14 * t705 - t13 * t116 * t6 - 0.8e1 * t110 * t60 - 0.4e1 * t16 * t455 - 0.2e1 * t14 * t76 - 0.2e1 * t14 * t716 + 0.6e1 * t719 + 0.4e1 * t721 + 0.4e1 * t297 * t314 + 0.4e1 * t642 - 0.4e1 * t726 + 0.2e1 * t728 + 0.2e1 * t716;
+		t734 = t106 * t6;
+		t735 = t229 * t6;
+		t740 = t614 * t47;
+		t742 = t31 * t10;
+		t744 = 0.2e1 * t203 + t734 + t735 + t247 + 0.2e1 * t263 - 0.2e1 * t598 - 0.2e1 * t450 - t587 - t14 * t272 + 0.6e1 * t740 + t429 - 0.2e1 * t742 + t286;
+		t747 = t75 * t10;
+		t753 = t341 * t21;
+		t761 = -0.2e1 * t41 - 0.6e1 * t379 + 0.2e1 * t747 + 0.4e1 * t186 + 0.2e1 * t314 + 0.2e1 * t611 - 0.2e1 * t654 + 0.2e1 * t753 - t14 * t735 + 0.2e1 * t250 + t288 + 0.2e1 * t1 * t6 + 0.4e1 * t705 + 0.4e1 * t519;
+		t771 = t639 * t19;
+		t779 = 0.2e1 * t233 + 0.12e2 * t615 + 0.8e1 * t567 + 0.6e1 * t14 * t127 + 0.2e1 * t634 - 0.2e1 * t771 + 0.4e1 * t53 + 0.4e1 * t404 + t388 + 0.2e1 * t44 + 0.8e1 * t38 * t186 + 0.2e1 * t298 + t123;
+		t801 = -0.4e1 * t14 * t346 - 0.6e1 * t447 - 0.6e1 * t38 * t127 + 0.6e1 * t14 * t740 - t14 * t29 + 0.2e1 * t1 * t247 - t14 * t734 - 0.4e1 * t17 * t44 - t640 + t8 * t244 - 0.2e1 * t14 * t344 - 0.4e1 * t110 * t92 + 0.2e1 * t557 - 0.2e1 * t31 * t390;
+		t830 = -0.4e1 * t118 * t58 * t47 - 0.4e1 * t14 * t186 + 0.2e1 * t9 * t263 - 0.2e1 * t9 * t250 + 0.2e1 * t14 * t138 - 0.2e1 * t14 * t104 + 0.4e1 * t17 * t288 + 0.2e1 * t501 + 0.6e1 * t13 * t116 * t32 + 0.2e1 * t37 * t177 + 0.6e1 * t14 * t379 + 0.2e1 * t14 * t41 - t118 * t190 * t47;
+		t854 = -t87 * t1 * t189 - 0.6e1 * t14 * t321 + 0.2e1 * t333 + t13 * t130 + 0.2e1 * t75 * t65 + 0.8e1 * t17 * t314 + 0.2e1 * t109 * t512 + 0.4e1 * t297 * t250 - t8 * t365 + 0.4e1 * t14 * t721 + t6 + 0.4e1 * t16 * t365 - 0.6e1 * t297 * t447 - 0.2e1 * t14 * t301;
+		t883 = 0.4e1 * t37 * t291 - 0.2e1 * t296 * t455 + 0.8e1 * t17 * t250 - 0.2e1 * t118 * t190 * t21 + t87 * t1 * t11 + 0.12e2 * t349 * t127 + 0.6e1 * t14 * t719 + 0.2e1 * t52 + 0.2e1 * t14 * t450 - 0.2e1 * t38 * t23 + 0.4e1 * t297 * t263 + 0.2e1 * t1 * t112 - 0.2e1 * t297 * t79;
+		t910 = -0.2e1 * t13 * t291 - 0.6e1 * t117 * t127 + t285 - 0.2e1 * t13 * t348 * t6 + 0.8e1 * t297 * t186 - t13 * t244 - t57 * t365 - 0.4e1 * t118 * t618 * t47 + 0.2e1 * t14 * t753 + t13 * t116 * t11 + 0.2e1 * t118 * t260 + 0.6e1 * t14 * t447 - 0.2e1 * t206 - 0.8e1 * t118 * t618 * t21;
+		t936 = -0.2e1 * t14 * t771 + 0.2e1 * t14 * t742 + t13 * t116 * t47 - 0.6e1 * t297 * t127 - 0.2e1 * t14 * t728 - t14 * t288 - 0.2e1 * t38 * t450 + 0.6e1 * t614 - 0.2e1 * t14 * t294 + 0.4e1 * t518 - 0.2e1 * t110 * t177 - 0.2e1 * t14 * t747 - 0.8e1 * t118 * t58 * t21;
+		t957 = 0.2e1 * t14 * t682 + 0.4e1 * t14 * t726 + 0.4e1 * t16 * t177 + t13 * t116 * t189 + 0.4e1 * t403 - 0.2e1 * t14 * t298 - t14 * t303 - t118 * t244 - t639 + 0.4e1 * t1 * t263 - 0.2e1 * t409 + t118 * t365 - t14 * t305 + 0.8e1 * t14 * t467;
+		t969 = pow(t5 + 0.1e1 + t19, 0.2e1);
+		t974 = pow(t5 - 0.1e1 - t19, 0.2e1);
+		t978 = n * n;
+		t982 = M_PI * M_PI;
+
+		u2b = deltaRho * t3 * (t910 + t74 + t582 + t310 + t830 + t491 + t883 + t645 + t342 + t957 + t283 + t673 + t220 + t121 + t183 + t609 + t550 + t731 + t374 + t702 + t402 + t431 + t854 + t522 + t761 + t744 + t779 + t463 + t155 + t253 + t936 + t801) / t10 / (0.1e1 + t21) / t969 / t974 / t26 / t978 / n / t982 / M_PI / viscosity / (0.1e1 + t15) / 0.2e1;
+
+		t1 = n * M_PI;
+		t2 = 0.1e1 / cosh(t1);
+		t3 = startBlockY * n;
+		t4 = t3 * M_PI;
+		t5 = tanh(t4);
+		t6 = t2 * t5;
+		t7 = 0.1e1 / cosh(t4);
+		t8 = tanh(t1);
+		t9 = t8 * t7;
+		t13 = sin(t1 * dx);
+		t15 = y * n;
+		t16 = t15 * M_PI;
+		t17 = tanh(t16);
+		t18 = t17 * t17;
+		t19 = t18 * t2;
+		t20 = t19 * startBlockY;
+		t21 = t8 * t8;
+		t22 = t21 * t5;
+		t23 = t1 * t22;
+		t25 = t2 * t2;
+		t26 = t25 * t2;
+		t27 = t18 * t26;
+		t29 = t1 * t5;
+		t31 = 0.1e1 / cosh(t16);
+		t32 = t31 * t31;
+		t33 = t32 * n;
+		t34 = M_PI * t2;
+		t35 = t34 * t21;
+		t38 = M_PI * t18;
+		t41 = t17 * t26;
+		t45 = t17 * startBlockY;
+		t46 = t45 * n;
+		t47 = M_PI * t21;
+		t48 = t47 * t7;
+		t51 = t19 * t8;
+		t53 = t19 * t21;
+		t57 = M_PI * t17;
+		t62 = t18 * n;
+		t65 = -t20 * t23 + t27 * startBlockY * t29 + 0.2e1 * t33 * t35 + t15 * t38 * t26 + 0.2e1 * t41 * startBlockY * t29 - 0.6e1 * t46 * t48 + 0.4e1 * t51 + 0.2e1 * t53 - t15 * t38 * t2 - 0.2e1 * t15 * t57 * t2 - 0.2e1 * t27 + 0.2e1 * t62 * t35;
+		t66 = t62 * M_PI;
+		t67 = t2 * t21;
+		t68 = t67 * t5;
+		t71 = t32 * t2;
+		t72 = t71 * startBlockY;
+		t73 = t8 * t5;
+		t74 = t1 * t73;
+		t77 = t17 * n;
+		t78 = t77 * M_PI;
+		t82 = t17 * t21 * t7;
+		t87 = t18 * startBlockY;
+		t88 = t87 * n;
+		t89 = M_PI * t8;
+		t90 = t89 * t7;
+		t93 = t21 * t8;
+		t97 = t2 * t8;
+		t98 = t97 * t5;
+		t102 = t17 * t2;
+		t103 = t102 * startBlockY;
+		t110 = 0.2e1 * t66 * t68 - 0.2e1 * t72 * t74 + 0.4e1 * t78 * t68 + 0.6e1 * t16 * t82 + 0.2e1 * t1 * t68 - 0.3e1 * t88 * t90 - 0.2e1 * t93 * t7 + 0.2e1 * t2 + 0.8e1 * t78 * t98 - 0.6e1 * t9 - 0.2e1 * t103 * t29 - 0.4e1 * t103 * t74 - 0.2e1 * t103 * t23;
+		t113 = t25 * t8 * t7;
+		t116 = t102 * t73;
+		t123 = M_PI * t26;
+		t127 = M_PI * t93 * t7;
+		t132 = M_PI * t25 * t7;
+		t134 = t33 * M_PI;
+		t140 = -t16 * t113 - t16 * t68 - 0.4e1 * t16 * t116 - 0.4e1 * t17 * t7 - 0.2e1 * t16 * t98 + t15 * t123 * t5 + t15 * t127 + 0.3e1 * t15 * t48 - t15 * t132 + 0.2e1 * t134 * t68 + 0.4e1 * t134 * t98 + 0.4e1 * t102;
+		t141 = t34 * t5;
+		t145 = t18 * t25;
+		t146 = t145 * t7;
+		t148 = t32 * startBlockY;
+		t149 = t148 * n;
+		t154 = t25 * t7;
+		t156 = t102 * t22;
+		t159 = t18 * t93 * t7;
+		t166 = t102 * t21;
+		t169 = t102 * t8;
+		t172 = 0.2e1 * t62 * t141 - t72 * t23 - t16 * t146 - 0.3e1 * t149 * t48 - 0.3e1 * t88 * t48 + 0.2e1 * t154 + 0.4e1 * t156 + t16 * t159 + t15 * t38 * t7 + 0.4e1 * t77 * t34 - t15 * t34 - 0.2e1 * t16 * t166 - 0.4e1 * t16 * t169;
+		t177 = t17 * t8 * t7;
+		t180 = M_PI * t32;
+		t183 = startBlockY * t25;
+		t184 = t183 * t7;
+		t186 = t1 * t8;
+		t192 = t32 * t26;
+		t193 = t192 * t5;
+		t196 = t32 * t21 * t7;
+		t201 = 0.2e1 * t6 + 0.6e1 * t16 * t177 - t15 * t180 * t26 + t66 * t184 - 0.2e1 * t20 * t186 + 0.4e1 * t98 - 0.12e2 * t177 + 0.8e1 * t169 - 0.2e1 * t193 - 0.6e1 * t196 + 0.2e1 * t1 * t2 + 0.2e1 * t67;
+		t202 = t71 * t73;
+		t205 = M_PI * t7;
+		t218 = t145 * t9;
+		t226 = 0.2e1 * t16 * t202 + t15 * t205 - t15 * t180 * t7 + t15 * t180 * t2 + 0.4e1 * t202 + t15 * t123 - 0.3e1 * t149 * t90 - 0.2e1 * t33 * t132 + t134 * t184 - t16 * t218 - 0.2e1 * t72 * t186 - 0.2e1 * t1 * t154 - 0.2e1 * t134 * t113;
+		t228 = t1 * t7;
+		t235 = t2 * startBlockY;
+		t236 = t235 * n;
+		t244 = t19 * t22;
+		t248 = t26 * startBlockY;
+		t252 = -t148 * t228 + 0.2e1 * t33 * t141 - t20 * t29 + 0.2e1 * t1 * t6 - t236 * t47 * t5 - t235 * t29 - 0.2e1 * t236 * t89 * t5 - t3 * t205 - t16 * t244 - 0.2e1 * t20 * t74 + t248 * t1 + 0.4e1 * t66 * t98;
+		t257 = t34 * t8;
+		t265 = t17 * t25;
+		t266 = t265 * t9;
+		t269 = t1 * t21;
+		t277 = t102 * t5;
+		t280 = -t235 * t1 - t149 * t127 + 0.2e1 * t1 * t67 + 0.4e1 * t62 * t257 - t72 * t29 - 0.2e1 * t16 * t51 + 0.4e1 * t1 * t97 - 0.2e1 * t16 * t266 - 0.2e1 * t103 * t269 - 0.2e1 * t45 * t228 + 0.4e1 * t77 * t141 - t72 * t269 - 0.2e1 * t16 * t277;
+		t286 = t265 * t7;
+		t289 = t71 * t21;
+		t291 = t41 * t5;
+		t296 = t32 * t25;
+		t297 = t296 * t7;
+		t307 = -0.2e1 * t1 * t113 - 0.2e1 * t16 * t286 + t16 * t289 + 0.2e1 * t16 * t291 + 0.2e1 * t71 - t16 * t193 + t16 * t297 - t3 * t127 - 0.2e1 * t16 * t156 - 0.2e1 * t235 * t186 - 0.3e1 * t3 * t90 - t19 * t4;
+		t310 = t18 * t8 * t7;
+		t331 = t27 * t4 + 0.3e1 * t16 * t310 + 0.2e1 * t15 * t57 * t26 - 0.2e1 * t192 + 0.8e1 * t77 * t257 + 0.2e1 * t78 * t184 - t16 * t53 + 0.4e1 * t33 * t257 + 0.3e1 * t15 * t90 - t15 * t141 - 0.4e1 * t78 * t113 + 0.2e1 * t244 - t20 * t269;
+		t334 = t19 * t5;
+		t339 = t18 * t21 * t7;
+		t341 = t27 * t5;
+		t347 = t71 * t8;
+		t350 = t32 * t8 * t7;
+		t352 = -0.6e1 * t310 + 0.2e1 * t334 + 0.2e1 * t146 - 0.2e1 * t159 - 0.6e1 * t339 - 0.2e1 * t341 + 0.2e1 * t113 + 0.2e1 * t68 + 0.2e1 * t289 + 0.4e1 * t166 + 0.4e1 * t347 - 0.6e1 * t350;
+		t353 = t71 * t5;
+		t356 = t32 * t93 * t7;
+		t362 = t17 * t93 * t7;
+		t366 = t19 * t73;
+		t369 = t183 * t9;
+		t376 = 0.2e1 * t353 - 0.2e1 * t356 + 0.2e1 * t297 + 0.4e1 * t277 + 0.4e1 * t286 - 0.4e1 * t362 - 0.12e2 * t82 - 0.4e1 * t291 + 0.4e1 * t366 + 0.2e1 * t218 + 0.2e1 * t78 * t369 + 0.2e1 * t62 * t34 - 0.6e1 * t21 * t7;
+		t399 = -0.2e1 * t62 * t132 - 0.2e1 * t66 * t113 + 0.2e1 * t15 * t57 * t7 - 0.3e1 * t16 * t350 + t16 * t353 - 0.2e1 * t32 * t7 - 0.4e1 * t41 + 0.4e1 * t97 + 0.8e1 * t116 - 0.4e1 * t103 * t186 - 0.3e1 * t3 * t48 - t87 * t228;
+		t405 = t71 * t22;
+		t409 = t296 * t9;
+		t421 = -0.2e1 * t26 * t5 + t192 * startBlockY * t29 + t134 * t369 + 0.2e1 * t405 + 0.4e1 * t266 + 0.2e1 * t19 + 0.2e1 * t409 - 0.2e1 * t18 * t7 - t16 * t334 + 0.2e1 * t33 * t34 + 0.4e1 * t77 * t35 + 0.4e1 * t1 * t98 + t66 * t369;
+		t442 = 0.2e1 * t16 * t362 - t15 * t35 - 0.2e1 * t15 * t257 - 0.2e1 * t46 * t127 - 0.6e1 * t46 * t90 - t88 * t127 - 0.3e1 * t16 * t196 + t16 * t409 + 0.3e1 * t16 * t339 - 0.2e1 * t7 - 0.2e1 * t102 * t4 - t235 * t269;
+		t460 = -0.2e1 * t16 * t366 + t16 * t341 - 0.4e1 * t77 * t132 + t1 * t184 + 0.2e1 * t16 * t347 + t4 * t113 + t248 * t29 - t71 * t4 - 0.2e1 * t26 + 0.2e1 * t41 * t4 - t16 * t356 + t16 * t405 + t192 * t4;
+		t471 = n * n;
+		t474 = M_PI * M_PI;
+		t479 = pow(t2 + 0.1e1 + t8, 0.2e1);
+		t483 = pow(t2 - 0.1e1 - t8, 0.2e1);
+
+		u3a = -(t2 + t6 - t7 - t9) * deltaRho * t13 * (t65 + t110 + t140 + t172 + t201 + t226 + t252 + t280 + t307 + t331 + t352 + t376 + t399 + t421 + t442 + t460) / t7 / (0.1e1 + t5) / t471 / n / t474 / M_PI / t479 / t483 / t31 / (0.1e1 + t17) / 0.2e1;
+
+		t1 = n * M_PI;
+		t3 = sin(t1 * dx);
+		t5 = y * n;
+		t6 = t5 * M_PI;
+		t7 = tanh(t6);
+		t8 = t7 * t7;
+		t9 = 0.1e1 / cosh(t1);
+		t10 = t8 * t9;
+		t11 = tanh(t1);
+		t12 = t11 * t11;
+		t13 = startBlockY * n;
+		t14 = t13 * M_PI;
+		t15 = 0.1e1 / cosh(t14);
+		t16 = t12 * t15;
+		t17 = t10 * t16;
+		t20 = t9 * t9;
+		t21 = t20 * t20;
+		t22 = t8 * t21;
+		t23 = t15 * t15;
+		t24 = t22 * t23;
+		t26 = tanh(t14);
+		t27 = t22 * t26;
+		t30 = t10 * t15;
+		t33 = 0.1e1 / cosh(t6);
+		t34 = t33 * t33;
+		t35 = t34 * t11;
+		t36 = t35 * t26;
+		t39 = t34 * n;
+		t40 = t39 * M_PI;
+		t41 = t26 * t20;
+		t42 = t41 * t11;
+		t45 = t8 * n;
+		t46 = t45 * M_PI;
+		t47 = t26 * t26;
+		t48 = t47 * t20;
+		t49 = t48 * t11;
+		t52 = t23 * t20;
+		t54 = t34 * t47;
+		t55 = t54 * t20;
+		t57 = t7 * t9;
+		t58 = t15 * t26;
+		t59 = t57 * t58;
+		t64 = M_PI * t7;
+		t65 = t5 * t64;
+		t66 = t9 * t11;
+		t67 = t66 * t58;
+		t70 = t8 * t47;
+		t71 = t20 * t12;
+		t72 = t70 * t71;
+		t74 = 0.6e1 * t6 * t17 + t6 * t24 + 0.2e1 * t6 * t27 + 0.2e1 * t6 * t30 + 0.8e1 * t6 * t36 + 0.8e1 * t40 * t42 + 0.4e1 * t46 * t49 + 0.2e1 * t52 - t6 * t55 + 0.4e1 * t6 * t59 - 0.2e1 * t6 * t49 + 0.12e2 * t65 * t67 - t6 * t72;
+		t75 = t34 * startBlockY;
+		t76 = t75 * n;
+		t77 = t12 * t11;
+		t78 = M_PI * t77;
+		t82 = t9 * t15;
+		t83 = t82 * t26;
+		t86 = t48 * t12;
+		t88 = M_PI * t12;
+		t93 = t7 * startBlockY;
+		t94 = t93 * n;
+		t95 = M_PI * t11;
+		t96 = t95 * t41;
+		t99 = t20 * t9;
+		t100 = t8 * t99;
+		t101 = t100 * t58;
+		t104 = t34 * t26;
+		t105 = t104 * t71;
+		t108 = t7 * t20;
+		t109 = t108 * t11;
+		t112 = t7 * n;
+		t113 = t112 * M_PI;
+		t114 = startBlockY * t20;
+		t115 = t114 * t11;
+		t118 = t1 * t9;
+		t119 = t11 * t15;
+		t120 = t119 * t26;
+		t123 = t99 * t11;
+		t124 = t123 * t58;
+		t127 = t77 * t15;
+		t128 = t10 * t127;
+		t130 = t52 * t12;
+		t133 = -0.8e1 * t76 * t78 * t26 - 0.2e1 * t40 * t83 - t6 * t86 - 0.12e2 * t76 * t88 * t26 + 0.2e1 * t54 - 0.8e1 * t94 * t96 - 0.2e1 * t6 * t101 - 0.2e1 * t6 * t105 - 0.4e1 * t6 * t109 - 0.4e1 * t113 * t115 - 0.6e1 * t118 * t120 - 0.2e1 * t6 * t124 - 0.4e1 * t128 + 0.2e1 * t40 * t130;
+		t138 = t8 * startBlockY;
+		t139 = t138 * n;
+		t140 = M_PI * t21;
+		t141 = t140 * t47;
+		t146 = M_PI * t20;
+		t151 = t57 * t127;
+		t153 = t57 * t119;
+		t157 = t100 * t119;
+		t159 = t34 * t9;
+		t160 = t159 * t119;
+		t164 = 0.6e1 * t76 * t88 * t23 + t139 * t141 + 0.4e1 * t101 - t1 * t114 - t75 * t1 + 0.2e1 * t45 * t146 + 0.2e1 * t1 * t71 - 0.8e1 * t151 - 0.24e2 * t153 + 0.4e1 * t112 * t146 + 0.4e1 * t157 - 0.12e2 * t160 + 0.6e1 * t6 * t67;
+		t165 = t159 * t58;
+		t167 = t159 * t127;
+		t169 = t127 * t26;
+		t173 = t34 * t99;
+		t174 = t173 * t119;
+		t178 = t7 * t99;
+		t179 = t178 * t58;
+		t186 = t173 * t58;
+		t188 = t9 * t77;
+		t189 = t188 * t58;
+		t192 = t99 * t15;
+		t193 = t192 * t26;
+		t196 = t20 * t11;
+		t197 = t104 * t196;
+		t199 = -0.4e1 * t165 - 0.4e1 * t167 - 0.4e1 * t159 * t169 - 0.4e1 * t105 + 0.2e1 * t6 * t174 + 0.2e1 * t20 + 0.8e1 * t179 + 0.4e1 * t174 + 0.2e1 * t6 * t128 - 0.2e1 * t6 * t157 + 0.4e1 * t186 - 0.4e1 * t113 * t189 - 0.4e1 * t113 * t193 - 0.8e1 * t197;
+		t205 = t10 * t119;
+		t208 = t35 * t47;
+		t211 = M_PI * t23;
+		t212 = t211 * t71;
+		t216 = t7 * t23;
+		t217 = t216 * t71;
+		t219 = t8 * t26;
+		t220 = t219 * t71;
+		t222 = t57 * t16;
+		t225 = t10 * t58;
+		t230 = t7 * t26;
+		t231 = t230 * t71;
+		t233 = 0.4e1 * t173 * t120 + t5 * t140 + 0.6e1 * t6 * t205 + 0.4e1 * t6 * t208 + t139 * t212 + 0.2e1 * t94 * t212 + 0.4e1 * t217 + 0.4e1 * t220 - 0.24e2 * t222 + 0.2e1 * t72 - 0.4e1 * t225 - 0.6e1 * t75 * t1 * t12 + 0.8e1 * t231;
+		t234 = t9 * t12;
+		t235 = t234 * t15;
+		t238 = t16 * t26;
+		t241 = t66 * t15;
+		t244 = t52 * t11;
+		t250 = M_PI * t26 * t20;
+		t253 = t211 * t20;
+		t255 = t88 * t41;
+		t258 = M_PI * t34;
+		t259 = t5 * t258;
+		t262 = t88 * t20;
+		t266 = t12 * t12;
+		t267 = t34 * t266;
+		t268 = t267 * t23;
+		t272 = -0.6e1 * t1 * t235 - 0.6e1 * t118 * t238 - 0.6e1 * t1 * t241 + 0.4e1 * t40 * t244 + 0.4e1 * t76 * t96 - 0.2e1 * t139 * t250 + t139 * t253 + 0.2e1 * t76 * t255 + t259 + 0.16e2 * t113 * t42 + t76 * t262 - 0.12e2 * t10 * t238 + t6 * t268 + 0.12e2 * t6 * t153;
+		t276 = t8 * t23;
+		t277 = t276 * t196;
+		t279 = M_PI * t47;
+		t280 = t279 * t20;
+		t294 = t219 * t20;
+		t299 = 0.4e1 * t112 * t253 + 0.4e1 * t277 - t5 * t280 - 0.6e1 * t46 * t235 + 0.2e1 * t1 * t52 - 0.12e2 * t67 - t5 * t146 - t75 * t1 * t47 - 0.2e1 * t1 * t115 + 0.12e2 * t6 * t222 - 0.2e1 * t6 * t294 - 0.4e1 * t82 - t13 * t280;
+		t300 = t234 * t58;
+		t308 = t140 * t26;
+		t313 = M_PI * startBlockY * t20;
+		t321 = t279 * t71;
+		t324 = M_PI * t99 * t15;
+		t329 = 0.6e1 * t6 * t300 - 0.2e1 * t40 * t124 - 0.2e1 * t1 * t192 + t13 * t141 + 0.2e1 * t13 * t308 - 0.12e2 * t300 - t45 * t313 + 0.4e1 * t1 * t41 + 0.2e1 * t1 * t48 + t13 * t140 - t76 * t212 + t76 * t321 - 0.2e1 * t39 * t324 + 0.2e1 * t39 * t280;
+		t336 = t41 * t12;
+		t342 = t70 * t196;
+		t344 = t219 * t196;
+		t346 = t276 * t71;
+		t350 = t188 * t15;
+		t359 = -0.4e1 * t6 * t179 + 0.4e1 * t124 + 0.4e1 * t1 * t336 - 0.4e1 * t189 + 0.2e1 * t76 * t250 + 0.4e1 * t342 + 0.8e1 * t344 + 0.2e1 * t346 - 0.2e1 * t1 * t82 - 0.2e1 * t46 * t350 + 0.2e1 * t39 * t146 - 0.2e1 * t6 * t244 + 0.4e1 * t1 * t196;
+		t365 = t230 * t196;
+		t367 = t159 * t16;
+		t369 = t34 * t23;
+		t370 = t369 * t71;
+		t374 = t369 * t196;
+		t376 = t54 * t71;
+		t378 = t54 * t196;
+		t380 = t178 * t119;
+		t382 = t211 * t196;
+		t385 = t216 * t196;
+		t387 = -0.12e2 * t205 + 0.4e1 * t45 * t250 - t14 * t86 - 0.8e1 * t59 + 0.16e2 * t365 - 0.12e2 * t367 - 0.2e1 * t370 + 0.4e1 * t46 * t244 - 0.4e1 * t374 - 0.2e1 * t376 - 0.4e1 * t378 + 0.8e1 * t380 + 0.2e1 * t139 * t382 + 0.8e1 * t385;
+		t389 = t7 * t47;
+		t390 = t389 * t71;
+		t392 = t34 * t12;
+		t393 = t392 * t47;
+		t396 = t389 * t196;
+		t408 = t178 * t15;
+		t411 = t7 * t21;
+		t412 = t411 * t47;
+		t415 = t34 * t20;
+		t416 = t415 * t12;
+		t422 = 0.4e1 * t390 + 0.6e1 * t6 * t393 + 0.8e1 * t396 + 0.2e1 * t139 * t308 - 0.2e1 * t46 * t83 + 0.4e1 * t94 * t382 + 0.2e1 * t40 * t86 - 0.4e1 * t6 * t344 - 0.4e1 * t6 * t408 + 0.2e1 * t6 * t412 - t6 * t416 - 0.2e1 * t1 * t350 - 0.2e1 * t118 * t169;
+		t423 = t123 * t15;
+		t428 = t279 * t196;
+		t452 = -0.2e1 * t40 * t423 + 0.2e1 * t45 * t253 - 0.2e1 * t139 * t428 - 0.4e1 * t6 * t42 - 0.4e1 * t94 * t428 + 0.4e1 * t108 + 0.2e1 * t46 * t86 - 0.2e1 * t5 * t324 + t5 * t141 + 0.4e1 * t6 * t151 + 0.4e1 * t5 * t258 * t77 - 0.2e1 * t45 * t324 - 0.6e1 * t259 * t67 + 0.2e1 * t45 * t280;
+		t461 = t57 * t15;
+		t473 = t411 * t26;
+		t476 = t140 * t23;
+		t484 = 0.4e1 * t112 * t280 - 0.4e1 * t112 * t324 - 0.2e1 * t112 * t313 + 0.4e1 * t6 * t461 - 0.2e1 * t6 * t378 - 0.6e1 * t40 * t235 - t5 * t258 * t20 + 0.6e1 * t5 * t258 * t12 + 0.4e1 * t6 * t473 - t13 * t476 + 0.2e1 * t94 * t141 + 0.2e1 * t5 * t258 * t26 + 0.2e1 * t369;
+		t485 = t35 * t23;
+		t491 = t8 * t20;
+		t492 = t491 * t12;
+		t500 = M_PI * t9 * t15;
+		t511 = t216 * t20;
+		t517 = 0.4e1 * t6 * t485 + t14 * t130 - 0.6e1 * t40 * t300 - t6 * t492 - 0.2e1 * t5 * t64 * t20 - 0.2e1 * t6 * t374 - 0.2e1 * t39 * t500 - 0.6e1 * t40 * t241 - 0.4e1 * t6 * t231 - 0.4e1 * t6 * t380 - 0.6e1 * t46 * t300 - 0.2e1 * t6 * t511 + 0.8e1 * t46 * t42 + 0.12e2 * t392;
+		t529 = t1 * t21;
+		t536 = M_PI * t8;
+		t537 = t5 * t536;
+		t544 = 0.8e1 * t112 * t250 - 0.24e2 * t57 * t238 + t39 * t313 + 0.2e1 * t48 + 0.4e1 * t46 * t336 + 0.8e1 * t178 * t120 + t138 * t529 - 0.8e1 * t57 * t169 - 0.2e1 * t40 * t350 - t6 * t376 + 0.6e1 * t537 * t67 - 0.4e1 * t6 * t385 - 0.2e1 * t6 * t167;
+		t551 = t70 * t20;
+		t553 = t276 * t20;
+		t556 = t389 * t20;
+		t573 = -0.12e2 * t159 * t238 - 0.4e1 * t10 * t169 + 0.4e1 * t100 * t120 + 0.2e1 * t551 + 0.2e1 * t553 + 0.4e1 * t294 + 0.4e1 * t556 - t5 * t262 - 0.6e1 * t76 * t88 * t47 + 0.4e1 * t113 * t86 + 0.6e1 * t537 * t300 + 0.4e1 * t76 * t95 * t23 + 0.4e1 * t40 * t336 + 0.4e1 * t40 * t49;
+		t580 = t411 * t23;
+		t600 = t146 * t11;
+		t605 = -0.4e1 * t94 * t250 + 0.2e1 * t6 * t580 - 0.12e2 * t10 * t120 + 0.4e1 * t94 * t308 - 0.4e1 * t113 * t83 + 0.4e1 * t5 * t258 * t11 - 0.2e1 * t1 * t193 + 0.2e1 * t71 - t6 * t370 - t75 * t1 * t266 + t75 * t1 * t23 + 0.4e1 * t45 * t600 + 0.2e1 * t537 * t189;
+		t611 = t369 * t20;
+		t626 = -0.2e1 * t1 * t99 * t120 - 0.2e1 * t6 * t423 - t6 * t611 + t13 * t253 - 0.8e1 * t461 - 0.2e1 * t55 - 0.2e1 * t611 - 0.2e1 * t416 - 0.2e1 * t46 * t189 + 0.2e1 * t267 - 0.12e2 * t17 - 0.2e1 * t14 * t336 - t6 * t346 - t6 * t130;
+		t638 = t34 * t77;
+		t639 = t638 * t26;
+		t646 = t230 * t20;
+		t651 = -0.4e1 * t113 * t423 - 0.4e1 * t139 * t96 - 0.2e1 * t139 * t255 - 0.24e2 * t57 * t120 + 0.2e1 * t1 * t130 + 0.8e1 * t6 * t639 + 0.2e1 * t45 * t262 + 0.4e1 * t511 - 0.8e1 * t473 + 0.8e1 * t646 - 0.12e2 * t241 + 0.4e1 * t193 + 0.4e1 * t423;
+		t652 = t267 * t47;
+		t654 = t638 * t47;
+		t657 = t415 * t11;
+		t659 = t491 * t11;
+		t662 = t392 * t26;
+		t664 = t173 * t15;
+		t673 = 0.2e1 * t652 + 0.8e1 * t654 + 0.8e1 * t109 - 0.4e1 * t657 + 0.4e1 * t659 + 0.16e2 * t36 + 0.24e2 * t662 + 0.4e1 * t664 + 0.8e1 * t485 + 0.8e1 * t208 + 0.2e1 * t1 * t20 + 0.2e1 * t86 + 0.4e1 * t49 - 0.2e1 * t415;
+		t699 = t392 * t23;
+		t702 = 0.12e2 * t6 * t662 - 0.2e1 * t5 * t250 - 0.2e1 * t6 * t217 - 0.4e1 * t14 * t42 - 0.12e2 * t113 * t235 - 0.12e2 * t113 * t300 - 0.12e2 * t159 * t120 - t139 * t476 - 0.2e1 * t6 * t659 - 0.2e1 * t6 * t336 - 0.2e1 * t76 * t382 + 0.2e1 * t76 * t428 + 0.6e1 * t6 * t699;
+		t727 = t104 * t20;
+		t730 = -t139 * t262 + 0.2e1 * t6 * t225 - 0.4e1 * t6 * t646 + 0.2e1 * t39 * t262 + 0.4e1 * t39 * t600 + 0.2e1 * t6 * t83 - 0.2e1 * t94 * t321 - 0.4e1 * t75 * t1 * t11 + 0.2e1 * t492 + 0.8e1 * t35 + 0.4e1 * t1 * t49 + 0.2e1 * t5 * t500 + 0.2e1 * t5 * t308 - 0.2e1 * t6 * t727;
+		t734 = t22 * t47;
+		t755 = 0.8e1 * t113 * t244 + t6 * t734 + 0.2e1 * t491 - 0.2e1 * t46 * t124 - 0.2e1 * t1 * t83 - 0.2e1 * t22 + 0.4e1 * t6 * t654 + 0.2e1 * t1 * t86 - 0.2e1 * t537 * t124 + 0.4e1 * t196 - t5 * t536 * t20 - 0.12e2 * t113 * t241 + 0.6e1 * t6 * t241;
+		t756 = t108 * t12;
+		t783 = -0.2e1 * t6 * t756 - 0.4e1 * t113 * t124 - 0.2e1 * t21 - 0.6e1 * t259 * t300 - 0.12e2 * t113 * t67 - 0.2e1 * t40 * t189 - t139 * t280 + 0.4e1 * t41 - 0.2e1 * t21 * t47 - 0.4e1 * t76 * t95 * t47 - t139 * t321 - 0.2e1 * t6 * t193 - 0.4e1 * t75 * t1 * t77 - 0.2e1 * t6 * t220;
+		t795 = M_PI * t266;
+		t806 = t638 * t23;
+		t809 = t267 * t26;
+		t811 = -0.2e1 * t40 * t193 + 0.8e1 * t638 - 0.2e1 * t6 * t165 + 0.2e1 * t34 - 0.2e1 * t259 * t189 - t76 * t795 * t47 - 0.4e1 * t21 * t26 - 0.4e1 * t113 * t350 + 0.2e1 * t94 * t253 + 0.2e1 * t39 * t253 + 0.8e1 * t806 + 0.12e2 * t699 + 0.4e1 * t809;
+		t816 = t100 * t15;
+		t823 = t159 * t15;
+		t828 = -0.4e1 * t727 + 0.4e1 * t756 + 0.4e1 * t336 + 0.8e1 * t42 + 0.4e1 * t816 + 0.16e2 * t639 - 0.4e1 * t412 - 0.4e1 * t580 - 0.2e1 * t24 + 0.8e1 * t408 - 0.4e1 * t823 - 0.12e2 * t235 - 0.4e1 * t350 - 0.4e1 * t30;
+		t849 = 0.2e1 * t268 + 0.12e2 * t393 - 0.2e1 * t734 - 0.4e1 * t83 - 0.4e1 * t27 + 0.4e1 * t244 + 0.2e1 * t130 - 0.4e1 * t112 * t500 + 0.4e1 * t65 * t189 - 0.4e1 * t65 * t124 - 0.2e1 * t94 * t476 - 0.6e1 * t6 * t367 + 0.8e1 * t1 * t42;
+		t877 = 0.4e1 * t39 * t250 + 0.2e1 * t6 * t189 + 0.2e1 * t259 * t124 - 0.2e1 * t6 * t556 + t76 * t795 * t23 - 0.2e1 * t76 * t795 * t26 - 0.2e1 * t21 * t23 - t6 * t551 - t6 * t553 + 0.2e1 * t5 * t64 * t21 - 0.4e1 * t6 * t197 + 0.4e1 * t113 * t130 + 0.4e1 * t192 + 0.2e1 * t40 * t115;
+		t904 = t5 * t476 - t13 * t262 - 0.4e1 * t6 * t396 + 0.4e1 * t76 * t78 * t23 + 0.4e1 * t104 - 0.2e1 * t14 * t49 - 0.8e1 * t6 * t365 + 0.2e1 * t14 * t244 - 0.2e1 * t6 * t390 - 0.6e1 * t46 * t241 - 0.2e1 * t6 * t342 + 0.2e1 * t93 * t529 - 0.4e1 * t94 * t255;
+		t933 = 0.2e1 * t6 * t350 + 0.2e1 * t6 * t809 + 0.6e1 * t6 * t235 - 0.2e1 * t6 * t277 - 0.2e1 * t45 * t500 - 0.2e1 * t94 * t280 + 0.8e1 * t112 * t600 + 0.4e1 * t1 * t244 - 0.2e1 * t46 * t115 - t5 * t253 - 0.2e1 * t6 * t657 - 0.6e1 * t6 * t160 - 0.2e1 * t75 * t1 * t26 + 0.12e2 * t65 * t300;
+		t962 = -0.2e1 * t94 * t262 + 0.2e1 * t6 * t664 + t5 * t536 * t21 - 0.2e1 * t1 * t423 + 0.4e1 * t6 * t806 + 0.2e1 * t6 * t186 - 0.2e1 * t6 * t816 - 0.6e1 * t46 * t67 - 0.2e1 * t13 * t250 + 0.8e1 * t113 * t336 + 0.4e1 * t112 * t262 - 0.6e1 * t40 * t67 - 0.8e1 * t76 * t95 * t26;
+		t988 = t5 * t258 * t266 + t5 * t258 * t47 - 0.4e1 * t411 + t5 * t258 * t23 + t6 * t652 - 0.4e1 * t76 * t78 * t47 - 0.2e1 * t46 * t423 - 0.2e1 * t46 * t193 - t76 * t253 + t76 * t280 + 0.8e1 * t113 * t49 - 0.2e1 * t5 * t600 - 0.2e1 * t6 * t823 + 0.2e1 * t46 * t130;
+		t1001 = pow(t9 + 0.1e1 + t11, 0.2e1);
+		t1004 = pow(t9 - 0.1e1 - t11, 0.2e1);
+		t1011 = n * n;
+		t1015 = M_PI * M_PI;
+
+		u3b = -deltaRho * t3 * (t74 + t933 + t544 + t299 + t164 + t849 + t904 + t702 + t651 + t452 + t828 + t199 + t387 + t359 + t962 + t133 + t877 + t811 + t484 + t422 + t605 + t783 + t730 + t626 + t272 + t673 + t573 + t233 + t329 + t755 + t988 + t517) / t15 / (0.1e1 + t26) / t1001 / t1004 / t33 / (0.1e1 + t7) / t1011 / n / t1015 / M_PI / 0.2e1;
+
+		if ( y > startBlockY ) {
+			u2=u2b;u3=u3b;
+		}
+		else {
+			u2=u2a;u3=u3a;
+		}
+
+		u5 = (double)-2*n*M_PI*(viscosity*u2 + u3)*cos(n*M_PI*x);
+
+		*pressure +=u5;
+
+	}
+	
+	if ( y > startBlockY ) {
+	    *pressure += deltaRho*dx*(0.5-y);
+	 } else {
+	    *pressure += deltaRho*dx*(0.5-startBlockY);
+	}
+
+}
+
+void _AnalyticBlock_Construct( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
+	AnalyticBlock*           self           = (AnalyticBlock*)analyticSolution;
+	FeVariable*              velocityField;
+	FeVariable*              pressureField;
+
+	/* Construct Parent */
+	_AnalyticSolution_Construct( self, cf, data );
+
+	/* Create Analytic Fields */
+	velocityField = Stg_ComponentFactory_ConstructByName( cf, "VelocityField", FeVariable, True, data ); 
+	AnalyticSolution_CreateAnalyticField( self, velocityField, _AnalyticBlock_VelocityFunction );
+
+	pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
+	AnalyticSolution_CreateAnalyticField( self, pressureField, _AnalyticBlock_PressureFunction );
+
+	self->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_DefaultNew( Name name ) {
+	return _AnalyticSolution_New(
+			sizeof(AnalyticBlock),
+			AnalyticBlock_Type,
+			_AnalyticSolution_Delete,
+			_AnalyticSolution_Print,
+			_AnalyticSolution_Copy,
+			_AnalyticBlock_DefaultNew,
+			_AnalyticBlock_Construct,
+			_AnalyticSolution_Build,
+			_AnalyticSolution_Initialise,
+			_AnalyticSolution_Execute,
+			_AnalyticSolution_Destroy,
+			name );
+}
+
+Index _PICellerator_AnalyticBlock_Register( PluginsManager* pluginsManager ) {
+	return PluginsManager_Submit( pluginsManager, AnalyticBlock_Type, "0", _AnalyticBlock_DefaultNew );
+}
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/AnalyticBlock/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/AnalyticBlock/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,71 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := $(shell find * -type d -prune ! -name .svn ) 
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# What to call the plugin
+modName := $(shell basename `pwd`)
+mod = ${PROJECT}_${modName}
+
+# Where to put header files
+includes = ${PROJECT}/${modName}
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN PETSC MPI XML 
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/AnalyticColumn/AnalyticColumn.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,336 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: AnalyticColumn.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#define MAX_FOURIER_TERMS 220
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PICellerator.h>
+
+#include <assert.h>
+
+const Type AnalyticColumn_Type = "AnalyticColumn";
+
+typedef struct {
+	__AnalyticSolution
+	Dimension_Index         dim;
+	double                  sigma;
+	double                  viscosity;
+	double                  startColumnX;
+	double                  endColumnX;
+	double                  startColumnZ;
+	double                  endColumnZ;
+} AnalyticColumn;
+
+void AnalyticColumn_Constants( void* analyticSolution, double n, double* C1, double* C2, double* C3, double *C4 ) {
+	AnalyticColumn*          self           = (AnalyticColumn*)analyticSolution;
+	double                  viscosity      = self->viscosity;
+	double                  deltaRho       = self->sigma;
+	double                  x0             = 0.5 * ( self->startColumnX + self->endColumnX );
+	double                  dx             = self->endColumnX - self->startColumnX;
+	double                  factor = M_PI * n;
+
+	*C1 = 0.2e1 * deltaRho * sin(factor * dx / 0.2e1) * cos(factor * x0) * exp(-factor) * (0.2e1 * exp(-factor) + 0.2e1 + factor) * pow(exp(-factor) + 0.1e1, -0.2e1) / viscosity * pow(M_PI, -0.3e1) * pow(n, -0.3e1); 
+		
+	*C2 = -0.2e1 * (-0.2e1 * exp(-factor) + factor * exp(-factor) - 0.2e1) * deltaRho * sin(factor * dx / 0.2e1) * cos(factor * x0) * pow(exp(-factor) + 0.1e1, -0.2e1) / viscosity * pow(M_PI, -0.3e1) * pow(n, -0.3e1); 
+		
+	*C3 = -0.2e1 * deltaRho * sin(factor * dx / 0.2e1) * cos(factor * x0) * exp(-factor) / viscosity * pow(n, -0.2e1) * pow(M_PI, -0.2e1) / (exp(-factor) + 0.1e1); 
+		
+	*C4 = 0.2e1 * deltaRho * sin(factor * dx / 0.2e1) * cos(factor * x0) / viscosity * pow(n, -0.2e1) * pow(M_PI, -0.2e1) / (exp(-factor) + 0.1e1);
+}
+
+
+void _AnalyticColumn_VelocityFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* velocity ) {
+	AnalyticColumn*         self           = (AnalyticColumn*)analyticSolution;
+	double                  n, m;
+	double                  x, y, z;
+	double                  C1, C2, C3, C4;
+	double                  viscosity      = self->viscosity;
+	double                  sigma          = self->sigma;
+	double                  deltaRho;
+	double                  x0;
+	double                  z0;
+	double                  dx;
+	double                  dz;
+	double                  u1, u2, u3;
+	double                  factor;
+	
+	/* Find coordinate of node */
+	x = coord[ I_AXIS ];
+	y = coord[ J_AXIS ];
+	z = coord[ K_AXIS ];
+
+	x0 = 0.5 * ( self->startColumnX + self->endColumnX );
+	dx = self->endColumnX - self->startColumnX;
+	z0 = 0.5 * ( self->startColumnZ + self->endColumnZ );
+	dz = self->endColumnZ - self->startColumnZ;
+
+	/* Initialise */
+	if ( self->dim == 2 ) {
+		velocity[ I_AXIS ] = 0.0;
+		velocity[ J_AXIS ] = 0.0;
+
+		for( n = 1.0 ; n < MAX_FOURIER_TERMS ; n++ ) {
+			factor = M_PI * n;
+
+			AnalyticColumn_Constants( self, n, &C1, &C2, &C3, &C4 );
+
+			u1 = (-0.2e1 * sigma * sin(factor * x0 + factor * dx / 0.2e1) + 0.2e1 * sigma * sin(factor * x0 - factor * dx / 0.2e1) + C1 * exp(factor * y) * pow(n, 0.3e1) * pow(M_PI, 0.3e1) * viscosity + C2 * exp(-factor * y) * pow(n, 0.3e1) * pow(M_PI, 0.3e1) * viscosity + C3 * exp(factor * y) * y * pow(n, 0.3e1) * pow(M_PI, 0.3e1) * viscosity + C4 * exp(-factor * y) * y * pow(n, 0.3e1) * pow(M_PI, 0.3e1) * viscosity) * pow(n, -0.3e1) * pow(M_PI, -0.3e1) / viscosity;
+
+			u2 = (-C1 * factor * exp(factor * y) + C2 * factor * exp(-factor * y) - C3 * factor * exp(factor * y) * y - C3 * exp(factor * y) + C4 * factor * exp(-factor * y) * y - C4 * exp(-factor * y)) / n / M_PI;
+			
+			u2 *= sin( factor * x );
+			velocity[ I_AXIS ] += u2;
+			u1 *= cos( factor * x );
+			velocity[ J_AXIS ] += u1;
+		}
+	}
+	else {
+		double L1,kn,km; 
+		double Am,Ap,Bm,Bp,C,D,E;
+
+		velocity[ I_AXIS ] = 0.0;
+		velocity[ J_AXIS ] = 0.0;
+		velocity[ K_AXIS ] = 0.0;
+
+		for ( n = 0 ; n < 45 ; n++ ) {
+			for ( m = 0 ; m < 45 ; m++ ) {
+
+				if ( n != 0 && m!=0 ){
+					deltaRho = 4.0*sigma*sin((double)n*M_PI*dx)*sin((double)m*M_PI*dz)/(double)n/M_PI/(double)m/M_PI; 
+				} 
+				else if ( n == 0 && m != 0 ) { 
+					deltaRho = 2.0*sigma*dx*sin((double)m*M_PI*dz)/(double)m/M_PI; 
+				}
+				else if  ( n != 0 && m == 0 ) { 
+					deltaRho = 2.0*sigma*dz*sin((double)n*M_PI*dx)/(double)n/M_PI; 
+				} 
+				else { 
+					deltaRho = sigma*dx*dz; 
+				} 
+				kn = M_PI * (double)n; 
+				km = M_PI * (double)m;
+				
+				L1 = M_PI * sqrt( (double)(n*n + m*m)); 
+				
+				Am = exp((y-2.0)*L1)-exp(-y*L1);
+				Ap = exp((y-2.0)*L1)+exp(-y*L1); 
+				Bm = exp((y-1.0)*L1)-exp(-(y+1.0)*L1); 
+				Bp = exp((y-1.0)*L1)+exp(-(y+1.0)*L1);
+
+				C = (exp(-y*L1)-1.0)*(exp((y-1.0)*L1)-1.0); 
+				D = exp((y-1.0)*L1)-exp(-y*L1); 
+				E = (1.0+exp(-L1)); 
+				
+				u1 = (n!=0 || m!=0) 
+					?  -( y*Am+(y-1.0)*Bm )*deltaRho/( 2*viscosity*L1*E*E ) - C*deltaRho/(viscosity*L1*L1*E) 
+					:  0.0; 
+				if ( m != 0 ){ 
+					u2 = ( y*Ap+(y-1.0)*Bp )*deltaRho*km/( 2*viscosity*L1*L1*E*E ) - D*deltaRho*km/(2*viscosity*L1*L1*L1*E);
+				} 
+				else { 
+					u2 = 0.0; 
+				} 
+				
+				if ( n != 0 ){ 
+					u3 = ( y*Ap+(y-1.0)*Bp )*deltaRho*kn/( 2*viscosity*L1*L1*E*E ) - D*deltaRho*kn/(2*viscosity*L1*L1*L1*E);
+				} 
+				else { 
+					u3 = 0.0; 
+				} 
+
+				u1 *= cos(n*M_PI*x)*cos(m*M_PI*z); 
+				velocity[ J_AXIS ] += u1;
+				u2 *= cos(n*M_PI*x)*sin(m*M_PI*z);
+				velocity[ K_AXIS ] += u2;
+				u3 *= sin(n*M_PI*x)*cos(m*M_PI*z);
+				velocity[ I_AXIS ] += u3;
+			}
+		}
+	}
+}
+
+void _AnalyticColumn_PressureFunction( void* analyticSolution, FeVariable* analyticFeVariable, double* coord, double* pressure ) {
+	AnalyticColumn*          self           = (AnalyticColumn*)analyticSolution;
+	double                  viscosity      = self->viscosity;
+	double                  sigma          = self->sigma;
+	double                  n, m;
+	double                  x, y, z;
+	double                  C1, C2, C3, C4;
+	double                  deltaRho;
+	double                  x0, z0;
+	double                  dx, dz;
+	double                  u2, u3, u4;
+	double                  pp;
+	double                  factor;
+	
+	/* Find coordinate of node */
+	x = coord[ I_AXIS ];
+	y = coord[ J_AXIS ];
+	z = coord[ K_AXIS ];
+
+	x0 = 0.5 * ( self->startColumnX + self->endColumnX );
+	dx = self->endColumnX - self->startColumnX;
+	z0 = 0.5 * ( self->startColumnZ + self->endColumnZ );
+	dz = self->endColumnZ - self->startColumnZ;
+
+	/* Initialise */
+	*pressure = 0.0;
+
+	if ( self->dim == 2 ) {
+		for( n = 1.0 ; n < MAX_FOURIER_TERMS ; n++ ) {
+			factor = M_PI * n;
+
+			AnalyticColumn_Constants( self, n, &C1, &C2, &C3, &C4 );
+
+			u2 = (-C1 * factor * exp(factor * y) + C2 * factor * exp(-factor * y) - C3 * factor * exp(factor * y) * y - C3 * exp(factor * y) + C4 * factor * exp(-factor * y) * y - C4 * exp(-factor * y)) / n / M_PI;
+			
+			u3 = -viscosity * (-C1 * exp(factor * y) + C2 * exp(-factor * y) - C3 * exp(factor * y) * y + C4 * exp(-factor * y) * y);
+			*pressure += (double)( -2.0* viscosity * factor * u2 - u3*2.0*factor )*cos( factor * x );
+		}
+	}
+	else {
+		double L1,kn,km; 
+		double Am,Ap,Bm,Bp,C,D,E;
+
+		for ( n = 0 ; n < 45 ; n++ ) {
+			for ( m = 0 ; m < 45 ; m++ ) {
+
+				if ( n!=0 && m!=0 ){
+					deltaRho = 4.0*sigma*sin((double)n*M_PI*dx)*sin((double)m*M_PI*dz)/(double)n/M_PI/(double)m/M_PI; 
+				} 
+				else if ( n==0 && m !=0) { 
+					deltaRho = 2.0*sigma*dx*sin((double)m*M_PI*dz)/(double)m/M_PI; 
+				}
+				else if  ( n!=0 && m ==0) { 
+					deltaRho = 2.0*sigma*dz*sin((double)n*M_PI*dx)/(double)n/M_PI; 
+				} 
+				else { 
+					deltaRho = sigma*dx*dz; 
+				} 
+				kn = M_PI * (double)n; 
+				km = M_PI * (double)m;
+				
+				L1 = M_PI * sqrt( (double)(n*n + m*m)); 
+				
+				Am = exp((y-2.0)*L1)-exp(-y*L1);
+				Ap = exp((y-2.0)*L1)+exp(-y*L1); 
+				Bm = exp((y-1.0)*L1)-exp(-(y+1.0)*L1); 
+				Bp = exp((y-1.0)*L1)+exp(-(y+1.0)*L1);
+
+				C = (exp(-y*L1)-1.0)*(exp((y-1.0)*L1)-1.0); 
+				D = exp((y-1.0)*L1)-exp(-y*L1); 
+				E = (1.0+exp(-L1)); 
+				
+				if ( m != 0 ){ 
+					u2 = ( y*Ap+(y-1.0)*Bp )*deltaRho*km/( 2*viscosity*L1*L1*E*E ) - D*deltaRho*km/(2*viscosity*L1*L1*L1*E);
+				} 
+				else { 
+					u2 = 0.0; 
+				} 
+				
+				if ( n != 0 ){ 
+					u3 = ( y*Ap+(y-1.0)*Bp )*deltaRho*kn/( 2*viscosity*L1*L1*E*E ) - D*deltaRho*kn/(2*viscosity*L1*L1*L1*E);
+				} 
+				else { 
+					u3 = 0.0; 
+				} 
+				
+				u4 = (n == 0 && m == 0 ) 
+					?  deltaRho*(y-0.5) 
+					:  -( y*Ap+(y-1.0)*Bp )*deltaRho/( E*E ) + 2.0*D*deltaRho/(L1*E) ; 
+				
+				pp = -u4-2.0*viscosity*(kn*u3+km*u2); 
+				pp *= cos(n*M_PI*x)*cos(m*M_PI*z); 
+				*pressure += pp; /* total pressure */
+			}
+		}
+	}
+}
+
+	
+void _AnalyticColumn_Construct( void* analyticSolution, Stg_ComponentFactory* cf, void* data ) {
+	AnalyticColumn*          self           = (AnalyticColumn*)analyticSolution;
+	FeVariable*              velocityField;
+	FeVariable*              pressureField;
+
+	/* Construct Parent */
+	_AnalyticSolution_Construct( self, cf, data );
+
+	/* Create Analytic Fields */
+	velocityField = Stg_ComponentFactory_ConstructByName( cf, "VelocityField", FeVariable, True, data ); 
+	AnalyticSolution_CreateAnalyticField( self, velocityField, _AnalyticColumn_VelocityFunction );
+
+	pressureField = Stg_ComponentFactory_ConstructByName( cf, "PressureField", FeVariable, True, data ); 
+	AnalyticSolution_CreateAnalyticField( self, pressureField, _AnalyticColumn_PressureFunction );
+
+	self->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_DefaultNew( Name name ) {
+	return _AnalyticSolution_New(
+			sizeof(AnalyticColumn),
+			AnalyticColumn_Type,
+			_AnalyticSolution_Delete,
+			_AnalyticSolution_Print,
+			_AnalyticSolution_Copy,
+			_AnalyticColumn_DefaultNew,
+			_AnalyticColumn_Construct,
+			_AnalyticSolution_Build,
+			_AnalyticSolution_Initialise,
+			_AnalyticSolution_Execute,
+			_AnalyticSolution_Destroy,
+			name );
+}
+
+Index _PICellerator_AnalyticColumn_Register( PluginsManager* pluginsManager ) {
+	return PluginsManager_Submit( pluginsManager, AnalyticColumn_Type, "0", _AnalyticColumn_DefaultNew );
+}
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/AnalyticColumn/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/AnalyticColumn/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,71 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := $(shell find * -type d -prune ! -name .svn ) 
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# What to call the plugin
+modName := $(shell basename `pwd`)
+mod = ${PROJECT}_${modName}
+
+# Where to put header files
+includes = ${PROJECT}/${modName}
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN PETSC MPI XML 
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/AnalyticPressureVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/AnalyticPressureVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="analyticPressureColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Black Purple DarkRed Orange Yellow</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="analyticPressureMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">AnalyticPressureField</param>
+			<param name="ColourMap">analyticPressureColourMap</param>
+		</struct>
+		<struct name="analyticPressureColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">analyticPressureColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="AnalyticPressureVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>analyticPressureMap</param>
+				<param>border</param>
+				<param>analyticPressureColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/AnalyticVelocityMagnitudeVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/AnalyticVelocityMagnitudeVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="analyticVelocityMagnitudeColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Purple Blue Green Yellow Orange Red Black</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="analyticVelocityMagnitudeMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">AnalyticVelocityMagnitudeField</param>
+			<param name="ColourMap">analyticVelocityMagnitudeColourMap</param>
+			<param name="resolution">128</param>
+		</struct>
+		<struct name="analyticVelocityArrows">
+			<param name="Type">lucVectorArrows</param>
+			<param name="VectorVariable">AnalyticVelocityField</param>
+			<param name="Colour">black</param>
+			<param name="arrowHeadSize">0.15</param>	
+			<param name="lengthScale">0.15</param>	
+		</struct>
+		<struct name="analyticVelocityMagnitudeColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">analyticVelocityMagnitudeColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="AnalyticVelocityMagnitudeVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>analyticVelocityMagnitudeMap</param>
+				<param>border</param>
+				<param>analyticVelocityArrows</param>
+				<param>analyticVelocityMagnitudeColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/AnalyticViewports.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/AnalyticViewports.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,22 @@
+<!-- Rayleigh-Taylor app input file -->
+
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>../VelocityMagnitudeVP.xml</include>
+	<include>../PressureVP.xml</include>
+	<include>./AnalyticVelocityMagnitudeVP.xml</include>
+	<include>./AnalyticPressureVP.xml</include>
+	<include>./PressureErrorVP.xml</include>
+	<include>./VelocityErrorMagnitudeVP.xml</include>
+	<include>../window.xml</include>
+	<struct name="components" mergeType="merge">
+		<struct name="window" mergeType="merge">
+			<list name="Viewport">
+				<param>VelocityMagnitudeVP AnalyticVelocityMagnitudeVP VelocityErrorMagnitudeVP</param>
+				<param>PressureVP AnalyticPressureVP PressureErrorVP</param>
+			</list>
+		</struct>
+	</struct>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/PressureErrorVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/PressureErrorVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="pressureErrorColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Purple Blue Green Yellow Orange Red Black</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="pressureErrorMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">ErrorPressureField</param>
+			<param name="ColourMap">pressureErrorColourMap</param>
+			<param name="resolution">128</param>
+		</struct>
+		<struct name="pressureErrorColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">pressureErrorColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="PressureErrorVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>pressureErrorMap</param>
+				<param>border</param>
+				<param>pressureErrorColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/VelocityErrorMagnitudeVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/VelocityErrorMagnitudeVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="velocityErrorMagnitudeColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Purple Blue Green Yellow Orange Red Black</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="velocityErrorMagnitudeMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">ErrorVelocityFieldMagnitude</param>
+			<param name="ColourMap">velocityErrorMagnitudeColourMap</param>
+			<param name="resolution">128</param>
+		</struct>
+		<struct name="velocityErrorMagnitudeColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">velocityErrorMagnitudeColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="VelocityErrorMagnitudeVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>velocityErrorMagnitudeMap</param>
+				<param>border</param>
+				<param>velocityErrorMagnitudeColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of1.PressureField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of1.PressureField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
+Timestep 1: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of1.VelocityField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of1.VelocityField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'VelocityField-ErrorMagnitudeField' is outside a tolerance 0.0001.
+Timestep 1: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.0001.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of2.PressureField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of2.PressureField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
+Timestep 1: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of2.VelocityField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticBlock.0of2.VelocityField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'VelocityField-ErrorMagnitudeField' is outside a tolerance 0.0001.
+Timestep 1: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.0001.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of1.PressureField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of1.PressureField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
+Timestep 1: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of1.VelocityField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of1.VelocityField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'VelocityField-ErrorMagnitudeField' is outside a tolerance 0.0001.
+Timestep 1: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.0001.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of2.PressureField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of2.PressureField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
+Timestep 1: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of2.VelocityField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticColumn.0of2.VelocityField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'VelocityField-ErrorMagnitudeField' is outside a tolerance 0.0001.
+Timestep 1: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.0001.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticColumn3D.0of1.PressureField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticColumn3D.0of1.PressureField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
+Timestep 1: Total integrated value of 'PressureField-ErrorMagnitudeField' is within a tolerance 0.2.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testAnalyticColumn3D.0of1.VelocityField-ErrorFile.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testAnalyticColumn3D.0of1.VelocityField-ErrorFile.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Timestep 0: Total integrated value of 'VelocityField-ErrorMagnitudeField' is outside a tolerance 0.0001.
+Timestep 1: Total integrated value of 'VelocityField-ErrorMagnitudeField' is within a tolerance 0.0001.
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testRayTay2D-i686.0of1.denseMaterialCentroid.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testRayTay2D-i686.0of1.denseMaterialCentroid.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,3 @@
+#       Timestep            Time          Volume       CentroidX       CentroidY       CentroidZ
+               1               0          0.0698        0.499859        0.462836               0
+               2         8.93795          0.0694         0.49841        0.429483               0
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testRayTay2D.0of1.denseMaterialCentroid.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testRayTay2D.0of1.denseMaterialCentroid.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,3 @@
+#       Timestep            Time          Volume       CentroidX       CentroidY       CentroidZ
+               1               0          0.0698        0.499859        0.462835               0
+               2          8.9377          0.0694        0.498411        0.429484               0
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testRayTay3D.0of1.denseMaterialCentroid.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testRayTay3D.0of1.denseMaterialCentroid.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,3 @@
+#       Timestep            Time          Volume       CentroidX       CentroidY       CentroidZ
+               1               0        0.014038        0.500444        0.468008        0.499153
+               2         9.45228        0.013806        0.500059        0.433079        0.498888
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testRayTaySuperimposedBall2D-invert.0of1.lightMaterialCentroid.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testRayTaySuperimposedBall2D-invert.0of1.lightMaterialCentroid.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,3 @@
+#       Timestep            Time          Volume       CentroidX       CentroidY       CentroidZ
+               1               0        0.929314        0.500049        0.502686               0
+               2         8.92749        0.929314         0.50005        0.505428               0
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/expected/testRayTaySuperimposedBall2D.0of1.denseMaterialCentroid.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/expected/testRayTaySuperimposedBall2D.0of1.denseMaterialCentroid.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,3 @@
+#       Timestep            Time          Volume       CentroidX       CentroidY       CentroidZ
+               1               0       0.0706858        0.500163        0.464306               0
+               2         8.90839       0.0706858        0.500205        0.428504               0
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,79 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 409 2007-01-17 13:01:26Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+subdirs = AnalyticColumn AnalyticBlock
+
+modName = $(shell basename `pwd | sed s/tests//g`)
+
+checks = \
+	testAnalyticBlock.0of1.sh \
+	testAnalyticBlock.0of2.sh \
+	testAnalyticColumn.0of1.sh \
+	testAnalyticColumn.0of2.sh \
+	testAnalyticColumn3D.0of1.sh \
+	testRayTay3D.0of1.sh \
+	testRayTaySuperimposedBall2D.0of1.sh \
+	testRayTaySuperimposedBall2D-invert.0of1.sh
+
+ifeq (${MACHINE},i686)
+	# i686 archs have weaker floating point calculations
+	checks += testRayTay2D-i686.0of1.sh 
+else
+	checks += testRayTay2D.0of1.sh 
+endif
+
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT} 
+
+XMLS_TARGET_DIR = ${EXAMPLES_DIR}/${modName}/tests
+XMLS = $(wildcard *.xml)
+
+packages = STGERMAIN PETSC MPI XML MATH DL HYPRE
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testAnalyticBlock.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testAnalyticBlock.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testAnalyticBlock.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 "PICellerator ./testAnalyticBlock.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testAnalyticBlock.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testAnalyticBlock.0of2.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testAnalyticBlock.0of2.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 "PICellerator ./testAnalyticBlock.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testAnalyticBlock.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testAnalyticBlock.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,96 @@
+<!-- Rayleigh-Taylor app input file -->
+
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>StgFEM/ElementLayout.xml          </include>
+	<include>StgFEM/ConstantMesh.xml           </include>
+	<include>StgFEM/LinearMesh.xml             </include>
+	<include>StgFEM/VelocityField.xml          </include>
+	<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>
+
+	<list name="plugins">
+		<!-- Solver Plugins -->
+		<param>PICellerator_AnalyticBlock</param>
+				
+		<!-- Output Plugins -->
+		<param>StgFEM_FrequentOutput</param>	
+		<param>StgFEM_CPUTime</param>
+	</list>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="buoyancyForceTerm">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="gravity">1.0</param>
+		</struct>
+		<struct name="everywhere">
+			<param name="Type">Everywhere</param>
+		</struct>
+		<struct name="block">
+			<param name="Type">Box</param>
+			<param name="startX"> minX </param> <param name="endX"> endBlockX </param>
+			<param name="startY"> startBlockY </param> <param name="endY"> maxY </param>
+			<param name="startZ"> minZ </param> <param name="endY"> maxZ </param>
+		</struct>
+		<struct name="lightMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">everywhere</param>
+			<param name="density">0.0</param>
+		</struct>		
+		<struct name="denseMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">block</param>
+			<param name="density">1.0</param>
+		</struct>		
+	</struct>
+
+	<param name="journal.info.Context-verbose">true</param>
+	<param name="journal.debug">f</param>
+	<param name="journal-enable-branch.debug.StgFEM">t</param>
+	<param name="journal-level-branch.debug.StgFEM"> 2 </param>
+	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
+
+	<!-- general simulation parameters -->
+	<param name="maxTimeSteps"> 1 </param>
+	<param name="dumpEvery"> 1 </param>
+	<param name="outputPath"> ./output </param>
+	
+	<param name="endBlockX"> 0.5 </param>
+	<param name="startBlockY"> 0.8 </param>
+
+	<!-- general decomposition parameters -->
+	<param name="dim"> 2 </param>
+	<!-- mesh parameters -->
+	<param name="elementResI"> 10 </param>
+	<param name="elementResJ"> 10 </param>
+	<param name="elementResK"> 10 </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>
+	<param name="buildElementNodeTbl"> True </param>
+
+	<!-- gauss integration point swarm parameters -->
+	<param name="gaussParticlesX"> 2 </param>
+	<param name="gaussParticlesY"> 2 </param>
+	<param name="gaussParticlesZ"> 2 </param>
+	
+	<!-- Swarm parameters -->
+	<param name="particlesPerCell"> 20 </param>
+	<param name="VelocityField-Tolerance">1e-4</param>
+	<param name="PressureField-Tolerance">0.2</param>
+	<!-- Ok, now setup the Boundary conditions -->
+	<include> ../velocityBCs.freeslip.xml </include>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testAnalyticColumn.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testAnalyticColumn.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testAnalyticColumn.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 "PICellerator ./testAnalyticColumn.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testAnalyticColumn.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testAnalyticColumn.0of2.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testAnalyticColumn.0of2.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 "PICellerator ./testAnalyticColumn.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testAnalyticColumn.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testAnalyticColumn.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,99 @@
+<!-- Rayleigh-Taylor app input file -->
+
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>StgFEM/ElementLayout.xml          </include>
+	<include>StgFEM/ConstantMesh.xml           </include>
+	<include>StgFEM/LinearMesh.xml             </include>
+	<include>StgFEM/VelocityField.xml          </include>
+	<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>
+
+	<list name="plugins">
+		<!-- Solver Plugins -->
+		<param>PICellerator_AnalyticColumn</param>
+				
+		<!-- Output Plugins -->
+		<param>StgFEM_FrequentOutput</param>	
+		<param>StgFEM_CPUTime</param>
+	</list>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="buoyancyForceTerm">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="gravity">1.0</param>
+		</struct>
+		<struct name="everywhere">
+			<param name="Type">Everywhere</param>
+		</struct>
+		<struct name="column">
+			<param name="Type">Box</param>
+			<param name="startX"> startColumnX </param> <param name="endX"> endColumnX </param>
+			<param name="startY"> minY </param> <param name="endY"> maxY </param>
+			<param name="startZ"> startColumnZ </param> <param name="endZ"> endColumnZ </param>
+		</struct>
+		<struct name="lightMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">everywhere</param>
+			<param name="density">0.0</param>
+		</struct>		
+		<struct name="denseMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">column</param>
+			<param name="density">1.0</param>
+		</struct>		
+	</struct>
+
+	<param name="journal.info.Context-verbose">true</param>
+	<param name="journal.debug">f</param>
+	<param name="journal-enable-branch.debug.StgFEM">t</param>
+	<param name="journal-level-branch.debug.StgFEM"> 2 </param>
+	<param name="journal-level.info.Stg_ComponentFactory"> 2 </param>
+
+	<!-- general simulation parameters -->
+	<param name="maxTimeSteps"> 1 </param>
+	<param name="dumpEvery"> 1 </param>
+	<param name="outputPath"> ./output </param>
+	
+	<param name="startColumnX"> 0.0 </param>
+	<param name="endColumnX"> 0.5 </param>
+	<param name="startColumnZ"> 0.0 </param>
+	<param name="endColumnZ"> 0.5 </param>
+
+	<!-- general decomposition parameters -->
+	<param name="dim"> 2 </param>
+	<!-- mesh parameters -->
+	<param name="elementResI"> 10 </param>
+	<param name="elementResJ"> 10 </param>
+	<param name="elementResK"> 10 </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>
+	<param name="buildElementNodeTbl"> True </param>
+
+	<!-- gauss integration point swarm parameters -->
+	<param name="gaussParticlesX"> 2 </param>
+	<param name="gaussParticlesY"> 2 </param>
+	<param name="gaussParticlesZ"> 2 </param>
+	
+	<!-- Swarm parameters -->
+	<param name="particlesPerCell"> 20 </param>
+	<param name="VelocityField-Tolerance">1e-4</param>
+	<param name="PressureField-Tolerance">0.2</param>
+
+	<!-- Ok, now setup the Boundary conditions -->
+	<include> ../velocityBCs.freeslip.xml </include>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testAnalyticColumn3D.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testAnalyticColumn3D.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testAnalyticColumn3D.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 "PICellerator ./testAnalyticColumn.xml --dim=3" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testRayTay.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testRayTay.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,13 @@
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>../RayTay_Example.xml</include>
+	
+	<list name="plugins" mergeType="merge">
+		<param>PICellerator_MaterialCentroid</param>
+	</list>
+
+	<param name="CentroidMaterial">denseMaterial</param>
+	<param name="maxTimeSteps"> 2 </param>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testRayTay2D-i686.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testRayTay2D-i686.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testRayTay2D.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 "PICellerator ./testRayTay.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testRayTay2D.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testRayTay2D.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testRayTay2D.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 "PICellerator ./testRayTay.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testRayTay3D.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testRayTay3D.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testRayTay3D.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 "PICellerator ./testRayTay.xml --dim=3" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testRayTaySuperimposedBall-invert.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testRayTaySuperimposedBall-invert.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,16 @@
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>../RayTay_Example-flip1.xml</include>
+	
+	<list name="plugins" mergeType="merge">
+		<param>PICellerator_MaterialCentroid</param>
+	</list>
+
+	<param name="MaterialCentroid_Swarm">picIntegrationPoints</param>
+	<param name="CentroidMaterial">lightMaterial</param>
+	<param name="maxTimeSteps"> 2 </param>
+
+	<param name="outputPath">./output</param>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testRayTaySuperimposedBall.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testRayTaySuperimposedBall.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,15 @@
+<!-- DTD to validate against -->
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>../RayTay_Example-test1.xml</include>
+	
+	<list name="plugins" mergeType="merge">
+		<param>PICellerator_MaterialCentroid</param>
+	</list>
+
+	<param name="CentroidMaterial">denseMaterial</param>
+	<param name="maxTimeSteps"> 2 </param>
+
+	<param name="outputPath">./output</param>
+
+</StGermainData>	
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testRayTaySuperimposedBall2D-invert.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testRayTaySuperimposedBall2D-invert.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testRayTay2D.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 "PICellerator ./testRayTaySuperimposedBall-invert.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/tests/testRayTaySuperimposedBall2D.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/tests/testRayTaySuperimposedBall2D.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testRayTay2D.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 "PICellerator ./testRayTaySuperimposedBall.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/velocityBCs.freeslip.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/velocityBCs.freeslip.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/velocityBCs.freeslipSides.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/velocityBCs.freeslipSides.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,89 @@
+<?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">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">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>
+		</list>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/RayleighTaylor/window.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/RayleighTaylor/window.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 	
+	<list name="plugins" mergeType="merge">
+		<param>lucPlugin</param>
+	</list>
+	<struct name="components" mergeType="merge">
+		<struct name="renderingEngine">
+			<param name="Type">lucRenderingEngineGL</param>
+		</struct>
+		<struct name="imageOutput">
+			<param name="Type">lucOutputPNG</param>
+		</struct>
+		<struct name="window">
+			<param name="Type">lucDefaultWindow</param>
+			<param name="RenderingEngine">renderingEngine</param>
+			<list name="OutputFormat">
+				<param>imageOutput</param>
+			</list>
+			<param name="height">640</param>
+			<param name="width">640</param>
+			<param name="backgroundColour">white</param>
+		</struct>
+		<struct name="movie">
+			<param name="Type">lucEncoderLibfame</param>
+			<param name="Window">window</param>
+		</struct>	
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/Makefile.def
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/Makefile.def	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,20 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Victorian Partnership for Advanced Computing (VPAC) Ltd, Australia
+## (C) 2003 All Rights Reserved
+##
+## <copyright-release-tag>
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+def_sub = # tests
+
+modName := $(shell basename `pwd` )
+modName := $(shell echo ${modName} | cut -c 1 | tr '[:lower:]' '[:upper:]' )$(shell echo ${modName} | cut -c 2- ) 
+
+def_mod = ${PROJECT}_${modName}
+def_inc = ${PROJECT}/${modName}
+
+def_srcs = $(wildcard *.c)
+
+def_hdrs = $(wildcard *.h)
diff -r 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/ParticleDensityVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/ParticleDensityVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,40 @@
+<!-- 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>
+		<struct name="densityColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Red Blue</param>
+			<param name="dynamicRange">False</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="particleDots">
+			<param name="Type">lucSwarmViewer</param>
+			<param name="Swarm">materialSwarm</param>
+			<param name="ColourVariable">materialSwarm-Density</param>
+			<param name="ColourMap">densityColourMap</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="ParticleDensityVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">camera</param>
+			<list name="DrawingObject">
+				<param>particleDots</param>
+				<param>border</param>
+			</list>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/TemperatureAndVelocityArrowsVP.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/TemperatureAndVelocityArrowsVP.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<struct name="components" mergeType="merge">
+		<struct name="temperatureVPCamera">
+			<param name="Type">lucCamera</param>
+			<param name="CentreFieldVariable">TemperatureField</param>
+			<param name="coordZ">1.5</param>
+		</struct>
+		<struct name="temperatureColourMap">
+			<param name="Type">lucColourMap</param>
+			<param name="colours">Blue White Red</param>
+			<param name="dynamicRange">true</param>
+		</struct>
+		<!-- Drawing Objects -->
+		<struct name="temperatureMap">
+			<param name="Type">lucScalarField</param>
+			<param name="FieldVariable">TemperatureField</param>
+			<param name="ColourMap">temperatureColourMap</param>
+			<param name="resolution">128</param>
+		</struct>
+		<struct name="velocityArrows">
+			<param name="Type">lucVectorArrows</param>
+			<param name="VectorVariable">VelocityField</param>
+			<param name="Colour">black</param>
+			<param name="arrowHeadSize">0.15</param>	
+			<param name="lengthScale">0.15</param>	
+		</struct>
+		<struct name="temperatureBorder">
+			<param name="Type">lucFieldVariableBorder</param>
+			<param name="FieldVariable">TemperatureField</param>
+		</struct>
+		<struct name="temperatureColourBar">
+			<param name="Type">lucColourBar</param>
+			<param name="ColourMap">temperatureColourMap</param>
+		</struct>
+		<!-- Put these althogether in a viewport -->
+		<struct name="TemperatureAndVelocityArrowsVP">
+			<param name="Type">lucViewport</param>
+			<param name="Camera">temperatureVPCamera</param>
+			<list name="DrawingObject">
+				<param>temperatureMap</param>
+				<param>temperatureBorder</param>
+				<param>velocityArrows</param>
+				<param>temperatureColourBar</param>
+			</list>
+		</struct>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/ThermoChem.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/ThermoChem.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 
+	<!-- Component Stuff -->
+	<include>StgFEM/ElementLayout.xml          </include>
+	<include>StgFEM/ConstantMesh.xml           </include>
+	<include>StgFEM/LinearMesh.xml             </include>
+	<include>StgFEM/VelocityField.xml          </include>
+	<include>StgFEM/TemperatureField.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>
+	<include>StgFEM/TempAdvDiff.xml            </include>
+	
+	<!-- Load the plugin that sets up the app, plus any others you require -->
+	<list name="plugins">
+		<!-- Output Plugins -->
+		<param>StgFEM_FrequentOutput</param>	
+		<param>StgFEM_CPUTime</param>	
+		<param>StgFEM_StandardConditionFunctions</param>	
+	</list>
+
+	<struct name="components" mergeType="merge">
+		<struct name="buoyancyForceTerm">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="TemperatureField">TemperatureField</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="gravity">gravity</param>
+		</struct>
+		<struct name="everywhere">
+			<param name="Type">Everywhere</param>
+		</struct>
+		<struct name="box">
+			<param name="Type">Box</param>
+			<param name="startX"> minX </param> <param name="endX"> maxX </param>
+			<param name="startY"> minY </param> <param name="endY"> 0.025 </param>
+		</struct>
+		<struct name="ambientMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">everywhere</param>
+			<param name="density">0.0</param>
+			<param name="alpha">1.0</param>
+		</struct>		
+		<struct name="denseMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">box</param>
+			<param name="density">1.0</param>
+			<param name="alpha">1.0</param>
+		</struct>		
+	</struct>
+
+	<!-- Simulation control -->
+	<param name="maxTimeSteps"> 100000000 </param>
+	<param name="outputPath"> ./output </param>
+	<param name="dumpEvery"> 1 </param>	
+	
+	<param name="gravity"> 1.0 </param>
+	<param name="Ra"> 3e5 </param>
+	
+	<param name="courantFactor"> 0.25 </param>	
+	
+	<!-- Journal Control -->
+	<param name="journal.info.Context-verbose">True</param>
+	<param name="journal-level.info.Stg_ComponentFactory"> 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>
+	
+	<!-- Geometry & Mesh setup -->
+	<param name="dim"> 2 </param>
+	<param name="elementResI"> 64 </param>
+	<param name="elementResJ"> 32 </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"> 2.0 </param>
+	<param name="maxY"> 1.0 </param>
+	<param name="maxZ"> 1.0 </param>
+	<param name="allowUnbalancing"> True </param>
+
+	<!-- Swarm parameters -->
+	<param name="particlesPerCell"> 20 </param>
+	<param name="seed"> 13 </param>
+
+	<!-- Set up BCs -->
+	<include> temperatureBCs.xml </include>
+	<include> temperatureICs.xml </include>
+	<include> velocityFreeslipBCs.xml </include>
+
+	<!-- Integration Scheme configuration -->
+	<param name="gaussParticlesX"> 2 </param>
+	<param name="gaussParticlesY"> 2 </param>
+	<param name="gaussParticlesZ"> 2 </param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/demo.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/demo.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 	
+	<include>./ThermoChem.xml</include>
+	<include>./ParticleDensityVP.xml</include>
+	<include>./TemperatureAndVelocityArrowsVP.xml</include>
+	<include>./window.xml</include>
+	<struct name="components" mergeType="merge">
+		<struct name="window" mergeType="merge">
+			<list name="Viewport">
+				<param>TemperatureAndVelocityArrowsVP</param>
+				<param>ParticleDensityVP</param>
+			</list>
+		</struct>
+	</struct>
+	<param name="outputPath">./output</param>
+	
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,80 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+include Makefile.def
+
+subdirs = ${def_sub}
+
+modName := $(shell basename `pwd` )
+mod = ${def_mod}
+includes = ${def_inc}
+
+SRCS = ${def_srcs}
+HDRS = ${def_hdrs}
+
+XMLS_TARGET_DIR = ${EXAMPLES_DIR}/${modName}
+XMLS = ${wildcard *.xml}
+
+PROJ_LIBS = lib${PROJECT}Update.so lib${PROJECT}Materials.so
+EXTERNAL_INCLUDES = ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${PETSC_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} 
+
+EXTERNAL_LIBS = \
+	${STGFEM_RPATH} ${STGFEM_LIBS} \
+	${STGFEM_RPATH} ${STGERMAIN_LIBS} \
+	${PETSC_RPATH} ${PETSC_LIBS} \
+	${MPI_RPATH} ${MPI_LIBS} \
+	${XML_LIBS} 
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+examples_xml = demo.xml
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/temperatureBCs.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/temperatureBCs.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,34 @@
+<?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">
+	
+	<struct name="temperatureBCs">
+		<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">temperature</param>
+						<param name="type">double</param>
+						<param name="value"> 1 </param>
+					</struct>
+				</list>
+			</struct>
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> top </param>
+				<list name="variables">
+					<struct>
+						<param name="name">temperature</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>				
+		</list>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/temperatureICs.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/temperatureICs.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,44 @@
+<?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">
+	
+	<struct name="temperatureICs">
+		<param name="type">CompositeVC</param>
+		<list name="vcList">
+			<struct>
+				<param name="type"> AllNodesVC </param>
+				<list name="variables">
+					<struct>
+						<param name="name">temperature</param>
+						<param name="type">func</param>
+						<param name="value"> AnalyticalTemperatureIC </param>
+					</struct>
+				</list>
+			</struct>
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> bottom </param>
+				<list name="variables">
+					<struct>
+						<param name="name">temperature</param>
+						<param name="type">double</param>
+						<param name="value"> 1 </param>
+					</struct>
+				</list>
+			</struct>
+			<struct>
+				<param name="type"> WallVC </param>
+				<param name="wall"> top </param>
+				<list name="variables">
+					<struct>
+						<param name="name">temperature</param>
+						<param name="type">double</param>
+						<param name="value"> 0 </param>
+					</struct>
+				</list>
+			</struct>				
+		</list>
+	</struct>
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/velocityFreeslipBCs.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/velocityFreeslipBCs.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e Apps/ThermoChem/window.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/ThermoChem/window.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+ 	
+	<list name="plugins" mergeType="merge">
+		<param>lucPlugin</param>
+	</list>
+	<struct name="components" mergeType="merge">
+		<struct name="renderingEngine">
+			<param name="Type">lucRenderingEngineGL</param>
+		</struct>
+		<struct name="imageOutput">
+			<param name="Type">lucOutputPNG</param>
+		</struct>
+		<struct name="window">
+			<param name="Type">lucDefaultWindow</param>
+			<param name="RenderingEngine">renderingEngine</param>
+			<list name="OutputFormat">
+				<param>imageOutput</param>
+			</list>
+			<param name="height">592</param>
+			<param name="width">592</param>
+			<param name="interactive">t</param>
+			<param name="backgroundColour">white</param>
+		</struct>
+		<struct name="movie">
+			<param name="Type">lucEncoderLibfame</param>
+			<param name="Window">window</param>
+		</struct>	
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Apps/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,51 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 409 2007-01-17 13:01:26Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+PROJ_ROOT = ..
+include ${PROJ_ROOT}/Makefile.system
+
+subdirs = src BuoyancyBenchmark LidDrivenPIC RayleighTaylor ThermoChem
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Apps/src
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Apps/src	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1 @@
+PIC_Components
\ No newline at end of file
diff -r 5896a19b8457 -r 31abbeebf74e COPYING
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/COPYING	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,510 @@
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+	51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                            Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations
+below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it
+becomes a de-facto standard.  To achieve this, non-free programs must
+be allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control
+compilation and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at least
+    three years, to give the same user the materials specified in
+    Subsection 6a, above, for a charge no more than the cost of
+    performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply, and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License
+may add an explicit geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                            NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms
+of the ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.
+It is safest to attach them to the start of each source file to most
+effectively convey the exclusion of warranty; and each file should
+have at least the "copyright" line and a pointer to where the full
+notice is found.
+
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or
+your school, if any, to sign a "copyright disclaimer" for the library,
+if necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James
+  Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff -r 5896a19b8457 -r 31abbeebf74e Makefile.vmake
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.vmake	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1 @@
+VMake/Makefile.vmake
\ No newline at end of file
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,53 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := src tests
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/BackgroundParticleLayout.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/BackgroundParticleLayout.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,208 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** $Id: BackgroundParticleLayout.c 3310 2005-10-26 07:10:18Z RobertTurnbull $
+**
+*/
+/** \file
+**  Role:
+**	A particle layout which creates only 1 particle, for use in creating backgroud layers where materials are "everywhere"
+**
+** Assumptions:
+**
+** Comments:
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "types.h"
+#include "BackgroundParticleLayout.h"
+
+#include <assert.h>
+#include <string.h>
+
+const Type BackgroundParticleLayout_Type = "BackgroundParticleLayout";
+
+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;
+}
+
+
+void _BackgroundParticleLayout_Init(
+		void*                  particleLayout,
+		CoordSystem            coordSystem,
+		Bool                   weightsInitialisedAtStartup )
+{
+	BackgroundParticleLayout* self = (BackgroundParticleLayout*)particleLayout;
+	
+	self->isConstructed = True;
+
+	_ParticleLayout_Init( particleLayout, coordSystem, weightsInitialisedAtStartup );
+}
+
+void _BackgroundParticleLayout_Delete( void* particleLayout ) {
+	BackgroundParticleLayout* self = (BackgroundParticleLayout*)particleLayout;
+	
+	_ParticleLayout_Delete( self );
+}
+
+void _BackgroundParticleLayout_Print( void* particleLayout, Stream* stream ) {
+	BackgroundParticleLayout* self = (BackgroundParticleLayout*)particleLayout;
+	
+	Journal_Printf( stream, "BackgroundParticleLayout (ptr): %p\n", self );
+	
+	/* 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;
+	
+	newBackgroundParticleLayout = (BackgroundParticleLayout*)_ParticleLayout_Copy( self, dest, deep, nameExt, ptrMap );
+
+	return (void*)newBackgroundParticleLayout;
+}
+
+void* _BackgroundParticleLayout_DefaultNew( Name name ) {
+	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_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 ) {}
+
+
+void _BackgroundParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm )
+{
+	Swarm*			  swarm         = (Swarm*)_swarm;
+	Cell_DomainIndex	  cell_I        = 0;
+	char			  tempStr[100];
+
+	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 */
+
+		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;
+	}
+}
+
+void _BackgroundParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm )
+{
+	Swarm*                    swarm         = (Swarm*)_swarm;
+	GlobalParticle*           particle;
+
+	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;
+
+	Swarm_AddParticleToCell( swarm, 0, 0 );
+}
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/BackgroundParticleLayout.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/BackgroundParticleLayout.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+#ifndef __PICellerator_MaterialPoints_BackgroundParticleLayout_h__
+#define __PICellerator_MaterialPoints_BackgroundParticleLayout_h__
+	
+	/* Textual name of this class */
+	extern const Type BackgroundParticleLayout_Type;
+	
+	/* ParticleLayout information */
+	#define __BackgroundParticleLayout \
+		/* General info */ \
+		__ParticleLayout \
+
+	struct BackgroundParticleLayout { __BackgroundParticleLayout };
+	
+	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 );
+	
+	void _BackgroundParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm );
+	void _BackgroundParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm );
+
+	
+#endif /* __PICellerator_MaterialPoints_BackgroundParticleLayout_h__ */
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/BackgroundParticleLayout.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/BackgroundParticleLayout.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">BackgroundParticleLayout</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">ParticleLayout</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">A particle layout which creates only 1 particle, for use in creating backgroud layers where materials are
+"everywhere"</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 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/CoincidentMapper.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/CoincidentMapper.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,315 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "types.h"
+#include "IntegrationPointMapper.h"
+#include "OneToOneMapper.h"
+#include "CoincidentMapper.h"
+
+#include "MaterialPointsSwarm.h"
+#include "MaterialPoint.h"
+#include "IntegrationPointsSwarm.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+const Type CoincidentMapper_Type = "CoincidentMapper";
+
+CoincidentMapper* CoincidentMapper_New(
+	Name                       name,
+	IntegrationPointsSwarm*    integrationSwarm,
+	MaterialPointsSwarm*       materialSwarm
+	)
+{
+	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 ) {
+	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(
+		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(
+			_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_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+	_OneToOneMapper_Construct( mapper, cf, data );
+}
+
+void _CoincidentMapper_Init(
+		void*                   mapper,
+		IntegrationPointsSwarm* integrationSwarm,
+		MaterialPointsSwarm*    materialSwarm ) 
+{
+	_OneToOneMapper_Init( mapper, integrationSwarm, materialSwarm );
+}
+
+void _CoincidentMapper_Delete( void* mapper ) {
+	_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 ) {
+	_OneToOneMapper_Build( mapper, cf );
+}
+
+void _CoincidentMapper_Initialise( void* mapper, void* cf ) {
+	_OneToOneMapper_Initialise( mapper, cf );
+}
+
+void _CoincidentMapper_Execute( void* mapper, void* data ) {
+}
+
+void _CoincidentMapper_Destroy( void* mapper, void* data ) {
+}
+
+void _CoincidentMapper_Map( void* mapper ) {
+	CoincidentMapper*       self                   = (CoincidentMapper*)mapper;
+
+	IntegrationPointsSwarm* integrationSwarm       = self->integrationSwarm;
+	MaterialPointsSwarm*    materialSwarm          = self->materialSwarm;
+
+	IntegrationPoint*       integrationPoint;
+	MaterialPoint*          materialPoint;
+	MaterialPointRef*       ref;
+
+	FiniteElement_Mesh*     mesh                   = materialSwarm->mesh;
+	ElementLayout*          layout                 = mesh->layout->elementLayout;
+
+	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__ ) ;
+	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] );
+		}
+		integrationSwarm->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 );	
+	/* 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 );
+
+		cell_dI = materialPoint->owningCell;
+
+		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 );
+
+		Swarm_AddParticleToCell( integrationSwarm, cell_dI, particle_lI );
+
+		/* Convert global to local coordinates */
+		ElementType_ConvertGlobalCoordToElLocal(
+				FiniteElement_Mesh_ElementTypeAt( mesh, cell_dI ),
+				layout,
+				(const Coord**)materialSwarm->cellPointTbl[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
+		/* 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(
+				(integrationPoint->xi[dim_I] >= -1.001) && (integrationPoint->xi[dim_I] <= 1.001 ),
+				errorStream,
+				"Error - in %s(): unable to map material point %d in cell %d of swarm \"%s\" (type %s) "
+				"coord to a valid \"local\" coordinate (xi). Coord was (%.3f,%.3f,%.3f), swarm's "
+				"particle layout type was %s, Xi result was (%.4f,%.4f,%.4f).\n",
+				__func__, particle_lI, cell_dI, materialSwarm->name, materialSwarm->type,
+				materialPoint->coord[0], materialPoint->coord[1], materialPoint->coord[2],
+				materialSwarm->particleLayout->type, integrationPoint->xi[0],
+				integrationPoint->xi[1], integrationPoint->xi[2] );
+		}
+		#endif
+
+		ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
+		ref->swarm_I = materialSwarm->swarmReg_I;
+		ref->particle_I = particle_lI;
+		Journal_DPrintfL( debugStream, 3, "updated the coincident mapper's material reference for "
+			"this integration point to map back to the material point.\n" );
+		Stream_UnIndentBranch( debugStream );	
+	}
+
+	Stream_UnIndentBranch( debugStream );	
+	Journal_DPrintfL( debugStream, 2, "...finished updating local positions.\n" );
+
+	Stream_UnIndentBranch( debugStream );
+	Journal_DPrintfL( debugStream, 1, "...%s(): Done.\n", __func__ );
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/CoincidentMapper.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/CoincidentMapper.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,117 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	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__
+
+	/* Textual name of this class */
+	extern const Type CoincidentMapper_Type;
+
+	#define __CoincidentMapper \
+		__OneToOneMapper 
+
+	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 );
+
+	void _CoincidentMapper_Init(
+			void*                   mapper,
+			IntegrationPointsSwarm* integrationSwarm,
+			MaterialPointsSwarm*    materialSwarm );
+
+
+	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_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_Map( void* mapper );
+	
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/CoincidentMapper.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/CoincidentMapper.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">CoincidentMapper</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">OneToOneMapper</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">A one-to-one mapper that maps integration points to material points at the same coordinates. A simple global to local operation is performed. The weight of the integration point is dependant on the WeightCalculator of the IntegrationPointsSwarm.</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 material points to be mapped.</param>
+	</struct>
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Context.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Context.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,232 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.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 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Context.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Context.h	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Context.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Context.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">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 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Finalise.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Finalise.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Finalise.c 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+
+#include "types.h"
+#include "Finalise.h"
+
+#include <stdio.h>
+
+Bool PICellerator_MaterialPoints_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Finalise.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Finalise.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,60 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Finalise.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_Finalise_h__
+#define __PICellerator_MaterialPoints_Finalise_h__
+	
+	Bool PICellerator_MaterialPoints_Finalise( void ) ;
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/GaussMapper.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/GaussMapper.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,189 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** $Id: GaussMapper.c 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+const Type GaussMapper_Type = "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 )
+{
+	GaussMapper* result;
+
+	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_Init(
+		void*                   mapper,
+		IntegrationPointsSwarm* integrationSwarm,
+		MaterialPointsSwarm*    materialSwarm ) 
+{
+	_OneToOneMapper_Init( mapper, integrationSwarm, materialSwarm );
+}
+
+void _GaussMapper_Delete( void* mapper ) {
+	_IntegrationPointMapper_Delete( mapper );
+}
+void _GaussMapper_Print( void* mapper, Stream* 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_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_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 );
+	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 );
+}
+
+void _GaussMapper_Build( void* mapper, void* cf ) {
+	_OneToOneMapper_Build( mapper, cf );
+}
+void _GaussMapper_Initialise( void* mapper, void* cf ) {
+	_OneToOneMapper_Initialise( mapper, cf );
+}
+void _GaussMapper_Execute( void* mapper, void* data ) {
+}
+void _GaussMapper_Destroy( void* mapper, void* 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;
+
+	materialPoint = (MaterialPoint*)Swarm_ParticleAt( materialSwarm, 0 ); /* Get the first and only point */
+	
+	/* Map each point in integration to the single material point for its properties */
+	for ( point_I = 0; point_I < integrationSwarm->particleLocalCount; point_I++ ) {
+		integrationPoint = (IntegrationPoint*)Swarm_ParticleAt( integrationSwarm, point_I );
+
+		ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
+		ref->swarm_I = materialSwarm->swarmReg_I;
+		ref->particle_I = 0;
+	}
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/GaussMapper.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/GaussMapper.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,90 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \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 $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_GaussMapper_h__
+#define __PICellerator_MaterialPoints_GaussMapper_h__
+
+	/* Textual name of this class */
+	extern const Type GaussMapper_Type;
+
+	#define __GaussMapper \
+		__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 );
+
+
+	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_Map( void* mapper );
+	
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/GaussMapper.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/GaussMapper.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">GaussMapper</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">OneToOneMapper</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">A special one-to-one mapper designed for IntegrationPointsSwarms that uses a GaussParticleLayout. Because
+you may still want to use a simple single-cell, 4-gauss point conservative option for perfect weights and local coord calculation,
+this mapper allow you to map IntegrationPoints to a signle MaterialPoint. The MaterialPointsSwarm will most likely be using a
+BackgroundParticleLayout.</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 material points to be mapped.</param>
+	</struct>
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/IPMapper.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/IPMapper.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">IPMapper</param>
+<param name="Organisation">VPAC & MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC & Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicensehttp://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">MaterialPoints</param>
+		<param name="Name">MaterialPoints</param>
+		<param name="Type">MaterialPoints</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 130 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Init.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Init.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,102 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Init.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <stdio.h>
+
+Bool PICellerator_MaterialPoints_Init( int* argc, char** argv[] ) {
+	Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
+
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+
+	Stg_ComponentRegister_Add( componentsRegister, PICelleratorContext_Type,      "0", _PICelleratorContext_DefaultNew );
+
+	Stg_ComponentRegister_Add( componentsRegister, BackgroundParticleLayout_Type, "0", _BackgroundParticleLayout_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,       "0", _MaterialFeVariable_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, Material_Type,                 "0", _Material_DefaultNew );
+	
+	Stg_ComponentRegister_Add( componentsRegister, CoincidentMapper_Type,         "0", _CoincidentMapper_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, GaussMapper_Type,              "0", _GaussMapper_DefaultNew );
+	
+	Stg_ComponentRegister_Add( componentsRegister, SwarmAdvector_Type,            "0", _SwarmAdvector_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, SwarmAdvectorD_Type,            "0", _SwarmAdvectorD_DefaultNew );
+		Stg_ComponentRegister_Add( componentsRegister, SwarmAdvectorW_Type,            "0", _SwarmAdvectorW_DefaultNew );
+
+	Stg_ComponentRegister_Add( componentsRegister, PeriodicBoundariesManager_Type,"0", _PeriodicBoundariesManager_DefaultNew );
+
+	/* Doing this in alphabetical order to match ls output */
+	RegisterParent( BackgroundParticleLayout_Type,  ParticleLayout_Type );
+	RegisterParent( CoincidentMapper_Type,          OneToOneMapper_Type );
+	RegisterParent( PICelleratorContext_Type,       FiniteElementContext_Type );
+	RegisterParent( GaussMapper_Type,               OneToOneMapper_Type );
+	RegisterParent( IntegrationPointMapper_Type,    Stg_Component_Type );
+	RegisterParent( IntegrationPointsSwarm_Type,    Swarm_Type );
+	RegisterParent( MappedParticleLayout_Type,      ParticleLayout_Type );
+	RegisterParent( ManyToOneMapper_Type,           IntegrationPointMapper_Type );
+	RegisterParent( Material_Type,                  Stg_Component_Type );
+	RegisterParent( MaterialFeVariable_Type,        ParticleFeVariable_Type );
+	RegisterParent( Materials_Register_Type,        NamedObject_Register_Type );
+	RegisterParent( MaterialPointsSwarm_Type,       Swarm_Type );
+	RegisterParent( OneToOneMapper_Type,            IntegrationPointMapper_Type );
+	RegisterParent( ParticleFeVariable_Type,        FeVariable_Type );
+	RegisterParent( PeriodicBoundariesManager_Type, Stg_Component_Type );
+	RegisterParent( SwarmAdvector_Type,             TimeIntegratee_Type );
+	RegisterParent( SwarmAdvectorD_Type,            SwarmAdvector_Type );
+	RegisterParent( SwarmAdvectorW_Type,            SwarmAdvector_Type );
+
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Init.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Init.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	performs and pre-running initialisation necessary in this directory.
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Init.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_Init_h__
+#define __PICellerator_MaterialPoints_Init_h__
+	
+	Bool PICellerator_MaterialPoints_Init( int* argc, char** argv[] );
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/IntegrationPointMapper.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/IntegrationPointMapper.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,215 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+const Type IntegrationPointMapper_Type = "IntegrationPointMapper";
+
+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(
+			_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;
+
+	if (initFlag) {
+		_IntegrationPointMapper_Init( self, integrationSwarm );
+	}
+
+	return self;
+}
+
+void _IntegrationPointMapper_Init( void* mapper, IntegrationPointsSwarm* integrationSwarm ) {
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+
+	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;
+	
+	Journal_Printf( stream, "IntegrationPointMapper (ptr): %s\n", (void*)self );
+	_Stg_Component_Print( self, stream );
+
+	Stream_Indent( stream );
+
+	Print( self->integrationSwarm, stream );
+
+	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 );
+
+	newCopy->integrationSwarm = Stg_Class_Copy( self->integrationSwarm, NULL, deep, nameExt, ptrMap );
+
+	return newCopy;
+}
+
+void _IntegrationPointMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+
+	IntegrationPointsSwarm* integrationSwarm;
+
+	integrationSwarm = Stg_ComponentFactory_ConstructByKey( 
+				cf, 
+				self->name, 
+				IntegrationPointsSwarm_Type, 
+				IntegrationPointsSwarm,
+				True,
+				data  );
+	
+	_IntegrationPointMapper_Init( self, integrationSwarm );
+}
+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_Map( void* mapper ) {
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+
+	self->_map( self );
+}
+
+MaterialPointsSwarm** IntegrationPointMapper_GetMaterialPointsSwarms( void* mapper, Index* count ) {
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+
+	return self->_getMaterialPointsSwarms( mapper, count );
+}
+
+Material_Index IntegrationPointMapper_GetMaterialIndexOnFunc( void* mapper, void* point ) {
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+
+	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 );
+
+	return IntegrationPointMapper_GetMaterialIndexOn( mapper, point );
+}
+void* IntegrationPointMapper_GetExtensionAtFunc( void* mapper, Index point_I, ExtensionInfo_Index extHandle ) {
+	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 );
+	
+	return IntegrationPointMapper_GetExtensionOn( mapper, point, extHandle );
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/IntegrationPointMapper.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/IntegrationPointMapper.h	Mon Mar 26 09:24:36 2007 +0000
@@ -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
+**
+*/
+/** \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 $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_IntegrationPointMapper_h__
+#define __PICellerator_MaterialPoints_IntegrationPointMapper_h__
+
+	/* Textual name of this class */
+	extern const Type IntegrationPointMapper_Type;
+
+	/** @see IntegrtaionPointMapper_Map */
+	typedef void (IntegrationPointMapper_MapFunction) ( void* mapper );
+
+	/** @see IntegrationPointMapper_GetMaterialPointsSwarmsFunction */
+	typedef MaterialPointsSwarm** (IntegrationPointMapper_GetMaterialPointsSwarmsFunction) ( void* mapper, Index* count );
+
+	/** @see IntegrationPointMapper_GetMaterialIndexOn */
+	typedef Material_Index (IntegrationPointMapper_GetMaterialIndexOnFunction) ( void* mapper, void* point );
+
+	/** @see IntegrationPointMapper_GetExtensionOn */
+	typedef void* (IntegrationPointMapper_GetExtensionOnFunction) ( 
+				void*                   mapper, 
+				void*                   points, 
+				ExtensionInfo_Index     extHandle );
+	
+	/* IntegrationPointMapper information */
+	#define __IntegrationPointMapper \
+		__Stg_Component \
+		\
+		/* Virtual functions */ \
+		IntegrationPointMapper_MapFunction*                             _map; \
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms; \
+		IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn; \
+		IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn; \
+		\
+		/* General info */ \
+		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 );
+
+	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_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 ) ;
+	
+	/** 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 */
+	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
+	#else
+		#define IntegrationPointMapper_GetMaterialIndexOn IntegrationPointMapper_GetMaterialIndexOnMacro
+	#endif
+	#define IntegrationPointMapper_GetMaterialIndexOnMacro( 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
+	#else
+		#define IntegrationPointMapper_GetExtensionOn IntegrationPointMapper_GetExtensionOnMacro
+	#endif
+	#define IntegrationPointMapper_GetExtensionOnMacro( 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
+	#else
+		#define IntegrationPointMapper_GetMaterialIndexAt IntegrationPointMapper_GetMaterialIndexAtMacro
+	#endif
+	#define IntegrationPointMapper_GetMaterialIndexAtMacro( mapper, 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
+	#else
+		#define IntegrationPointMapper_GetExtensionAt
+	#endif
+	#define IntegrationPointMapper_GetExtensionAtMacro( mapper, 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 );
+
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/IntegrationPointMapper.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/IntegrationPointMapper.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">IntegrationPointMapper</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">IntegrationPointsSwarm</param>
+		<param name="Type">IntegrationPointsSwarm</param>
+		<param name="Description">...</param>
+	</struct>
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/IntegrationPointsSwarm.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/IntegrationPointsSwarm.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,487 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: IntegrationPointsSwarm.c 436 2007-03-05 06:11:35Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+#include "Material.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type IntegrationPointsSwarm_Type = "IntegrationPointsSwarm";
+
+IntegrationPointsSwarm* IntegrationPointsSwarm_New(
+		Name                                  name,
+		void*                                 cellLayout,
+		void*                                 particleLayout,
+		Dimension_Index                       dim,
+		SizeT                                 particleSize,
+		Particle_InCellIndex                  cellParticleTblDelta,
+		double                                extraParticlesFactor,
+		FiniteElement_Mesh*                   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 = _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 ) {
+	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(
+		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,
+		FiniteElement_Mesh*                             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) );
+	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 );
+
+	if (initFlag) {
+		_IntegrationPointsSwarm_Init( 
+			self,
+			mesh, 
+			timeIntegrator,
+			weights,
+			mapper,
+			materials_Register,
+			recalculateWeights );
+	}
+		
+	return self;
+}
+
+
+void _IntegrationPointsSwarm_Construct( void* integrationPoints, Stg_ComponentFactory* cf, void* data ) {
+	IntegrationPointsSwarm*	        self          = (IntegrationPointsSwarm*) integrationPoints;
+	FiniteElement_Mesh*             mesh;
+	TimeIntegrator*                 timeIntegrator;
+	WeightsCalculator*              weights;
+	IntegrationPointMapper*         mapper;
+	Materials_Register*             materials_Register;
+	Bool                            recalculateWeights;
+
+	/* This will also call _Swarm_Init */
+	_Swarm_Construct( self, cf, data );
+
+	mesh           = Stg_ComponentFactory_ConstructByKey( cf, self->name, "FiniteElement_Mesh", FiniteElement_Mesh, 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 ||
+			(weights == NULL && Stg_Class_IsInstance( mapper, GaussMapper_Type ) ),
+			Journal_MyStream( Error_Type, self ),
+			"In func %s, %s which is a %s must either have a %s or use %s\n",
+			__func__,
+			self->name,
+			self->type,
+			WeightsCalculator_Type,
+			GaussMapper_Type );
+	
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
+	assert( materials_Register );
+
+	_IntegrationPointsSwarm_Init( self, mesh, timeIntegrator, weights, mapper, materials_Register, recalculateWeights );
+}
+
+
+void _IntegrationPointsSwarm_Init( 
+		void*                                 swarm,
+		FiniteElement_Mesh*                   mesh, 
+		TimeIntegrator*                       timeIntegrator,
+		WeightsCalculator*                    weights,
+		IntegrationPointMapper*               mapper,
+		Materials_Register*                   materials_Register,
+		Bool                                  recalculateWeights )
+{
+	IntegrationPointsSwarm* self = (IntegrationPointsSwarm*)swarm;
+	LocalParticle localParticle;
+	IntegrationPoint particle;
+
+	self->mesh               = mesh;
+	self->timeIntegrator     = timeIntegrator;
+	self->weights            = weights;
+	self->mapper             = mapper;
+	self->materials_Register = materials_Register;
+
+	self->recalculateWeights = recalculateWeights;
+
+	/* Disable checkpointing and reloading of IP swarms - currently they can't be reloaded if the particles
+	don't have a global coord. We assume there is no history info on them which means we're happy to re-create
+	them from scratch given the position the material points were in when the checkpoint was made as input
+	-- PatrickSunter 12 June 2006 */
+	self->isSwarmTypeToCheckPointAndReload = False;
+
+	self->weightVariable = Swarm_NewScalarVariable( 
+			self,
+			"Weight",
+			GetOffsetOfMember( particle , weight ), 
+			Variable_DataType_Double );
+
+	self->localCoordVariable = Swarm_NewVectorVariable(
+		self,
+		"LocalElCoord",
+		GetOffsetOfMember( localParticle , xi ),
+		Variable_DataType_Double,
+		self->dim,
+		"Xi",
+		"Eta",
+		"Zeta" );
+
+	if ( timeIntegrator ) {
+		/* 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 */
+		TimeIntegrator_InsertAfterFinishEP(
+				timeIntegrator,
+				"MaterialPointsSwarm_Update", /* Needs to be after a the material update */
+				"IntegrationPointsSwarm_Update",
+				_IntegrationPointsSwarm_UpdateHook,
+				self->name,
+				self );
+	}
+	
+	/* _Construct calls _Swarm_Init */
+
+	/* Lock down the extension manager.
+	 * It doesn't make sense for the IntegrationPointsSwarm to allow IntegrationPoints to be extended
+	 * This means attempts to extend integration points are firewalled to pickup errors.
+	 * -- Alan 20060506
+	 */
+	ExtensionManager_SetLockDown( self->particleExtensionMgr, True );
+}
+
+void _IntegrationPointsSwarm_Delete( void* integrationPoints ) {
+	IntegrationPointsSwarm* self = (IntegrationPointsSwarm*)integrationPoints;
+
+	_Swarm_Delete( self );
+}
+
+
+void _IntegrationPointsSwarm_Print( void* integrationPoints, Stream* stream ) {
+	IntegrationPointsSwarm* self = (IntegrationPointsSwarm*)integrationPoints;
+	
+	_Swarm_Print( self, stream );
+}
+
+void* _IntegrationPointsSwarm_Copy( void* integrationPoints, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	IntegrationPointsSwarm*	self = (IntegrationPointsSwarm*)integrationPoints;
+	IntegrationPointsSwarm*	newIntegrationPointsSwarm;
+	
+	newIntegrationPointsSwarm = (IntegrationPointsSwarm*)_Swarm_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newIntegrationPointsSwarm->mesh = (FiniteElement_Mesh*)Stg_Class_Copy(
+				self->mesh,
+				NULL,
+				deep,
+				nameExt,
+				ptrMap );
+	if ( self->weights != NULL ) {
+		newIntegrationPointsSwarm->weights = (WeightsCalculator*)Stg_Class_Copy(
+					self->weights,
+					NULL,
+					deep,
+					nameExt,
+					ptrMap );
+	}
+	newIntegrationPointsSwarm->mapper = (IntegrationPointMapper*)Stg_Class_Copy(
+				self->mapper,
+				NULL,
+				deep,
+				nameExt,
+				ptrMap );
+	newIntegrationPointsSwarm->materials_Register = self->materials_Register;
+	newIntegrationPointsSwarm->weightVariable = (SwarmVariable*)Stg_Class_Copy(
+				self->weightVariable,
+				NULL,
+				deep,
+				nameExt,
+				ptrMap );
+	
+	return (void*)newIntegrationPointsSwarm;
+}
+
+
+void _IntegrationPointsSwarm_Build( void* integrationPoints, void* data ) {
+	IntegrationPointsSwarm*	self = (IntegrationPointsSwarm*) integrationPoints;
+
+	_Swarm_Build( self, data );
+
+	Stg_Component_Build( self->localCoordVariable, data, False );
+	Stg_Component_Build( self->weightVariable, data, False );
+	Stg_Component_Build( self->mapper, data, False );
+}
+void _IntegrationPointsSwarm_Initialise( void* integrationPoints, void* data ) {
+	IntegrationPointsSwarm*	self = (IntegrationPointsSwarm*) integrationPoints;
+
+	Journal_DPrintf( self->debug, "In %s(): for swarm \"%s\":\n",
+		__func__, self->name );
+	Stream_IndentBranch( Swarm_Debug );
+
+	_Swarm_Initialise( self, data );
+
+	Stg_Component_Initialise( self->localCoordVariable, data, False );
+	Stg_Component_Initialise( self->weightVariable, data, False );
+	Stg_Component_Initialise( self->mapper, data, False );
+
+	if ( self->weights != NULL ) {
+		Stg_Component_Initialise( self->weights, data, False );
+	}
+
+	/* We call this function to actually set up the integration point positions and 
+	weights, based on the now set up material point swarm */
+	IntegrationPointsSwarm_RemapIntegrationPointsAndRecalculateWeights( self );
+
+	Stream_UnIndentBranch( Swarm_Debug );
+	Journal_DPrintf( self->debug, "...done in %s() for swarm \"%s\".\n",
+		__func__, self->name );
+}
+void _IntegrationPointsSwarm_Execute( void* integrationPoints, void* data ) {
+	IntegrationPointsSwarm*	self = (IntegrationPointsSwarm*)integrationPoints;
+	
+	_Swarm_Execute( self, data );
+}
+void _IntegrationPointsSwarm_Destroy( void* integrationPoints, void* data ) {
+	IntegrationPointsSwarm*	self = (IntegrationPointsSwarm*)integrationPoints;
+	
+	_Swarm_Destroy( self, data );
+}
+
+void _IntegrationPointsSwarm_UpdateHook( void* timeIntegrator, void* swarm ) {
+	IntegrationPointsSwarm* self = (IntegrationPointsSwarm*)swarm;
+
+	Journal_DPrintf( self->debug, "In %s(): for swarm \"%s\":\n",
+		__func__, self->name );
+	Stream_IndentBranch( Swarm_Debug );
+
+	IntegrationPointsSwarm_RemapIntegrationPointsAndRecalculateWeights( self );
+
+	Stream_UnIndentBranch( Swarm_Debug );
+	Journal_DPrintf( self->debug, "...done in %s() for swarm \"%s\".\n",
+		__func__, self->name );
+}
+
+
+void IntegrationPointsSwarm_RemapIntegrationPointsAndRecalculateWeights( void* swarm ) {	
+	IntegrationPointsSwarm* self = (IntegrationPointsSwarm*)swarm;
+	double                  mapStartTime, mapTime;
+	double                  weightsUpdateStartTime, weightsUpdateTime;
+
+	Journal_DPrintf( self->debug, "In %s(): for swarm \"%s\":\n",
+		__func__, self->name );
+	Stream_IndentBranch( Swarm_Debug );
+
+	Journal_DPrintf( self->debug, "Calling IntegrationPointsMapper \"%s\" (of type %s) to set up mappings\n"
+		"\tfrom I.P.s to M.P.s, and calculate local coords:\n", self->mapper->name, self->mapper->type );
+	mapStartTime = MPI_Wtime();	
+	IntegrationPointMapper_Map( self->mapper );
+	mapTime = MPI_Wtime() - mapStartTime;
+	Journal_DPrintf( self->debug, "...done - took %g secs.\n", mapTime );
+
+	if ( self->weights != NULL ) {
+		Journal_DPrintf( self->debug, "Calling WeightsCalculator \"%s\" (of type %s)\n"
+			"\tto calculate and set integration weights:\n",
+			self->weights->name, self->weights->type );
+		weightsUpdateStartTime = MPI_Wtime();
+		WeightsCalculator_CalculateAll(self->weights, self );
+		weightsUpdateTime = MPI_Wtime() - weightsUpdateStartTime;
+		Journal_DPrintf( self->debug, "...weights updating finished - took %g secs.\n", weightsUpdateTime );
+	}	
+	else {
+		Stream* errorStream = Journal_Register( Error_Type, self->type );
+		Journal_Firewall( Stg_Class_IsInstance( self->mapper, GaussMapper_Type ), errorStream,
+			"Error - in %s(): for IntegrationPointSwarm \"%s\", no weights calculator provided "
+			"and mapper is not a %s.\n", GaussMapper_Type );
+
+		Journal_DPrintf( self->debug, "not recalculating weights since we are using a %s mapper and "
+			"assume the points are not being advected.\n", GaussMapper_Type );
+	}
+
+	Stream_UnIndentBranch( Swarm_Debug );
+	Journal_DPrintf( self->debug, "...done in %s() for swarm \"%s\"\n",
+		__func__, self->name );
+}
+
+
+Material_Index IntegrationPointsSwarm_GetMaterialIndexOn( IntegrationPointsSwarm* swarm, IntegrationPoint* point ) {
+	return IntegrationPointMapper_GetMaterialIndexOn( swarm->mapper, point );
+}
+
+
+Material* IntegrationPointsSwarm_GetMaterialOn( IntegrationPointsSwarm* swarm, IntegrationPoint* point ) {
+	return Materials_Register_GetByIndex(
+		swarm->materials_Register, 
+		IntegrationPointsSwarm_GetMaterialIndexOn( swarm, point ) );
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/IntegrationPointsSwarm.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/IntegrationPointsSwarm.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,195 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	A specific swarm used for integration which is "aware" of the materials used.
+**	A mapper relationship links it with the physical material swarm(s) of which can actually be
+**	advected.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: IntegrationPointsSwarm.h 435 2007-03-04 10:42:10Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_IntegrationPointsSwarm_IntegrationPointsSwarm_h__
+#define __PICellerator_IntegrationPointsSwarm_IntegrationPointsSwarm_h__
+
+	/* Textual name of this class */
+	extern const Type IntegrationPointsSwarm_Type;
+
+	/* IntegrationPointsSwarm information */
+	#define __IntegrationPointsSwarm \
+		__Swarm \
+		\
+		FiniteElement_Mesh*                   mesh;                 \
+		TimeIntegrator*                       timeIntegrator;       \
+		WeightsCalculator*                    weights;              \
+		IntegrationPointMapper*               mapper;               \
+		SwarmVariable*                        localCoordVariable;    /** Set only if a local coord system swarm. */ \
+		SwarmVariable*                        weightVariable;       \
+		Materials_Register*                   materials_Register;   \
+		Bool                                  recalculateWeights;
+
+	struct IntegrationPointsSwarm { __IntegrationPointsSwarm };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+
+	/** Classic C++-style constructor */
+	IntegrationPointsSwarm* IntegrationPointsSwarm_New(
+		Name                                  name,
+		void*                                 cellLayout,
+		void*                                 particleLayout,
+		Dimension_Index                       dim,
+		SizeT                                 particleSize,
+		Particle_InCellIndex                  cellParticleTblDelta,
+		double                                extraParticlesFactor,
+		FiniteElement_Mesh*                   mesh,
+		TimeIntegrator*                       timeIntegrator,
+		WeightsCalculator*                    weights,
+		IntegrationPointMapper*               mapper,
+		Bool                                  recalculateWeights,
+		ExtensionManager_Register*            extensionMgr_Register,
+		Variable_Register*                    swarmVariable_Register,
+		Materials_Register*                   materials_Register,
+		MPI_Comm                              comm);
+	
+	void* _IntegrationPointsSwarm_DefaultNew( Name name ) ;
+
+	/** Private New */
+	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,
+		FiniteElement_Mesh*                             mesh, 
+		TimeIntegrator*                                 timeIntegrator,
+		WeightsCalculator*                              weights,
+		IntegrationPointMapper*                         mapper,
+		Bool                                            recalculateWeights,
+		ExtensionManager_Register*                      extensionMgr_Register,
+		Variable_Register*                              swarmVariable_Register,
+		Materials_Register*                             materials_Register,
+		MPI_Comm                                        comm
+		);
+
+	void _IntegrationPointsSwarm_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+
+	void _IntegrationPointsSwarm_Init(
+		void*                                           swarm,
+		FiniteElement_Mesh*                             mesh, 
+		TimeIntegrator*                                 timeIntegrator,
+		WeightsCalculator*                              weights,
+		IntegrationPointMapper*                         mapper,
+		Materials_Register*                             materials_Register,
+		Bool                                            recalculateWeights );
+
+	/* Stg_Class_Delete IntegrationPointsSwarm implementation */
+	void _IntegrationPointsSwarm_Delete( void* integrationPoints );
+	void _IntegrationPointsSwarm_Print( void* integrationPoints, Stream* stream );
+	#define IntegrationPointsSwarm_Copy( self ) \
+		(IntegrationPointsSwarm*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define IntegrationPointsSwarm_DeepCopy( self ) \
+		(IntegrationPointsSwarm*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _IntegrationPointsSwarm_Copy( void* integrationPoints, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void _IntegrationPointsSwarm_Build( void* integrationPoints, void* data ) ;
+	void _IntegrationPointsSwarm_Initialise( void* integrationPoints, void* data ) ;
+	void _IntegrationPointsSwarm_Execute( void* integrationPoints, void* data );
+	void _IntegrationPointsSwarm_Destroy( void* integrationPoints, void* data ) ;
+
+	void _IntegrationPointsSwarm_UpdateHook( void* timeIntegrator, void* swarm );
+	
+	/** Update the weights and local positions of all integration points, based on the 
+		current mapped material particles */
+	void IntegrationPointsSwarm_RemapIntegrationPointsAndRecalculateWeights( void* swarm );
+	
+	/** Get the material index associated with this integration point */
+	Material_Index IntegrationPointsSwarm_GetMaterialIndexOn(
+		IntegrationPointsSwarm* swarm,
+		IntegrationPoint* point ); 
+	
+	/** Get the material associated with this integration point */
+	Material* IntegrationPointsSwarm_GetMaterialOn(
+		IntegrationPointsSwarm* swarm,
+		IntegrationPoint* point );
+
+	/** Get the extension associated with this integration point */
+	#define IntegrationPointsSwarm_GetExtensionOn( swarm, point, extHandle ) \
+		IntegrationPointMapper_GetExtensionOn( ((IntegrationPointsSwarm*)(swarm))->mapper, (point), (extHandle) )
+
+
+	/** Get the material index associated with this integration point index */
+	#define IntegrationPointsSwarm_GetMaterialIndexAt( swarm, point_I ) \
+		IntegrationPointMapper_GetMaterialIndexAt( ((IntegrationPointsSwarm*)(swarm))->mapper, (point_I) )
+
+	/** Get the material associated with this integration point index */
+	#define IntegrationPointsSwarm_GetMaterialAt( swarm, point_I ) \
+		Materials_Register_GetByIndex( \
+				 ((IntegrationPointsSwarm*)(swarm))->materials_Register, \
+				IntegrationPointsSwarm_GetMaterialIndexAt( (swarm), (point_I) ) )
+
+	/** Get the extension associated with this integration point index */
+	#define IntegrationPointsSwarm_GetExtensionAt( swarm, point_I, extHandle ) \
+		IntegrationPointMapper_GetExtensionAt( ((IntegrationPointsSwarm*)(swarm))->mapper, (point_I), (extHandle) )
+
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/IntegrationPointsSwarm.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/IntegrationPointsSwarm.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">IntegrationPointsSwarm</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Swarm</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">A specific swarm used for integration which is "aware" of the materials used. A mapper relationship links
+it with the physical material swarm(s) of which can actually be advected.</param>
+
+<!--Now the interesting stuff-->
+
+<list name="Params">
+	<struct>
+		<param name="Name">recalculateWeights</param>
+		<param name="Type">Bool</param>
+		<param name="Default">True</param>
+		<param name="Description">Whether weights should be recalculated at every timestep</param>
+	</struct>
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">FiniteElement_Mesh</param>
+		<param name="Type">FiniteElement_Mesh</param>
+		<param name="Description">The mesh this swarm exists in.</param>
+	</struct>
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">TimeIntegrator</param>
+		<param name="Type">TimeIntegrator</param>
+		<param name="Description">This is for particle updates</param>
+	</struct>
+	<struct>
+		<param name="Essential">False</param>
+		<param name="Name">WeightsCalculator</param>
+		<param name="Type">WeightsCalculator</param>
+		<param name="Description">Calculates each IntegrationPoint's weight at every timestep. If the particle layout is a
+		generally needed unless you are using a gauss layout which will set the weight for you.</param>
+	</struct>
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">IntegrationPointMapper</param>
+		<param name="Type">IntegrationPointMapper</param>
+		<param name="Description">Maps these IntegrationPoints to MaterialPointsSwarm(s). The mapper type determines the
+		method which the points are mapped.</param>
+	</struct>
+
+</list>
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/ManyToOneMapper.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/ManyToOneMapper.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,249 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+const Type ManyToOneMapper_Type = "ManyToOneMapper";
+
+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(
+			_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,
+		IntegrationPointsSwarm* integrationSwarm,
+		MaterialPointsSwarm**   materialSwarms,
+		Index                   materialSwarmCount )
+{
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+
+	self->materialSwarms = materialSwarms;
+	self->materialSwarmCount = materialSwarmCount;
+
+	_IntegrationPointMapper_Init( self, integrationSwarm );
+}
+
+void _ManyToOneMapper_Delete( void* 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;
+
+	_IntegrationPointMapper_Print( self, stream );
+	if ( self->materialSwarms != NULL ) {
+		Stream_Indent( stream );
+		for ( i = 0; i < self->materialSwarmCount; ++i ) {
+			Print( self->materialSwarms[i], stream );
+		}
+		Stream_UnIndent( stream );
+	}
+}
+void* _ManyToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+	ManyToOneMapper* newCopy;
+	
+	newCopy = (ManyToOneMapper*)_IntegrationPointMapper_Copy( self, dest, deep, nameExt, ptrMap );
+
+	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 );
+		}
+		newCopy->materialSwarmCount = self->materialSwarmCount;
+	}
+	else {
+		newCopy->materialSwarms = NULL;
+		newCopy->materialSwarmCount = 0;
+	}
+
+	return newCopy;
+}
+
+void _ManyToOneMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+
+	MaterialPointsSwarm** materialSwarms;
+	int i;
+	
+	_IntegrationPointMapper_Construct( self, cf, 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, self->type ),
+		"In func %s, there must be at least one swarm in the material swarm list!\n", __func__ );
+
+	_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;
+
+	_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;
+
+	_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_Destroy( void* mapper, void* data ) {
+
+}
+
+MaterialPointsSwarm** ManyToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count ) {
+	ManyToOneMapper*       self   = (ManyToOneMapper*)mapper;
+	MaterialPointsSwarm** result = Memory_Alloc_Array( MaterialPointsSwarm*, self->materialSwarmCount, "Swarms" );
+	Index                  i;
+	
+	*count = self->materialSwarmCount;
+
+	for ( i = 0; i < self->materialSwarmCount; ++i ) {
+		result[i] = self->materialSwarms[i];
+	}
+
+	return result;
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/ManyToOneMapper.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/ManyToOneMapper.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,117 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 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__
+
+	/* Textual name of this class */
+	extern const Type ManyToOneMapper_Type;
+
+	/* ManyToOneMapper information */
+	#define __ManyToOneMapper \
+		__IntegrationPointMapper \
+		\
+		MaterialPointsSwarm**   materialSwarms; \
+		Index                   materialSwarmCount;
+
+	struct ManyToOneMapper { __ManyToOneMapper };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	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 );
+
+	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_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 ) ;
+
+	MaterialPointsSwarm** ManyToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count );
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/ManyToOneMapper.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/ManyToOneMapper.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">ManyToOneMapper</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">IntegrationPointMapper</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Maps many MaterialPointsSwarms to one IntegrationPointsSwarm</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">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MappedParticleLayout.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MappedParticleLayout.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,193 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** $Id: MappedParticleLayout.c 3310 2005-10-26 07:10:18Z RobertTurnbull $
+**
+*/
+/** \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:
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <assert.h>
+#include <string.h>
+
+const Type MappedParticleLayout_Type = "MappedParticleLayout";
+
+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;
+	
+	/* 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;
+}
+
+
+void _MappedParticleLayout_Init(
+		void*                  particleLayout,
+		CoordSystem            coordSystem,
+		Bool                   weightsInitialisedAtStartup )
+{
+	MappedParticleLayout* self = (MappedParticleLayout*)particleLayout;
+	
+	self->isConstructed = True;
+
+	_ParticleLayout_Init( particleLayout, coordSystem, weightsInitialisedAtStartup );
+}
+
+void _MappedParticleLayout_Delete( void* particleLayout ) {
+	MappedParticleLayout* self = (MappedParticleLayout*)particleLayout;
+	
+	_ParticleLayout_Delete( self );
+}
+
+void _MappedParticleLayout_Print( void* particleLayout, Stream* stream ) {
+	MappedParticleLayout* self = (MappedParticleLayout*)particleLayout;
+	
+	Journal_Printf( stream, "MappedParticleLayout (ptr): %p\n", self );
+	
+	/* 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;
+	
+	newMappedParticleLayout = (MappedParticleLayout*)_ParticleLayout_Copy( self, dest, deep, nameExt, ptrMap );
+
+	return (void*)newMappedParticleLayout;
+}
+
+void* _MappedParticleLayout_DefaultNew( Name name ) {
+	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_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 ) {}
+
+
+void _MappedParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm )
+{
+	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 */
+
+		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;
+	}
+}
+
+void _MappedParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm )
+{
+	/* Don't need to do anything */
+}
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MappedParticleLayout.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MappedParticleLayout.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+#ifndef __PICellerator_MaterialPoints_MappedParticleLayout_h__
+#define __PICellerator_MaterialPoints_MappedParticleLayout_h__
+	
+	/* Textual name of this class */
+	extern const Type MappedParticleLayout_Type;
+	
+	/* ParticleLayout information */
+	#define __MappedParticleLayout \
+		/* General info */ \
+		__ParticleLayout \
+
+	struct MappedParticleLayout { __MappedParticleLayout };
+	
+	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 );
+	
+	void _MappedParticleLayout_SetInitialCounts( void* particleLayout, void* _swarm );
+	void _MappedParticleLayout_InitialiseParticles( void* particleLayout, void* _swarm );
+
+	
+#endif /* __PICellerator_MaterialPoints_MappedParticleLayout_h__ */
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MappedParticleLayout.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MappedParticleLayout.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">MappedParticleLayout</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">ParticleLayout</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Special particle layout for IntegrationPointsSwarms. Indicates that the particle layout will be determined
+by a IntegrationPointMapper.</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 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Material.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Material.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,371 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Material.c 435 2007-03-04 10:42:10Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <assert.h>
+#include <string.h>
+
+const Type Material_Type = "Material";
+
+/* Public Constructor */
+Material* Material_New( 
+		Name                                            name,
+		Stg_Shape*                                      shape,
+		Dictionary*                                     materialDictionary,
+		Materials_Register*                             materialRegister )
+{
+	Material* self;
+
+	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 ) {
+	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(
+		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) );
+	self = (Material*) _Stg_Component_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			name,
+			NON_GLOBAL );
+
+	_Material_Init( self, shape, materialDictionary, materialRegister );
+
+	return self;
+}
+
+
+void _Material_Init( 
+		void*                                           material,
+		Stg_Shape*                                      shape,
+		Dictionary*                                     materialDictionary,
+		Materials_Register*                             materialRegister )
+{
+	Material* self = (Material*)material;
+	
+	/* Set Values */
+	self->dictionary = materialDictionary;
+	self->shape      = shape;
+
+	/* Register material */
+	if (materialRegister != NULL)	
+		self->index = Materials_Register_Add( materialRegister, self );	
+	else 
+		self->index = 0;
+
+	self->extensionMgr = ExtensionManager_New_OfExistingObject( self->name, self );
+}
+
+void _Material_Delete( void* material ) {
+	Material* self = (Material*) material;
+
+	Stg_Class_Delete( self->extensionMgr );
+	_Stg_Component_Delete( material );
+}
+
+
+void _Material_Print( void* material, Stream* stream ) {
+	Material* self = (Material*) material;
+
+	_Stg_Component_Print( self, stream );
+
+	Journal_PrintPointer( stream, self->dictionary );
+	Journal_PrintUnsignedInt( stream, self->index );
+}
+
+
+void* _Material_Copy( void* material, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	Material* self = (Material*) material;
+	Material* newMaterial;
+
+	newMaterial = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newMaterial->dictionary = self->dictionary;
+	newMaterial->index      = self->index;
+
+	return newMaterial;
+}
+
+
+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,  "Shape", Stg_Shape,  True, data  ) ;
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
+
+	_Material_Init( self, shape, materialDictionary, materials_Register );
+}
+
+
+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 ) {}
+
+void Material_Layout( void* material, MaterialPointsSwarm* swarm ) {	
+	Material*             self               = (Material*) material;
+	Stg_Shape*            shape              = self->shape;
+	MaterialPoint*        particle;
+	Particle_Index        lParticle_I;
+	Particle_Index        particleLocalCount = swarm->particleLocalCount;
+	Stream*               stream             = Journal_MyStream( Info_Type, self );
+
+	Journal_Printf( stream, "Laying out material '%s' within %s '%s':\n", self->name, shape->type, shape->name );
+	
+	for ( lParticle_I = 0 ; lParticle_I < particleLocalCount ; lParticle_I++ ) {
+		particle = (MaterialPoint*)Swarm_ParticleAt( swarm, lParticle_I );
+		
+		if ( Stg_Shape_IsCoordInside( shape, particle->coord ) ) {
+			particle->materialIndex = self->index;
+		}
+	}
+}
+
+double Material_Volume( void* material, IntegrationPointsSwarm* swarm, Coord centroid ) {
+	Material*            self               = (Material*)material;
+	FiniteElement_Mesh*  feMesh             = swarm->mesh;
+	ElementType*         elementType;
+	IntegrationPoint*    particle;
+	Coord                globalCoord;
+	Cell_Index           lCell_I;
+	Cell_Index           cellLocalCount     = swarm->cellLocalCount;
+	Particle_InCellIndex cParticle_I;
+	Particle_Index       lParticle_I;
+	Material_Index       material_I         = self->index;
+	Dimension_Index      dim                = swarm->dim;
+	Coord                localCentroid;
+	double               detJac;
+	double               volume; 
+	double               volumeGlobal;
+
+	/* Initialise Sumation of Integral */
+	volume = 0.0;	
+	memset( localCentroid, 0, sizeof(Coord) );
+
+	/* Loop over all cells in domain */
+	for ( lCell_I = 0 ; lCell_I < cellLocalCount ; lCell_I++ ) {
+		elementType = FeMesh_ElementTypeAt( feMesh, lCell_I );
+		for( cParticle_I = 0 ; cParticle_I < swarm->cellParticleCountTbl[lCell_I] ; cParticle_I++ ) {
+			lParticle_I = swarm->cellParticleTbl[lCell_I][cParticle_I];
+			particle = (IntegrationPoint*)Swarm_ParticleAt( swarm, lParticle_I );
+
+			/* If particle isn't of the same material type as the material passed in - 
+			 * then there is no contribution to the volume */
+			if ( material_I != IntegrationPointsSwarm_GetMaterialIndexOn( swarm, particle ) )
+				continue;
+
+			/* Calculate Determinant of Jacobian */
+			detJac = ElementType_JacobianDeterminant( elementType, feMesh, lCell_I, particle->xi, dim );
+
+			/* Sum Volume */
+			volume += detJac * particle->weight;
+
+			FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( feMesh, dim, lCell_I, particle->xi, globalCoord );
+				
+			/* Sum centroid */
+			localCentroid[ I_AXIS ] += detJac * particle->weight * globalCoord[ I_AXIS ];
+			localCentroid[ J_AXIS ] += detJac * particle->weight * globalCoord[ J_AXIS ];
+			if ( dim == 3 )
+				localCentroid[ K_AXIS ] += detJac * particle->weight * globalCoord[ K_AXIS ];
+		}
+	}
+
+	/* Gather and sum volumes from other processors */
+	MPI_Allreduce( &volume, &volumeGlobal, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
+	MPI_Allreduce( &localCentroid, centroid, dim, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
+
+	/* Divide by volume to obtain true centroid */
+	centroid[ I_AXIS ] /= volumeGlobal;
+	centroid[ J_AXIS ] /= volumeGlobal;
+	if ( dim == 3 )
+		centroid[ K_AXIS ] /= volumeGlobal;
+	else
+		centroid[ K_AXIS ] = 0.0;
+
+	return volumeGlobal;
+}
+
+
+void Material_IntegrateField( 
+		void*                   material, 
+		IntegrationPointsSwarm* swarm, 
+		FeVariable*             field, 
+		double*                 volumeGlobal, 
+		double*                 result ) 
+{
+	Material*            self               = (Material*)material;
+	FiniteElement_Mesh*  feMesh             = swarm->mesh;
+	ElementType*         elementType;
+	IntegrationPoint*    particle;
+	Cell_Index           lCell_I;
+	Cell_Index           cellLocalCount     = swarm->cellLocalCount;
+	Particle_InCellIndex cParticle_I;
+	Particle_Index       lParticle_I;
+	Material_Index       material_I         = self->index;
+	double               detJac;
+	double               volume; 
+	double*              fieldValue;
+	double*              localResult;
+	Dof_Index            fieldComponentCount = field->fieldComponentCount;
+	Dof_Index            component_I;
+	
+	/* Allocate memory */
+	fieldValue  = Memory_Alloc_Array( double, fieldComponentCount, "fieldValue" );
+	localResult = Memory_Alloc_Array( double, fieldComponentCount, "localResult" );
+
+	/* Initialise Sumation of Integral */
+	volume = 0.0;	
+	memset( localResult, 0, sizeof(double) * fieldComponentCount );
+
+	/* Loop over all cells in domain */
+	for ( lCell_I = 0 ; lCell_I < cellLocalCount ; lCell_I++ ) {
+		elementType = FeMesh_ElementTypeAt( feMesh, lCell_I );
+		for( cParticle_I = 0 ; cParticle_I < swarm->cellParticleCountTbl[lCell_I] ; cParticle_I++ ) {
+			lParticle_I = swarm->cellParticleTbl[lCell_I][cParticle_I];
+			particle = (IntegrationPoint*) Swarm_ParticleAt( swarm, lParticle_I );
+
+			/* If particle isn't of the same material type as the material passed in - 
+			 * then there is no contribution to the volume */
+			if ( material_I != IntegrationPointsSwarm_GetMaterialIndexOn( swarm, particle ) )
+				continue;
+
+			/* Calculate Determinant of Jacobian */
+			detJac = ElementType_JacobianDeterminant( elementType, feMesh, lCell_I, particle->xi, swarm->dim );
+
+			/* Sum Volume */
+			volume += detJac * particle->weight;
+
+			/* Integrate field */ 
+			FeVariable_InterpolateWithinElement( field, lCell_I, particle->xi, fieldValue );
+			for ( component_I = 0 ; component_I < fieldComponentCount ; component_I++ ) {
+				localResult[ component_I ] += detJac * particle->weight * fieldValue[ component_I ];
+			}
+		}
+	}
+
+	/* Gather and sum volumes from other processors */
+	MPI_Allreduce( localResult, result, fieldComponentCount, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
+	if ( volumeGlobal )
+		MPI_Allreduce( &volume, volumeGlobal, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD );
+
+	Memory_Free( fieldValue );
+	Memory_Free( localResult );
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Material.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Material.h	Mon Mar 26 09:24:36 2007 +0000
@@ -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
+**
+*/
+
+#ifndef __PICellerator_MaterialPoints_Materials_h__
+#define __PICellerator_MaterialPoints_Materials_h__
+	
+	/* Textual name of this class */
+	extern const Type Material_Type;
+	
+	/* Material information */
+	#define __Material \
+		__Stg_Component \
+		\
+		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,
+		Stg_Shape*                                      shape,
+		Dictionary*                                     materialDictionary,
+		Materials_Register*                             materialRegister );
+
+	void* _Material_DefaultNew( Name name );
+
+	/* Private Constructor */
+	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 );
+
+	void _Material_Construct( void* material, Stg_ComponentFactory* cf, void* data );
+
+	void _Material_Init( 
+		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_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
+	 *  coordinates fall within the shape */
+	void Material_Layout( void* material, MaterialPointsSwarm* swarm ) ;
+
+	/** Calculates the volume and centroid of the material by using the weights of an integration swarm.
+	 *     @param  centroid Output argument where the calculated centroid is written
+	 *     @result The volume of the material. */
+	double Material_Volume( void* material, IntegrationPointsSwarm* swarm, Coord centroid ) ;
+	
+	/** Integrates an FeVariable over a particular material (not the whole domain).
+	 *  The function will also return the volume of the material in case the purpose of the integral is to get an average
+	 *     @param volumeGlobal Output argument where the global volume is written.
+	 *     @param result       Output argument where integration result is written. It will integrate each component of the 
+	 *                         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 );
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Material.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Material.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">Material</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">
+Instances of the Material component represent a physical material. Its parameters are dynamic, each corresponding to a material
+property which defines its mathematical behaviour.
+</param>
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Shape</param>
+		<param name="Type">Stg_Shape</param>
+		<param name="Description">A shape which defines its location and dimensions within the problem domain</param>
+	</struct>
+
+</list>
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialFeVariable.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialFeVariable.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,242 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: MaterialFeVariable.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <assert.h>
+
+const Type MaterialFeVariable_Type = "MaterialFeVariable";
+
+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(
+			_sizeOfSelf, 
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute, 
+			_destroy,
+			_interpolateValueAt,
+			_getMinGlobalFeMagnitude, 
+			_getMaxGlobalFeMagnitude,
+			_getMinAndMaxLocalCoords, 
+			_getMinAndMaxGlobalCoords,
+			_interpolateWithinElement,
+			_getValueAtNode,
+			_valueAtParticle,
+			name );
+	
+	return self;
+}
+
+void _MaterialFeVariable_Init( MaterialFeVariable* self, Material* material ) {
+	IntegrationPointsSwarm* swarm;
+	Name tmpName;
+	Variable_Register* variable_Register = NULL;
+
+	/* Assign Pointers */
+	swarm = Stg_CheckType( self->assemblyTerm->integrationSwarm, IntegrationPointsSwarm );
+	self->picIntegrationPoints = swarm;
+	self->material       = material;
+
+	/* Create Dof Layout */
+	if ( swarm->swarmVariable_Register )
+		variable_Register = swarm->swarmVariable_Register->variable_Register;
+
+	tmpName = Stg_Object_AppendSuffix( self, "DataVariable" );
+	self->dataVariable = Variable_NewScalar( 	
+			tmpName,
+			Variable_DataType_Double, 
+			&self->feMesh->nodeDomainCount, 
+			(void**)&self->data, 
+			variable_Register );
+	Memory_Free( tmpName );
+	self->fieldComponentCount = 1;
+	
+	tmpName = Stg_Object_AppendSuffix( self, "DofLayout" );
+	self->dofLayout = DofLayout_New( tmpName, variable_Register, self->feMesh->layout->decomp->nodeDomainCount );
+	DofLayout_AddAllFromVariableArray( self->dofLayout, 1, &self->dataVariable );
+	Memory_Free( tmpName );
+	self->eqNum->dofLayout = self->dofLayout;
+}
+
+/* --- Virtual Function Implementations --- */
+void _MaterialFeVariable_Delete( void* materialFeVariable ) {
+	MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
+
+	_ParticleFeVariable_Delete( self );
+}
+
+void _MaterialFeVariable_Print( void* materialFeVariable, Stream* stream ) {
+	MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
+	
+	/* General info */
+	Journal_Printf( stream, "MaterialFeVariable (ptr): %p\n", self );
+	
+	/* Print parent */
+	_ParticleFeVariable_Print( self, stream );
+	
+	/* MaterialFeVariable info */
+	Journal_PrintPointer( stream, self->material );
+}
+
+
+void* _MaterialFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	MaterialFeVariable*	self = (MaterialFeVariable*)feVariable;
+	MaterialFeVariable*	newMaterialFeVariable;
+	
+	newMaterialFeVariable = (MaterialFeVariable*) _ParticleFeVariable_Copy( feVariable, dest, deep, nameExt, ptrMap );
+
+	newMaterialFeVariable->picIntegrationPoints = self->picIntegrationPoints;
+	newMaterialFeVariable->material = self->material;
+	
+	return (void*)newMaterialFeVariable;
+}
+
+void* _MaterialFeVariable_DefaultNew( Name name ) {
+	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_Construct( void* materialFeVariable, Stg_ComponentFactory* cf, void* data ){
+	MaterialFeVariable*   self              = (MaterialFeVariable*) materialFeVariable;
+	Material*             material;
+	
+	material = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Material", Material, True, data );
+
+	/* Construct Parent */
+	_ParticleFeVariable_Construct( self, cf, data );
+
+	_FieldVariable_Construct( self, cf, data );
+	_MaterialFeVariable_Init( self, material );
+}
+
+void _MaterialFeVariable_Build( void* materialFeVariable, void* data ) {
+	MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
+	
+	_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 )
+{
+	MaterialFeVariable* self = (MaterialFeVariable*) materialFeVariable;
+	*particleValue = (double) ( self->material->index == IntegrationPointsSwarm_GetMaterialIndexOn( swarm, particle ) );
+}
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialFeVariable.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialFeVariable.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,102 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+
+#ifndef __PICellerator_MaterialPoints_MaterialFeVariable_h__
+#define __PICellerator_MaterialPoints_MaterialFeVariable_h__
+	
+	/** Textual name of this class */
+	extern const Type MaterialFeVariable_Type;
+
+	/** MaterialFeVariable class contents */
+	#define __MaterialFeVariable \
+		/* General info */ \
+		__ParticleFeVariable \
+		\
+		Material*                         material;                       \
+		IntegrationPointsSwarm*           picIntegrationPoints;                 
+		
+	struct MaterialFeVariable { __MaterialFeVariable };
+	
+	/* --- Contstructors / Destructors --- */
+	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 ) ;
+	
+	/** Print the contents of an MaterialFeVariable construct */
+	void* _MaterialFeVariable_DefaultNew( Name name );
+	void _MaterialFeVariable_Delete( void* variable );
+	void _MaterialFeVariable_Print( void* variable, Stream* stream );
+	void* _MaterialFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+
+	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 );
+	void _MaterialFeVariable_Destroy( void* variable, void* data );
+	void _MaterialFeVariable_ValueAtParticle( 
+			void*                   materialFeVariable, 
+			IntegrationPointsSwarm* swarm,
+			Element_LocalIndex      lElement_I,
+			void*                   particle,
+			double*                 particleValue );
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialFeVariable.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialFeVariable.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">MaterialFeVariable</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">ParticleFeVariable</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Material</param>
+		<param name="Type">Material</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 175 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialPoint.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialPoint.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,56 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "types.h"
+#include "MaterialPoint.h"
+
+const Type MaterialPoint_Type = "MaterialPoint";
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialPoint.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialPoint.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,63 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+
+#ifndef __PICellerator_MaterialPoint_struct_h__
+#define __PICellerator_MaterialPoint_struct_h__
+
+	extern const Type MaterialPoint_Type;
+
+	#define __MaterialPoint \
+		__GlobalParticle		\
+		Index materialIndex;
+
+	struct MaterialPoint { __MaterialPoint };
+
+	/* A reference structure for integration points to material particles */
+	#define __MaterialPointRef \
+		Index	swarm_I;	/**< Index of swarm in swarm register */	\
+		Index	particle_I;	/**< Index of particle in swarm */
+
+	struct MaterialPointRef { __MaterialPointRef };
+
+
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialPoints.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialPoints.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,74 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+
+#ifndef __PICellerator_MaterialPoints_h__
+#define __PICellerator_MaterialPoints_h__
+	
+	#include "types.h"
+	#include "Materials_Register.h"
+	#include "Material.h"
+	#include "MaterialPoint.h"
+	#include "ParticleFeVariable.h"
+	#include "MaterialFeVariable.h"
+	#include "SwarmAdvector.h"
+	#include "SwarmAdvectorD.h"
+    #include "SwarmAdvectorW.h"
+
+	#include "PeriodicBoundariesManager.h"
+
+	#include "MappedParticleLayout.h"
+	#include "BackgroundParticleLayout.h"
+
+	#include "IntegrationPointMapper.h"
+	#include "OneToOneMapper.h"
+	#include "CoincidentMapper.h"
+	#include "GaussMapper.h"
+	#include "ManyToOneMapper.h"
+
+	#include "MaterialPointsSwarm.h"
+	#include "IntegrationPointsSwarm.h"
+
+	#include "Context.h"
+	#include "Init.h"
+	#include "Finalise.h"
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialPointsSwarm.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialPointsSwarm.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,423 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+#include "MaterialPointsSwarm.h"
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type MaterialPointsSwarm_Type = "MaterialPointsSwarm";
+
+MaterialPointsSwarm* MaterialPointsSwarm_New(
+		Name                                  name,
+		void*                                 cellLayout,
+		void*                                 particleLayout,
+		Dimension_Index                       dim,
+		SizeT                                 particleSize,
+		Particle_InCellIndex                  cellParticleTblDelta,
+		double                                extraParticlesFactor,
+		FiniteElement_Mesh*                   mesh,
+		RemovalRoutine*                       removalRoutine,
+		SplittingRoutine*                     splittingRoutine,
+		EscapedRoutine*                       escapedRoutine, 
+		Material*                             material,
+		Variable_Register*                    swarmVariable_Register,
+		ExtensionManager_Register*            extensionMgr_Register,
+		Materials_Register*                   materials_Register,		
+		MPI_Comm                              comm) 
+{
+	MaterialPointsSwarm* self = (MaterialPointsSwarm*) _MaterialPointsSwarm_DefaultNew( name );
+	
+		self->particleSize = particleSize;
+
+		/* 	MaterialPointsSwarm_InitAll */
+		_Swarm_Init(  	(Swarm*)self, 
+						cellLayout, 
+						particleLayout, 
+						dim, 
+						cellParticleTblDelta, 	 
+						extraParticlesFactor,
+		 				extensionMgr_Register,
+		  				swarmVariable_Register, 
+						comm);
+		_MaterialPointsSwarm_Init(	self, 
+									mesh, 
+									removalRoutine, 
+									splittingRoutine,
+		 							escapedRoutine, 
+									material, 
+									materials_Register);
+
+	return self;
+}
+
+
+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,
+		ExtensionManager_Register*                      extensionMgr_Register,
+		Variable_Register*                              swarmVariable_Register,
+		MPI_Comm                                        comm )
+{
+	MaterialPointsSwarm* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(MaterialPointsSwarm) );
+	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 );
+
+	return self;
+}
+
+void _MaterialPointsSwarm_Init( 
+		void*                                 swarm,
+		FiniteElement_Mesh*                   mesh,
+		RemovalRoutine*                       removalRoutine,
+		SplittingRoutine*                     splittingRoutine,
+		EscapedRoutine*                       escapedRoutine, 
+		Material*                             material,
+		Materials_Register*                   materials_Register )
+{
+	MaterialPointsSwarm*    self = (MaterialPointsSwarm*)swarm;
+	MaterialPoint           particle;
+	GlobalParticle          globalParticle;
+
+	self->mesh               = mesh;
+	self->swarmAdvector      = NULL;		/* If we're using a SwarmAdvector, it will 'attach' itself later on. */
+	self->removalRoutine     = removalRoutine;
+	self->splittingRoutine   = splittingRoutine;
+	self->escapedRoutine     = escapedRoutine;
+	self->material           = material;
+	self->materials_Register = materials_Register;
+	
+	self->particleCoordVariable = Swarm_NewVectorVariable(
+		self,
+		"Position",
+		GetOffsetOfMember( globalParticle, coord ),
+		Variable_DataType_Double,
+		self->dim,
+		"PositionX",
+		"PositionY",
+		"PositionZ" );
+
+	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( self->escapedRoutine )
+		self->particleCommunicationHandler->defensive = False;
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _MaterialPointsSwarm_Delete( void* swarm ) {
+	MaterialPointsSwarm* self = (MaterialPointsSwarm*)swarm;
+
+	_Swarm_Delete( self );
+}
+
+
+void _MaterialPointsSwarm_Print( void* swarm, Stream* stream ) {
+	MaterialPointsSwarm* self = (MaterialPointsSwarm*)swarm;
+	
+	_Swarm_Print( self, stream );
+}
+
+
+
+void* _MaterialPointsSwarm_Copy( void* swarm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	MaterialPointsSwarm*	self = (MaterialPointsSwarm*)swarm;
+	MaterialPointsSwarm*	newMaterialPointsSwarm;
+	
+	newMaterialPointsSwarm = (MaterialPointsSwarm*)_Swarm_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newMaterialPointsSwarm->materialIndexVariable = (SwarmVariable*)Stg_Class_Copy(
+				self->materialIndexVariable,
+				NULL,
+				deep,
+				nameExt,
+				ptrMap );
+	
+	return (void*)newMaterialPointsSwarm;
+}
+
+void* _MaterialPointsSwarm_DefaultNew( Name name ) {
+	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,                      
+			0.0,
+			NULL,
+			NULL,
+			0);
+}
+
+
+void _MaterialPointsSwarm_Construct( void* swarm, Stg_ComponentFactory* cf, void* data ) {
+	MaterialPointsSwarm*	        self          = (MaterialPointsSwarm*) swarm;
+	FiniteElement_Mesh*             mesh;
+	RemovalRoutine*                 removalRoutine;
+	SplittingRoutine*               splittingRoutine;
+	EscapedRoutine*                 escapedRoutine;
+	Material*                       material;
+	Materials_Register*             materials_Register;
+
+	_Swarm_Construct( self, cf, data );
+
+	mesh             = Stg_ComponentFactory_ConstructByKey( cf, self->name, "FiniteElement_Mesh", FiniteElement_Mesh, True, data );
+	removalRoutine   = Stg_ComponentFactory_ConstructByKey( cf, self->name, "RemovalRoutine",     RemovalRoutine,     False, data );
+	splittingRoutine = Stg_ComponentFactory_ConstructByKey( cf, self->name, "SplittingRoutine",   SplittingRoutine,   False, data );
+	escapedRoutine   = Stg_ComponentFactory_ConstructByKey( cf, self->name, "EscapedRoutine",     EscapedRoutine,     False, data );
+	material         = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Material",           Material,           False, data );
+
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
+	assert( materials_Register );
+
+	_MaterialPointsSwarm_Init(
+			self,
+			mesh, 
+			removalRoutine,
+			splittingRoutine,
+			escapedRoutine,
+			material,
+			materials_Register );
+}
+
+void _MaterialPointsSwarm_Build( void* swarm, void* data ) {
+	MaterialPointsSwarm*	self = (MaterialPointsSwarm*) swarm;
+
+	_Swarm_Build( self, data );
+	Stg_Component_Build( self->particleCoordVariable, data, False );
+	Stg_Component_Build( self->materialIndexVariable, data, False );
+
+}
+void _MaterialPointsSwarm_Initialise( void* swarm, void* data ) {
+	MaterialPointsSwarm*	self = (MaterialPointsSwarm*) swarm;
+	AbstractContext* context = (AbstractContext*)data;
+	
+	_Swarm_Initialise( self, data );
+	Stg_Component_Initialise( self->particleCoordVariable, data, False );
+	Stg_Component_Initialise( self->materialIndexVariable, data, False );
+
+	/* if loading from checkpoint, particle materials etc have already been loaded in Swarm_Build() - 
+	 * thus nothing to do here */
+	if ( context && (True == context->loadFromCheckPoint) ) {
+		/* TODO: print info / debug message */
+	}
+	/* else for a normal run, lay out the particle->material mappings based on user defined materials */
+	else {
+		/* Setup the material properties */
+		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 );
+		}
+	}
+}
+void _MaterialPointsSwarm_Execute( void* swarm, void* data ) {
+	MaterialPointsSwarm*	self = (MaterialPointsSwarm*)swarm;
+	
+	_Swarm_Execute( self, data );
+}
+void _MaterialPointsSwarm_Destroy( void* swarm, void* data ) {
+	MaterialPointsSwarm*	self = (MaterialPointsSwarm*)swarm;
+	
+	_Swarm_Destroy( self, data );
+}
+
+void _MaterialPointsSwarm_UpdateHook( void* timeIntegrator, void* swarm ) {
+	MaterialPointsSwarm* self               = (MaterialPointsSwarm*)swarm;
+	FiniteElement_Mesh*  mesh               = self->mesh;
+	Index                cell;
+	Index                point_I;
+	MaterialPoint*       materialPoint;
+
+	/* Need to check for escaped particles before the next block. */
+	if ( self->escapedRoutine ) {
+		Stg_Component_Execute( self->escapedRoutine, self, True );
+	}
+	/* These two should also come before the "outside box" check, so we
+	can check that split particles never end up outside the box either */
+	if ( self->removalRoutine ) {
+		RemovalRoutine_RemoveFromSwarm( self->removalRoutine, self );
+	}
+	if ( self->splittingRoutine ) {
+		Stg_Component_Execute( self->splittingRoutine, self, True );
+	}
+
+	/* Check that particles have not exited the box after advection */
+	if ( self->swarmAdvector  ) {
+		for ( point_I = 0; point_I < self->particleLocalCount; ++point_I ) {
+			materialPoint = (MaterialPoint*)Swarm_ParticleAt( self, point_I );
+			cell = materialPoint->owningCell;
+			Journal_Firewall(
+				cell < mesh->elementLocalCount,
+				Journal_MyStream( Error_Type, self ),
+				"In func %s: MaterialPoint '%d' outside element. Coord = {%g, %g, %g}\n",
+				__func__,
+				point_I,
+				materialPoint->coord[ I_AXIS ],
+				materialPoint->coord[ J_AXIS ],
+				materialPoint->coord[ K_AXIS ] );
+		}
+	}
+	
+}
+
+void MaterialPointsSwarm_SetMaterialAt( void* swarm, Index point_I, Index materialIndex ) {
+	MaterialPointsSwarm* self  = (MaterialPointsSwarm*)swarm;
+	MaterialPoint*       point;
+
+	point = (MaterialPoint*)Swarm_ParticleAt( self, point_I );
+	point->materialIndex = materialIndex;
+}
+
+
+Material* MaterialPointsSwarm_GetMaterialOn( void* swarm, void* particle ) {
+	MaterialPointsSwarm* self  = (MaterialPointsSwarm*)swarm;
+	MaterialPoint*       materialPoint = (MaterialPoint*)particle;
+	
+	return Materials_Register_GetByIndex( self->materials_Register, materialPoint->materialIndex );
+}
+
+
+Material* MaterialPointsSwarm_GetMaterialAt( void* swarm, Index point_I ) {
+	MaterialPointsSwarm* self  = (MaterialPointsSwarm*)swarm;
+	MaterialPoint*       point;
+
+	point = (MaterialPoint*)Swarm_ParticleAt( self, point_I );
+	return Materials_Register_GetByIndex( self->materials_Register, point->materialIndex );
+}
+
+Index MaterialPointsSwarm_GetMaterialIndexAt( void* swarm, Index point_I ) {
+	MaterialPointsSwarm* self  = (MaterialPointsSwarm*)swarm;
+	MaterialPoint*       point;
+
+	point = (MaterialPoint*)Swarm_ParticleAt( self, point_I );
+	return point->materialIndex;
+}
+
+void* MaterialPointsSwarm_GetExtensionAt( void* swarm, Index point_I, Index extHandle ) {
+	MaterialPointsSwarm* self  = (MaterialPointsSwarm*)swarm;
+	MaterialPoint*       point;
+
+	point = (MaterialPoint*)Swarm_ParticleAt( self, point_I );
+	return ExtensionManager_Get( self->particleExtensionMgr, point, extHandle );
+	
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialPointsSwarm.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialPointsSwarm.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,169 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Represents a set of points which track materials in the domain. It can be advected during the simulation and
+**	can be population controlled for load balancing purposes.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: MaterialPointsSwarm.h 210 2005-11-03 06:23:55Z AlanLo $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_MaterialPointsSwarm_h__
+#define __PICellerator_MaterialPoints_MaterialPointsSwarm_h__
+
+	/* Textual name of this class */
+	extern const Type MaterialPointsSwarm_Type;
+
+	/* MaterialPointsSwarm information */
+	#define __MaterialPointsSwarm \
+		__Swarm \
+		\
+		FiniteElement_Mesh*                   mesh;                 \
+		SwarmAdvector*                        swarmAdvector;        \
+		RemovalRoutine*                       removalRoutine;       \
+		SplittingRoutine*                     splittingRoutine;     \
+		EscapedRoutine*                       escapedRoutine;       \
+		Material*                             material;             /**< For material assignment */ \
+		Materials_Register*                   materials_Register;   \
+		SwarmVariable*                        particleCoordVariable; /** Set only if a global coord system swarm. */ \
+		SwarmVariable*                        materialIndexVariable; 
+
+	struct MaterialPointsSwarm { __MaterialPointsSwarm };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	MaterialPointsSwarm* MaterialPointsSwarm_New(
+		Name                                  name,
+		void*                                 cellLayout,
+		void*                                 particleLayout,
+		Dimension_Index                       dim,
+		SizeT                                 particleSize,
+		Particle_InCellIndex                  cellParticleTblDelta,
+		double                                extraParticlesFactor,
+		FiniteElement_Mesh*                   mesh,
+		RemovalRoutine*                       removalRoutine,
+		SplittingRoutine*                     splittingRoutine,
+		EscapedRoutine*                       escapedRoutine, 
+		Material*                             material,
+		Variable_Register*                    swarmVariable_Register,
+		ExtensionManager_Register*            extensionMgr_Register,
+		Materials_Register*                   materials_Register,		
+		MPI_Comm                              comm);
+		
+	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,
+		ExtensionManager_Register*                      extensionMgr_Register,
+		Variable_Register*                              swarmVariable_Register,
+		MPI_Comm                                        comm);
+
+	void _MaterialPointsSwarm_Delete( void* swarm );
+	void _MaterialPointsSwarm_Print( void* swarm, Stream* stream );
+	#define MaterialPointsSwarm_Copy( self ) \
+		(MaterialPointsSwarm*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define MaterialPointsSwarm_DeepCopy( self ) \
+		(MaterialPointsSwarm*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _MaterialPointsSwarm_Copy( void* swarm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void* _MaterialPointsSwarm_DefaultNew( Name name ) ;
+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 );
+	void _MaterialPointsSwarm_Destroy( void* swarm, void* data ) ;
+
+
+void _MaterialPointsSwarm_Init( 
+		void*                                 swarm,
+		FiniteElement_Mesh*                   mesh,
+		RemovalRoutine*                       removalRoutine,
+		SplittingRoutine*                     splittingRoutine,
+		EscapedRoutine*                       escapedRoutine, 
+		Material*                             material,
+		Materials_Register*                   materials_Register );
+
+	/** TimeIntegrator hook, used to update envoke population control routines after advection */
+	void _MaterialPointsSwarm_UpdateHook( void* timeIntegrator, void* swarm );
+
+	/* Public functions */
+
+	/** Sets the material instance associated with the given point index */
+	void MaterialPointsSwarm_SetMaterialAt( void* swarm, Index point_I, Index materialIndex );
+
+	/** Returns the material instance associated with the given point index */
+	Material* MaterialPointsSwarm_GetMaterialAt( void* swarm, Index point_I );
+
+	/** Returns the material instance associated with the given MaterialPoint */
+	Material* MaterialPointsSwarm_GetMaterialOn( void* swarm, void* particle );
+
+	/** Returns the material instance associated with the given point index */
+	Index MaterialPointsSwarm_GetMaterialIndexAt( void* swarm, Index point_I );
+
+	/** Returns the particle extension at given point index */
+	void* MaterialPointsSwarm_GetExtensionAt( void* swarm, Index point_I, Index extHandle );
+	
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialPointsSwarm.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialPointsSwarm.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">MaterialPointsSwarm</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Swarm</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Represents a set of points which track materials in the domain. It can be advected during the simulation
+and can be population controlled for load balancing purposes.
+</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">FiniteElement_Mesh</param>
+		<param name="Type">FiniteElement_Mesh</param>
+		<param name="Description">The mesh this swarm exists in.</param>
+	</struct>
+	<struct>
+		<param name="Essential">False</param>
+		<param name="Name">RemovalRoutine</param>
+		<param name="Type">RemovalRoutine</param>
+		<param name="Description">Population control routine that reduces particles in a cell when there is too many.</param>
+	</struct>
+	<struct>
+		<param name="Essential">False</param>
+		<param name="Name">SplittingRoutine</param>
+		<param name="Type">SplittingRoutine</param>
+		<param name="Description">Population control routine that increases the number of particles in a cell when there is
+		not enough. </param>
+	</struct>
+	<struct>
+		<param name="Essential">False</param>
+		<param name="Name">EscapedRoutine</param>
+		<param name="Type">EscapedRoutine</param>
+		<param name="Description">Population control routine which removes particles which have escaped the mesh
+		domain</param>
+	</struct>
+	<struct>
+		<param name="Essential">False</param>
+		<param name="Name">Material</param>
+		<param name="Type">Material</param>
+		<param name="Description">If you set a material in a MaterialPointsSwarm, the entire swarm's particle will be
+		located within the material's bounds and will only consist of particle of that material. Otherwise, the swarm is
+		spread across the entire domain and will be assigned materials according to the all the materials. </param>
+	</struct>
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/MaterialSwarm.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/MaterialSwarm.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">MaterialSwarm</param>
+<param name="Organisation">VPAC & MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC & Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicensehttp://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">PopulationControlSwarm</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">ParticleType</param>
+		<param name="Type">String</param>
+		<param name="Default">MaterialParticle</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Materials_Register.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Materials_Register.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,282 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Materials_Register.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <string.h>
+#include <assert.h>
+#include <math.h>
+
+const Type Materials_Register_Type = "Materials_Register";
+
+Materials_Register* Materials_Register_New( void ) {
+	Materials_Register* self;
+
+	self = (Materials_Register*) _NamedObject_Register_New(
+		sizeof(Materials_Register),
+		Materials_Register_Type,
+		_Materials_Register_Delete,
+		_Materials_Register_Print,
+		_Materials_Register_Copy );
+
+	return self;
+}
+
+void _Materials_Register_Delete( void* _materialsRegister ) {
+	Materials_Register* self = (Materials_Register*) _materialsRegister;
+
+	_NamedObject_Register_Delete( self );
+}
+void _Materials_Register_Print( void* _materialsRegister, Stream* stream ) {
+	Materials_Register* self = (Materials_Register*) _materialsRegister;
+
+	_NamedObject_Register_Print( self, stream );
+}
+
+void* _Materials_Register_Copy( void* _materialsRegister, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	Materials_Register* self                   = (Materials_Register*) _materialsRegister;
+	Materials_Register* newMaterials_Register;
+
+	newMaterials_Register = (Materials_Register*)_NamedObject_Register_Copy( self, dest, deep, nameExt, ptrMap );
+
+	return newMaterials_Register;
+}
+
+
+void Materials_Register_SetupSwarm( void* materialRegister, MaterialPointsSwarm* swarm )
+{
+	Materials_Register* self = (Materials_Register*)materialRegister;
+
+	assert( swarm != NULL );
+
+	_Materials_Register_LayoutGeometry( self, swarm );
+	//Materials_Register_SetupParticleToMaterialMappings( self, swarm );
+	Materials_Register_AssignParticleProperties( self, swarm, swarm->swarmVariable_Register->variable_Register );
+}
+
+
+ExtensionInfo_Index Materials_Register_AddMaterialExtension( void* materialsRegister, Type type, SizeT extensionSize ) {
+	Materials_Register*     self         = (Materials_Register*) materialsRegister;
+	Material*               material;
+	ExtensionInfo_Index     firstResult  = 0;
+	ExtensionInfo_Index     result       = 0;
+	Material_Index          material_I   = 0;
+
+	for ( material_I = 0 ; material_I < Materials_Register_GetCount( self ) ; material_I++) {
+		material = Materials_Register_GetByIndex( self, material_I );
+
+		result = ExtensionManager_Add( material->extensionMgr, type, extensionSize );
+
+		if ( material_I == 0 )
+			firstResult = result;
+		else {
+			Journal_Firewall( 
+				firstResult == result, 
+				Journal_Register( Error_Type, self->type ),
+				"Material '%s' has a different number of extensions than eariler materials.\n", 
+				material->name );
+		}
+	}
+
+	return result;
+}
+			
+void _Materials_Register_LayoutGeometry( void* materialsRegister, void* swarm ) {
+	Materials_Register*     self         = (Materials_Register*) materialsRegister;
+	Material_Index          material_I;
+	Material*               material;
+	
+	for ( material_I = 0 ; material_I < Materials_Register_GetCount( self ) ; material_I++) {
+		material = Materials_Register_GetByIndex( self, material_I );
+		Material_Layout( material, swarm );
+	}
+}
+
+void Materials_Register_AssignParticleProperties( 
+		void*                   materialRegister,
+		MaterialPointsSwarm*    swarm,
+		Variable_Register*      variableRegister )
+{
+	Materials_Register* self               = (Materials_Register*)materialRegister;
+	Material*           material;
+	Particle_Index      lParticle_I;
+	Particle_Index      particleLocalCount = swarm->particleLocalCount;
+	Particle_Index      particleGlobalCount = 0;
+	Stream*             stream = Journal_Register( Info_Type, self->type );
+	double              setupStartTime = 0;
+	double              setupTime = 0;
+	Processor_Index     formerStreamPrintingRank;
+	unsigned int        numberOfCompletionPrintIncrements=10;
+	double              completionRatioIncrement= 1 / (double)numberOfCompletionPrintIncrements;
+	double              nextCompletionRatioToPrint=0;
+	Particle_Index      nextCompletedParticleCountToPrint=0;
+	Particle_Index      nextPlusOneCompletedParticleCountToPrint=0;
+
+	Journal_Printf( stream, "In func %s(): for swarm \"%s\"\n", __func__, swarm->name );
+	Stream_Indent( stream );
+	setupStartTime = MPI_Wtime();
+	formerStreamPrintingRank = Stream_GetPrintingRank( stream );
+	Stream_SetPrintingRank( stream, 0 );
+	MPI_Reduce( &particleLocalCount, &particleGlobalCount, 1, MPI_UNSIGNED, MPI_SUM, 0, swarm->comm );
+	Journal_Printf( stream, "Assigning initial particle properties to the %u global particles\n",
+		particleGlobalCount );
+	Stream_Indent( stream );
+
+	nextCompletionRatioToPrint = completionRatioIncrement;
+	nextCompletedParticleCountToPrint = ceil(particleLocalCount * nextCompletionRatioToPrint - 0.001 );
+
+	for ( lParticle_I = 0 ; lParticle_I < particleLocalCount ; lParticle_I++ ) {
+		material = MaterialPointsSwarm_GetMaterialAt( swarm, lParticle_I );
+
+		Journal_Firewall( 
+				material != NULL, 
+				Journal_Register( Error_Type, self->type ),
+				"In func %s: Cannot find material for particle '%u'\n", 
+				__func__, 
+				lParticle_I );
+	
+		/* Loop through material's dictionary assigning values to the variables of this particle */
+		Variable_Register_SetAllVariablesFromDictionary( variableRegister, lParticle_I, material->dictionary );
+
+		
+		if ( /*(swarm->myRank == 0) && */ ((lParticle_I+1) >= nextCompletedParticleCountToPrint ) ) {
+			// TODO: parallelise : non-master CPUs send a non-blocking update to the master to report
+			// status. Master does blocking receive on all updates before printing
+
+			/* Special case for really small swarms, or really small increments - may cross more than one
+				at once */
+			nextPlusOneCompletedParticleCountToPrint = ceil(( particleLocalCount
+				* (nextCompletionRatioToPrint + completionRatioIncrement )) - 0.001 );
+
+			while ( (lParticle_I+1) >= nextPlusOneCompletedParticleCountToPrint )
+			{
+				nextCompletionRatioToPrint += completionRatioIncrement;
+				nextPlusOneCompletedParticleCountToPrint = ceil(( particleLocalCount
+					* (nextCompletionRatioToPrint + completionRatioIncrement )) - 0.001 );
+				if ( nextCompletionRatioToPrint >= 1.0 ) {
+					nextCompletionRatioToPrint = 1.0;
+					break;
+				}
+			}
+			Journal_Printf( stream, "done %.0f%% (%u particles)...\n", 
+				(nextCompletionRatioToPrint * 100),
+				lParticle_I+1 );
+			nextCompletionRatioToPrint += completionRatioIncrement;
+			nextCompletedParticleCountToPrint = ceil(particleLocalCount * nextCompletionRatioToPrint - 0.001);
+		}
+	}
+	Stream_UnIndent( stream );
+	/* Need this barrier so the time is accurate */
+	MPI_Barrier( swarm->comm );
+	setupTime = MPI_Wtime() - setupStartTime;
+
+	Stream_UnIndent( stream );
+	Stream_SetPrintingRank( stream, formerStreamPrintingRank );
+	Journal_Printf( stream, "%s(): finished setup of material properties for swarm \"%s\"\n"
+		"\ttook %g secs\n", __func__, swarm->name, setupTime );
+}
+
+
+void Variable_SetValueFromDictionary( void* _variable, Index index, Dictionary* dictionary ) {
+	Variable*          variable = (Variable*)_variable;
+
+	Variable_Update( variable );
+	
+	/* Assign variable from dictionary according to data type */
+	switch (variable->dataTypes[0]) {
+		case Variable_DataType_Char:
+			Variable_SetValueChar(  variable, index, Dictionary_GetUnsignedInt( dictionary, variable->name ));
+			break;
+		case Variable_DataType_Short:
+			Variable_SetValueShort( variable, index, Dictionary_GetUnsignedInt( dictionary, variable->name ));
+			break;
+		case Variable_DataType_Int:
+			Variable_SetValueShort( variable, index, Dictionary_GetInt( dictionary, variable->name ));
+			break;
+		case Variable_DataType_Float:
+			Variable_SetValueFloat(  variable, index, Dictionary_GetDouble( dictionary, variable->name ));
+			break;
+		case Variable_DataType_Double:
+			Variable_SetValueDouble( variable, index, Dictionary_GetDouble( dictionary, variable->name ));
+			break;
+		default: {
+			Journal_Printf( 
+				Journal_MyStream( Error_Type, variable ), 
+				"In func %s: Unable to set value of %s from dictionary.", 
+				__func__, 
+				variable->name );
+		}
+	}
+}
+
+void Variable_Register_SetAllVariablesFromDictionary( void* _variable_Register, Index index, Dictionary* dictionary ) {
+	Variable_Register* variable_Register = (Variable_Register*) _variable_Register;
+	Variable*          variable;
+	Dictionary_Index   dictionary_I;
+	Dictionary_Entry*  entry;
+
+	for ( dictionary_I = 0 ; dictionary_I < dictionary->count ; dictionary_I++ ) {
+		entry = dictionary->entryPtr[ dictionary_I ];
+
+		/* Find variable on particle associated with this name */
+		variable = Variable_Register_GetByName( variable_Register, entry->key );
+		
+		/* If there is no variable, continue through loop */
+		if (variable == NULL) 
+			continue;
+
+		/* Assign Value */
+		Variable_SetValueFromDictionary( variable, index, dictionary );
+	}
+}
+
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/Materials_Register.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/Materials_Register.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,123 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Allows users to access Materialss based on their textual name,
+**	or index.
+**
+** Assumptions:
+**
+** Comments:
+**
+**
+** $Id: Materials_Register.h 280 2006-04-13 04:22:21Z AlanLo $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_Materials_Register_h__
+#define __PICellerator_MaterialPoints_Materials_Register_h__
+	
+	
+	extern const Type Materials_Register_Type;
+	
+	#define __Materials_Register \
+		__NamedObject_Register
+
+	struct Materials_Register { __Materials_Register };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructor
+	*/
+	
+	Materials_Register* Materials_Register_New( void );
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** General virtual functions
+	*/
+	void _Materials_Register_Delete( void* _materialsRegister ) ;
+	void _Materials_Register_Print( void* _materialsRegister, Stream* stream ) ;
+	void* _Materials_Register_Copy( void* _materialsRegister, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	#define Materials_Register_Add NamedObject_Register_Add
+	#define Materials_Register_GetIndex NamedObject_Register_GetIndex 
+
+	#define Materials_Register_GetByName( self, materialName ) \
+		( (Material*) NamedObject_Register_GetByName( self, materialName ) ) 
+	
+	#define Materials_Register_GetByIndex( self, materialIndex ) \
+		( (Material*) NamedObject_Register_GetByIndex( self, materialIndex ) )
+
+	#define Materials_Register_GetCount( self ) \
+		self->objects->count
+	#define Materials_Register_PrintAllEntryNames NamedObject_Register_PrintAllEntryNames
+
+	/** Setups material information for the given swarm */
+	void Materials_Register_SetupSwarm( void* materialRegister, MaterialPointsSwarm* swarm );
+
+	/** Adds an extension to each known material in the system.*/
+	ExtensionInfo_Index Materials_Register_AddMaterialExtension( void* materialsRegister, Type type, SizeT extensionSize ) ;
+
+	/** Assigns a material to each point of the swarm based on geometry setup of each material */	
+	void _Materials_Register_LayoutGeometry( void* materialsRegister, void* _swarm );
+	
+	/** Assigns material property extension values to each material point based on the material they are given by using
+	 *  the property variables.  */
+	void Materials_Register_AssignParticleProperties( 
+			void*                   materialRegister, 
+			MaterialPointsSwarm*    swarm, 
+			Variable_Register*      variableRegister );
+
+
+	/** Assigns the value for the index a number taken from the dictionary with a key that has same name as the variable */
+	void Variable_SetValueFromDictionary( void* _variable, Index index, Dictionary* dictionary );
+
+	/** For the given index in each variable of the register, assign a numerical value from the dictionary with a key that has 
+	 *  the same name as the variable. */
+	void Variable_Register_SetAllVariablesFromDictionary( void* _variable_Register, Index index, Dictionary* dictionary );
+
+
+#endif
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/OneToOneMapper.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/OneToOneMapper.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,255 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+const Type OneToOneMapper_Type = "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 )
+{
+	OneToOneMapper* result;
+
+	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, IntegrationPointsSwarm* integrationSwarm, MaterialPointsSwarm* materialSwarm ) {
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
+
+	_IntegrationPointMapper_Init( mapper, integrationSwarm );
+	
+	self->materialSwarm = materialSwarm;
+
+	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, False );
+	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;
+	
+	_IntegrationPointMapper_Print( self, stream );
+	Stream_Indent( stream );
+	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;
+	
+	newCopy = (OneToOneMapper*)_IntegrationPointMapper_Copy( self, dest, deep, nameExt, ptrMap );
+	newCopy->materialSwarm = (MaterialPointsSwarm*)Stg_Class_Copy( self->materialSwarm, NULL, deep, nameExt, ptrMap );
+
+	return newCopy;
+}
+
+void _OneToOneMapper_Construct( void* mapper, Stg_ComponentFactory* cf, void* data ) {
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
+	MaterialPointsSwarm* materialSwarm;
+	
+	_IntegrationPointMapper_Construct( self, cf, data );
+
+	materialSwarm = Stg_ComponentFactory_ConstructByKey( 
+				cf, 
+				self->name, 
+				MaterialPointsSwarm_Type, 
+				MaterialPointsSwarm,  
+				True,
+				data  );
+
+	_OneToOneMapper_Init( self, self->integrationSwarm, materialSwarm );
+
+}
+
+void _OneToOneMapper_Build( void* mapper, void* data ) {
+	OneToOneMapper* self = (OneToOneMapper*)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 ) {}
+
+MaterialPointRef* OneToOneMapper_GetMaterialRef( void* mapper, void* integrationPoint ) {
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
+
+	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 */
+
+	ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
+	Journal_Firewall(
+			ref != NULL,
+			Journal_MyStream( Error_Type, self ),
+			"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,
+			Journal_MyStream( Error_Type, self ),
+			"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,
+			Journal_MyStream( Error_Type, self ),
+			"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" );
+	result[0] = self->materialSwarm;
+	*count = 1;
+
+	return result;
+}
+
+Material_Index _OneToOneMapper_GetMaterialIndexOn( void* mapper, void* point ) {
+	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 */
+
+	materialPoint = OneToOneMapper_GetMaterialPoint( self, point, &swarm );
+
+	return ExtensionManager_Get( swarm->particleExtensionMgr, materialPoint, extHandle );
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/OneToOneMapper.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/OneToOneMapper.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,121 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: OneToOneMapper.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_OneToOneMapper_h__
+#define __PICellerator_MaterialPoints_OneToOneMapper_h__
+
+	extern const Type OneToOneMapper_Type;
+
+	/* OneToOneMapper information */
+	#define __OneToOneMapper \
+		__IntegrationPointMapper \
+		\
+		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 );
+
+	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_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 );
+
+	MaterialPointRef* OneToOneMapper_GetMaterialRef( void* mapper, void* integrationPoint );
+	MaterialPoint* OneToOneMapper_GetMaterialPoint( void* mapper, void* integrationPoint, MaterialPointsSwarm** materialSwarm );
+	
+	
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/OneToOneMapper.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/OneToOneMapper.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">OneToOneMapper</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">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 material swarm to map to</param>
+	</struct>
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/ParticleFeVariable.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/ParticleFeVariable.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,344 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: ParticleFeVariable.c 381 2006-11-23 01:41:37Z EinatLev $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints.h"
+
+#include <assert.h>
+
+const Type ParticleFeVariable_Type = "ParticleFeVariable";
+
+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) );
+	self = (ParticleFeVariable*)
+		_FeVariable_New(
+			_sizeOfSelf, 
+			type, 
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute, 
+			_destroy,
+			name,
+			False,
+			_interpolateValueAt,
+			_getMinGlobalFeMagnitude, 
+			_getMaxGlobalFeMagnitude,
+			_getMinAndMaxLocalCoords, 
+			_getMinAndMaxGlobalCoords,
+			_interpolateWithinElement,
+			_getValueAtNode,
+			NULL,
+			NULL,
+			NULL,
+			NULL,   /* bcs */
+			NULL,   /* ics */
+			NULL,   /* linkedDofInfo */
+			NULL,   /* templateFeVariable */
+			0,      /* fieldComponentCount */
+			0,	/* dim */
+			True, /* isCheckpointedAndReloaded */
+			NULL,	/* import format type */
+			NULL,	/* export format type */
+			0,	/* communicator */
+			NULL	/* fv_Register */
+			);
+
+	self->_valueAtParticle = _valueAtParticle;
+	
+	return self;
+}
+
+void _ParticleFeVariable_Init( ParticleFeVariable* self, IntegrationPointsSwarm* swarm, FiniteElementContext* context ) 
+{
+	/* Create Vector */
+	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 );
+	ForceTerm_SetAssembleElementFunction( self->assemblyTerm, ParticleFeVariable_AssembleElement );
+
+	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 );
+	
+	EP_AppendClassHook( Context_GetEntryPoint( context, AbstractContext_EP_UpdateClass ),	ParticleFeVariable_Update, self );
+}
+
+/* --- 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 );
+}
+
+void _ParticleFeVariable_Print( void* materialFeVariable, Stream* stream ) {
+	ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
+	
+	/* General info */
+	Journal_Printf( stream, "ParticleFeVariable (ptr): %p\n", self );
+	
+	/* Print parent */
+	_FeVariable_Print( self, stream );
+	
+	/* ParticleFeVariable info */
+}
+
+
+void* _ParticleFeVariable_Copy( void* feVariable, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	abort();
+	
+	return NULL;
+}
+
+void _ParticleFeVariable_Construct( void* materialFeVariable, Stg_ComponentFactory* cf, void* data ){
+	ParticleFeVariable*     self            = (ParticleFeVariable*) materialFeVariable;
+	IntegrationPointsSwarm* swarm;
+	FiniteElementContext*   context;
+	FiniteElement_Mesh*     mesh;
+
+	swarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Swarm", IntegrationPointsSwarm, True, data );
+	context = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Context", FiniteElementContext, True, data );
+	mesh = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Mesh", FiniteElement_Mesh, True, data );
+
+	/* Construct Parent */
+	_FieldVariable_Construct( self, cf, data );
+	_FeVariable_Init( (FeVariable*)self, mesh, NULL, NULL, NULL, NULL, NULL, NULL,
+		StgFEM_Native_ImportExportType, StgFEM_Native_ImportExportType );
+	_ParticleFeVariable_Init( self, swarm, context );
+}
+
+void _ParticleFeVariable_Build( void* materialFeVariable, void* data ) {
+	ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
+	
+	Stg_Component_Build( self->feMesh, data, False );
+	self->data = Memory_Alloc_Array( double, self->feMesh->nodeDomainCount * self->fieldComponentCount, "data" );
+
+	/* Do a Variable_Update() first as well as last, since if we are loading from checkpoint we need
+	to make sure the variable exists to put ICs onto - and we only just allocated it */
+	Stg_Component_Build( self->dataVariable, data, False );
+	Variable_Update( self->dataVariable );
+
+	_FeVariable_Build( self, data );
+
+	Stg_Component_Build( self->assemblyVector, data, False );
+	Stg_Component_Build( self->massMatrix, data, False );
+
+	Variable_Update( self->dataVariable );
+}
+
+void _ParticleFeVariable_Initialise( void* materialFeVariable, void* data ) {
+	ParticleFeVariable*      self = (ParticleFeVariable*) materialFeVariable;
+	DiscretisationContext*   context = (DiscretisationContext*)data;
+
+	/* Do a Variable_Update() first as well as last, since if we are loading from checkpoint we need
+	to make sure the variable exists to put ICs onto */
+
+	Stg_Component_Initialise( self->dataVariable, data, False );
+	Variable_Update( self->dataVariable );
+
+	_FeVariable_Initialise( self, data );
+
+	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 && (True == context->loadFromCheckPoint)  ) ) {
+		ParticleFeVariable_Update( self );
+	}
+}
+
+void _ParticleFeVariable_Execute( void* materialFeVariable, void* data ) {
+	ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
+
+	_FeVariable_Execute( self, data );
+}
+
+void _ParticleFeVariable_Destroy( void* materialFeVariable, void* data ) {
+	ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
+
+	_FeVariable_Destroy( self, data );
+}
+
+
+void ParticleFeVariable_Update( void* materialFeVariable ) {
+	ParticleFeVariable* self = (ParticleFeVariable*) materialFeVariable;
+
+	/* Initialise Vectors */
+	Vector_Zero( self->assemblyVector->vector );
+	Vector_Zero( self->massMatrix->vector );
+
+	ForceVector_Assemble( self->assemblyVector );
+	ForceVector_Assemble( self->massMatrix );
+
+	Vector_PointwiseDivide( self->assemblyVector->vector, self->massMatrix->vector, self->assemblyVector->vector );
+
+	SolutionVector_UpdateSolutionOntoNodes( self->assemblyVector );
+}
+
+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;
+	FiniteElement_Mesh*        mesh              = self->feMesh;
+	Element_NodeIndex          elementNodeCount  = mesh->elementNodeCountTbl[ lElement_I ];
+	ElementType*               elementType       = FeMesh_ElementTypeAt( mesh, lElement_I );
+	Cell_Index                 cell_I            = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
+	Particle_InCellIndex       cellParticleCount;
+	Particle_InCellIndex       cParticle_I;
+	IntegrationPoint*          particle;
+	Node_Index                 node_I;
+	Dof_Index                  dofCount          = self->fieldComponentCount;
+	Dof_Index                  dof_I;
+	double                     shapeFunc[8];
+	double                     particleValue[9];
+
+	cellParticleCount = swarm->cellParticleCountTbl[ cell_I ];
+	
+	for( cParticle_I = 0 ; cParticle_I < cellParticleCount; cParticle_I++ ) {
+		/* Find this particle in the element */
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
+
+		ParticleFeVariable_ValueAtParticle( self, swarm, lElement_I, particle, particleValue );
+
+		ElementType_EvaluateShapeFunctionsAt( elementType, particle->xi, shapeFunc );
+
+		for ( dof_I = 0 ; dof_I < dofCount ; dof_I++ ) {
+			for ( node_I = 0 ; node_I < elementNodeCount ; node_I++ ) {
+				elForceVector[ node_I * dofCount + dof_I ] += shapeFunc[ node_I ] * particleValue[ dof_I ]; 
+			}
+		}
+	}
+}
+
+void ParticleFeVariable_AssembleElementShapeFunc( void* _forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVector ) 
+{
+	ForceTerm*                 forceTerm         = (ForceTerm*) _forceTerm;
+	ParticleFeVariable*        self              = Stg_CheckType( forceVector->feVariable, ParticleFeVariable );
+	Swarm*                     swarm             = forceTerm->integrationSwarm;
+	FiniteElement_Mesh*        mesh              = self->feMesh;
+	Element_NodeIndex          elementNodeCount  = mesh->elementNodeCountTbl[ lElement_I ];
+	ElementType*               elementType       = FeMesh_ElementTypeAt( mesh, lElement_I );
+	Cell_Index                 cell_I            = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
+	Particle_InCellIndex       cellParticleCount;
+	Particle_InCellIndex       cParticle_I;
+	IntegrationPoint*          particle;
+	Node_Index                 node_I;
+	Dof_Index                  dofCount          = self->fieldComponentCount;
+	Dof_Index                  dof_I;
+	double                     shapeFunc[8];
+
+	cellParticleCount = swarm->cellParticleCountTbl[ cell_I ];
+	
+	for( cParticle_I = 0 ; cParticle_I < cellParticleCount; cParticle_I++ ) {
+		/* Find this particle in the element */
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
+
+		ElementType_EvaluateShapeFunctionsAt( elementType, particle->xi, shapeFunc );
+
+		for ( dof_I = 0 ; dof_I < dofCount ; dof_I++ ) {
+			for ( node_I = 0 ; node_I < elementNodeCount ; node_I++ ) {
+				elForceVector[ node_I * dofCount + dof_I ] += shapeFunc[ node_I ]; 
+			}
+		}
+	}
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/ParticleFeVariable.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/ParticleFeVariable.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,136 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+
+#ifndef __PICellerator_MaterialPoints_ParticleFeVariable_h__
+#define __PICellerator_MaterialPoints_ParticleFeVariable_h__
+
+	/** @see ParticleFeVariable_ValueAtParticle */
+	typedef void ParticleFeVariable_ValueAtParticleFunction( 
+			void*                   particleFeVariable, 
+			IntegrationPointsSwarm* swarm, 
+			Element_LocalIndex      lElement_I, 
+			void*                   particle, 
+			double*                 particleValue );
+	
+	/** Textual name of this class */
+	extern const Type ParticleFeVariable_Type;
+
+	/** ParticleFeVariable class contents */
+	#define __ParticleFeVariable \
+		/* General info */ \
+		__FeVariable \
+		\
+		/* Virtual info */ \
+		ParticleFeVariable_ValueAtParticleFunction*       _valueAtParticle;               \
+		\
+		/* ParticleFeVariable info */ \
+		double*                                           data;                           \
+		Variable*                                         dataVariable;                   \
+		Name                                              assemblyVectorName;             \
+		ForceVector*                                      assemblyVector;                 \
+		ForceTerm*                                        assemblyTerm;                   \
+		Name                                              massMatrixName;                 \
+		ForceVector*                                      massMatrix;                     \
+		ForceTerm*                                        massMatrixForceTerm;            \
+		
+		
+	struct ParticleFeVariable { __ParticleFeVariable };
+	
+	/* --- 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 );
+	
+	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_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) )
+
+	void ParticleFeVariable_Update( void* materialFeVariable );
+
+	void ParticleFeVariable_AssembleElement( 
+			void*                   forceTerm, 
+			ForceVector*            forceVector, 
+			Element_LocalIndex      lElement_I, 
+			double*                 elForceVector );
+
+	void ParticleFeVariable_AssembleElementShapeFunc( 
+			void*                   forceTerm, 
+			ForceVector*            forceVector, 
+			Element_LocalIndex      lElement_I, 
+			double*                 elForceVector );
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/ParticleFeVariable.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/ParticleFeVariable.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">FeVariable</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Swarm</param>
+		<param name="Type">Swarm</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 162 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Context</param>
+		<param name="Type">FiniteElementContext</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 163 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Mesh</param>
+		<param name="Type">FiniteElement_Mesh</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 164 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/PeriodicBoundariesManager.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/PeriodicBoundariesManager.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,406 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: PeriodicBoundariesManager.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "types.h"
+#include "PeriodicBoundariesManager.h"
+
+#include <string.h>
+#include <assert.h>
+
+/* Textual name of this class */
+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,
+		BlockGeometry*              geometry,
+		Swarm*                      swarm,
+		Dictionary*                 dictionary )
+{
+	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,
+		geometry,
+		swarm,
+		dictionary );
+}	
+
+
+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,
+		BlockGeometry*                         geometry,
+		Swarm*                                 swarm,
+		Dictionary*                            dictionary )		
+{
+	PeriodicBoundariesManager* self;
+	
+	/* Allocate memory */
+	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, geometry, swarm, dictionary );
+	}
+	
+	return self;
+}
+
+
+void _PeriodicBoundariesManager_Init(
+		void*             periodicBCsManager,
+		BlockGeometry*    geometry,
+		Swarm*            swarm,
+		Dictionary*       dictionary )
+{
+	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)periodicBCsManager;
+
+	self->isConstructed = True;
+	self->dictionary = dictionary;
+	self->geometry = geometry;
+	self->swarm = swarm;
+	self->count = 0;
+	self->delta = 0;
+	self->size = 0;
+	self->boundaries = NULL;
+	self->debug = Journal_Register( Debug_Type, self->type );
+}
+
+
+void _PeriodicBoundariesManager_Construct( void* periodicBCsManager, Stg_ComponentFactory* cf, void* data ) {
+	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)periodicBCsManager;
+	Dictionary*			dictionary = NULL;
+	BlockGeometry*                  geometry = NULL;
+	Swarm*                          swarm = NULL;
+
+	dictionary = Dictionary_GetDictionary( cf->componentDict, self->name );
+	geometry =  Stg_ComponentFactory_ConstructByKey(  cf,  self->name,  "Geometry", BlockGeometry,  True, data  ) ;
+	swarm =  Stg_ComponentFactory_ConstructByKey(  cf,  self->name,  "Swarm", Swarm,  True, data  ) ;
+
+	_PeriodicBoundariesManager_Init( self, geometry, swarm, dictionary );
+}
+
+
+void _PeriodicBoundariesManager_Delete( void* perBCsManager ) {
+	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)perBCsManager;
+	
+	Memory_Free( self->boundaries );
+	
+	/* Stg_Class_Delete parent */
+	_Stg_Component_Delete( self );
+}
+
+/* Virtual Functions -------------------------------------------------------------------------------------------------------------*/
+
+void _PeriodicBoundariesManager_Print( void* perBCsManager, Stream* stream ) {
+	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)perBCsManager;
+	Index		perBoundary_I = 0;
+	
+	/* General info */
+	Journal_Printf( stream, "PeriodicBoundariesManager (ptr): %p\n", self );
+	
+	/* Print parent */
+	_Stg_Component_Print( self, stream );
+
+	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,
+			self->boundaries[perBoundary_I].minWall,
+			self->boundaries[perBoundary_I].maxWall );
+	}
+	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;
+	
+	if( !map ) {
+		map = PtrMap_New( 10 );
+		ownMap = True;
+	}
+
+	newPeriodicBCsManager = _Stg_Class_Copy( self, dest, deep, nameExt, map );
+
+	newPeriodicBCsManager->count = self->count;
+	newPeriodicBCsManager->size = self->size;
+	newPeriodicBCsManager->delta = self->delta;
+
+	if ( deep ) {
+		newPeriodicBCsManager->dictionary = (Dictionary*)Stg_Class_Copy( self->dictionary, NULL, deep, nameExt, map );
+		newPeriodicBCsManager->geometry = (BlockGeometry*)Stg_Class_Copy( self->geometry, NULL, deep, nameExt, map );
+		newPeriodicBCsManager->swarm = (Swarm*)Stg_Class_Copy( self->swarm, NULL, deep, nameExt, map );
+		newPeriodicBCsManager->debug = self->debug;
+		newPeriodicBCsManager->boundaries = Memory_Alloc_Array( PeriodicBoundary, self->size,
+			"PeriodicBoundaries" );
+		memcpy( newPeriodicBCsManager->boundaries, self->boundaries, sizeof(PeriodicBoundary)*self->count );	
+	}
+	else {
+		newPeriodicBCsManager->dictionary = self->dictionary;
+		newPeriodicBCsManager->geometry = self->geometry;
+		newPeriodicBCsManager->swarm = self->swarm;
+		newPeriodicBCsManager->boundaries = self->boundaries;
+		newPeriodicBCsManager->debug = self->debug;
+	}
+	
+	if( ownMap ) {
+		Stg_Class_Delete( map );
+	}
+	
+	return (void*)newPeriodicBCsManager;
+
+
+	
+	return NULL;
+}
+
+
+void _PeriodicBoundariesManager_Build( void* periodicBCsManager, void* data ) {	
+	PeriodicBoundariesManager* self = (PeriodicBoundariesManager*)periodicBCsManager;
+	Dictionary_Entry_Value*    periodicBCsList = NULL;
+	
+	self->size = 4;
+	self->boundaries = Memory_Alloc_Array( PeriodicBoundary, self->size, "PeriodicBoundariesManager->boundaries" );
+
+	periodicBCsList = Dictionary_Get( self->dictionary, "PeriodicBoundaries" );
+	
+	/* Dictionary entry is optional - users may prefer to enter in code */
+	if ( periodicBCsList ) {
+		Index                   numPeriodicBCs = 0;
+		Index                   periodicBC_I = 0;
+		Dictionary_Entry_Value* periodicBC = NULL;
+		char*                   perBCAxis = NULL;
+		
+		numPeriodicBCs = Dictionary_Entry_Value_GetCount( periodicBCsList );
+
+		for ( periodicBC_I = 0; periodicBC_I < numPeriodicBCs; periodicBC_I++ ) {
+			periodicBC = Dictionary_Entry_Value_GetElement( periodicBCsList, periodicBC_I );
+			perBCAxis = Dictionary_Entry_Value_AsString( periodicBC );
+
+			if ( 0 == strcmp( perBCAxis, "I_AXIS" ) ) {
+				PeriodicBoundariesManager_AddPeriodicBoundary( self, I_AXIS );
+			}
+			else if ( 0 == strcmp( perBCAxis, "J_AXIS" ) ) {
+				PeriodicBoundariesManager_AddPeriodicBoundary( self, J_AXIS );
+			}
+			else if ( 0 == strcmp( perBCAxis, "K_AXIS" ) ) {
+				PeriodicBoundariesManager_AddPeriodicBoundary( self, K_AXIS );
+			}
+		}
+	}
+
+}
+
+
+void _PeriodicBoundariesManager_Initialise( void* periodicBCsManager, void* data ) {	
+}
+
+void _PeriodicBoundariesManager_Execute( void* periodicBCsManager, void* data ) {	
+}
+
+void _PeriodicBoundariesManager_Destroy( void* periodicBCsManager, void* data ) {	
+}
+
+/* Public Functions -------------------------------------------------------------------------------------------------------------*/
+
+void PeriodicBoundariesManager_AddPeriodicBoundary( void* periodicBCsManager, Axis axis ) {
+	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)periodicBCsManager;	
+	PeriodicBoundary*		newPeriodicBoundary;
+	
+	if ( self->count == self->size ) {
+		self->size += self->delta;
+		self->boundaries = Memory_Realloc_Array( self->boundaries, PeriodicBoundary, self->size );
+	}
+	newPeriodicBoundary = &self->boundaries[self->count];
+	newPeriodicBoundary->axis = axis;
+	newPeriodicBoundary->minWall = self->geometry->min[axis];
+	newPeriodicBoundary->maxWall = self->geometry->max[axis];
+	newPeriodicBoundary->particlesUpdatedMinEndCount = 0;	
+	newPeriodicBoundary->particlesUpdatedMaxEndCount = 0;	
+	self->count++;
+}
+
+
+void PeriodicBoundariesManager_UpdateParticle( void* periodicBCsManager, Particle_Index lParticle_I ) {
+	Axis				boundaryAxis;	
+	PeriodicBoundariesManager*	self = (PeriodicBoundariesManager*)periodicBCsManager;
+	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 (%.2f,%.2f,%2f)\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 %.2f:\n", perBoundary->minWall );
+			difference = perBoundary->minWall - particle->coord[boundaryAxis];
+			particle->coord[boundaryAxis] = perBoundary->maxWall - difference;
+			perBoundary->particlesUpdatedMinEndCount++;
+			Journal_DPrintfL( self->debug, 3, "moving to (%.2f,%.2f,%.2f).\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 %.2f:\n", perBoundary->maxWall );
+			difference = particle->coord[boundaryAxis] - perBoundary->maxWall; 
+			particle->coord[boundaryAxis] = perBoundary->minWall + difference;
+			perBoundary->particlesUpdatedMaxEndCount++;
+			Journal_DPrintfL( self->debug, 3, "moving to (%.2f,%.2f,%.2f).\n",
+				particle->coord[I_AXIS], particle->coord[J_AXIS],
+				particle->coord[K_AXIS] );
+		}
+		Stream_UnIndent( self->debug );
+	}	
+
+	Stream_UnIndent( self->debug );
+
+	/* TODO: this is a bit of a hack to print this here using the lParticleI = swarm->total - 1, but its
+	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;
+	
+		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];
+
+			Journal_DPrintfL( self->debug, 1, "Periodic Boundary in %c Axis {%.2f,%.2f}: %d min end, %d max end\n",
+				IJKTopology_DimNumToDimLetter[boundary->axis], boundary->minWall, boundary->maxWall,
+				boundary->particlesUpdatedMinEndCount, boundary->particlesUpdatedMaxEndCount );
+			/* Reset the counters for next time */
+			boundary->particlesUpdatedMinEndCount = 0;	
+			boundary->particlesUpdatedMaxEndCount = 0;	
+		}
+		Stream_UnIndent( self->debug );
+	}
+}	
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/PeriodicBoundariesManager.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/PeriodicBoundariesManager.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,134 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Manages the interactions between particles and periodic boundary conditions.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: PeriodicBoundariesManager.h 374 2006-10-12 08:59:41Z SteveQuenette $
+*
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#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;
+	} PeriodicBoundary;
+
+	#define __PeriodicBoundariesManager \
+		__Stg_Component \
+		\
+		Dictionary*		dictionary; \
+		BlockGeometry*          geometry; \
+		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,
+		BlockGeometry*                                  geometry,
+		Swarm*                                          swarm,
+		Dictionary*					dictionary );
+
+	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,
+		BlockGeometry*                         geometry,
+		Swarm*                                 swarm,
+		Dictionary*                            dictionary );
+
+	void _PeriodicBoundariesManager_Init(
+		void*             periodicBCsManager,
+		BlockGeometry*    geometry,
+		Swarm*            swarm,
+		Dictionary*       dictionary );
+		
+	void _PeriodicBoundariesManager_Construct( void* periodicBCsManager, Stg_ComponentFactory* cf, void* data );
+	
+	void _PeriodicBoundariesManager_Delete( void* context );
+
+	void _PeriodicBoundariesManager_Print( void* context, Stream* stream );
+
+	void* _PeriodicBoundariesManager_Copy( void* periodicBCsManager, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+
+	void _PeriodicBoundariesManager_Build( void* periodicBCsManager, void* data );
+
+	void _PeriodicBoundariesManager_Initialise( void* periodicBCsManager, void* data );
+
+	void _PeriodicBoundariesManager_Execute( void* periodicBCsManager, void* data );
+
+	void _PeriodicBoundariesManager_Destroy( void* periodicBCsManager, void* data );
+
+	void PeriodicBoundariesManager_AddPeriodicBoundary( void* periodicBCsManager, Axis axis );
+
+	void PeriodicBoundariesManager_UpdateParticle( void* periodicBCsManager, Particle_Index lParticle_I );
+
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/PeriodicBoundariesManager.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/PeriodicBoundariesManager.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">PeriodicBoundariesManager</param>
+<param name="Author">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SingleMaterialMapper.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SingleMaterialMapper.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">SingleMaterialMapper</param>
+<param name="Organisation">VPAC & MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC & Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicensehttp://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">IPMapper</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 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SwarmAdvector.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SwarmAdvector.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,317 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: SwarmAdvector.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "types.h"
+#include "SwarmAdvector.h"
+
+#include "MaterialPointsSwarm.h"
+#include "PeriodicBoundariesManager.h"
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type SwarmAdvector_Type = "SwarmAdvector";
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+SwarmAdvector* SwarmAdvector_New(
+		Name                                       name,
+		TimeIntegrator*                            timeIntegrator,
+		FeVariable*                                velocityField,
+		Bool                                       allowFallbackToFirstOrder,
+		MaterialPointsSwarm*                       swarm,
+		PeriodicBoundariesManager*                 periodicBCsManager )
+{
+	SwarmAdvector* self = (SwarmAdvector*) _SwarmAdvector_DefaultNew( name );
+
+	/* 	SwarmAdvector_InitAll */
+	_TimeIntegratee_Init( self, timeIntegrator, swarm->particleCoordVariable->variable, 0, NULL,
+		allowFallbackToFirstOrder );
+	_SwarmAdvector_Init( self, velocityField, swarm, periodicBCsManager );
+
+	return self;
+}
+
+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*)_TimeIntegratee_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculateTimeDeriv,
+			_intermediate,
+			name );
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _SwarmAdvector_Init( 
+		SwarmAdvector*                             self,
+		FeVariable*                                velocityField,
+		MaterialPointsSwarm*                       swarm,
+		PeriodicBoundariesManager*                 periodicBCsManager )
+{
+	// TODO - commented out by Pat Sunter 20060428 since we need to use gauss layout initially for testing sometimes
+	/*
+	Journal_Firewall(
+		swarm->particleLayout->coordSystem == GlobalCoordSystem,
+		Journal_MyStream( Error_Type, self ),
+		"In func - %s, swarm %s does not use a global coordinate system because of particle layout %s is of type %s\n",
+		__func__,
+		swarm->name,
+		swarm->particleLayout->name,
+		swarm->particleLayout->type );
+	*/
+	
+	self->velocityField = velocityField;
+	self->swarm = swarm;
+	self->swarm->swarmAdvector = self;	/* Attach ourselves to the swarm */
+	self->variable = swarm->particleCoordVariable->variable;
+	self->periodicBCsManager = periodicBCsManager;
+
+	TimeIntegrator_AppendSetupEP( self->timeIntegrator,  
+			"SwarmAdvector_AdvectionSetup", SwarmAdvector_AdvectionSetup,  self->name, self );
+	TimeIntegrator_PrependFinishEP( self->timeIntegrator,
+			"SwarmAdvector_AdvectionFinish", SwarmAdvector_AdvectionFinish,  self->name, self );
+	TimeIntegrator_InsertBeforeFinishEP( 
+		self->timeIntegrator,
+		"IntegrationPointsSwarm_Update", /* Must before this */
+		"MaterialPointsSwarm_Update", 
+		_MaterialPointsSwarm_UpdateHook, 
+		swarm->name, 
+		swarm );
+			
+}
+
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _SwarmAdvector_Delete( void* swarmAdvector ) {
+	SwarmAdvector* self = (SwarmAdvector*)swarmAdvector;
+
+	/* Delete parent */
+	_TimeIntegratee_Delete( self );
+}
+
+
+void _SwarmAdvector_Print( void* swarmAdvector, Stream* stream ) {
+	SwarmAdvector* self = (SwarmAdvector*)swarmAdvector;
+	
+	/* Print parent */
+	_TimeIntegratee_Print( self, stream );
+}
+
+
+void* _SwarmAdvector_Copy( void* swarmAdvector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	SwarmAdvector*	self = (SwarmAdvector*)swarmAdvector;
+	SwarmAdvector*	newSwarmAdvector;
+	
+	newSwarmAdvector = (SwarmAdvector*)_TimeIntegratee_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newSwarmAdvector->velocityField = self->velocityField;
+	newSwarmAdvector->swarm         = self->swarm;
+	newSwarmAdvector->periodicBCsManager = self->periodicBCsManager;
+	
+	return (void*)newSwarmAdvector;
+}
+
+void* _SwarmAdvector_DefaultNew( Name name ) {
+	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_Construct( void* swarmAdvector, Stg_ComponentFactory* cf, void* data ) {
+	SwarmAdvector*	            self          = (SwarmAdvector*) swarmAdvector;
+	FeVariable*                 velocityField;
+	MaterialPointsSwarm*        swarm;
+	PeriodicBoundariesManager*  periodicBCsManager;
+
+	_TimeIntegratee_Construct( self, cf, 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 );
+}
+
+void _SwarmAdvector_Build( void* swarmAdvector, void* data ) {
+	SwarmAdvector*	self = (SwarmAdvector*) swarmAdvector;
+
+	_TimeIntegratee_Build( self, data );
+}
+void _SwarmAdvector_Initialise( void* swarmAdvector, void* data ) {
+	SwarmAdvector*	self = (SwarmAdvector*) swarmAdvector;
+	
+	_TimeIntegratee_Initialise( self, data );
+}
+void _SwarmAdvector_Execute( void* swarmAdvector, void* data ) {
+	SwarmAdvector*	self = (SwarmAdvector*)swarmAdvector;
+	
+	_TimeIntegratee_Execute( self, data );
+}
+void _SwarmAdvector_Destroy( void* swarmAdvector, void* data ) {
+	SwarmAdvector*	self = (SwarmAdvector*)swarmAdvector;
+	
+	_TimeIntegratee_Destroy( self, data );
+}
+
+Bool _SwarmAdvector_TimeDeriv( void* swarmAdvector, Index array_I, double* timeDeriv ) {
+	SwarmAdvector*      self          = (SwarmAdvector*) swarmAdvector;
+	FieldVariable*      velocityField = (FieldVariable*) self->velocityField;
+	double*             coord;
+	InterpolationResult result;
+
+	/* Get Coordinate of Object using Variable */
+	coord = Variable_GetPtrDouble( self->variable, array_I );
+
+	result = FieldVariable_InterpolateValueAt( velocityField, coord, timeDeriv );
+
+	if ( result == OTHER_PROC || result == OUTSIDE_GLOBAL || isinf(timeDeriv[0]) || isinf(timeDeriv[1]) || 
+			( self->swarm->dim == 3 && isinf(timeDeriv[2]) ) ) 
+	{
+		#if 0
+		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], 
+			timeDeriv[0], timeDeriv[1], ( self->swarm->dim == 3 ? timeDeriv[2] : 0.0 ),
+			InterpolationResultToStringMap[result]  );
+		#endif	
+		return False;	
+	}
+
+	return True;
+}
+
+
+void _SwarmAdvector_Intermediate( void* swarmAdvector, Index lParticle_I ) {
+	SwarmAdvector*      self          = (SwarmAdvector*) swarmAdvector;
+
+	if ( self->periodicBCsManager ) {
+		PeriodicBoundariesManager_UpdateParticle( self->periodicBCsManager, lParticle_I );
+	}
+}
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+/*---------------------------------------------------------------------------------------------------------------------
+** Entry Point Hooks
+*/
+void SwarmAdvector_AdvectionSetup( TimeIntegrator* timeIntegrator, SwarmAdvector* self ) {
+	FeVariable_SyncShadowValues( self->velocityField );
+}
+
+void SwarmAdvector_AdvectionFinish( TimeIntegrator* timeIntegrator, SwarmAdvector* self ) {
+	#if DEBUG
+		Swarm_CheckCoordsAreFinite( self->swarm );
+	#endif
+	
+	/* Move particles across processors because they've just been advected */
+	Swarm_UpdateAllParticleOwners( self->swarm );
+}
+
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SwarmAdvector.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SwarmAdvector.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,136 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: SwarmAdvector.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_SwarmAdvector_h__
+#define __PICellerator_MaterialPoints_SwarmAdvector_h__
+
+	/* Textual name of this class */
+	extern const Type SwarmAdvector_Type;
+
+	/* SwarmAdvector information */
+	#define __SwarmAdvector \
+		/* General info */ \
+		__TimeIntegratee \
+		/* Virtual Info */\
+		/* Other Info */\
+		MaterialPointsSwarm*                  swarm;                \
+		FeVariable*                           velocityField;        \
+		PeriodicBoundariesManager*            periodicBCsManager;   \
+
+	struct SwarmAdvector { __SwarmAdvector };
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	SwarmAdvector* SwarmAdvector_New(
+		Name                                       name,
+		TimeIntegrator*                            timeIntegrator,
+		FeVariable*                                velocityField,
+		Bool                                       allowFallbackToFirstOrder,
+		MaterialPointsSwarm*                       swarm,
+		PeriodicBoundariesManager*                 periodicBCsManager );
+
+	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,
+		FeVariable*                                velocityField,
+		MaterialPointsSwarm*                       swarm,
+		PeriodicBoundariesManager*                 periodicBCsManager );
+
+	void _SwarmAdvector_Delete( void* materialSwarm );
+	void _SwarmAdvector_Print( void* materialSwarm, Stream* stream );
+	#define SwarmAdvector_Copy( self ) \
+		(SwarmAdvector*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define SwarmAdvector_DeepCopy( self ) \
+		(SwarmAdvector*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _SwarmAdvector_Copy( void* materialSwarm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void* _SwarmAdvector_DefaultNew( Name name ) ;
+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 );
+	void _SwarmAdvector_Destroy( void* materialSwarm, void* data ) ;
+	Bool _SwarmAdvector_TimeDeriv( void* swarmAdvector, Index array_I, double* timeDeriv ) ;
+	void _SwarmAdvector_Intermediate( void* swarmAdvector, Index array_I ) ;
+	
+		
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Entry Point Hooks
+	*/
+	void SwarmAdvector_AdvectionSetup( TimeIntegrator* timeIntegrator, SwarmAdvector* self ) ;
+	void SwarmAdvector_AdvectionFinish( TimeIntegrator* timeIntegrator, SwarmAdvector* self ) ;
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SwarmAdvector.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SwarmAdvector.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">SwarmAdvector</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">TimeIntegratee</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">VelocityField</param>
+		<param name="Type">FeVariable</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 184 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Swarm</param>
+		<param name="Type">Swarm</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 185 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">PeriodicBCsManager</param>
+		<param name="Type">PeriodicBoundariesManager</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 186 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SwarmAdvectorD.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SwarmAdvectorD.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,241 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "types.h"
+#include "SwarmAdvector.h"
+#include "SwarmAdvectorD.h"
+
+#include "MaterialPointsSwarm.h"
+#include "PeriodicBoundariesManager.h"
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type SwarmAdvectorD_Type = "SwarmAdvectorD";
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+SwarmAdvectorD* SwarmAdvectorD_New(
+		Name                                       name,
+		TimeIntegrator*                            timeIntegrator,
+		FeVariable*                                velocityField,
+		Bool                                       allowFallbackToFirstOrder,
+		MaterialPointsSwarm*                       swarm,
+		PeriodicBoundariesManager*                 periodicBCsManager )
+{
+	SwarmAdvectorD* self = (SwarmAdvectorD*) _SwarmAdvectorD_DefaultNew( name );
+
+	/* 	SwarmAdvectorD_InitAll */
+	_TimeIntegratee_Init( self, timeIntegrator, swarm->particleCoordVariable->variable, 0, NULL,
+		allowFallbackToFirstOrder );
+	_SwarmAdvector_Init( (SwarmAdvector*)self, velocityField, swarm, periodicBCsManager );
+	_SwarmAdvectorD_Init( self );
+
+	return self;
+}
+
+SwarmAdvectorD* _SwarmAdvectorD_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 )
+{
+	SwarmAdvectorD* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(SwarmAdvectorD) );
+	self = (SwarmAdvectorD*)_SwarmAdvector_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculateTimeDeriv,
+			_intermediate,
+			name );
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _SwarmAdvectorD_Init( SwarmAdvectorD* self )
+{
+}
+
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _SwarmAdvectorD_Delete( void* swarmAdvector ) {
+	SwarmAdvectorD* self = (SwarmAdvectorD*)swarmAdvector;
+
+	/* Delete parent */
+	_SwarmAdvector_Delete( self );
+}
+
+
+void _SwarmAdvectorD_Print( void* swarmAdvector, Stream* stream ) {
+	SwarmAdvectorD* self = (SwarmAdvectorD*)swarmAdvector;
+	
+	/* Print parent */
+	_SwarmAdvector_Print( self, stream );
+}
+
+
+void* _SwarmAdvectorD_Copy( void* swarmAdvector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	SwarmAdvectorD*	self = (SwarmAdvectorD*)swarmAdvector;
+	SwarmAdvectorD*	newSwarmAdvectorD;
+	
+	newSwarmAdvectorD = (SwarmAdvectorD*)_SwarmAdvector_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newSwarmAdvectorD->velocityField = self->velocityField;
+	newSwarmAdvectorD->swarm         = self->swarm;
+	newSwarmAdvectorD->periodicBCsManager = self->periodicBCsManager;
+	
+	return (void*)newSwarmAdvectorD;
+}
+
+void* _SwarmAdvectorD_DefaultNew( Name name ) {
+	return (void*) _SwarmAdvectorD_New(
+			sizeof(SwarmAdvectorD),
+			SwarmAdvectorD_Type,
+			_SwarmAdvectorD_Delete,
+			_SwarmAdvectorD_Print,
+			_SwarmAdvectorD_Copy,
+			_SwarmAdvectorD_DefaultNew,
+			_SwarmAdvectorD_Construct,
+			/* Just use the normal parent's implementation for next few, apart from new TimeDeriv function */
+			_SwarmAdvector_Build,
+			_SwarmAdvector_Initialise,
+			_SwarmAdvector_Execute,
+			_SwarmAdvector_Destroy,
+			_SwarmAdvectorD_TimeDeriv,
+			_SwarmAdvector_Intermediate,
+			name );
+}
+
+
+void _SwarmAdvectorD_Construct( void* swarmAdvector, Stg_ComponentFactory* cf, void* data ) {
+	SwarmAdvectorD*	            self          = (SwarmAdvectorD*) swarmAdvector;
+
+	_SwarmAdvector_Construct( self, cf, data );
+	/* Everything constructed by parent already */
+	_SwarmAdvectorD_Init( self );
+}
+
+
+Bool _SwarmAdvectorD_TimeDeriv( void* swarmAdvector, Index array_I, double* timeDeriv ) {
+	SwarmAdvectorD*      self          = (SwarmAdvectorD*) swarmAdvector;
+	FieldVariable*      velocityField = (FieldVariable*) self->velocityField;
+	double*             coord;
+	InterpolationResult result;
+
+	/* Get Coordinate of Object using Variable */
+	coord = Variable_GetPtrDouble( self->variable, array_I );
+
+	result = FieldVariable_InterpolateValueAt( velocityField, coord, timeDeriv );
+	        timeDeriv[ K_AXIS ] = 0.0;
+
+
+	if ( result == OTHER_PROC || result == OUTSIDE_GLOBAL || isinf(timeDeriv[0]) || isinf(timeDeriv[1]) || 
+			( self->swarm->dim == 3 && isinf(timeDeriv[2]) ) ) 
+	{
+		#if 0
+		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], 
+			timeDeriv[0], timeDeriv[1], ( self->swarm->dim == 3 ? timeDeriv[2] : 0.0 ),
+			result );
+		abort();
+		#endif
+
+		return False;
+	}
+
+	return True;
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+/*---------------------------------------------------------------------------------------------------------------------
+** Entry Point Hooks
+*/
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SwarmAdvectorD.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SwarmAdvectorD.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,130 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Special swarm advector requested by Dave Stegman (hence AdvectorD) which doesn't advect in the K axis, even
+**	for 3D problems.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: SwarmAdvectorD.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_SwarmAdvectorD_h__
+#define __PICellerator_MaterialPoints_SwarmAdvectorD_h__
+
+	/* Textual name of this class */
+	extern const Type SwarmAdvectorD_Type;
+
+	/* SwarmAdvectorD information */
+	#define __SwarmAdvectorD \
+		/* General info */ \
+		__SwarmAdvector 	/** Now inherits from SwarmAdvector class */
+
+	struct SwarmAdvectorD { __SwarmAdvectorD };
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	SwarmAdvectorD* SwarmAdvectorD_New(
+		Name                                       name,
+		TimeIntegrator*                            timeIntegrator,
+		FeVariable*                                velocityField,
+		Bool                                       allowFallbackToFirstOrder,
+		MaterialPointsSwarm*                       swarm,
+		PeriodicBoundariesManager*                 periodicBCsManager );
+
+	SwarmAdvectorD* _SwarmAdvectorD_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 _SwarmAdvectorD_Init( 
+		SwarmAdvectorD*                             self );
+
+	void _SwarmAdvectorD_Delete( void* materialSwarm );
+	void _SwarmAdvectorD_Print( void* materialSwarm, Stream* stream );
+	#define SwarmAdvectorD_Copy( self ) \
+		(SwarmAdvectorD*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define SwarmAdvectorD_DeepCopy( self ) \
+		(SwarmAdvectorD*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _SwarmAdvectorD_Copy( void* materialSwarm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void* _SwarmAdvectorD_DefaultNew( Name name ) ;
+void _SwarmAdvectorD_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _SwarmAdvectorD_Build( void* materialSwarm, void* data ) ;
+	void _SwarmAdvectorD_Initialise( void* materialSwarm, void* data ) ;
+	void _SwarmAdvectorD_Execute( void* materialSwarm, void* data );
+	void _SwarmAdvectorD_Destroy( void* materialSwarm, void* data ) ;
+	Bool _SwarmAdvectorD_TimeDeriv( void* swarmAdvector, Index array_I, double* timeDeriv ) ;
+	void _SwarmAdvectorD_Intermediate( void* swarmAdvector, Index array_I ) ;
+	
+		
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Entry Point Hooks
+	*/
+	void SwarmAdvectorD_AdvectionSetup( TimeIntegrator* timeIntegrator, SwarmAdvectorD* self ) ;
+	void SwarmAdvectorD_AdvectionFinish( TimeIntegrator* timeIntegrator, SwarmAdvectorD* self ) ;
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SwarmAdvectorD.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SwarmAdvectorD.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">SwarmAdvectorD</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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">TimeIntegratee</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">VelocityField</param>
+		<param name="Type">FeVariable</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 184 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Swarm</param>
+		<param name="Type">Swarm</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 185 of the c file and then remove this comment afterwards -->
+
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">PeriodicBCsManager</param>
+		<param name="Type">PeriodicBoundariesManager</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 186 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SwarmAdvectorW.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SwarmAdvectorW.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,245 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "types.h"
+#include "SwarmAdvector.h"
+#include "SwarmAdvectorW.h"
+
+#include "MaterialPointsSwarm.h"
+#include "PeriodicBoundariesManager.h"
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type SwarmAdvectorW_Type = "SwarmAdvectorW";
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+SwarmAdvectorW* SwarmAdvectorW_New(
+		Name                                       name,
+		TimeIntegrator*                            timeIntegrator,
+		FeVariable*                                velocityField,
+		Bool                                       allowFallbackToFirstOrder,
+		MaterialPointsSwarm*                       swarm,
+		PeriodicBoundariesManager*                 periodicBCsManager )
+{
+	SwarmAdvectorW* self = (SwarmAdvectorW*) _SwarmAdvectorW_DefaultNew( name );
+
+	/* 	SwarmAdvectorW_InitAll */
+	_TimeIntegratee_Init( self, timeIntegrator, swarm->particleCoordVariable->variable, 0, NULL,
+		allowFallbackToFirstOrder );
+	_SwarmAdvector_Init( (SwarmAdvector*)self, velocityField, swarm, periodicBCsManager );
+	_SwarmAdvectorW_Init( self );
+
+	return self;
+}
+
+SwarmAdvectorW* _SwarmAdvectorW_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 )
+{
+	SwarmAdvectorW* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(SwarmAdvectorW) );
+	self = (SwarmAdvectorW*)_SwarmAdvector_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculateTimeDeriv,
+			_intermediate,
+			name );
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _SwarmAdvectorW_Init( SwarmAdvectorW* self )
+{
+}
+
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _SwarmAdvectorW_Delete( void* swarmAdvector ) {
+	SwarmAdvectorW* self = (SwarmAdvectorW*)swarmAdvector;
+
+	/* Delete parent */
+	_SwarmAdvector_Delete( self );
+}
+
+
+void _SwarmAdvectorW_Print( void* swarmAdvector, Stream* stream ) {
+	SwarmAdvectorW* self = (SwarmAdvectorW*)swarmAdvector;
+	
+	/* Print parent */
+	_SwarmAdvector_Print( self, stream );
+}
+
+
+void* _SwarmAdvectorW_Copy( void* swarmAdvector, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	SwarmAdvectorW*	self = (SwarmAdvectorW*)swarmAdvector;
+	SwarmAdvectorW*	newSwarmAdvectorW;
+	
+	newSwarmAdvectorW = (SwarmAdvectorW*)_SwarmAdvector_Copy( self, dest, deep, nameExt, ptrMap );
+
+	newSwarmAdvectorW->velocityField = self->velocityField;
+	newSwarmAdvectorW->swarm         = self->swarm;
+	newSwarmAdvectorW->periodicBCsManager = self->periodicBCsManager;
+	
+	return (void*)newSwarmAdvectorW;
+}
+
+void* _SwarmAdvectorW_DefaultNew( Name name ) {
+	return (void*) _SwarmAdvectorW_New(
+			sizeof(SwarmAdvectorW),
+			SwarmAdvectorW_Type,
+			_SwarmAdvectorW_Delete,
+			_SwarmAdvectorW_Print,
+			_SwarmAdvectorW_Copy,
+			_SwarmAdvectorW_DefaultNew,
+			_SwarmAdvectorW_Construct,
+			/* Just use the normal parent's implementation for next few, apart from new TimeDeriv function */
+			_SwarmAdvector_Build,
+			_SwarmAdvector_Initialise,
+			_SwarmAdvector_Execute,
+			_SwarmAdvector_Destroy,
+			_SwarmAdvectorW_TimeDeriv,
+			_SwarmAdvector_Intermediate,
+			name );
+}
+
+
+void _SwarmAdvectorW_Construct( void* swarmAdvector, Stg_ComponentFactory* cf, void* data ) {
+	SwarmAdvectorW*	            self          = (SwarmAdvectorW*) swarmAdvector;
+
+	_SwarmAdvector_Construct( self, cf, data );
+	/* Everything constructed by parent already */
+	_SwarmAdvectorW_Init( self );
+}
+
+
+Bool _SwarmAdvectorW_TimeDeriv( void* swarmAdvector, Index array_I, double* timeDeriv ) {
+	SwarmAdvectorW*      self          = (SwarmAdvectorW*) swarmAdvector;
+	FieldVariable*      velocityField = (FieldVariable*) self->velocityField;
+	double*             coord;
+	InterpolationResult result;
+
+	/* Get Coordinate of Object using Variable */
+	coord = Variable_GetPtrDouble( self->variable, array_I );
+
+	result = FieldVariable_InterpolateValueAt( velocityField, coord, timeDeriv );
+	if( coord[ J_AXIS ] >= 0.99 ){
+		timeDeriv[ K_AXIS ] = 0.0;
+		timeDeriv[ I_AXIS ] = 0.0;
+		timeDeriv[ J_AXIS ] = 0.0;
+	}	
+
+
+	if ( result == OTHER_PROC || result == OUTSIDE_GLOBAL || isinf(timeDeriv[0]) || isinf(timeDeriv[1]) || 
+			( self->swarm->dim == 3 && isinf(timeDeriv[2]) ) ) 
+	{
+		#if 0
+		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], 
+			timeDeriv[0], timeDeriv[1], ( self->swarm->dim == 3 ? timeDeriv[2] : 0.0 ),
+			result );
+		abort();
+		#endif
+
+		return False;
+	}
+
+	return True;
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+/*---------------------------------------------------------------------------------------------------------------------
+** Entry Point Hooks
+*/
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SwarmAdvectorW.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SwarmAdvectorW.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,130 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Special swarm advector which doesn't advect particles when they are is positioned above y = 0.99 even
+**	for 3D problems.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: SwarmAdvectorW.h 189 2005-10-20 00:39:29Z wendy sharples$
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_SwarmAdvectorW_h__
+#define __PICellerator_MaterialPoints_SwarmAdvectorW_h__
+
+	/* Textual name of this class */
+	extern const Type SwarmAdvectorW_Type;
+
+	/* SwarmAdvectorW information */
+	#define __SwarmAdvectorW \
+		/* General info */ \
+		__SwarmAdvector 	/** Now inherits from SwarmAdvector class */
+
+	struct SwarmAdvectorW { __SwarmAdvectorW };
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	SwarmAdvectorW* SwarmAdvectorW_New(
+		Name                                       name,
+		TimeIntegrator*                            timeIntegrator,
+		FeVariable*                                velocityField,
+		Bool                                       allowFallbackToFirstOrder,
+		MaterialPointsSwarm*                       swarm,
+		PeriodicBoundariesManager*                 periodicBCsManager );
+
+	SwarmAdvectorW* _SwarmAdvectorW_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 _SwarmAdvectorW_Init( 
+		SwarmAdvectorW*                             self );
+
+	void _SwarmAdvectorW_Delete( void* materialSwarm );
+	void _SwarmAdvectorW_Print( void* materialSwarm, Stream* stream );
+	#define SwarmAdvectorW_Copy( self ) \
+		(SwarmAdvectorW*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define SwarmAdvectorW_DeepCopy( self ) \
+		(SwarmAdvectorW*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _SwarmAdvectorW_Copy( void* materialSwarm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void* _SwarmAdvectorW_DefaultNew( Name name ) ;
+	void _SwarmAdvectorW_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _SwarmAdvectorW_Build( void* materialSwarm, void* data ) ;
+	void _SwarmAdvectorW_Initialise( void* materialSwarm, void* data ) ;
+	void _SwarmAdvectorW_Execute( void* materialSwarm, void* data );
+	void _SwarmAdvectorW_Destroy( void* materialSwarm, void* data ) ;
+	Bool _SwarmAdvectorW_TimeDeriv( void* swarmAdvector, Index array_I, double* timeDeriv ) ;
+	void _SwarmAdvectorW_Intermediate( void* swarmAdvector, Index array_I ) ;
+	
+		
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Entry Point Hooks
+	*/
+	void SwarmAdvectorW_AdvectionSetup( TimeIntegrator* timeIntegrator, SwarmAdvectorW* self ) ;
+	void SwarmAdvectorW_AdvectionFinish( TimeIntegrator* timeIntegrator, SwarmAdvectorW* self ) ;
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/SwarmAdvectorW.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/SwarmAdvectorW.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">SwarmAdvectorW</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">SwarmAdvector</param>
+<param name="Reference">...</param>
+<param name="Summary">...</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 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,66 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 427 2007-02-23 02:37:11Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# External Libraries and Headers
+EXTERNAL_INCLUDES = ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} -DLIB_DIR=\"${LIB_DIR}\"
+EXTERNAL_LIBS = ${STGERMAIN_FEM_LIBS} ${STGERMAIN_LIBS} ${MPI_LIBS} ${XML_LIBS}
+
+# Work out name to call library
+lib = ${PROJECT}$(shell basename `pwd | sed s/src//g`)
+libdynamic = yes
+libstatic = yes
+
+# Name of directory to place header files
+includes := ${PROJECT}/$(shell basename `pwd | sed s/src//g`)
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/src/types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/src/types.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,88 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Type definitions for this module.
+**
+** Assumptions:
+**	None as yet.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: types.h 349 2006-07-05 11:02:57Z WendySharples $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_MaterialPoints_types_h__
+#define __PICellerator_MaterialPoints_types_h__
+
+	typedef struct MappedParticleLayout         MappedParticleLayout;
+	typedef struct BackgroundParticleLayout     BackgroundParticleLayout;
+
+	typedef struct IntegrationPointMapper       IntegrationPointMapper;
+	typedef struct OneToOneMapper               OneToOneMapper;
+	typedef struct CoincidentMapper             CoincidentMapper;
+	typedef struct GaussMapper                  GaussMapper;
+	typedef struct ManyToOneMapper              ManyToOneMapper;
+
+	typedef struct MaterialPointsSwarm           MaterialPointsSwarm;
+	typedef struct IntegrationPointsSwarm       IntegrationPointsSwarm;
+	typedef struct PICelleratorContext          PICelleratorContext;
+	
+	typedef struct Material                     Material;
+	typedef struct Materials_Register           Materials_Register;
+	typedef struct ParticleFeVariable           ParticleFeVariable;
+	typedef struct MaterialFeVariable           MaterialFeVariable;
+	typedef struct MaterialPoint                MaterialPoint;
+	typedef struct MaterialPointRef             MaterialPointRef;
+	typedef struct SwarmAdvector                SwarmAdvector;
+typedef struct SwarmAdvectorD                SwarmAdvectorD;
+typedef struct SwarmAdvectorW                SwarmAdvectorW;
+
+	typedef struct PeriodicBoundariesManager    PeriodicBoundariesManager;
+
+	/* Types, for readability */
+	typedef Index                             Material_Index;
+
+#endif
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/Viewport.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/Viewport.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Test Passed
+Test Passed
diff -r 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Test Passed
+Test Passed
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/expected/testPeriodicBCs.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testPeriodicBCs.0of1.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2867 @@
+StGermain Framework revision 4046. Copyright (C) 2003-2005 VPAC.
+StGermain Discretisation Library revision 4046. Copyright (C) 2003-2005 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): 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 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/expected/testPeriodicBCs.0of2.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testPeriodicBCs.0of2.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1535 @@
+StGermain Framework revision 4046. Copyright (C) 2003-2005 VPAC.
+StGermain Discretisation Library revision 4046. Copyright (C) 2003-2005 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 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/expected/testPeriodicBCs.1of2.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/expected/testPeriodicBCs.1of2.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1535 @@
+StGermain Framework revision 4046. Copyright (C) 2003-2005 VPAC.
+StGermain Discretisation Library revision 4046. Copyright (C) 2003-2005 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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,64 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 427 2007-02-23 02:37:11Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# External Libraries and Headers
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT} ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} -DLIB_DIR=\"${LIB_DIR}\"
+EXTERNAL_LIBS = ${RPATH_LFLAGS} -L${LIB_DIR} -l${PROJECT}MaterialPoints -l${PROJECT}Weights -l${PROJECT}Voronoi -l${PROJECT}PopulationControl ${STGFEM_LIBS} ${STGERMAIN_LIBS} ${MPI_LIBS} ${XML_LIBS}
+
+packages += STGFEM STGERMAIN PETSC MPI
+
+# Subdirectories
+subdirs := plugins
+
+tests = lib${PROJECT}_MaterialPoints
+SRCS = $(wildcard *.c)
+
+checks = $(wildcard *.sh)
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/plugins/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/plugins/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,57 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN MPI XML 
+
+# Note don't put the .c extension. just the base name of the plugin
+plugins := testAdvection testMaterialFeVariable
+
+include ${PROJ_ROOT}/Makefile.vmake
+
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/plugins/testAdvection.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/plugins/testAdvection.c	Mon Mar 26 09:24:36 2007 +0000
@@ -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 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+#include <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 ) {
+	DiscretisationContext* context;
+	Stream*           stream               = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	context = (DiscretisationContext*)Stg_ComponentFactory_ConstructByName( cf, "context", DiscretisationContext, 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 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/plugins/testMaterialFeVariable.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/plugins/testMaterialFeVariable.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,119 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: testMaterialFeVariable.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+#define TOLERANCE 0.0025
+
+void testMaterialFeVariable_Check( PICelleratorContext* context ) {
+	IntegrationPointsSwarm*     swarm;
+	MaterialFeVariable* materialFeVariable;
+	Material*           material;
+	Swarm*              gaussSwarm;
+	double              volumePIC;
+	double              volumeFEM;
+	Coord               centroid;
+	Stream*             stream               = Journal_Register( Dump_Type, CURR_MODULE_NAME );
+	Stream*             outputStream         = Journal_Register( Info_Type, CURR_MODULE_NAME );
+
+	materialFeVariable = (MaterialFeVariable*) LiveComponentRegister_Get( context->CF->LCRegister, "materialFeVariable" );
+	gaussSwarm = (Swarm*) LiveComponentRegister_Get( context->CF->LCRegister, "gaussSwarm" );
+
+	Stream_Enable( stream, True );
+
+	assert(materialFeVariable);
+	assert(gaussSwarm);
+
+	material = materialFeVariable->material;
+	swarm = materialFeVariable->picIntegrationPoints;
+
+	volumePIC = Material_Volume( material, swarm, centroid );
+	volumeFEM = FeVariable_Integrate( materialFeVariable, gaussSwarm );
+
+	Journal_PrintValue( outputStream, volumePIC );
+	Journal_PrintValue( outputStream, volumeFEM );
+	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "output.dat" );
+	Journal_Printf( stream, "Test %s\n", fabs( volumePIC - volumeFEM ) < TOLERANCE ? "Passed" : "Failed" );
+}
+
+const Type testMaterialFeVariable_Type = "testMaterialFeVariable";
+typedef struct {
+	__Codelet
+} testMaterialFeVariable;
+
+void _testMaterialFeVariable_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	PICelleratorContext* context;
+	context = (PICelleratorContext*)Stg_ComponentFactory_ConstructByName( cf, "context", PICelleratorContext, True, data ); 
+	ContextEP_Prepend( context, AbstractContext_EP_Dump, testMaterialFeVariable_Check );
+}
+
+void* _testParticleCoords_DefaultNew( Name name ) {
+	return _Codelet_New(
+		sizeof( Codelet ),
+		testMaterialFeVariable_Type,
+		_Codelet_Delete,
+		_Codelet_Print,
+		_Codelet_Copy,
+		_testParticleCoords_DefaultNew,
+		_testMaterialFeVariable_Construct,
+		_Codelet_Build,
+		_Codelet_Initialise,
+		_Codelet_Execute,
+		_Codelet_Destroy,
+		name );
+}
+
+Index testMaterialFeVariable_Register( PluginsManager* pluginsManager ) {
+	return PluginsManager_Submit( pluginsManager, testMaterialFeVariable_Type, "0", _testParticleCoords_DefaultNew );
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testAdvection.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testAdvection.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,100 @@
+<?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/ElementLayout.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">mesh-linear</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="materialPointsSwarm">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">particleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="WeightsCalculator">weights</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+		</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 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testEuler.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testEuler.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 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 "PICellerator testEuler.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testEuler.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testEuler.0of2.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 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 "PICellerator testEuler.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testEuler.0of3.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testEuler.0of3.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 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 "PICellerator testEuler.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testEuler.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testEuler.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,13 @@
+<?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 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testMaterialFeVariable.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testMaterialFeVariable.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testMaterialFeVariable.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 "PICellerator testMaterialFeVariable.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testMaterialFeVariable.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testMaterialFeVariable.0of2.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testMaterialFeVariable.0of2.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 "PICellerator testMaterialFeVariable.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testMaterialFeVariable.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testMaterialFeVariable.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,120 @@
+<?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/GaussSwarm.xml</include>
+	<include>StgFEM/ElementLayout.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">mesh-linear</param>
+		</struct>
+		<struct name="everywhereShape">
+			<param name="Type">Everywhere</param>
+		</struct>
+		<struct name="shape">
+			<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="picIntegrationPointsParticleLayout">
+			<param name="Type">SpaceFillerParticleLayout</param>
+			<param name="totalInitialParticles">5000</param>
+		</struct>
+		<struct name="discreteVoronoi">
+			<param name="Type">CellularAutomataVoronoi</param>
+			<param name="resolution">10</param>
+			<param name="diagonalNeighbours">true</param>
+		</struct>		
+		<struct name="weights">
+			<param name="Type">DiscreteVoronoiWeights</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+		</struct>
+		<struct name="localLayout">
+			<param name="Type">MappedParticleLayout</param>
+		</struct>
+		<struct name="picIntegrationPoints">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">localLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</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">picIntegrationPoints</param>
+			<param name="MaterialPointsSwarm">materialSwarm</param>
+		</struct>
+		<struct name="materialSwarm">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">picIntegrationPointsParticleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+		</struct>
+
+		
+		<struct name="backgroundMaterial">
+			<param name="Type">Material</param>
+			<param name="Shape">everywhereShape</param>
+		</struct>		
+		<struct name="material">
+			<param name="Type">Material</param>
+			<param name="Shape">shape</param>
+		</struct>		
+		<struct name="materialFeVariable">
+			<param name="Type">MaterialFeVariable</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="Material">material</param>
+			<param name="Context">context</param>
+			<param name="Mesh">mesh-linear</param>
+		</struct>		
+	</struct>
+
+	<list name="plugins">
+		<param>testMaterialFeVariable</param>
+		<param>StgFEM_StandardConditionFunctions</param>
+		<param>StgFEM_PrintFeVariableDiscreteValues_2dBox</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"> 1 </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>
+	<param name="minX"> -1.0 </param>
+	<param name="minY"> -1.0 </param>
+	<param name="minZ"> -1.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>
+	<param name="buildElementNodeTbl"> True </param>
+
+	<list name="PrintFeVariableDiscreteValues_2dBox">
+		<param>materialFeVariable</param>
+	</list>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testPeriodicBCs.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testPeriodicBCs.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testPeriodicBCs.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 "testPeriodicBCs " "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testPeriodicBCs.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testPeriodicBCs.0of2.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testPeriodicBCs.0of2.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 "testPeriodicBCs " "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testPeriodicBCs.1of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testPeriodicBCs.1of2.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testPeriodicBCs.1of2.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 "testPeriodicBCs " "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testPeriodicBCs.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testPeriodicBCs.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,309 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: testPeriodicBCs.c 427 2007-02-23 02:37:11Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include "MaterialPoints/MaterialPoints.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+struct _Node {
+	Coord				coord;
+};
+
+struct _Element {
+	Coord				coord;
+};
+
+struct _Particle {
+	__GlobalParticle
+};
+
+void UpdateParticlePositionsToLeft( 
+		Swarm* swarm,
+		Processor_Index rank,
+		Processor_Index procToWatch );
+
+int main( int argc, char* argv[] ) {
+	MPI_Comm			CommWorld;
+	int				rank;
+	int				numProcessors;
+	int				procToWatch;
+	Dictionary*			dictionary;
+	Topology*			nTopology;
+	ElementLayout*			eLayout;
+	NodeLayout*			nLayout;
+	MeshDecomp*			decomp;
+	MeshLayout*			layout;
+	ExtensionManager_Register*	extensionMgr_Register;
+	Mesh*				mesh;
+	ElementCellLayout*		elementCellLayout;
+	RandomParticleLayout*		randomParticleLayout;
+	Swarm*				swarm;
+	Stream*				stream;
+	Index				timeStep;
+	BlockGeometry*			blockGeom;
+	EntryPoint_Register*		epRegister;
+	PeriodicBoundariesManager*	perBCsManager;
+	Index                           decompDims;
+	char*                           directory;	
+	/* 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 );
+	
+	StGermain_Init( &argc, &argv );
+	StgFEM_Init( &argc, &argv );
+        PICellerator_Voronoi_Init( &argc, &argv );
+        PICellerator_PopulationControl_Init( &argc, &argv );
+        PICellerator_Weights_Init( &argc, &argv );
+        PICellerator_MaterialPoints_Init( &argc, &argv );	
+
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	/* Add the PICellerator path to the global xml path dictionary */
+	directory = Memory_Alloc_Array( char, 200, "xmlDirectory" ) ;
+	sprintf(directory, "%s%s", LIB_DIR, "/StGermain" );
+	XML_IO_Handler_AddDirectory( "PICellerator", directory );
+	Memory_Free(directory);
+						
+	/* Add the plugin path to the global plugin list */
+	PluginsManager_AddDirectory( "PICellerator", LIB_DIR );
+
+	stream = Journal_Register (Info_Type, "myStream");
+
+	/* *** Journal stuff *** */
+	Journal_Enable_TypedStream( DebugStream_Type, False );
+	Stream_EnableBranch( Journal_Register( Info_Type, ParticleCommHandler_Type ), False );
+	/*
+	perBCsManagerStream = Journal_Register( Debug_Type, PeriodicBoundariesManager_Type );
+	Stream_EnableBranch( perBCsManagerStream, True );
+	Stream_SetLevelBranch( perBCsManagerStream, 3 );
+	perBCsManagerStream = Journal_Register( Debug_Type, Swarm_Type );
+	Stream_EnableBranch( perBCsManagerStream, True );
+	Stream_SetLevelBranch( perBCsManagerStream, 3 );
+	perBCsManagerStream = Journal_Register( Debug_Type, Mesh_Type );
+	Stream_EnableBranch( perBCsManagerStream, True );
+	Stream_SetLevelBranch( perBCsManagerStream, 3 );
+	*/
+
+	if( argc >= 2 ) {
+		procToWatch = atoi( argv[1] );
+	}
+	else {
+		procToWatch = 0;
+	}
+	if( rank == procToWatch ) printf( "Watching rank: %i\n", rank );
+	
+	/* Read input */
+	dictionary = Dictionary_New();
+	Dictionary_Add( dictionary, "rank", Dictionary_Entry_Value_FromUnsignedInt( rank ) );
+	Dictionary_Add( dictionary, "numProcessors", Dictionary_Entry_Value_FromUnsignedInt( numProcessors ) );
+	Dictionary_Add( dictionary, "meshSizeI", Dictionary_Entry_Value_FromUnsignedInt( 13 ) );
+	Dictionary_Add( dictionary, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( 13 ) );
+	Dictionary_Add( dictionary, "meshSizeK", Dictionary_Entry_Value_FromUnsignedInt( 2 ) );
+	Dictionary_Add( dictionary, "allowUnbalancing", Dictionary_Entry_Value_FromBool( True ) );
+	Dictionary_Add( dictionary, "minX", Dictionary_Entry_Value_FromDouble( 0.0f ) );
+	Dictionary_Add( dictionary, "minY", Dictionary_Entry_Value_FromDouble( 0.0f ) );
+	Dictionary_Add( dictionary, "minZ", Dictionary_Entry_Value_FromDouble( 0.0f ) );
+	Dictionary_Add( dictionary, "maxX", Dictionary_Entry_Value_FromDouble( 1.0f ) );
+	Dictionary_Add( dictionary, "maxY", Dictionary_Entry_Value_FromDouble( 1.0f ) );
+	Dictionary_Add( dictionary, "maxZ", Dictionary_Entry_Value_FromDouble( 1.0f ) );
+	Dictionary_Add( dictionary, "particlesPerCell", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+	Dictionary_Add( dictionary, "seed", Dictionary_Entry_Value_FromUnsignedInt( 13 ) );
+	Dictionary_Add( dictionary, "shadowDepth", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+	// TODO: a 2nd test with the periodic shadowing enabled. Its handy to keep the orig one
+	//	without it though.
+	//Dictionary_Add( dictionary, "isPeriodicI", Dictionary_Entry_Value_FromBool( True ) );
+	//Dictionary_Add( dictionary, "isPeriodicJ", Dictionary_Entry_Value_FromBool( True ) );
+	decompDims = 1;
+
+	/* Run the mesher */
+	nTopology = (Topology*)IJK6Topology_New( "IJK6Topology", dictionary );
+	eLayout = (ElementLayout*)ParallelPipedHexaEL_New( "PPHexaEL", 3, dictionary );
+	nLayout = (NodeLayout*)CornerNL_New( "CornerNL", dictionary, eLayout, nTopology );
+	decomp = (MeshDecomp*)HexaMD_New_All( "HexaMD", dictionary, MPI_COMM_WORLD, eLayout, nLayout, decompDims );
+	layout = MeshLayout_New( "Meshlayout", eLayout, nLayout, decomp );
+	
+	/* Init mesh */
+	extensionMgr_Register = ExtensionManager_Register_New();
+	mesh = Mesh_New( "Mesh", layout, sizeof(Node), sizeof(Element), extensionMgr_Register, dictionary );
+	
+	/* Configure the element-cell-layout */
+	elementCellLayout = ElementCellLayout_New( "elementCellLayout", mesh );
+	
+	/* Configure the random-particle-layout */
+	randomParticleLayout = RandomParticleLayout_New( "randomParticleLayout", 1, 13 );
+	
+	/* Configure the swarm */
+	swarm = Swarm_New( "testSwarm", elementCellLayout, randomParticleLayout, 3, sizeof(Particle),
+		extensionMgr_Register, NULL, CommWorld );
+	
+	blockGeom = (BlockGeometry*)eLayout->geometry;
+
+	epRegister = EntryPoint_Register_New();
+	
+	/* Configure the perBCs manager */
+	perBCsManager = PeriodicBoundariesManager_New( "perBCsManager", blockGeom, swarm,
+		dictionary );
+	
+	/* +++ BUILD PHASE +++ */
+	
+	/* Build the mesh */
+	Build( mesh, 0, False );
+	/* Build the swarm */
+	Build( swarm, 0, False );
+
+	Build( perBCsManager, 0, False );
+	PeriodicBoundariesManager_AddPeriodicBoundary( perBCsManager, I_AXIS );
+	/* +++ INITIALISE PHASE +++ */
+
+	Initialise( mesh, 0, False );
+	Initialise( swarm, 0, False );
+	Initialise( perBCsManager, 0, False );
+	
+	if( rank == procToWatch ) {
+		Print( swarm, stream );
+	}	
+
+	/* +++ RUN PHASE +++ */
+
+	/* Start a sample app, where each timestep we move the particles towards the attractor point */
+	for ( timeStep=1; timeStep <= 5; timeStep++ ) {
+		Particle_Index lParticle_I;
+		
+		if( rank == procToWatch ) {
+			printf("\nStarting timestep %d:\n", timeStep );
+		}	
+
+		UpdateParticlePositionsToLeft( swarm, rank, procToWatch );
+	
+		if( rank == procToWatch ) {
+			printf("\nUpdating periodic BCs\n" );
+		}	
+		for ( lParticle_I = 0; lParticle_I < swarm->particleLocalCount ; lParticle_I++ ) {
+			PeriodicBoundariesManager_UpdateParticle( perBCsManager, lParticle_I );
+		}
+		
+		Swarm_UpdateAllParticleOwners( swarm );
+	}
+	
+	/* Destroy stuff */
+	Stg_Class_Delete( swarm );
+	Stg_Class_Delete( randomParticleLayout );
+	Stg_Class_Delete( elementCellLayout );
+	Stg_Class_Delete( mesh );
+	Stg_Class_Delete( extensionMgr_Register );
+	Stg_Class_Delete( layout );
+	Stg_Class_Delete( decomp );
+	Stg_Class_Delete( nLayout );
+	Stg_Class_Delete( eLayout );
+	Stg_Class_Delete( nTopology );
+	Stg_Class_Delete( dictionary );
+	
+        PICellerator_MaterialPoints_Finalise();
+        PICellerator_Weights_Finalise();
+        PICellerator_PopulationControl_Finalise();
+        PICellerator_Voronoi_Finalise();
+	StgFEM_Finalise();
+	StGermain_Finalise();
+
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0; /* success */
+}
+
+
+void UpdateParticlePositionsToLeft( 
+		Swarm* swarm,
+		Processor_Index rank,
+		Processor_Index procToWatch )
+{
+	Cell_LocalIndex			lCell_I;
+	Particle_InCellIndex		cParticle_I;
+	GlobalParticle* 		currParticle;
+	Index				dim_I;
+
+	for ( lCell_I=0; lCell_I < swarm->cellLocalCount; lCell_I++ ) {
+		if( rank == procToWatch ) {
+			printf("\tUpdating 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;
+			if( rank == procToWatch ) {
+				printf("\t\tUpdating particleInCell %d:\n", cParticle_I );
+			}	
+
+			movementVector[I_AXIS] = -0.1;
+
+			for ( dim_I=0; dim_I < 3; dim_I++ ) {
+				newParticleCoord[dim_I] = (*oldCoord)[dim_I] + movementVector[dim_I];
+			}
+
+			if( rank == procToWatch ) {
+				printf("\t\tChanging 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];
+			}
+		}
+	}
+}
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testRK2.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK2.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 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 "PICellerator testRK2.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testRK2.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK2.0of2.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 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 "PICellerator testRK2.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testRK2.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK2.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,13 @@
+<?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 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testRK4.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK4.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 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 "PICellerator testRK4.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testRK4.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK4.0of2.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 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 "PICellerator testRK4.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e MaterialPoints/tests/testRK4.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MaterialPoints/tests/testRK4.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,13 @@
+<?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 5896a19b8457 -r 31abbeebf74e PopulationControl/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,53 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := src tests
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/DiscreteVoronoiRemove.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/DiscreteVoronoiRemove.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,182 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: DiscreteVoronoiRemove.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+
+#include "types.h"
+#include "RemovalRoutine.h"
+#include "DiscreteVoronoiRemove.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type DiscreteVoronoiRemove_Type = "DiscreteVoronoiRemove";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+DiscreteVoronoiRemove* _DiscreteVoronoiRemove_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,		
+		RemovalRoutine_RemoveFromCellFunction*  _removeFromCell,
+		Name                                    name )
+{
+	DiscreteVoronoiRemove* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(DiscreteVoronoiRemove) );
+	self = (DiscreteVoronoiRemove*)_RemovalRoutine_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_removeFromCell,
+			name );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _DiscreteVoronoiRemove_Init( void* discreteVoronoiRemove, DiscreteVoronoi* discreteVoronoi ) {
+	DiscreteVoronoiRemove* self = (DiscreteVoronoiRemove*)discreteVoronoiRemove;
+	
+	self->isConstructed = True;
+	self->discreteVoronoi = discreteVoronoi;
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+void* _DiscreteVoronoiRemove_DefaultNew( Name name ) {
+	return (void*) _DiscreteVoronoiRemove_New(
+			sizeof(DiscreteVoronoiRemove),
+			DiscreteVoronoiRemove_Type,
+			_RemovalRoutine_Delete,
+			_RemovalRoutine_Print,
+			_RemovalRoutine_Copy,
+			_DiscreteVoronoiRemove_DefaultNew,
+			_DiscreteVoronoiRemove_Construct,
+			_DiscreteVoronoiRemove_Build,
+			_DiscreteVoronoiRemove_Initialise,
+			_RemovalRoutine_Execute,
+			_RemovalRoutine_Destroy,
+			_DiscreteVoronoiRemove_RemoveFromCell,
+			name );
+}
+
+
+void _DiscreteVoronoiRemove_Construct( void* discreteVoronoiRemove, Stg_ComponentFactory* cf, void* data ) {
+	DiscreteVoronoiRemove*	     self            = (DiscreteVoronoiRemove*) discreteVoronoiRemove;
+	DiscreteVoronoi*             discreteVoronoi;
+
+	_RemovalRoutine_Construct( self, cf, data );
+
+	discreteVoronoi =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "DiscreteVoronoi", DiscreteVoronoi, True, data );
+	_DiscreteVoronoiRemove_Init( self, discreteVoronoi );
+}
+
+void _DiscreteVoronoiRemove_Build( void* discreteVoronoiRemove, void* data ) {
+	DiscreteVoronoiRemove*	     self            = (DiscreteVoronoiRemove*) discreteVoronoiRemove;
+
+	/* Ensure that the discrete voronoi object I'm using is built */
+	Stg_Component_Build( self->discreteVoronoi, data, False );
+	_RemovalRoutine_Build( self, data );
+}
+
+void _DiscreteVoronoiRemove_Initialise( void* discreteVoronoiRemove, void* data ) {
+	DiscreteVoronoiRemove*       self            = (DiscreteVoronoiRemove*) discreteVoronoiRemove;
+
+	/* Ensure that the discrete voronoi object I'm using is initialised */
+	Stg_Component_Initialise( self->discreteVoronoi, data, False );
+	_RemovalRoutine_Initialise( self, data );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+void _DiscreteVoronoiRemove_RemoveFromCell( void* discreteVoronoiRemove, void* _swarm, Cell_LocalIndex lCell_I ) {
+	DiscreteVoronoiRemove*	     self            = (DiscreteVoronoiRemove*) discreteVoronoiRemove;
+	Swarm*                       swarm           = (Swarm*)                 _swarm;
+	DiscreteVoronoiParticleInfo* voronoiParticleInfo;
+	Particle_InCellIndex         cellParticleCount = swarm->cellParticleCountTbl[ lCell_I ];
+	Particle_InCellIndex         cParticle_I;
+	Particle_InCellIndex         particlesToRemoveCount = cellParticleCount - self->idealParticleCount;
+
+	DiscreteVoronoi_CalculateForCell( self->discreteVoronoi, swarm, lCell_I );
+	voronoiParticleInfo = DiscreteVoronoi_CreateParticleInfo( self->discreteVoronoi, swarm, lCell_I );
+	DiscreteVoronoiParticleInfo_SortByVolume( voronoiParticleInfo, cellParticleCount );
+
+	/* Go through particles with smallest area and set them for removal */
+	for ( cParticle_I = 0 ; cParticle_I < particlesToRemoveCount ; cParticle_I++ ) 
+		RemovalRoutine_SetParticleToRemove( self, swarm, lCell_I, voronoiParticleInfo[ cParticle_I ].particle_I );
+
+	DiscreteVoronoiParticleInfo_Delete( voronoiParticleInfo );
+}
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/DiscreteVoronoiRemove.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/DiscreteVoronoiRemove.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,105 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: DiscreteVoronoiRemove.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_DiscreteVoronoiRemoveClass_h__
+#define __PICellerator_PopulationControl_DiscreteVoronoiRemoveClass_h__
+
+	/* Textual name of this class */
+	extern const Type DiscreteVoronoiRemove_Type;
+
+	/* DiscreteVoronoiRemove information */
+	#define __DiscreteVoronoiRemove \
+		/* Parent info */ \
+		__RemovalRoutine \
+		/* Virtual Info */\
+		\
+		/* General Info */\
+		DiscreteVoronoi*        discreteVoronoi;
+
+	struct DiscreteVoronoiRemove { __DiscreteVoronoiRemove };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	DiscreteVoronoiRemove* _DiscreteVoronoiRemove_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,		
+		RemovalRoutine_RemoveFromCellFunction*  _removeFromCell,
+		Name                                    name );
+
+	void* _DiscreteVoronoiRemove_DefaultNew( Name name ) ;
+void _DiscreteVoronoiRemove_Construct( void* discreteVoronoiRemove, Stg_ComponentFactory* cf, void* data ) ;
+	void _DiscreteVoronoiRemove_Build( void* discreteVoronoiRemove, void* data ) ;
+	void _DiscreteVoronoiRemove_Initialise( void* discreteVoronoiRemove, void* data ) ;
+		
+	void _DiscreteVoronoiRemove_RemoveFromCell( void* discreteVoronoiRemove, void* _swarm, Cell_LocalIndex lCell_I ) ;
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/DiscreteVoronoiRemove.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/DiscreteVoronoiRemove.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">DiscreteVoronoiRemove</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/PopulationControl/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">RemovalRoutine</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">DiscreteVoronoi</param>
+		<param name="Type">DiscreteVoronoi</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 121 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/DiscreteVoronoiSplitting.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/DiscreteVoronoiSplitting.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,196 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: DiscreteVoronoiSplitting.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+
+#include "types.h"
+#include "SplittingRoutine.h"
+#include "DiscreteVoronoiSplitting.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type DiscreteVoronoiSplitting_Type = "DiscreteVoronoiSplitting";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+DiscreteVoronoiSplitting* _DiscreteVoronoiSplitting_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,		
+		SplittingRoutine_SplitParticlesInCellFunction*   _splitInCell,
+		Name                                    name )
+{
+	DiscreteVoronoiSplitting* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(DiscreteVoronoiSplitting) );
+	self = (DiscreteVoronoiSplitting*)_SplittingRoutine_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_splitInCell,
+			name );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _DiscreteVoronoiSplitting_Init( void* discreteVoronoiSplitting, DiscreteVoronoi* discreteVoronoi ) {
+	DiscreteVoronoiSplitting* self = (DiscreteVoronoiSplitting*)discreteVoronoiSplitting;
+	
+	self->isConstructed   = True;
+	self->discreteVoronoi = discreteVoronoi;
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+void* _DiscreteVoronoiSplitting_DefaultNew( Name name ) {
+	return (void*) _DiscreteVoronoiSplitting_New(
+			sizeof(DiscreteVoronoiSplitting),
+			DiscreteVoronoiSplitting_Type,
+			_SplittingRoutine_Delete,
+			_SplittingRoutine_Print,
+			_SplittingRoutine_Copy,
+			_DiscreteVoronoiSplitting_DefaultNew,
+			_DiscreteVoronoiSplitting_Construct,
+			_DiscreteVoronoiSplitting_Build,
+			_DiscreteVoronoiSplitting_Initialise,
+			_SplittingRoutine_Execute,
+			_SplittingRoutine_Destroy,
+			_DiscreteVoronoiSplitting_SplitParticlesInCell,
+			name );
+}
+
+
+void _DiscreteVoronoiSplitting_Construct( void* discreteVoronoiSplitting, Stg_ComponentFactory* cf, void* data ) {
+	DiscreteVoronoiSplitting*	     self            = (DiscreteVoronoiSplitting*) discreteVoronoiSplitting;
+	DiscreteVoronoi*             discreteVoronoi;
+
+	_SplittingRoutine_Construct( self, cf, data );
+
+	discreteVoronoi =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "DiscreteVoronoi", DiscreteVoronoi, True, data ) ;
+	_DiscreteVoronoiSplitting_Init( self, discreteVoronoi );
+}
+
+
+void _DiscreteVoronoiSplitting_Build( void* discreteVoronoiSplitting, void* data ) { 
+	DiscreteVoronoiSplitting*       self            = (DiscreteVoronoiSplitting*) discreteVoronoiSplitting; 
+
+	/* Ensure that the discrete voronoi object I'm using is built */ 
+	Stg_Component_Build( self->discreteVoronoi, data, False ); 
+	_SplittingRoutine_Build( self, data );
+}
+
+void _DiscreteVoronoiSplitting_Initialise( void* discreteVoronoiSplitting, void* data ) {
+	DiscreteVoronoiSplitting*       self            = (DiscreteVoronoiSplitting*) discreteVoronoiSplitting;
+
+	/* Ensure that the discrete voronoi object I'm using is initialised */
+	Stg_Component_Initialise( self->discreteVoronoi, data, False );
+	_SplittingRoutine_Initialise( self, data );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+void _DiscreteVoronoiSplitting_SplitParticlesInCell( void* discreteVoronoiSplitting, void* _swarm, Cell_LocalIndex lCell_I ) {
+	DiscreteVoronoiSplitting*	 self            = (DiscreteVoronoiSplitting*) discreteVoronoiSplitting;
+	Swarm*                       swarm           = (Swarm*)                 _swarm;
+	DiscreteVoronoiParticleInfo* voronoiParticleInfo;
+	DiscreteVoronoiParticleInfo* currParticleInfo;
+	Particle_InCellIndex         cellParticleCount = swarm->cellParticleCountTbl[ lCell_I ];
+	Particle_InCellIndex         cParticle_I;
+	Particle_InCellIndex         particlesToSplitCount = self->idealParticleCount - cellParticleCount;
+
+	DiscreteVoronoi_CalculateForCell( self->discreteVoronoi, swarm, lCell_I );
+	voronoiParticleInfo = DiscreteVoronoi_CreateParticleInfo( self->discreteVoronoi, swarm, lCell_I );
+	DiscreteVoronoiParticleInfo_SortByVolume( voronoiParticleInfo, cellParticleCount );
+
+	/* Make sure number of particles to split is no more than the particles in the box */
+	if ( particlesToSplitCount > cellParticleCount )
+		particlesToSplitCount = cellParticleCount;
+	
+	/* Go through particles with largest area split them by putting the new particle on centroid */
+	for ( cParticle_I = cellParticleCount - particlesToSplitCount ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+		currParticleInfo = &voronoiParticleInfo[ cParticle_I ];
+		SplittingRoutine_SplitParticle( self, swarm, lCell_I, currParticleInfo->particle_I, currParticleInfo->centroid );
+
+		/* Make sure that centroid has a proper number */
+		assert( !( 
+					isnan ( currParticleInfo->centroid[0] ) || 
+					isnan ( currParticleInfo->centroid[1] ) || 
+					isnan ( currParticleInfo->centroid[2] ) ) );
+	}
+
+	DiscreteVoronoiParticleInfo_Delete( voronoiParticleInfo );
+}
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/DiscreteVoronoiSplitting.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/DiscreteVoronoiSplitting.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,105 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: DiscreteVoronoiSplitting.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_DiscreteVoronoiSplitting_h__
+#define __PICellerator_PopulationControl_DiscreteVoronoiSplitting_h__
+
+	/* Textual name of this class */
+	extern const Type DiscreteVoronoiSplitting_Type;
+
+	/* DiscreteVoronoiSplitting information */
+	#define __DiscreteVoronoiSplitting \
+		/* Parent info */ \
+		__SplittingRoutine \
+		/* Virtual Info */\
+		\
+		/* General Info */\
+		DiscreteVoronoi*        discreteVoronoi;
+
+	struct DiscreteVoronoiSplitting { __DiscreteVoronoiSplitting };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	DiscreteVoronoiSplitting* _DiscreteVoronoiSplitting_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,		
+		SplittingRoutine_SplitParticlesInCellFunction*   _splitInCell,
+		Name                                    name );
+
+	void* _DiscreteVoronoiSplitting_DefaultNew( Name name ) ;
+void _DiscreteVoronoiSplitting_Construct( void* discreteVoronoiSplitting, Stg_ComponentFactory* cf, void* data ) ;
+	void _DiscreteVoronoiSplitting_Build( void* discreteVoronoiSplitting, void* data ) ;
+	void _DiscreteVoronoiSplitting_Initialise( void* discreteVoronoiSplitting, void* data ) ;
+		
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	void _DiscreteVoronoiSplitting_SplitParticlesInCell( void* discreteVoronoiSplitting, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/DiscreteVoronoiSplitting.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/DiscreteVoronoiSplitting.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">DiscreteVoronoiSplitting</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/PopulationControl/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">SplittingRoutine</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">DiscreteVoronoi</param>
+		<param name="Type">DiscreteVoronoi</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 121 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/EscapedRoutine.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/EscapedRoutine.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,332 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 "types.h"
+#include "EscapedRoutine.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+/* Textual name of this class */
+const Type EscapedRoutine_Type = "EscapedRoutine";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+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) );
+	self = (EscapedRoutine*)_Stg_Component_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			name ,
+			NON_GLOBAL );
+	
+	/* General info */
+
+	/* Virtual Info */
+	self->_select = _select;
+	
+	return self;
+}
+
+void* _EscapedRoutine_DefaultNew( Name name ) {
+	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( 
+		EscapedRoutine*                            self, 
+		Dimension_Index                            dim, 
+		Particle_Index                             particlesToRemoveDelta )
+{
+	self->isConstructed          = True;
+	self->dim                    = dim;
+	self->particlesToRemoveDelta = particlesToRemoveDelta;
+
+	self->debug = Journal_Register( Debug_Type, EscapedRoutine_Type ); /* TODO Register Child */
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _EscapedRoutine_Delete( void* escapedRoutine ) {
+	EscapedRoutine* self = (EscapedRoutine*)escapedRoutine;
+	
+	Memory_Free( self->particlesToRemoveList );
+
+	/* Delete parent */
+	_Stg_Component_Delete( self );
+}
+
+
+void _EscapedRoutine_Print( void* escapedRoutine, Stream* stream ) {
+	EscapedRoutine* self = (EscapedRoutine*)escapedRoutine;
+	
+	/* Print parent */
+	_Stg_Component_Print( self, stream );
+}
+
+
+void* _EscapedRoutine_Copy( void* escapedRoutine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	EscapedRoutine*	self = (EscapedRoutine*)escapedRoutine;
+	EscapedRoutine*	newEscapedRoutine;
+	
+	newEscapedRoutine = (EscapedRoutine*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newEscapedRoutine;
+}
+
+void _EscapedRoutine_Construct( void* escapedRoutine, Stg_ComponentFactory* cf, void* data ) {
+	EscapedRoutine*	     self          = (EscapedRoutine*) escapedRoutine;
+	Dimension_Index      dim;
+	Particle_Index       particlesToRemoveDelta;
+
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+	particlesToRemoveDelta = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "particlesToRemoveDelta", 20 );
+
+	_EscapedRoutine_Init( self, dim, particlesToRemoveDelta );
+}
+
+void _EscapedRoutine_Build( void* escapedRoutine, void* data ) {
+	EscapedRoutine*	     self          = (EscapedRoutine*) escapedRoutine;
+
+	self->particlesToRemoveList = Memory_Alloc_Array( unsigned, self->particlesToRemoveDelta * 10, "particlesToRemoveList" );
+	
+}
+void _EscapedRoutine_Initialise( void* escapedRoutine, void* data ) {
+}
+void _EscapedRoutine_Execute( void* escapedRoutine, void* data ) {
+	EscapedRoutine_RemoveFromSwarm( escapedRoutine, data );
+}
+
+void _EscapedRoutine_Destroy( void* escapedRoutine, void* data ) {
+}
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+void EscapedRoutine_Select( void* escapedRoutine, void* _swarm ) {
+	EscapedRoutine*	 self          = (EscapedRoutine*) escapedRoutine;
+
+	self->_select( self, _swarm );
+}
+
+
+void _EscapedRoutine_Select( void* escapedRoutine, void* _swarm ) {
+	EscapedRoutine*	self = (EscapedRoutine*)escapedRoutine;
+	Swarm*		swarm = (Swarm*)_swarm;
+	unsigned	p_i;
+
+	assert( self );
+	assert( swarm );
+
+	/* Check all particles for removal. */
+	for( p_i = 0; p_i < swarm->particleLocalCount; p_i++ ) {
+		StandardParticle*	particle = (StandardParticle*)Swarm_ParticleAt( swarm, p_i );
+
+		if( particle->owningCell >= swarm->cellDomainCount ) {
+			EscapedRoutine_SetParticleToRemove( self, swarm, p_i );
+		}
+	}
+}
+
+
+void EscapedRoutine_RemoveFromSwarm( void* escapedRoutine, void* _swarm ) {
+	EscapedRoutine*	     self                = (EscapedRoutine*) escapedRoutine;
+	Swarm*               swarm               = (Swarm*) _swarm;
+	
+	EscapedRoutine_InitialiseParticleList( self );
+	
+	/* Select particles to remove. */
+	EscapedRoutine_Select( self, swarm );
+
+	/* Actually remove particles */
+	EscapedRoutine_RemoveParticles( self, swarm );
+}
+
+void EscapedRoutine_InitialiseParticleList( void* 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;
+
+	/* Check memory */
+	if ( self->particlesToRemoveCount >= self->particlesToRemoveAlloced ) {
+		self->particlesToRemoveAlloced += self->particlesToRemoveDelta;
+		self->particlesToRemoveList = 
+			Memory_Realloc_Array( self->particlesToRemoveList, unsigned, self->particlesToRemoveAlloced );
+	}
+
+	self->particlesToRemoveList[ self->particlesToRemoveCount ] = lParticle_I;
+
+	self->particlesToRemoveCount++;
+}
+
+int _EscapedRoutine_SortParticles( const void* _aParticleInfo, const void* _bParticleInfo ) {
+	return (*(unsigned*)_aParticleInfo - *(unsigned*)_bParticleInfo );
+}
+
+void EscapedRoutine_SortParticleList( void* escapedRoutine ) {
+	EscapedRoutine*	     self                = (EscapedRoutine*) escapedRoutine;
+
+	qsort( self->particlesToRemoveList, self->particlesToRemoveCount, 
+			sizeof(unsigned), _EscapedRoutine_SortParticles );
+}
+
+void EscapedRoutine_RemoveParticles( void* escapedRoutine, Swarm* swarm ) {
+	EscapedRoutine*	      self                = (EscapedRoutine*) escapedRoutine;
+	Index                 array_I;
+	StandardParticle*     particleToRemove;
+	Particle_Index        particleToRemove_I;
+	
+	StandardParticle*     lastParticle;
+	Cell_Index            lastParticle_CellIndex;
+	Particle_Index        lastParticle_I;
+	Particle_InCellIndex  lastParticle_IndexWithinCell;
+	SizeT                 particleSize        = swarm->particleExtensionMgr->finalSize;
+
+	#if DEBUG
+	if ( Stream_IsPrintableLevel( self->debug, 2 ) ) {
+		Journal_Printf( self->debug, "Particles to remove:\n{ " );
+		for ( array_I = 0 ; array_I < self->particlesToRemoveCount - 1 ; array_I++ ) {
+			Journal_Printf( self->debug, "%u, ", self->particlesToRemoveList[ array_I ] );
+		}
+		Journal_Printf( self->debug, "%u }\n", self->particlesToRemoveList[ array_I ] );
+	}
+	#endif
+
+
+	EscapedRoutine_SortParticleList( self );
+
+	#if DEBUG
+	if ( Stream_IsPrintableLevel( self->debug, 2 ) ) {
+		Journal_Printf( self->debug, "Particles to remove:\n{ " );
+		for ( array_I = 0 ; array_I < self->particlesToRemoveCount - 1 ; array_I++ ) {
+			Journal_Printf( self->debug, "%u, ", self->particlesToRemoveList[ array_I ] );
+		}
+		Journal_Printf( self->debug, "%u }\n", self->particlesToRemoveList[ array_I ] );
+	}
+	#endif
+
+	for ( array_I = self->particlesToRemoveCount - 1 ; array_I < self->particlesToRemoveCount ; array_I-- ) {
+		particleToRemove_I               = self->particlesToRemoveList[ array_I ];
+		particleToRemove                 = Swarm_ParticleAt( swarm, particleToRemove_I );
+
+		Journal_DPrintfL( self->debug, 2, "Removing particle %u\n", particleToRemove_I );
+		
+		/* Copy over particle with last particle in array - as long as it isn't the last one */
+		lastParticle_I = swarm->particleLocalCount - 1;
+		lastParticle   = Swarm_ParticleAt( swarm, lastParticle_I );
+		if ( particleToRemove_I != lastParticle_I ) {
+			/* Get last Particle information */
+			lastParticle_CellIndex       = lastParticle->owningCell;
+			lastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( swarm, lastParticle_CellIndex, lastParticle_I);
+
+			Journal_DPrintfL( self->debug, 2, 
+					"Copying over particle %u using last particle %u from cell %u (cell particle index - %u)\n", 
+					particleToRemove_I, lastParticle_I, lastParticle_CellIndex, lastParticle_IndexWithinCell );
+
+			/* Copy over particle */
+			memcpy( particleToRemove, lastParticle, particleSize );
+			
+			/* Change value in cell particle table to point to new index in array */
+			swarm->cellParticleTbl[lastParticle_CellIndex][ lastParticle_IndexWithinCell ] = particleToRemove_I;
+		}
+
+		/* Initialise memory to zero so it is clear that it's been deleted */
+		memset( lastParticle, 0, particleSize );
+		swarm->particleLocalCount--;
+	}
+
+	Swarm_Realloc( swarm );
+}
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/EscapedRoutine.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/EscapedRoutine.h	Mon Mar 26 09:24:36 2007 +0000
@@ -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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: EscapedRoutine.h 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_EscapedRoutine_h__
+#define __PICellerator_PopulationControl_EscapedRoutine_h__
+
+	typedef void (EscapedRoutine_SelectFunction)( void* escapedRoutine, void* _swarm );
+
+	/* Textual name of this class */
+	extern const Type EscapedRoutine_Type;
+
+	/* EscapedRoutine information */
+	#define __EscapedRoutine \
+		/* General info */ \
+		__Stg_Component \
+		/* Virtual Info */\
+		EscapedRoutine_SelectFunction*		_select; \
+		/* Other Info */\
+		Stream*                                    debug;                    \
+		Dimension_Index                            dim;                      \
+		/* Removal Info */  \
+		Particle_Index                             particlesToRemoveCount;   \
+		Particle_Index                             particlesToRemoveAlloced; \
+		Particle_Index                             particlesToRemoveDelta;   \
+		unsigned*				   particlesToRemoveList;    
+
+	struct EscapedRoutine { __EscapedRoutine };
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	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 );
+	
+	/* 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_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 ) ;
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+
+	void EscapedRoutine_Select( void* escapedRoutine, void* _swarm ) ;
+	void _EscapedRoutine_Select( void* escapedRoutine, void* _swarm );
+	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 ) ;
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/EscapedRoutine.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/EscapedRoutine.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">EscapedRoutine</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/PopulationControl/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">dim</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">particlesToRemoveDelta</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">20</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/Finalise.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/Finalise.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Finalise.c 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+
+#include "types.h"
+#include "Finalise.h"
+
+#include <stdio.h>
+
+Bool PICellerator_PopulationControl_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/Finalise.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/Finalise.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,60 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Finalise.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_Finalise_h__
+#define __PICellerator_PopulationControl_Finalise_h__
+	
+	Bool PICellerator_PopulationControl_Finalise( void ) ;
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/Init.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/Init.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,73 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Init.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+
+#include "PopulationControl.h"
+
+#include <stdio.h>
+
+Bool PICellerator_PopulationControl_Init( int* argc, char** argv[] ) {
+	Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
+
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+
+	Stg_ComponentRegister_Add( componentsRegister, DiscreteVoronoiRemove_Type,      "0", _DiscreteVoronoiRemove_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, DiscreteVoronoiSplitting_Type,   "0", _DiscreteVoronoiSplitting_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, EscapedRoutine_Type,      	"0", _EscapedRoutine_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, ReseedSplitting_Type,            "0", _ReseedSplitting_DefaultNew );
+
+	RegisterParent( RemovalRoutine_Type,             Stg_Component_Type );
+	RegisterParent( DiscreteVoronoiRemove_Type,      RemovalRoutine_Type );
+	RegisterParent( EscapedRoutine_Type,      	 Stg_Component_Type );
+	
+	RegisterParent( SplittingRoutine_Type,           Stg_Component_Type );
+	RegisterParent( DiscreteVoronoiSplitting_Type,   SplittingRoutine_Type );
+	RegisterParent( ReseedSplitting_Type,            SplittingRoutine_Type );
+
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/Init.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/Init.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	performs and pre-running initialisation necessary in this directory.
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Init.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_Init_h__
+#define __PICellerator_PopulationControl_Init_h__
+	
+	Bool PICellerator_PopulationControl_Init( int* argc, char** argv[] );
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/PopulationControl.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/PopulationControl.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,68 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: PopulationControl.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_h__
+#define __PICellerator_PopulationControl_h__
+
+	#include "types.h"	
+	#include "Init.h"	
+	#include "Finalise.h"	
+	#include "RemovalRoutine.h"	
+	#include "SplittingRoutine.h"	
+	#include "EscapedRoutine.h"
+	
+	#include "ReseedSplitting.h"	
+
+	#include "DiscreteVoronoiRemove.h"	
+	#include "DiscreteVoronoiSplitting.h"	
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/RemovalRoutine.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/RemovalRoutine.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,327 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: RemovalRoutine.c 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "RemovalRoutine.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+/* Textual name of this class */
+const Type RemovalRoutine_Type = "RemovalRoutine";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+RemovalRoutine* _RemovalRoutine_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,		
+		RemovalRoutine_RemoveFromCellFunction*     _removeFromCell,
+		Name                                       name )
+{
+	RemovalRoutine* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(RemovalRoutine) );
+	self = (RemovalRoutine*)_Stg_Component_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			name ,
+			NON_GLOBAL );
+	
+	/* General info */
+
+	/* Virtual Info */
+	self->_removeFromCell = _removeFromCell;
+	
+	return self;
+}
+
+void _RemovalRoutine_Init( 
+		RemovalRoutine*                            self, 
+		Dimension_Index                            dim, 
+		Particle_InCellIndex                       idealParticleCount,
+		Particle_InCellIndex                       maxParticlesPerCell,
+		Particle_Index                             particlesToRemoveDelta )
+{
+	self->isConstructed          = True;
+	self->dim                    = dim;
+	self->idealParticleCount     = idealParticleCount;
+	self->maxParticlesPerCell    = maxParticlesPerCell;
+	self->particlesToRemoveDelta = particlesToRemoveDelta;
+
+	self->debug = Journal_Register( Debug_Type, RemovalRoutine_Type ); /* TODO Register Child */
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _RemovalRoutine_Delete( void* removalRoutine ) {
+	RemovalRoutine* self = (RemovalRoutine*)removalRoutine;
+	
+	Memory_Free( self->particlesToRemoveList );
+
+	/* Delete parent */
+	_Stg_Component_Delete( self );
+}
+
+
+void _RemovalRoutine_Print( void* removalRoutine, Stream* stream ) {
+	RemovalRoutine* self = (RemovalRoutine*)removalRoutine;
+	
+	/* Print parent */
+	_Stg_Component_Print( self, stream );
+}
+
+
+void* _RemovalRoutine_Copy( void* removalRoutine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	RemovalRoutine*	self = (RemovalRoutine*)removalRoutine;
+	RemovalRoutine*	newRemovalRoutine;
+	
+	newRemovalRoutine = (RemovalRoutine*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newRemovalRoutine;
+}
+
+void _RemovalRoutine_Construct( void* removalRoutine, Stg_ComponentFactory* cf, void* data ) {
+	RemovalRoutine*	     self          = (RemovalRoutine*) removalRoutine;
+	Dimension_Index      dim;
+	Particle_InCellIndex idealParticleCount;
+	Particle_InCellIndex maxParticlesPerCell;
+	Particle_Index       particlesToRemoveDelta;
+
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+
+	idealParticleCount  = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "idealParticleCount",  0 );
+	maxParticlesPerCell = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "maxParticlesPerCell", idealParticleCount );
+	
+	particlesToRemoveDelta = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "particlesToRemoveDelta", 20 );
+
+	_RemovalRoutine_Init( self, dim, idealParticleCount, maxParticlesPerCell, particlesToRemoveDelta );
+}
+
+void _RemovalRoutine_Build( void* removalRoutine, void* data ) {
+	RemovalRoutine*	     self          = (RemovalRoutine*) removalRoutine;
+
+	self->particlesToRemoveList = Memory_Alloc_Array( ParticleToRemoveInfo, self->particlesToRemoveDelta * 10, "particlesToRemoveList" );
+	
+}
+void _RemovalRoutine_Initialise( void* removalRoutine, void* data ) {
+}
+void _RemovalRoutine_Execute( void* removalRoutine, void* data ) {
+}
+void _RemovalRoutine_Destroy( void* removalRoutine, void* data ) {
+}
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+void RemovalRoutine_RemoveFromCell( void* removalRoutine, void* _swarm, Cell_LocalIndex lCell_I ) {
+	RemovalRoutine*	 self          = (RemovalRoutine*) removalRoutine;
+
+	self->_removeFromCell( self, _swarm, lCell_I );
+}
+
+void RemovalRoutine_RemoveFromSwarm( void* removalRoutine, void* _swarm ) {
+	RemovalRoutine*	     self                = (RemovalRoutine*) removalRoutine;
+	Swarm*               swarm               = (Swarm*) _swarm;
+	Particle_InCellIndex maxParticlesPerCell = self->maxParticlesPerCell;
+	Cell_LocalIndex	     cellLocalCount      = swarm->cellLocalCount;
+	Cell_LocalIndex	     lCell_I;
+	
+	RemovalRoutine_InitialiseParticleList( self );
+	
+	/* Loop over all local cells */
+	for ( lCell_I = 0 ; lCell_I < cellLocalCount ; lCell_I++ ) {
+		if ( swarm->cellParticleCountTbl[ lCell_I ] > maxParticlesPerCell ) 
+			RemovalRoutine_RemoveFromCell( self, swarm, lCell_I );
+	}
+
+	/* Actually remove particles */
+	RemovalRoutine_RemoveParticles( self, swarm );
+}
+
+void RemovalRoutine_InitialiseParticleList( void* removalRoutine ) {
+	RemovalRoutine*	     self                = (RemovalRoutine*) removalRoutine;
+
+	self->particlesToRemoveCount = 0;
+	memset( self->particlesToRemoveList, 0, sizeof(Particle_Index) * self->particlesToRemoveAlloced );
+}
+
+void RemovalRoutine_SetParticleToRemove( void* removalRoutine, Swarm* swarm, Cell_Index cell_I, Particle_InCellIndex cParticle_I ) {
+	RemovalRoutine*	      self                = (RemovalRoutine*) removalRoutine;
+	ParticleToRemoveInfo* particleRemoveInfo;
+
+	/* Check memory */
+	if ( self->particlesToRemoveCount >= self->particlesToRemoveAlloced ) {
+		self->particlesToRemoveAlloced += self->particlesToRemoveDelta;
+		self->particlesToRemoveList = 
+			Memory_Realloc_Array( self->particlesToRemoveList, ParticleToRemoveInfo, self->particlesToRemoveAlloced );
+	}
+
+	particleRemoveInfo = &self->particlesToRemoveList[ self->particlesToRemoveCount ];
+
+	particleRemoveInfo->cell_I       = cell_I;
+	particleRemoveInfo->lParticle_I  = swarm->cellParticleTbl[cell_I][cParticle_I];
+
+	self->particlesToRemoveCount++;
+}
+
+int _RemovalRoutine_SortParticles( const void* _aParticleInfo, const void* _bParticleInfo ) {
+	ParticleToRemoveInfo* aParticleInfo = (ParticleToRemoveInfo*) _aParticleInfo;
+	ParticleToRemoveInfo* bParticleInfo = (ParticleToRemoveInfo*) _bParticleInfo;
+
+	return ((int) aParticleInfo->lParticle_I - (int) bParticleInfo->lParticle_I );
+}
+
+void RemovalRoutine_SortParticleList( void* removalRoutine ) {
+	RemovalRoutine*	     self                = (RemovalRoutine*) removalRoutine;
+
+	qsort( self->particlesToRemoveList, self->particlesToRemoveCount, 
+			sizeof(ParticleToRemoveInfo), _RemovalRoutine_SortParticles );
+}
+
+void RemovalRoutine_RemoveParticles( void* removalRoutine, Swarm* swarm ) {
+	RemovalRoutine*	      self                = (RemovalRoutine*) removalRoutine;
+	Index                 array_I;
+	GlobalParticle*       particleToRemove;
+	Particle_Index        particleToRemove_I;
+	Particle_InCellIndex  particleToRemove_IndexWithinCell;
+	Cell_Index            particleToRemove_CellIndex;
+	ParticleToRemoveInfo* particleInfo;
+	
+	GlobalParticle*       lastParticle;
+	Cell_Index            lastParticle_CellIndex;
+	Particle_Index        lastParticle_I;
+	Particle_InCellIndex  lastParticle_IndexWithinCell;
+	SizeT                 particleSize        = swarm->particleExtensionMgr->finalSize;
+
+	#if DEBUG
+	if ( Stream_IsPrintableLevel( self->debug, 2 ) ) {
+		Journal_Printf( self->debug, "Particles to remove:\n{ " );
+		for ( array_I = 0 ; array_I < self->particlesToRemoveCount - 1 ; array_I++ ) {
+			Journal_Printf( self->debug, "%u, ", self->particlesToRemoveList[ array_I ].lParticle_I );
+		}
+		Journal_Printf( self->debug, "%u }\n", self->particlesToRemoveList[ array_I ].lParticle_I );
+	}
+	#endif
+
+
+	RemovalRoutine_SortParticleList( self );
+
+	#if DEBUG
+	if ( Stream_IsPrintableLevel( self->debug, 2 ) ) {
+		Journal_Printf( self->debug, "Particles to remove:\n{ " );
+		for ( array_I = 0 ; array_I < self->particlesToRemoveCount - 1 ; array_I++ ) {
+			Journal_Printf( self->debug, "%u, ", self->particlesToRemoveList[ array_I ].lParticle_I );
+		}
+		Journal_Printf( self->debug, "%u }\n", self->particlesToRemoveList[ array_I ].lParticle_I );
+	}
+	#endif
+
+	for ( array_I = self->particlesToRemoveCount - 1 ; array_I < self->particlesToRemoveCount ; array_I-- ) {
+		particleInfo                     = &self->particlesToRemoveList[ array_I ];
+		particleToRemove_I               = particleInfo->lParticle_I;
+		particleToRemove_CellIndex       = particleInfo->cell_I;
+		particleToRemove_IndexWithinCell = Swarm_GetParticleIndexWithinCell( 
+				swarm, particleToRemove_CellIndex, particleToRemove_I );
+		particleToRemove                 = (GlobalParticle*)Swarm_ParticleAt( swarm, particleToRemove_I );
+
+		Journal_DPrintfL( self->debug, 2, "Removing particle %u from cell %u (cell particle index - %u)\n",
+				particleToRemove_I, particleToRemove_CellIndex, particleToRemove_IndexWithinCell );
+		
+		Swarm_RemoveParticleFromCell( swarm, particleToRemove_CellIndex, particleToRemove_IndexWithinCell );
+		
+		/* Copy over particle with last particle in array - as long as it isn't the last one */
+		lastParticle_I = swarm->particleLocalCount - 1;
+		lastParticle   = (GlobalParticle*)Swarm_ParticleAt( swarm, lastParticle_I );
+		if ( particleToRemove_I != lastParticle_I ) {
+			/* Get last Particle information */
+			lastParticle                 = (GlobalParticle*)Swarm_ParticleAt( swarm, lastParticle_I );
+			lastParticle_CellIndex       = lastParticle->owningCell;
+			lastParticle_IndexWithinCell = Swarm_GetParticleIndexWithinCell( swarm, lastParticle_CellIndex, lastParticle_I);
+
+			Journal_DPrintfL( self->debug, 2, 
+					"Copying over particle %u using last particle %u from cell %u (cell particle index - %u)\n", 
+					particleToRemove_I, lastParticle_I, lastParticle_CellIndex, lastParticle_IndexWithinCell );
+
+			/* Copy over particle */
+			memcpy( particleToRemove, lastParticle, particleSize );
+			
+			/* Change value in cell particle table to point to new index in array */
+			swarm->cellParticleTbl[lastParticle_CellIndex][ lastParticle_IndexWithinCell ] = particleToRemove_I;
+		}
+
+		/* Initialise memory to zero so it is clear that it's been deleted */
+		memset( lastParticle, 0, particleSize );
+		swarm->particleLocalCount--;
+	}
+
+	Swarm_Realloc( swarm );
+}
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/RemovalRoutine.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/RemovalRoutine.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,132 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: RemovalRoutine.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_RemovalRoutine_h__
+#define __PICellerator_PopulationControl_RemovalRoutine_h__
+
+	typedef void (RemovalRoutine_RemoveFromCellFunction)( void* removalRoutine, void* _swarm, Cell_LocalIndex lCell_I );
+
+	/* Textual name of this class */
+	extern const Type RemovalRoutine_Type;
+
+	/* RemovalRoutine information */
+	#define __RemovalRoutine \
+		/* General info */ \
+		__Stg_Component \
+		/* Virtual Info */\
+		RemovalRoutine_RemoveFromCellFunction*     _removeFromCell;          \
+		/* Other Info */\
+		Stream*                                    debug;                    \
+		Dimension_Index                            dim;                      \
+		Particle_InCellIndex                       idealParticleCount;       \
+		Particle_InCellIndex                       maxParticlesPerCell;      \
+		/* Removal Info */  \
+		Particle_Index                             particlesToRemoveCount;   \
+		Particle_Index                             particlesToRemoveAlloced; \
+		Particle_Index                             particlesToRemoveDelta;   \
+		ParticleToRemoveInfo*                      particlesToRemoveList;    
+
+
+	typedef struct {
+		Particle_Index       lParticle_I;
+		Cell_Index           cell_I;
+	} ParticleToRemoveInfo;
+
+	struct RemovalRoutine { __RemovalRoutine };
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	RemovalRoutine* _RemovalRoutine_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,		
+		RemovalRoutine_RemoveFromCellFunction*     _removeFromCell,
+		Name                                       name );
+	
+	/* Stg_Class_Delete RemovalRoutine implementation */
+	void _RemovalRoutine_Delete( void* removalRoutine );
+	void _RemovalRoutine_Print( void* removalRoutine, Stream* stream );
+	#define RemovalRoutine_Copy( self ) \
+		(RemovalRoutine*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define RemovalRoutine_DeepCopy( self ) \
+		(RemovalRoutine*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _RemovalRoutine_Copy( void* removalRoutine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+void _RemovalRoutine_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _RemovalRoutine_Build( void* removalRoutine, void* data ) ;
+	void _RemovalRoutine_Initialise( void* removalRoutine, void* data ) ;
+	void _RemovalRoutine_Execute( void* removalRoutine, void* data );
+	void _RemovalRoutine_Destroy( void* removalRoutine, void* data ) ;
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+
+	void RemovalRoutine_RemoveFromCell( void* removalRoutine, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	void RemovalRoutine_RemoveFromSwarm( void* removalRoutine, void* _swarm ) ;
+
+	void RemovalRoutine_InitialiseParticleList( void* removalRoutine ) ;
+	void RemovalRoutine_SetParticleToRemove( void* removalRoutine, Swarm* swarm, Cell_Index cell_I, Particle_InCellIndex cParticle_I ) ;
+
+	void RemovalRoutine_SortParticleList( void* removalRoutine ) ;
+	void RemovalRoutine_RemoveParticles( void* removalRoutine, Swarm* swarm ) ;
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/RemovalRoutine.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/RemovalRoutine.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">RemovalRoutine</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/PopulationControl/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">dim</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">idealParticleCount</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">maxParticlesPerCell</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">idealParticleCount</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">particlesToRemoveDelta</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">20</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/ReseedSplitting.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/ReseedSplitting.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,227 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: ReseedSplitting.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "types.h"
+#include "SplittingRoutine.h"
+#include "ReseedSplitting.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+const Type ReseedSplitting_Type = "ReseedSplitting";
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+ReseedSplitting* _ReseedSplitting_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,		
+		SplittingRoutine_SplitParticlesInCellFunction*   _splitInCell,
+		Name                                             name )
+{
+	ReseedSplitting* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(ReseedSplitting) );
+	self = (ReseedSplitting*)_SplittingRoutine_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_splitInCell,
+			name );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _ReseedSplitting_Init( void* reseedSplitting, Index baseNum ) {
+	ReseedSplitting* self = (ReseedSplitting*)reseedSplitting;
+	
+	self->isConstructed   = True;
+
+	self->baseNum = baseNum;
+	self->regionCount = baseNum * baseNum;
+	if (self->dim == 3)
+		self->regionCount *= baseNum;
+	self->regionContainsParticleTbl = Memory_Alloc_Array( Bool, self->regionCount, "regionContainsParticleTbl" );
+	memset( self->regionContainsParticleTbl, 0, self->regionCount * sizeof(Bool) );
+}
+
+void _ReseedSplitting_Delete( void* reseedSplitting ) {
+	ReseedSplitting* self = (ReseedSplitting*)reseedSplitting;
+
+	Memory_Free( self->regionContainsParticleTbl );
+
+	_SplittingRoutine_Delete( self );
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+void* _ReseedSplitting_DefaultNew( Name name ) {
+	return (void*) _ReseedSplitting_New(
+			sizeof(ReseedSplitting),
+			ReseedSplitting_Type,
+			_ReseedSplitting_Delete,
+			_SplittingRoutine_Print,
+			_SplittingRoutine_Copy,
+			_ReseedSplitting_DefaultNew,
+			_ReseedSplitting_Construct,
+			_SplittingRoutine_Build,
+			_SplittingRoutine_Initialise,
+			_SplittingRoutine_Execute,
+			_SplittingRoutine_Destroy,
+			_ReseedSplitting_SplitParticlesInCell,
+			name );
+}
+
+
+void _ReseedSplitting_Construct( void* reseedSplitting, Stg_ComponentFactory* cf, void* data ) {
+	ReseedSplitting*	     self            = (ReseedSplitting*) reseedSplitting;
+	Index                    baseNum;
+
+	_SplittingRoutine_Construct( self, cf, data );
+
+	baseNum = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "baseNum", 
+			(Index) pow( (double) self->idealParticleCount, 1.0/(double)(self->dim) ) );
+
+	_ReseedSplitting_Init( self, baseNum );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+void _ReseedSplitting_SplitParticlesInCell( void* reseedSplitting, void* _swarm, Cell_LocalIndex lCell_I ) {
+	ReseedSplitting*        self              = (ReseedSplitting*) reseedSplitting;
+	Swarm*                  swarm             = (Swarm*)  _swarm;
+	Particle_InCellIndex    cellParticleCount = swarm->cellParticleCountTbl[ lCell_I ];
+	Particle_InCellIndex    cParticle_I;
+	GlobalParticle*         particle;
+	Coord                   newCoord;
+	Coord                   xi;
+	IJK                     regionIJK         = { 0, 0, 0 };
+	IJK                     regionSizes       = { 1, 1, 1 };
+	Index                   region_I;
+	Dimension_Index         dim_I;
+	Dimension_Index         dim               = self->dim;
+	double                  regionLength;
+	FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)swarm->cellLayout)->mesh;
+	ElementLayout*          elementLayout     = mesh->layout->elementLayout;
+
+	/* Initialise all Bools to false */
+	memset( self->regionContainsParticleTbl, 0, self->regionCount * sizeof(Bool) );
+	regionSizes[ I_AXIS ] = regionSizes[ J_AXIS ] = self->baseNum;
+	if ( dim == 3 )
+		regionSizes[ K_AXIS ] = self->baseNum;
+	regionLength = 2.0 / (double) self->baseNum;
+		
+	/* Fill table of regions with true if there is a particle in the region */
+	for ( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+		particle = (GlobalParticle*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I ) ;
+		
+		/* Calculate local coordinates */
+		ElementType_ConvertGlobalCoordToElLocal(
+				FiniteElement_Mesh_ElementTypeAt( mesh, lCell_I ),
+				elementLayout,
+				(const Coord**) swarm->cellPointTbl[lCell_I],
+				particle->coord,
+				xi );
+
+		for ( dim_I = 0 ; dim_I < dim ; dim_I++ ) 
+			regionIJK[ dim_I ] = (Index) ( (xi[ dim_I ] + 1.0) / regionLength );
+
+		Dimension_3DTo1D( regionIJK, regionSizes, &region_I );
+
+		self->regionContainsParticleTbl[ region_I ] = True;
+	}
+
+	/* Go through and add particles to empty regions */
+	for ( region_I = 0 ; region_I < self->regionCount ; region_I++ ) {
+
+		/* Don't do anything if region has particle */
+		if ( self->regionContainsParticleTbl[ region_I ] )
+			continue;
+
+		/* Find local coordinate of empty region */
+		Dimension_1DTo3D( region_I, regionSizes, regionIJK );
+		for ( dim_I = 0 ; dim_I < dim ; dim_I++ ) {
+			xi[ dim_I ] = (double) regionIJK[ dim_I ] * regionLength - 1.0 + 0.5 * regionLength;
+		}
+
+		/* Convert Local Coordinate to Global Coordinate */
+		FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, dim, lCell_I, xi, newCoord );
+			
+		/* Work out particle to split by finding closest particle in this cell */
+		cParticle_I = Swarm_FindClosestParticleInCell( swarm, lCell_I, dim, newCoord, NULL );
+
+		/* Split particle */
+		SplittingRoutine_SplitParticle( self, swarm, lCell_I, cParticle_I, newCoord );
+	}
+}
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/ReseedSplitting.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/ReseedSplitting.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,105 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: ReseedSplitting.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_ReseedSplitting_h__
+#define __PICellerator_PopulationControl_ReseedSplitting_h__
+
+	/* Textual name of this class */
+	extern const Type ReseedSplitting_Type;
+
+	/* ReseedSplitting information */
+	#define __ReseedSplitting \
+		/* Parent info */ \
+		__SplittingRoutine \
+		/* Virtual Info */\
+		\
+		/* General Info */\
+		Index                  baseNum;                     \
+		Index                  regionCount;                 \
+		Bool*                  regionContainsParticleTbl;
+
+	struct ReseedSplitting { __ReseedSplitting };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	ReseedSplitting* _ReseedSplitting_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,		
+		SplittingRoutine_SplitParticlesInCellFunction*   _splitInCell,
+		Name                                    name );
+
+	void* _ReseedSplitting_DefaultNew( Name name ) ;
+void _ReseedSplitting_Construct( void* reseedSplitting, Stg_ComponentFactory* cf, void* data ) ;
+		
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	void _ReseedSplitting_SplitParticlesInCell( void* reseedSplitting, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/ReseedSplitting.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/ReseedSplitting.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">ReseedSplitting</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/PopulationControl/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">SplittingRoutine</param>
+<param name="Reference">...</param>
+<param name="Summary">...</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 5896a19b8457 -r 31abbeebf74e PopulationControl/src/SplittingRoutine.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/SplittingRoutine.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,212 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: SplittingRoutine.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "types.h"
+#include "SplittingRoutine.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+/* Textual name of this class */
+const Type SplittingRoutine_Type = "SplittingRoutine";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+SplittingRoutine* _SplittingRoutine_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,		
+		SplittingRoutine_SplitParticlesInCellFunction*     _splitParticlesInCell,
+		Name                                               name )
+{
+	SplittingRoutine* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(SplittingRoutine) );
+	self = (SplittingRoutine*)_Stg_Component_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			name ,
+			NON_GLOBAL );
+	
+	/* General info */
+
+	/* Virtual Info */
+	self->_splitParticlesInCell = _splitParticlesInCell;
+	
+	return self;
+}
+
+void _SplittingRoutine_Init( 
+		SplittingRoutine*                                  self, 
+		Dimension_Index                                    dim, 
+		Particle_InCellIndex                               idealParticleCount,
+		Particle_InCellIndex                               minParticlesPerCell )
+{
+	self->isConstructed          = True;
+	self->dim                    = dim;
+	self->idealParticleCount     = idealParticleCount;
+	self->minParticlesPerCell    = minParticlesPerCell;
+
+	self->debug = Journal_Register( Debug_Type, SplittingRoutine_Type ); /* TODO Register Child */
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _SplittingRoutine_Delete( void* splittingRoutine ) {
+	SplittingRoutine* self = (SplittingRoutine*)splittingRoutine;
+	
+	/* Delete parent */
+	_Stg_Component_Delete( self );
+}
+
+
+void _SplittingRoutine_Print( void* splittingRoutine, Stream* stream ) {
+	SplittingRoutine* self = (SplittingRoutine*)splittingRoutine;
+	
+	/* Print parent */
+	_Stg_Component_Print( self, stream );
+}
+
+
+void* _SplittingRoutine_Copy( void* splittingRoutine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	SplittingRoutine*	self = (SplittingRoutine*)splittingRoutine;
+	SplittingRoutine*	newSplittingRoutine;
+	
+	newSplittingRoutine = (SplittingRoutine*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newSplittingRoutine;
+}
+
+void _SplittingRoutine_Construct( void* splittingRoutine, Stg_ComponentFactory* cf, void* data ) {
+	SplittingRoutine*	 self          = (SplittingRoutine*) splittingRoutine;
+	Dimension_Index      dim;
+	Particle_InCellIndex idealParticleCount;
+	Particle_InCellIndex minParticlesPerCell;
+
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+
+	idealParticleCount  = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "idealParticleCount",  0 );
+	minParticlesPerCell = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "minParticlesPerCell", idealParticleCount );
+	
+	_SplittingRoutine_Init( self, dim, idealParticleCount, minParticlesPerCell );
+}
+
+void _SplittingRoutine_Build( void* splittingRoutine, void* data ) {
+}
+void _SplittingRoutine_Initialise( void* splittingRoutine, void* data ) {
+}
+void _SplittingRoutine_Execute( void* splittingRoutine, void* _swarm ) {
+	SplittingRoutine*    self                = (SplittingRoutine*) splittingRoutine;
+	Swarm*               swarm               = (Swarm*) _swarm;
+	Particle_InCellIndex minParticlesPerCell = self->minParticlesPerCell;
+	Cell_LocalIndex	     cellLocalCount      = swarm->cellLocalCount;
+	Cell_LocalIndex	     lCell_I;
+	
+	/* Loop over all local cells */
+	for ( lCell_I = 0 ; lCell_I < cellLocalCount ; lCell_I++ ) {
+		if ( swarm->cellParticleCountTbl[ lCell_I ] < minParticlesPerCell ) 
+			SplittingRoutine_SplitParticlesInCell( self, swarm, lCell_I );
+	}
+}
+void _SplittingRoutine_Destroy( void* splittingRoutine, void* data ) {
+}
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+void SplittingRoutine_SplitParticlesInCell( void* splittingRoutine, void* _swarm, Cell_LocalIndex lCell_I ) {
+	SplittingRoutine*	 self          = (SplittingRoutine*) splittingRoutine;
+
+	self->_splitParticlesInCell( self, _swarm, lCell_I );
+}
+
+	
+
+
+void SplittingRoutine_SplitParticle( void* splittingRoutine, void* _swarm, Cell_LocalIndex lCell_I, Particle_InCellIndex cParticle_I, Coord newCoord ) 
+{
+	Swarm*               swarm            = (Swarm*)            _swarm;
+	Particle_Index       newParticle_I;
+	GlobalParticle*      newParticle;
+	GlobalParticle*      particleToSplit;
+
+	/* Add new particle to end of swarm */
+	newParticle     = (GlobalParticle*) Swarm_CreateNewParticle( swarm, &newParticle_I );
+	
+	/* Copy particle information */
+	particleToSplit = (GlobalParticle*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+	memcpy( newParticle, particleToSplit, swarm->particleExtensionMgr->finalSize );
+	Swarm_AddParticleToCell( swarm, lCell_I, newParticle_I );
+
+	/* Copy new position */
+	memcpy( newParticle->coord, newCoord, sizeof(Coord) );
+}
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/SplittingRoutine.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/SplittingRoutine.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,116 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: SplittingRoutine.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_SplittingRoutine_h__
+#define __PICellerator_PopulationControl_SplittingRoutine_h__
+
+	typedef void (SplittingRoutine_SplitParticlesInCellFunction)( void* splittingRoutine, void* _swarm, Cell_LocalIndex lCell_I );
+
+	/* Textual name of this class */
+	extern const Type SplittingRoutine_Type;
+
+	/* SplittingRoutine information */
+	#define __SplittingRoutine \
+		/* General info */ \
+		__Stg_Component \
+		/* Virtual Info */\
+		SplittingRoutine_SplitParticlesInCellFunction*     _splitParticlesInCell;          \
+		/* Other Info */\
+		Stream*                                    debug;                    \
+		Dimension_Index                            dim;                      \
+		Particle_InCellIndex                       idealParticleCount;       \
+		Particle_InCellIndex                       minParticlesPerCell;      \
+
+	struct SplittingRoutine { __SplittingRoutine };
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	SplittingRoutine* _SplittingRoutine_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,		
+		SplittingRoutine_SplitParticlesInCellFunction*    _splitParticlesInCell,
+		Name                                              name );
+	
+	/* Stg_Class_Delete SplittingRoutine implementation */
+	void _SplittingRoutine_Delete( void* splittingRoutine );
+	void _SplittingRoutine_Print( void* splittingRoutine, Stream* stream );
+	#define SplittingRoutine_Copy( self ) \
+		(SplittingRoutine*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define SplittingRoutine_DeepCopy( self ) \
+		(SplittingRoutine*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _SplittingRoutine_Copy( void* splittingRoutine, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+void _SplittingRoutine_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _SplittingRoutine_Build( void* splittingRoutine, void* data ) ;
+	void _SplittingRoutine_Initialise( void* splittingRoutine, void* data ) ;
+	void _SplittingRoutine_Execute( void* splittingRoutine, void* data );
+	void _SplittingRoutine_Destroy( void* splittingRoutine, void* data ) ;
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+
+	void SplittingRoutine_SplitParticlesInCell( void* splittingRoutine, void* _swarm, Cell_LocalIndex lCell_I ) ;
+
+	void SplittingRoutine_SplitParticle( void* splittingRoutine, void* _swarm, Cell_LocalIndex lCell_I, Particle_InCellIndex cParticle_I, Coord newCoord );
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/SplittingRoutine.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/SplittingRoutine.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">SplittingRoutine</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/PopulationControl/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">dim</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">idealParticleCount</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">0</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">minParticlesPerCell</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">idealParticleCount</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,65 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN MPI XML
+
+# Work out name to call library
+lib = ${PROJECT}$(shell basename `pwd | sed s/src//g`)
+libstatic = yes
+libdynamic = yes
+
+# Name of directory to place header files
+includes := ${PROJECT}/$(shell basename `pwd | sed s/src//g`)
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/src/types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/src/types.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,67 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Basic framework types.
+**
+** Assumptions:
+**	None as yet.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: types.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_PopulationControl_types_h__
+#define __PICellerator_PopulationControl_types_h__
+	
+	typedef struct RemovalRoutine               RemovalRoutine;
+	typedef struct SplittingRoutine             SplittingRoutine;
+	typedef struct EscapedRoutine		    EscapedRoutine;
+	typedef struct ReseedSplitting              ReseedSplitting;
+	typedef struct DiscreteVoronoiRemove        DiscreteVoronoiRemove;
+	typedef struct DiscreteVoronoiSplitting     DiscreteVoronoiSplitting;
+	
+#endif
+
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/expected/testDiscreteVoronoiRemove.0of1.discrepancy.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/expected/testDiscreteVoronoiRemove.0of1.discrepancy.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Testing DiscreteVoronoiRemove
+Test passed with max discrepancy = 0.16
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/expected/testDiscreteVoronoiSplitting.0of1.discrepancy.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/expected/testDiscreteVoronoiSplitting.0of1.discrepancy.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Testing DiscreteVoronoiSplitting
+Test passed with max discrepancy = 0.14
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/expected/testReseedSplitting.0of1.discrepancy.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/expected/testReseedSplitting.0of1.discrepancy.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Testing ReseedSplitting
+Test passed with max discrepancy = 0.11
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,55 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := plugins
+
+checks = $(wildcard *.sh)
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/plugins/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/plugins/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,57 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN MPI XML 
+
+# Note don't put the .c extension. just the base name of the plugin
+plugins := $(wildcard *.c)
+
+include ${PROJ_ROOT}/Makefile.vmake
+
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/plugins/testDiscrepancy.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/plugins/testDiscrepancy.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,229 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: testDiscrepancy.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+
+/* Discrepancy is a measure of the spacing of the particles 
+ * For information on 'Discrepancy' check out:
+ * P. Bratley, B.L. Fox,  Implementing Sobol's Quasirandom Sequence Generator,  
+ * ACM Transactions on Mathematical Software, March 1988, Volume 14, pp. 88 - 100
+ * http://portal.acm.org/ft_gateway.cfm?id=214372&type=pdf&coll=GUIDE&dl=GUIDE&CFID=45681167&CFTOKEN=8969368
+ *
+ * also http://en.wikipedia.org/wiki/Quasi-random */
+
+#define VOLUME_OF_CUBE 1.0
+
+double Swarm_ParticleDiscrepancy( void* swarm, Cell_LocalIndex lCell_I, Particle_InCellIndex cParticle_I ) {
+	Swarm*               self    = (Swarm*) swarm;
+	Particle_InCellIndex countSn = 0;
+	Dimension_Index      dim     = self->dim;
+	double               volumeGx;
+	Particle_InCellIndex smallerCellParticle_I;
+	Particle_InCellIndex cellParticleCount = self->cellParticleCountTbl[ lCell_I ];
+	GlobalParticle*      particle          = (GlobalParticle*)Swarm_ParticleInCellAt( self, lCell_I, cParticle_I );
+	double*              coord             = particle->coord;
+	GlobalParticle*      smallerCellParticle;
+	double*              startCellCoord    = (double*) self->cellPointTbl[lCell_I][0];
+	double*              endCellCoord      = (double*) self->cellPointTbl[lCell_I][ dim == 2 ? 2 : 6 ];
+
+	/* Calculate volume of Gx */
+	volumeGx = 
+		(coord[ I_AXIS ] - startCellCoord[ I_AXIS ])/( endCellCoord[ I_AXIS ] - startCellCoord[ I_AXIS ]) *
+		(coord[ J_AXIS ] - startCellCoord[ J_AXIS ])/( endCellCoord[ J_AXIS ] - startCellCoord[ J_AXIS ]) ;
+	if ( dim == 3 )
+		volumeGx *= (coord[ K_AXIS ] - startCellCoord[ K_AXIS ])/( endCellCoord[ K_AXIS ] - startCellCoord[ K_AXIS ]) ;
+	
+	for ( smallerCellParticle_I = 0 ; smallerCellParticle_I < cellParticleCount ; smallerCellParticle_I++ ) {
+		smallerCellParticle = (GlobalParticle*)Swarm_ParticleInCellAt( self, lCell_I, smallerCellParticle_I );
+	
+		/* Only include particles with lower coords than this particle in counting Sn */
+		if ( smallerCellParticle_I == cParticle_I )
+			continue;
+
+		if ( smallerCellParticle->coord[ I_AXIS ] >= coord[ I_AXIS ] )
+			continue;
+		
+		if ( smallerCellParticle->coord[ J_AXIS ] >= coord[ J_AXIS ] )
+			continue;
+		
+		if ( dim == 3 && smallerCellParticle->coord[ K_AXIS ] >= coord[ K_AXIS ] )
+			continue;
+
+		
+		/* Otherwise, particle is within Gx - Therfore contributes to Sn */
+		countSn++;
+	}
+
+	return fabs( ((double) countSn / (double) cellParticleCount - volumeGx / VOLUME_OF_CUBE ) );
+}
+
+double Swarm_CellDiscrepancy( void* swarm, Cell_LocalIndex lCell_I ) {
+	Swarm*               self    = (Swarm*) swarm;
+	double               discrepancy = 0.0;
+	double               result;
+	Particle_InCellIndex cParticle_I;
+	Particle_InCellIndex cellParticleCount = self->cellParticleCountTbl[ lCell_I ];
+
+	for ( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+		result = Swarm_ParticleDiscrepancy( self, lCell_I, cParticle_I );
+
+		/* Discrepancy is the supremum of all the particles */
+		if ( discrepancy < result )
+			discrepancy = result;
+	}
+
+	return discrepancy;
+}
+
+double Swarm_AverageDiscrepancy( void* swarm ) {
+	Swarm*               self    = (Swarm*) swarm;
+	double               localDiscrepancy  = 0.0;
+	double               globalDiscrepancy = 0.0;
+	Cell_LocalIndex      lCell_I;
+	Cell_Index           globalCellCount;
+
+	for ( lCell_I = 0 ; lCell_I < self->cellLocalCount ; lCell_I++ ) {
+		localDiscrepancy += Swarm_CellDiscrepancy( self, lCell_I );
+	}
+
+	MPI_Allreduce( &localDiscrepancy, &globalDiscrepancy, 1, MPI_DOUBLE, MPI_MAX, self->comm );
+	MPI_Allreduce( &self->cellLocalCount, &globalCellCount, 1, MPI_UNSIGNED, MPI_MAX, self->comm );
+
+	return globalDiscrepancy/(double)globalCellCount;
+}
+
+
+void testDiscrepancy_Function( DiscretisationContext* context ) {
+	Stream*           stream = Journal_Register( Info_Type, CURR_MODULE_NAME );
+	double            discrepancy;
+	double            maxDiscrepancy;
+	Particle_Index    globalParticleCount;
+	Swarm*            swarm            = Stg_ComponentFactory_ConstructByName( context->CF, "swarm", Swarm, True, 0 );
+	SplittingRoutine* splittingRoutine = Stg_ComponentFactory_ConstructByName( 
+						context->CF, 
+						"splittingRoutine", 
+						SplittingRoutine, 
+						False, 
+						0 );
+	RemovalRoutine*   removalRoutine   = Stg_ComponentFactory_ConstructByName( 
+						context->CF, 
+						"removalRoutine", 
+						RemovalRoutine, 
+						False, 
+						0 );
+
+	/* Output before population control */
+	discrepancy = Swarm_AverageDiscrepancy( swarm );
+	MPI_Allreduce( &swarm->particleLocalCount, &globalParticleCount, 1, MPI_UNSIGNED, MPI_MAX, swarm->comm );
+	Journal_Printf( stream, "Before population control - global particle count = %u - discrepancy = %.4g\n",
+			globalParticleCount, discrepancy );
+
+	/* Do population control */
+	if ( removalRoutine ) 
+		RemovalRoutine_RemoveFromSwarm( removalRoutine, swarm );
+	if ( splittingRoutine ) 
+		Stg_Component_Execute( splittingRoutine, swarm, True );
+
+	/* Output after population control */
+	discrepancy = Swarm_AverageDiscrepancy( swarm );
+	MPI_Allreduce( &swarm->particleLocalCount, &globalParticleCount, 1, MPI_UNSIGNED, MPI_MAX, swarm->comm );
+	Journal_Printf( stream, "Before population control - global particle count = %u - discrepancy = %.4g\n",
+			globalParticleCount, discrepancy );
+	
+	/* Output information to file */
+	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "discrepancy.dat" );
+	if ( removalRoutine )
+		Journal_Printf( stream, "Testing %s\n", removalRoutine->type );
+	if ( splittingRoutine )
+		Journal_Printf( stream, "Testing %s\n", splittingRoutine->type );
+	maxDiscrepancy = Dictionary_GetDouble( context->dictionary, "maxDiscrepancy" );
+	if ( discrepancy <= maxDiscrepancy ) 
+		Journal_Printf( stream, "Test passed with max discrepancy = %.4g\n", maxDiscrepancy );
+	else 
+		Journal_Printf( stream, "Test failed with discrepancy = %g and max discrepancy = %.4g\n", 
+				discrepancy, maxDiscrepancy );
+
+	exit( EXIT_SUCCESS );
+}
+	
+const Type testDiscrepancy_Type = "testDiscrepancy";
+
+typedef struct {
+	__Codelet
+} testDiscrepancy;
+
+void _testDiscrepancy_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	DiscretisationContext* context;
+	context = (DiscretisationContext*)Stg_ComponentFactory_ConstructByName( cf, "context", DiscretisationContext, True, data ); 
+	ContextEP_Append( context, AbstractContext_EP_Initialise, testDiscrepancy_Function );
+}
+
+void* _testDiscrepancy_Default_New( Name name ) {
+	return _Codelet_New(
+		sizeof( Codelet ),
+		testDiscrepancy_Type,
+		_Codelet_Delete,
+		_Codelet_Print,
+		_Codelet_Copy,
+		_testDiscrepancy_Default_New, 
+		_testDiscrepancy_Construct,
+		_Codelet_Build,
+		_Codelet_Initialise,
+		_Codelet_Execute,
+		_Codelet_Destroy,
+		name );
+}
+
+Index testDiscrepancy_Register( PluginsManager* pluginsManager ) {
+        Index result;
+
+        result = PluginsManager_Submit( pluginsManager, testDiscrepancy_Type, "0", _testDiscrepancy_Default_New );
+
+        return result;
+}
+	
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/plugins/testParticleCoords.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/plugins/testParticleCoords.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,109 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: testParticleCoords.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+const Type TestParticleCoords_Type = "TestParticleCoords";
+
+void PICellerator_testParticleCoords( DiscretisationContext* context ) {
+	Swarm*     swarm;
+	Stream*             stream  = Journal_Register( Info_Type, CURR_MODULE_NAME );
+	Name                filename;
+
+	if ( context->timeStep == 0 )
+		return;
+
+	Stg_asprintf( &filename, "output%u.dat", context->rank );
+
+	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, filename );
+
+	Memory_Free( filename );
+
+	swarm = (Swarm*)            LiveComponentRegister_Get( context->CF->LCRegister, "picIntegrationPoints" );
+	assert(swarm);
+
+	Swarm_PrintParticleCoords( swarm, stream );
+}
+	
+void _testParticleCoords_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	DiscretisationContext* context;
+	context = (DiscretisationContext*)Stg_ComponentFactory_ConstructByName( cf, "context", DiscretisationContext, True, data ); 
+	
+	ContextEP_Append( context, AbstractContext_EP_Dump, PICellerator_testParticleCoords );
+}
+
+
+void* _testParticleCoords_DefaultNew( Name name ) {
+	return _Codelet_New(
+			sizeof( Codelet ),
+			TestParticleCoords_Type,
+			_Codelet_Delete,
+			_Codelet_Print,
+			_Codelet_Copy,
+			_testParticleCoords_DefaultNew,
+			_testParticleCoords_Construct,
+			_Codelet_Build,
+			_Codelet_Initialise,
+			_Codelet_Execute,
+			_Codelet_Destroy,
+			name );
+}
+
+
+Index testParticleCoords_Register( PluginsManager* pluginsManager ) {
+	Index result;
+
+	result = PluginsManager_Submit( pluginsManager, TestParticleCoords_Type, "0",
+		_testParticleCoords_DefaultNew );
+
+	return result;
+}
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/testDiscreteVoronoiRemove.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/testDiscreteVoronoiRemove.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testDiscreteVoronoiRemove.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 "PICellerator testDiscreteVoronoiRemove.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/testDiscreteVoronoiRemove.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/testDiscreteVoronoiRemove.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>testPopulationControl.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="discreteVoronoi">
+			<param name="Type">CellularAutomataVoronoi</param>
+			<param name="resolution">16</param>
+			<param name="diagonalNeighbours">true</param>
+		</struct>		
+		<struct name="removalRoutine">
+			<param name="Type">DiscreteVoronoiRemove</param>
+			<param name="idealParticleCount">15</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+		</struct>	
+	</struct>
+
+	<param name="maxDiscrepancy">0.16</param>
+	
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/testDiscreteVoronoiSplitting.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/testDiscreteVoronoiSplitting.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testDiscreteVoronoiSplitting.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 "PICellerator testDiscreteVoronoiSplitting.xml --particleCount=30" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/testDiscreteVoronoiSplitting.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/testDiscreteVoronoiSplitting.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>testPopulationControl.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="discreteVoronoi">
+			<param name="Type">CellularAutomataVoronoi</param>
+			<param name="resolution">16</param>
+			<param name="diagonalNeighbours">true</param>
+		</struct>
+		<struct name="splittingRoutine">
+			<param name="Type">DiscreteVoronoiSplitting</param>
+			<param name="idealParticleCount">100</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+		</struct>	
+	</struct>
+
+	<param name="maxDiscrepancy">0.14</param>
+	
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/testPopulationControl.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/testPopulationControl.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,55 @@
+<?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/ElementLayout.xml</include>
+
+	<struct name="components" mergeType="merge">
+		<struct name="elementCellLayout">
+			<param name="Type">ElementCellLayout</param>
+			<param name="Mesh">mesh-linear</param>
+		</struct>
+		<struct name="particleLayout">
+			<param name="Type">RandomParticleLayout</param>
+			<param name="cellParticleCount">particleCount</param>
+		</struct>
+		<struct name="swarm">
+			<param name="Type">Swarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">particleLayout</param>
+		</struct>
+	</struct>
+
+	<list name="plugins">
+		<param>testDiscrepancy</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="maxTimeSteps"> 1 </param>
+	<param name="dumpEvery"> 1 </param>
+	<param name="outputPath"> ./output </param>
+	<param name="dim"> 2 </param>
+	
+	<param name="particleCount"> 60 </param>
+
+	<!-- Mesh Stuff -->
+	<param name="elementResI"> 10 </param>
+	<param name="elementResJ"> 10 </param>
+	<param name="elementResK"> 1 </param>
+	
+	<param name="shadowDepth"> 1 </param>
+	<param name="minX"> -1.0 </param>
+	<param name="minY"> -1.0 </param>
+	<param name="minZ"> -1.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>
+	<param name="buildElementNodeTbl"> True </param>
+	
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/testReseedSplitting.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/testReseedSplitting.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testReseedSplitting.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 "PICellerator testReseedSplitting.xml --particleCount=30" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e PopulationControl/tests/testReseedSplitting.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PopulationControl/tests/testReseedSplitting.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+	<include>testPopulationControl.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="splittingRoutine">
+			<param name="Type">ReseedSplitting</param>
+			<param name="idealParticleCount">50</param>
+		</struct>	
+	</struct>
+
+	<param name="maxDiscrepancy">0.11</param>
+	
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Templates/PICelleratorLicense.makefile.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Templates/PICelleratorLicense.makefile.txt	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,39 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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
diff -r 5896a19b8457 -r 31abbeebf74e Templates/PICelleratorLicense.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Templates/PICelleratorLicense.txt	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,39 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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
diff -r 5896a19b8457 -r 31abbeebf74e Templates/license.c_suffix.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Templates/license.c_suffix.txt	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,4 @@
+**
+** $Id:  $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
diff -r 5896a19b8457 -r 31abbeebf74e Templates/license.h_suffix.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Templates/license.h_suffix.txt	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+**
+*/
diff -r 5896a19b8457 -r 31abbeebf74e Templates/license.makefile_suffix.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Templates/license.makefile_suffix.txt	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,4 @@
+##
+## $Id:  $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff -r 5896a19b8457 -r 31abbeebf74e Utils/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,53 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := src #tests
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/BuoyancyForceTerm.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/BuoyancyForceTerm.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,390 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: BuoyancyForceTerm.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+#include "types.h"
+#include "BuoyancyForceTerm.h"
+#include "MaterialSwarmVariable.h"
+
+#include <assert.h>
+#include <string.h>
+
+/* Textual name of this class */
+const Type BuoyancyForceTerm_Type = "BuoyancyForceTerm";
+
+BuoyancyForceTerm* BuoyancyForceTerm_New( 
+		Name                                                name,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              gravity,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register )
+{
+	BuoyancyForceTerm* self = (BuoyancyForceTerm*) _BuoyancyForceTerm_DefaultNew( name );
+
+	BuoyancyForceTerm_InitAll( 
+			self,
+			forceVector,
+			integrationSwarm,
+			temperatureField,
+			gravity,
+			adjust,
+			materials_Register );
+
+	return self;
+}
+
+/* Creation implementation / Virtual constructor */
+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) );
+	self = (BuoyancyForceTerm*) _ForceTerm_New( 
+		sizeOfSelf, 
+		type, 
+		_delete, 
+		_print, 
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build, 
+		_initialise,
+		_execute,
+		_destroy,
+		_assembleElement,
+		name );
+	
+	/* Virtual info */
+	self->_calcGravity = _calcGravity;
+	
+	return self;
+}
+
+void _BuoyancyForceTerm_Init( 
+		BuoyancyForceTerm*                                  self, 
+		FeVariable*                                         temperatureField,
+		double                                              gravity,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register )
+{
+	self->temperatureField    = temperatureField;
+	self->gravity             = gravity;
+	self->adjust              = adjust;
+	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;
+
+	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 );
+}
+
+void _BuoyancyForceTerm_Print( void* forceTerm, Stream* stream ) {
+	BuoyancyForceTerm* self = (BuoyancyForceTerm*)forceTerm;
+	
+	_ForceTerm_Print( self, stream );
+
+	/* General info */
+	Journal_PrintPointer( stream, self->temperatureField );
+	Journal_PrintDouble( stream, self->gravity );
+}
+
+void* _BuoyancyForceTerm_DefaultNew( Name name ) {
+	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_Construct( void* forceTerm, Stg_ComponentFactory* cf, void* data ) {
+	BuoyancyForceTerm*          self             = (BuoyancyForceTerm*)forceTerm;
+	FeVariable*                 temperatureField;
+	double                      gravity;
+	Bool                        adjust;
+	Materials_Register*         materials_Register;
+
+	/* Construct Parent */
+	_ForceTerm_Construct( self, cf, data );
+
+	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 );
+
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
+	assert( materials_Register );
+
+	_BuoyancyForceTerm_Init( self, temperatureField, gravity, adjust, materials_Register );
+}
+
+void _BuoyancyForceTerm_Build( void* forceTerm, void* data ) {
+	BuoyancyForceTerm*               self               = (BuoyancyForceTerm*)forceTerm;
+	BuoyancyForceTerm_MaterialExt*   materialExt;
+	Material_Index                   material_I;
+	Material*                        material;
+	Materials_Register*              materials_Register = self->materials_Register;
+	IntegrationPointsSwarm*          swarm              = (IntegrationPointsSwarm*)self->integrationSwarm;
+	MaterialPointsSwarm**            materialSwarms;
+	Index                            materialSwarm_I;
+	Name                             name;
+
+	_ForceTerm_Build( self, data );
+
+	if ( self->temperatureField )
+		Stg_Component_Build( self->temperatureField, data, False );
+
+	/* Sort out material extension stuff */
+	self->materialExtHandle = Materials_Register_AddMaterialExtension( 
+			self->materials_Register, 
+			self->type, 
+			sizeof(BuoyancyForceTerm_MaterialExt) );
+	for ( material_I = 0 ; material_I < Materials_Register_GetCount( materials_Register ) ; material_I++) {
+		material = Materials_Register_GetByIndex( materials_Register, material_I );
+		materialExt = ExtensionManager_GetFunc( material->extensionMgr, material, self->materialExtHandle );
+
+		materialExt->density = Dictionary_GetDouble_WithDefault( material->dictionary, "density", 0.0 );
+		materialExt->alpha   = Dictionary_GetDouble_WithDefault( material->dictionary, "alpha",   0.0 );
+	}
+	
+	/* Create Swarm Variables of each material swarm this ip swarm is mapped against */
+	materialSwarms = IntegrationPointMapper_GetMaterialPointsSwarms( swarm->mapper, &(self->materialSwarmCount) );
+	self->densitySwarmVariables = Memory_Alloc_Array( MaterialSwarmVariable*, self->materialSwarmCount, "DensityVariables" );
+	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], "Density" );
+		self->densitySwarmVariables[materialSwarm_I] = MaterialSwarmVariable_New( 
+				name, 
+				materialSwarms[materialSwarm_I], 
+				1, 
+				self->materials_Register, 
+				self->materialExtHandle, 
+				GetOffsetOfMember( *materialExt, density ) );
+		Memory_Free( name );
+
+		name = Stg_Object_AppendSuffix( materialSwarms[materialSwarm_I], "Alpha" );
+		self->alphaSwarmVariables[materialSwarm_I] = MaterialSwarmVariable_New( 
+				name, 
+				materialSwarms[materialSwarm_I], 
+				1, 
+				self->materials_Register, 
+				self->materialExtHandle, 
+				GetOffsetOfMember( *materialExt, alpha ) );
+		Memory_Free( name );
+	
+		/* Build new Swarm Variables */
+		Stg_Component_Build( self->densitySwarmVariables[materialSwarm_I], data, False );
+		Stg_Component_Build( self->alphaSwarmVariables[materialSwarm_I],   data, False );
+	}
+
+
+}
+
+void _BuoyancyForceTerm_Initialise( void* forceTerm, void* data ) {
+	BuoyancyForceTerm*             self             = (BuoyancyForceTerm*)forceTerm;
+	Index                          i;
+
+	_ForceTerm_Initialise( self, data );
+
+	if ( self->temperatureField )
+		Stg_Component_Initialise( self->temperatureField, data, False );
+	
+	for ( i = 0; i < self->materialSwarmCount; ++i ) {
+		Stg_Component_Initialise( self->densitySwarmVariables[i], data, False );
+		Stg_Component_Initialise( self->alphaSwarmVariables[i],   data, False );
+	}
+}
+
+void _BuoyancyForceTerm_Execute( void* forceTerm, void* data ) {
+	_ForceTerm_Execute( forceTerm, data );
+}
+
+void _BuoyancyForceTerm_Destroy( void* forceTerm, void* data ) {
+	_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;
+	Dimension_Index                  dim                = forceVector->dim;
+	IntegrationPointsSwarm*          swarm              = (IntegrationPointsSwarm*)self->integrationSwarm;
+	FiniteElement_Mesh*              mesh               = forceVector->feVariable->feMesh;
+	Node_ElementLocalIndex           eNode_I;
+	Cell_Index                       cell_I;
+	ElementType*                     elementType;
+	Dof_Index                        nodeDofCount;
+	double                           gravity;
+	double                           detJac             = 0.0;
+	double                           factor;
+	double                           Ni[8];
+	double                           force;
+	double*                          xi;
+	Material*                        material;
+	FeVariable*                      temperatureField   = self->temperatureField;
+	double                           temperature        = 0.0;
+
+	double totalWeight = 0.0;
+	double adjustFactor = 0.0;
+
+	elementType       = FeMesh_ElementTypeAt( mesh, lElement_I );
+	elementNodeCount  = elementType->nodeCount;
+	nodeDofCount      = dim;
+	cell_I            = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
+	cellParticleCount = swarm->cellParticleCountTbl[cell_I];
+
+	/* adjust & adjustFactor -- 20060411 Alan
+	 *
+	 * The adjust decides whether an adjustFactor should be applied to the resulting factor.
+	 * If on, the total weight of the particles in the cell are scaled to the cell local volume.
+	 *
+	 * This is designed to be used when integrating with swarms which do not cover the whole domain
+	 * (ie - I used it to do dave.m's test of 1 swarm for blob, 1 swarm for background)
+	 */ 
+	if ( self->adjust ) {
+		for( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+			particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
+			totalWeight += particle->weight;
+		}
+		adjustFactor = swarm->weights->cellLocalVolume / totalWeight;
+	}
+	else {
+		adjustFactor = 1.0;
+	}
+			
+	for( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
+		xi       = particle->xi;
+
+		detJac = ElementType_JacobianDeterminant( elementType, mesh, lElement_I, xi, dim );
+		ElementType_EvaluateShapeFunctionsAt( elementType, xi, Ni );
+
+		/* Get parameters */
+		if ( temperatureField )
+			FeVariable_InterpolateWithinElement( temperatureField, lElement_I, xi, &temperature );
+		material = IntegrationPointsSwarm_GetMaterialOn( (IntegrationPointsSwarm*) swarm, particle );
+		materialExt = ExtensionManager_Get( material->extensionMgr, material, self->materialExtHandle );
+
+		/* Calculate Force */
+		gravity = BuoyancyForceTerm_CalcGravity( self, (Swarm*)swarm, lElement_I, particle );
+		force = - materialExt->density * gravity * (1.0 - materialExt->alpha * temperature);
+		factor = detJac * particle->weight * adjustFactor * force;
+
+		/* Apply force in verticle direction */
+		for( eNode_I = 0 ; eNode_I < elementNodeCount; eNode_I++ ) { 		
+			elForceVec[ eNode_I * nodeDofCount + J_AXIS ] += factor * Ni[ eNode_I ] ;
+		}
+	}
+	
+}
+
+/* The default implementation is for the gravity to be constant. */
+double _BuoyancyForceTerm_CalcGravity( void* forceTerm, Swarm* swarm, Element_DomainIndex dElement_I, void* particle ) {
+	BuoyancyForceTerm*               self               = (BuoyancyForceTerm*) forceTerm;
+
+	return self->gravity;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/BuoyancyForceTerm.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/BuoyancyForceTerm.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,131 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+
+
+#ifndef __PICellerator_Utils_BuoyancyForceTerm_h__
+#define __PICellerator_Utils_BuoyancyForceTerm_h__
+
+	typedef double (BuoyancyForceTerm_CalcGravityFunction) (
+				void* forceTerm, 
+				Swarm* swarm, 
+				Element_LocalIndex lElement_I, 
+				void* particle );
+
+	/** Textual name of this class */
+	extern const Type BuoyancyForceTerm_Type;
+
+	typedef struct {
+		double alpha;
+		double density;
+	} BuoyancyForceTerm_MaterialExt;
+
+	/** BuoyancyForceTerm class contents */
+	#define __BuoyancyForceTerm \
+		/* General info */ \
+		__ForceTerm \
+		\
+		/* Virtual info */ \
+		BuoyancyForceTerm_CalcGravityFunction*              _calcGravity;                          \
+		\
+		/* BuoyancyForceTerm info */ \
+		FeVariable*                                         temperatureField;                  \
+		double                                              gravity;                           \
+		Bool                                                adjust;                            \
+		Materials_Register*                                 materials_Register;                \
+		ExtensionInfo_Index                                 materialExtHandle;                 \
+		MaterialSwarmVariable**                             densitySwarmVariables;             \
+		MaterialSwarmVariable**                             alphaSwarmVariables;               \
+		Index                                               materialSwarmCount;
+
+	struct BuoyancyForceTerm { __BuoyancyForceTerm };
+
+	BuoyancyForceTerm* BuoyancyForceTerm_New( 
+		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 );
+	
+	void BuoyancyForceTerm_InitAll( 
+		void*                                               forceTerm,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		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_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 )\
+		(( (BuoyancyForceTerm*) forceTerm )->_calcGravity( forceTerm, swarm, lElement_I, particle ) )
+
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/BuoyancyForceTerm.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/BuoyancyForceTerm.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<!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">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">ForceTerm</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">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-->
+
+
+<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>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">
+		<struct name="buoyancyForceTerm">
+			<param name="Type">BuoyancyForceTerm</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="TemperatureField">TemperatureField</param>
+			<param name="Swarm">materialPoints</param>
+			<param name="gravity">1.0</param>
+		</struct>
+</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/BuoyancyForceTermThermoChem.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/BuoyancyForceTermThermoChem.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,394 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: BuoyancyForceTermThermoChem.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+#include "types.h"
+#include "BuoyancyForceTermThermoChem.h"
+#include "MaterialSwarmVariable.h"
+
+#include <assert.h>
+#include <string.h>
+
+/* Textual name of this class */
+const Type BuoyancyForceTermThermoChem_Type = "BuoyancyForceTermThermoChem";
+
+BuoyancyForceTermThermoChem* BuoyancyForceTermThermoChem_New( 
+		Name                                                name,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		FeVariable*                                         temperatureField,
+		double                                              RaT,
+		double                                              RaC,
+		Bool                                                adjust,
+		Materials_Register*                                 materials_Register )
+{
+	BuoyancyForceTermThermoChem* self = (BuoyancyForceTermThermoChem*) _BuoyancyForceTermThermoChem_DefaultNew( name );
+
+	BuoyancyForceTermThermoChem_InitAll( 
+			self,
+			forceVector,
+			integrationSwarm,
+			temperatureField,
+			RaT,
+			RaC,
+			adjust,
+			materials_Register );
+
+	return self;
+}
+
+/* Creation implementation / Virtual constructor */
+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) );
+	self = (BuoyancyForceTermThermoChem*) _ForceTerm_New( 
+		sizeOfSelf, 
+		type, 
+		_delete, 
+		_print, 
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build, 
+		_initialise,
+		_execute,
+		_destroy,
+		_assembleElement,
+		name );
+	
+	/* Virtual info */
+	self->_calcRaT = _calcRaT;
+	self->_calcRaC = _calcRaC;
+	
+	return self;
+}
+
+void _BuoyancyForceTermThermoChem_Init( 
+		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;
+
+	for ( i = 0; i < self->materialSwarmCount; ++i ) {
+		Stg_Class_Delete( self->densitySwarmVariables[i] );
+	}
+	Stg_Class_Delete( self->densitySwarmVariables );
+
+	_ForceTerm_Delete( self );
+}
+
+void _BuoyancyForceTermThermoChem_Print( void* forceTerm, Stream* stream ) {
+	BuoyancyForceTermThermoChem* self = (BuoyancyForceTermThermoChem*)forceTerm;
+	
+	_ForceTerm_Print( self, stream );
+
+	/* General info */
+	Journal_PrintPointer( stream, self->temperatureField );
+	Journal_PrintDouble( stream, self->RaT );
+	Journal_PrintDouble( stream, self->RaC );
+}
+
+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_Construct( self, cf, data );
+
+	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 );
+
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
+	assert( materials_Register );
+
+	_BuoyancyForceTermThermoChem_Init( self, temperatureField, RaT, RaC, adjust, materials_Register );
+}
+
+void _BuoyancyForceTermThermoChem_Build( void* forceTerm, void* data ) {
+	BuoyancyForceTermThermoChem*               self               = (BuoyancyForceTermThermoChem*)forceTerm;
+	BuoyancyForceTermThermoChem_MaterialExt*   materialExt;
+	Material_Index                   material_I;
+	Material*                        material;
+	Materials_Register*              materials_Register = self->materials_Register;
+	IntegrationPointsSwarm*          swarm              = (IntegrationPointsSwarm*)self->integrationSwarm;
+	MaterialPointsSwarm**            materialSwarms;
+	Index                            materialSwarm_I;
+	Name                             name;
+
+	_ForceTerm_Build( self, data );
+
+	if ( self->temperatureField )
+		Stg_Component_Build( self->temperatureField, data, False );
+
+	/* Sort out material extension stuff */
+	self->materialExtHandle = Materials_Register_AddMaterialExtension( 
+			self->materials_Register, 
+			self->type, 
+			sizeof(BuoyancyForceTermThermoChem_MaterialExt) );
+	for ( material_I = 0 ; material_I < Materials_Register_GetCount( materials_Register ) ; material_I++) {
+		material = Materials_Register_GetByIndex( materials_Register, material_I );
+		materialExt = ExtensionManager_GetFunc( material->extensionMgr, material, self->materialExtHandle );
+
+		materialExt->density = Dictionary_GetDouble_WithDefault( material->dictionary, "density", 0.0 );
+	}
+	
+	/* Create Swarm Variables of each material swarm this ip swarm is mapped against */
+	materialSwarms = IntegrationPointMapper_GetMaterialPointsSwarms( swarm->mapper, &(self->materialSwarmCount) );
+	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], "Density" );
+		self->densitySwarmVariables[materialSwarm_I] = MaterialSwarmVariable_New( 
+				name, 
+				materialSwarms[materialSwarm_I], 
+				1, 
+				self->materials_Register, 
+				self->materialExtHandle, 
+				GetOffsetOfMember( *materialExt, density ) );
+		Memory_Free( name );
+		
+		/* Build new Swarm Variables */
+		Stg_Component_Build( self->densitySwarmVariables[materialSwarm_I], data, False );
+	}
+
+
+}
+
+void _BuoyancyForceTermThermoChem_Initialise( void* forceTerm, void* data ) {
+	BuoyancyForceTermThermoChem*             self             = (BuoyancyForceTermThermoChem*)forceTerm;
+	Index                          i;
+
+	_ForceTerm_Initialise( self, data );
+
+	if ( self->temperatureField )
+		Stg_Component_Initialise( self->temperatureField, data, False );
+	
+	for ( i = 0; i < self->materialSwarmCount; ++i ) {
+		Stg_Component_Initialise( self->densitySwarmVariables[i], data, False );
+	}
+}
+
+void _BuoyancyForceTermThermoChem_Execute( void* forceTerm, void* data ) {
+	_ForceTerm_Execute( forceTerm, data );
+}
+
+void _BuoyancyForceTermThermoChem_Destroy( void* forceTerm, void* data ) {
+	_ForceTerm_Destroy( forceTerm, data );
+}
+
+
+void _BuoyancyForceTermThermoChem_AssembleElement( void* forceTerm, ForceVector* forceVector, Element_LocalIndex lElement_I, double* elForceVec ) {
+	BuoyancyForceTermThermoChem*               self               = (BuoyancyForceTermThermoChem*) forceTerm;
+	IntegrationPoint*                particle;
+	BuoyancyForceTermThermoChem_MaterialExt*   materialExt;
+	Particle_InCellIndex             cParticle_I;
+	Particle_InCellIndex             cellParticleCount;
+	Element_NodeIndex                elementNodeCount;
+	Dimension_Index                  dim                = forceVector->dim;
+	IntegrationPointsSwarm*          swarm              = (IntegrationPointsSwarm*)self->integrationSwarm;
+	FiniteElement_Mesh*              mesh               = forceVector->feVariable->feMesh;
+	Node_ElementLocalIndex           eNode_I;
+	Cell_Index                       cell_I;
+	ElementType*                     elementType;
+	Dof_Index                        nodeDofCount;
+	double                           RaT;
+	double                           RaC;
+	double                           detJac             = 0.0;
+	double                           factor;
+	double                           Ni[8];
+	double                           force;
+	double*                          xi;
+	Material*                        material;
+	FeVariable*                      temperatureField   = self->temperatureField;
+	double                           temperature        = 0.0;
+
+	double totalWeight = 0.0;
+	double adjustFactor = 0.0;
+
+	elementType       = FeMesh_ElementTypeAt( mesh, lElement_I );
+	elementNodeCount  = elementType->nodeCount;
+	nodeDofCount      = dim;
+	cell_I            = CellLayout_MapElementIdToCellId( swarm->cellLayout, lElement_I );
+	cellParticleCount = swarm->cellParticleCountTbl[cell_I];
+
+	/* adjust & adjustFactor -- 20060411 Alan
+	 *
+	 * The adjust decides whether an adjustFactor should be applied to the resulting factor.
+	 * If on, the total weight of the particles in the cell are scaled to the cell local volume.
+	 *
+	 * This is designed to be used when integrating with swarms which do not cover the whole domain
+	 * (ie - I used it to do dave.m's test of 1 swarm for blob, 1 swarm for background)
+	 */ 
+	if ( self->adjust ) {
+		for( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+			particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
+			totalWeight += particle->weight;
+		}
+		adjustFactor = swarm->weights->cellLocalVolume / totalWeight;
+	}
+	else {
+		adjustFactor = 1.0;
+	}
+			
+	for( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
+		xi       = particle->xi;
+
+		detJac = ElementType_JacobianDeterminant( elementType, mesh, lElement_I, xi, dim );
+		ElementType_EvaluateShapeFunctionsAt( elementType, xi, Ni );
+
+		/* Get parameters */
+		if ( temperatureField )
+			FeVariable_InterpolateWithinElement( temperatureField, lElement_I, xi, &temperature );
+		material = IntegrationPointsSwarm_GetMaterialOn( (IntegrationPointsSwarm*) swarm, particle );
+		materialExt = ExtensionManager_Get( material->extensionMgr, material, self->materialExtHandle );
+
+		/* Calculate Force */
+		RaT = BuoyancyForceTermThermoChem_CalcRaT( self, (Swarm*)swarm, lElement_I, particle );
+		RaC = BuoyancyForceTermThermoChem_CalcRaC( self, (Swarm*)swarm, lElement_I, particle );
+
+		force =  ( RaT * temperature) - ( materialExt->density * RaC );
+		factor = detJac * particle->weight * adjustFactor * force;
+
+		/* Apply force in verticle direction */
+		for( eNode_I = 0 ; eNode_I < elementNodeCount; eNode_I++ ) { 		
+			elForceVec[ eNode_I * nodeDofCount + J_AXIS ] += factor * Ni[ eNode_I ] ;
+		}
+	}
+	
+}
+
+/* The default implementation is for the RaC to be constant. */
+double _BuoyancyForceTermThermoChem_CalcRaT( void* forceTerm, Swarm* swarm, Element_DomainIndex dElement_I, void* particle ) {
+	BuoyancyForceTermThermoChem*               self               = (BuoyancyForceTermThermoChem*) forceTerm;
+
+	return self->RaT;
+}
+
+double _BuoyancyForceTermThermoChem_CalcRaC( void* forceTerm, Swarm* swarm, Element_DomainIndex dElement_I, void* particle ) {
+	BuoyancyForceTermThermoChem*               self               = (BuoyancyForceTermThermoChem*) forceTerm;
+
+	return self->RaC;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/BuoyancyForceTermThermoChem.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/BuoyancyForceTermThermoChem.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,145 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+
+
+#ifndef __PICellerator_Utils_BuoyancyForceTermThermoChem_h__
+#define __PICellerator_Utils_BuoyancyForceTermThermoChem_h__
+
+	typedef double (BuoyancyForceTermThermoChem_CalcRaTFunction) (
+				void* forceTerm, 
+				Swarm* swarm, 
+				Element_LocalIndex lElement_I, 
+				void* particle );
+
+	typedef double (BuoyancyForceTermThermoChem_CalcRaCFunction) (
+				void* forceTerm, 
+				Swarm* swarm, 
+				Element_LocalIndex lElement_I, 
+				void* particle );
+
+	/** Textual name of this class */
+	extern const Type BuoyancyForceTermThermoChem_Type;
+
+	typedef struct {
+		double density;
+	} BuoyancyForceTermThermoChem_MaterialExt;
+
+	/** BuoyancyForceTermThermoChem class contents */
+	#define __BuoyancyForceTermThermoChem \
+		/* General info */ \
+		__ForceTerm \
+		\
+		/* Virtual info */ \
+		BuoyancyForceTermThermoChem_CalcRaTFunction*              _calcRaT;                          \
+		\
+		BuoyancyForceTermThermoChem_CalcRaCFunction*              _calcRaC;                          \
+		\
+		/* BuoyancyForceTermThermoChem info */ \
+		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,
+		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 );
+	
+	void BuoyancyForceTermThermoChem_InitAll( 
+		void*                                               forceTerm,
+		ForceVector*                                        forceVector,
+		Swarm*                                              integrationSwarm,
+		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_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_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 ) ;
+
+	#define BuoyancyForceTermThermoChem_CalcRaC( forceTerm, swarm, lElement_I, particle )\
+		(( (BuoyancyForceTermThermoChem*) forceTerm )->_calcRaC( forceTerm, swarm, lElement_I, particle ) )
+
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/BuoyancyForceTermThermoChem.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/BuoyancyForceTermThermoChem.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">BuoyancyForceTermThermoChem</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Utils/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">ForceTerm</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">This adds a force term for themo-chemical convection, as found in van Keken et al, 'A comparison of methods for modelling of thermochemcical convection', JGR, 1997</param>
+<param name="Equation">$temperature * RaT - \rho * RaC $</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">RaT</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">thermal Rayleigh number</param>
+	</struct>
+	<struct>
+		<param name="Name">RaC</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.0</param>
+		<param name="Description">chemical Rayleigh number</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>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">
+		<struct name="buoyancyForceTerm">
+			<param name="Type">BuoyancyForceTermThermoChem</param>
+			<param name="ForceVector">mom_force</param>
+			<param name="TemperatureField">TemperatureField</param>
+			<param name="Swarm">picIntegrationPoints</param>
+			<param name="RaT">RaT</param>
+			<param name="RaC">RaC</param>
+		</struct>
+</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/Finalise.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/Finalise.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Finalise.c 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+
+#include "types.h"
+#include "Finalise.h"
+
+#include <stdio.h>
+
+Bool PICellerator_Utils_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/Finalise.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/Finalise.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,60 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Finalise.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Utils_Finalise_h__
+#define __PICellerator_Utils_Finalise_h__
+	
+	Bool PICellerator_Utils_Finalise( void ) ;
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/Init.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/Init.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,70 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Init.c 420 2007-02-09 05:09:54Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+#include "Utils.h"
+#include <stdio.h>
+
+Bool PICellerator_Utils_Init( int* argc, char** argv[] ) {
+	Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
+
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+        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 );
+
+	RegisterParent( BuoyancyForceTerm_Type,     ForceTerm_Type );
+	RegisterParent( BuoyancyForceTermThermoChem_Type,     ForceTerm_Type );
+	RegisterParent( MaterialSwarmVariable_Type, SwarmVariable_Type );
+	RegisterParent( PCDVC_Type,                 DVCWeights_Type );
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/Init.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/Init.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	performs and pre-running initialisation necessary in this directory.
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Init.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Utils_Init_h__
+#define __PICellerator_Utils_Init_h__
+	
+	Bool PICellerator_Utils_Init( int* argc, char** argv[] );
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/MaterialSwarmVariable.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/MaterialSwarmVariable.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,244 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: MaterialSwarmVariable.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+#include "types.h"
+#include "MaterialSwarmVariable.h"
+
+#include <assert.h>
+#include <string.h>
+
+/* Textual name of this class */
+const Type MaterialSwarmVariable_Type = "MaterialSwarmVariable";
+
+MaterialSwarmVariable* MaterialSwarmVariable_New( 
+		Name                                                name,
+		MaterialPointsSwarm*                                swarm,
+		Index                                               dofCount,
+		Materials_Register*                                 materials_Register,
+		ExtensionInfo_Index                                 materialExtensionHandle,
+		SizeT                                               offset )
+{
+	MaterialSwarmVariable* self = (MaterialSwarmVariable*) _MaterialSwarmVariable_DefaultNew( name );
+
+	MaterialSwarmVariable_InitAll( 
+			self,
+			swarm,
+			dofCount,
+			materials_Register,
+			materialExtensionHandle,
+			offset );
+
+	return self;
+}
+
+/* Creation implementation / Virtual constructor */
+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( 
+		sizeOfSelf, 
+		type, 
+		_delete, 
+		_print, 
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build, 
+		_initialise,
+		_execute,
+		_destroy,
+		_valueAt,
+		_getMinGlobalMagnitude,
+		_getMaxGlobalMagnitude,
+		name );
+	
+	/* Virtual info */
+	
+	return self;
+}
+
+void _MaterialSwarmVariable_Init( 
+		MaterialSwarmVariable*                              self, 
+		Materials_Register*                                 materials_Register,
+		ExtensionInfo_Index                                 materialExtensionHandle,
+		SizeT                                               offset )
+{
+	self->materials_Register      = materials_Register;
+	self->materialExtensionHandle = materialExtensionHandle;
+	self->offset                  = offset;
+}
+
+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 ) {
+	MaterialSwarmVariable* self = (MaterialSwarmVariable*)swarmVariable;
+
+	_SwarmVariable_Delete( self );
+}
+
+void _MaterialSwarmVariable_Print( void* swarmVariable, Stream* stream ) {
+	MaterialSwarmVariable* self = (MaterialSwarmVariable*)swarmVariable;
+	
+	_SwarmVariable_Print( self, stream );
+
+	/* General info */
+	Journal_PrintPointer( stream, self->materials_Register );
+	Journal_PrintValue( stream, self->materialExtensionHandle );
+	Journal_PrintValue( stream, self->offset );
+}
+
+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_Construct( self, cf, data );
+
+	materials_Register = Stg_ObjectList_Get( cf->registerRegister, "Materials_Register" );
+	assert( materials_Register );
+
+	abort( );
+	_MaterialSwarmVariable_Init( self, materials_Register, 0, 0 );
+}
+
+void _MaterialSwarmVariable_Build( void* swarmVariable, void* data ) {
+	MaterialSwarmVariable*               self               = (MaterialSwarmVariable*)swarmVariable;
+
+	_SwarmVariable_Build( self, data );
+}
+
+void _MaterialSwarmVariable_Initialise( void* swarmVariable, void* data ) {
+	_SwarmVariable_Initialise( swarmVariable, data );
+}
+
+void _MaterialSwarmVariable_Execute( void* swarmVariable, void* data ) {
+	_SwarmVariable_Execute( swarmVariable, data );
+}
+
+void _MaterialSwarmVariable_Destroy( void* swarmVariable, void* 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;
+	Material*               material;
+	ArithPointer            materialExt;
+
+	/* Get Material */
+	material = MaterialPointsSwarm_GetMaterialAt( swarm, lParticle_I );
+
+	/* Get Material Extension */
+	materialExt = (ArithPointer) ExtensionManager_Get( material->extensionMgr, NULL, self->materialExtensionHandle );
+
+	/* Copy value */
+	memcpy( value, (void*) (materialExt + self->offset), sizeof(double) * self->dofCount );
+}
+
+double _MaterialSwarmVariable_GetMinGlobalMagnitude( void* swarmVariable ) {
+	return _SwarmVariable_GetMinGlobalMagnitude( swarmVariable );
+}
+double _MaterialSwarmVariable_GetMaxGlobalMagnitude( void* swarmVariable ) {
+	return _SwarmVariable_GetMaxGlobalMagnitude( swarmVariable );
+}
+	
+	
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/MaterialSwarmVariable.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/MaterialSwarmVariable.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,109 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+
+
+#ifndef __PICellerator_Utils_MaterialSwarmVariable_h__
+#define __PICellerator_Utils_MaterialSwarmVariable_h__
+
+	/** Textual name of this class */
+	extern const Type MaterialSwarmVariable_Type;
+
+	/** MaterialSwarmVariable class contents */
+	#define __MaterialSwarmVariable \
+		/* General info */ \
+		__SwarmVariable \
+		/* Virtual info */ \
+		/* MaterialSwarmVariable info */ \
+		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( 
+		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 );
+	
+	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_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_ValueAt( void* swarmVariable, Particle_Index lParticle_I, double* value ) ;
+	double _MaterialSwarmVariable_GetMinGlobalMagnitude( void* swarmVariable ) ;
+	double _MaterialSwarmVariable_GetMaxGlobalMagnitude( void* swarmVariable ) ;
+
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/MaterialSwarmVariable.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/MaterialSwarmVariable.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">MaterialSwarmVariable</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Utils/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">SwarmVariable</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Creates a swarm variable from a value stored on each material. This means that the degrees of freedom for the SwarmVariable aren't extra data on the particles in the swarm but stored only once per material.</param>
+
+<list name="Params">
+</list>
+
+<list name="Dependencies">
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/PCDVC.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/PCDVC.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1172 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2006, 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
+*%
+** Author:
+**              Mirko Velic - Mirko.Velic at sci.monash.edu.au
+**              Patrick Sunter - patrick at vpac.org
+**              Julian Giordani - julian.giordani at sci.monash.edu.au
+**          
+**  Assumptions:
+**  	 I am assuming that the xi's (local coords) on the IntegrationPoint particles
+**       are precalculated. i.e. We assume the Coincident mapper is being used.
+**
+**  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
+**                 a pointer inside that function.
+**
+**         If the function  getIntParticleMaterialRef_PointingToMaterialParticle ever gets called
+**         then someone has messed up the mapping between integration and material points. This function
+**         is potentially slow as it traverses the whole swarm. This should be avoided.
+**
+**         We do not allow particle deletion in interface cells (cells that have more than one type of material
+**         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.
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+/****************************************************************************************************************
+
+  The algorithm here-in uses the DVCWeights module to compute a discrete voronoi diagram per FEM cell given a set of local
+  particle positions, in 3D and 2D. The volumes of the Voronoi regions are used as integration weights for
+  the integration point swarm and the integration points are the centroids of the same volumes.
+
+  The volumes are also used as criteria for splitting and deleting particles.
+  At the moment we are only deleting or adding *one* particle per cell per time-step: This
+  will be changed shortlyas it may be inadequate.
+
+  For a description of the Voronoi algorithm, see the article by Velic et.al.
+     "A Fast Robust Algorithm for computing Discrete Voronoi Diagrams in N-dimensions"
+  
+*****************************************************************************************************************/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+#include <PICellerator/Weights/Weights.h>
+#include <PICellerator/MaterialPoints/MaterialPoints.h>
+
+//#include <PICellerator/PICellerator.h>
+#include "types.h"
+
+#include "PCDVC.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type PCDVC_Type = "PCDVC";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+PCDVC* PCDVC_New( Name name, Dimension_Index dim ) {
+	PCDVC* self = (PCDVC*) _PCDVC_DefaultNew( name );
+
+	PCDVC_InitAll( self, dim );
+	return 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 );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	return self;
+}
+
+void _PCDVC_Init( void* pcdvc, MaterialPointsSwarm* mps,  double upT, double lowT, int maxDeletions, int maxSplits, Bool splitInInterfaceCells, int *res ) {
+	PCDVC* self = (PCDVC*)pcdvc;
+	
+	self->materialPointsSwarm = mps;
+	self->upperT = upT;
+	self->lowerT = lowT;
+	self->maxDeletions = maxDeletions;
+	self->maxSplits = maxSplits;
+	self->resX = res[I_AXIS];
+	self->resY = res[J_AXIS];
+	self->resZ = res[K_AXIS];
+	self->splitInInterfaceCells = splitInInterfaceCells;
+
+}
+
+void PCDVC_InitAll( void* pcdvc, Dimension_Index dim ) {
+	PCDVC* self = (PCDVC*)pcdvc;
+	WeightsCalculator_InitAll( self, dim );
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _PCDVC_Delete( void* pcdvc ) {
+	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 );
+}
+
+
+
+void* _PCDVC_Copy( void* pcdvc, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	PCDVC*	self = (PCDVC*)pcdvc;
+	PCDVC*	newPCDVC;
+	
+	newPCDVC = (PCDVC*)_DVCWeights_Copy( self, dest, deep, nameExt, ptrMap );
+	return (void*)newPCDVC;
+}
+
+void* _PCDVC_DefaultNew( Name name ) {
+	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_Construct( void* pcdvc, Stg_ComponentFactory* cf, void *data ) {
+
+	PCDVC*	     self          = (PCDVC*) pcdvc;
+	MaterialPointsSwarm*       materialPointsSwarm;
+	double upT, lowT;
+	int defaultResolution;
+	int resolution[3];
+	int maxD, maxS;
+	Bool splitInInterfaceCells;
+	_DVCWeights_Construct( self, cf, data );
+	materialPointsSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, "MaterialPointsSwarm", MaterialPointsSwarm, True, data );
+	Stream*  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);
+	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 );
+
+	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, resolution );
+}
+
+void _PCDVC_Build( void* pcdvc, void* data ) {
+	PCDVC*	self = (PCDVC*)pcdvc;
+	_DVCWeights_Build( self, data );
+}
+void _PCDVC_Initialise( void* pcdvc, void* data ) {
+	PCDVC*	self = (PCDVC*)pcdvc;
+	_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 );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+/* this function loops over the intSwarm in order to find the MaterialPointRef for the integration point particle
+   that points to the matLastParticle_IndexOnCPU of a material particle. It is used here in the case that the last integration point
+   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, 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
+ as well as the corresponding material point.
+ It assumes the one to one coincidence mapper is being used. i.e. for every integration point 
+ 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;
+
+      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);
+
+      /* 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 */
+
+      /* 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);                                              
+                                                                                                                                                                                                
+	    /* 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);                    
+                                                                                                                                                                                                
+	    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 );                                                                                                       
+                                                                                                                                                                                                
+	    /* 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*/
+	      
+}
+/****************************************************************************************************
+ This function deletes integration particle number intParticleToRemove_IndexOnCPU
+ on integration swarm as well as the corresponding material point.
+ It assumes the one to one coincidence mapper is being used. i.e. for every integration point 
+ 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;
+
+
+      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_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intParticleToRemove->owningCell, intParticleToRemove_IndexOnCPU);
+
+      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);
+
+      /* 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 */
+
+      /* 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);
+      
+	    /* 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);                    
+                                                                                                                                                                                                
+	    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 );                                                                                                       
+                                                                                                                                                                                                
+	    /* 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*/
+	      
+}
+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;
+//      SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
+//      SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
+      Coord                   newCoord;
+//      Coord                   xi;
+
+      FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
+
+	      
+      //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 );
+	      
+      /* 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 );
+
+      /* Copy new local position to xi on new int particle */
+      memcpy( intNewParticle->xi, xi, sizeof(Coord) );
+	      
+      /* Get new Global Coordinates from the Local Coordinates */
+      FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, matSwarm->dim, lCell_I, xi, newCoord );
+
+      /* 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");
+      */
+
+}
+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;
+//      SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
+//      SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
+      Coord                   newCoord;
+//      Coord                   xi;
+
+      Cell_LocalIndex lCell_I;
+
+      FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
+
+	      
+      //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 );
+	      
+
+
+      /* Copy particle information */
+      intParticleToSplit_IndexWithinCell = Swarm_GetParticleIndexWithinCell( intSwarm, intParticleToSplit->owningCell, intParticleToSplit_IndexOnCPU);
+
+      intParticleToSplit = (IntegrationPoint*) Swarm_ParticleInCellAt( intSwarm, lCell_I, intParticleToSplit_IndexWithinCell );
+
+
+      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 */
+
+      /* 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) );
+	      
+      /* Get new Global Coordinates from the Local Coordinates */
+      FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, matSwarm->dim, lCell_I, xi, newCoord );
+
+      /* 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");
+      */
+
+}
+/* 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;
+      
+      if(particleA->indexOnCPU < particleB->indexOnCPU)
+	    return 1;
+      else
+	    return -1;
+
+}
+/* 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;
+
+	/*************************************/
+	/* 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;
+
+//	SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
+//	SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
+//	Coord                   newCoord;
+	Coord                   xi;
+
+//	FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
+
+	/* end decs needed for particle control */
+	/*************************************/
+	
+
+
+	numx = self->resX;
+	numy = self->resY;
+	numz = self->resZ;
+
+	nump_orig = nump = cParticleCount = intSwarm->cellParticleCountTbl[lCell_I];
+
+	/* 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 */
+	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));
+
+
+	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;
+	
+	// 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);
+	
+	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( 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);
+
+	/****************************/
+	/****************************/
+	/* Start Population Control */
+	/****************************/
+	/****************************/
+	/* todo: put print statements into Journal statements */
+	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){
+		    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;
+	      }
+	}
+	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 */
+
+//	if(pList[maxI].w > upT*8/100.0){
+	Count = maxSplits > splitCount ? splitCount : maxSplits;
+	for(i=0;i<Count;i++){
+	      maxI = splitList[i];
+	      /* 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;
+
+	      split_flag = 1;
+	      nump++;
+
+	      splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, maxI, xi );
+
+	}
+
+//	if( (pList[minI].w < lowT*8/100.0) ){
+	Count = maxDeletions > deleteCount ? deleteCount : maxDeletions;
+	for(i=0;i<Count;i++){
+
+	      minI = deleteList[i].indexOnCPU;
+
+	      deleteIntParticleByIndexOnCPU( intSwarm,  matSwarm, minI );
+
+	      delete_flag = 1;
+	      nump--;
+
+	} /* if(pList[minI].w < lowT*8/100.0) */
+	
+	//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 );
+	      }
+	      // init the data structures
+	      _DVCWeights_InitialiseStructs( &bchain, &pList, nump);
+	      //_DVCWeights_ResetGrid(&cells,numz*numy*numx);
+	      
+	      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++){
+		    
+		    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);
+
+	}/* if delete_flag */
+	/****************************/
+	/****************************/
+	/* End 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++){
+
+	      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);
+
+}
+
+/* Calculate the integration weighting for each particle by contructing
+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 ;
+
+	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;
+//	SizeT                 intparticleSize     = intSwarm->particleExtensionMgr->finalSize;
+//	SizeT                 matparticleSize     = matSwarm->particleExtensionMgr->finalSize;
+
+//	Coord                   newCoord;
+	Coord                   xi;
+
+//	FiniteElement_Mesh*     mesh              = (FiniteElement_Mesh*)((ElementCellLayout*)matSwarm->cellLayout)->mesh;
+
+	/* end decs needed for particle control */
+	/*************************************/
+	
+
+	numx = self->resX;
+	numy = self->resY;
+
+	nump_orig = nump = cParticleCount = intSwarm->cellParticleCountTbl[lCell_I];
+
+	/* 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 */
+	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));
+
+	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;
+	
+	// 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);
+	}
+	
+	
+	// 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( 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);
+
+	/****************************/
+	/****************************/
+	/* Start Population 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){
+		    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;
+	      }
+	}
+	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 */
+	Count = maxSplits > splitCount ? splitCount : maxSplits;
+	for(i=0;i<Count;i++){
+	      maxI = splitList[i];
+	      /* 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;
+
+	      split_flag = 1;
+	      nump++;
+
+	      splitIntParticleByIndexWithinCell( intSwarm, matSwarm, lCell_I, maxI, xi );
+
+	}
+	Count = maxDeletions > deleteCount ? deleteCount : maxDeletions;
+	for(i=0;i<Count;i++){
+
+	      minI = deleteList[i].indexOnCPU;
+
+	      deleteIntParticleByIndexOnCPU( intSwarm,  matSwarm, minI );
+
+
+	      delete_flag = 1;
+	      nump--;
+
+	      
+	} /* if(pList[minI].w < lowT*8/100.0) */
+	
+	//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].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_ResetGrid2D(&cells,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_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 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++){
+
+	      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);
+	free(deleteList);
+	free(splitList);
+
+}
+
+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, 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(dim == 3){
+	    _PCDVC_Calculate3D( pcdvc, _swarm, lCell_I);
+      }
+      else {
+	    _PCDVC_Calculate2D( pcdvc, _swarm, lCell_I);
+      }
+
+}
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/PCDVC.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/PCDVC.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,141 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2006, 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
+*%
+** Author:
+**              Mirko Velic - Mirko.Velic at sci.monash.edu.au
+**              Patrick Sunter - patrick at vpac.org
+**              Julian Giordani - julian.giordani at sci.monash.edu.au
+**
+**  Assumptions:
+**  	 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
+**                 a pointer inside that function.
+**
+**         If the function  getIntParticleMaterialRef_PointingToMaterialParticle ever gets called
+**         then someone has messed up the mapping between integration and material points. This function
+**         is potentially slow as it traverses the whole swarm. This should be avoided.
+**
+**         We do not allow particle deletion in interface cells (cells that have more than one type of material
+**         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.
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+/****************************************************************************************************************
+
+  The algorithm here-in computes a discrete voronoi diagram per FEM cell given a set of local
+  particle positions, in 3D and 2D. The volumes of the Voronoi regions are used as integration weights for
+  the integration point swarm and the integration points are the centroids of the same volumes.
+
+  For a description of this algorithm, see the article by Velic et.al.
+     "A Fast Robust Algorithm for computing Discrete Voronoi Diagrams in N-dimensions"
+
+
+
+*****************************************************************************************************************/
+
+#ifndef __PICellerator_Weights_PCDVCClass_h__
+#define __PICellerator_Weights_PCDVCClass_h__
+
+	/* 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;
+
+#define __PCDVC __DVCWeights MaterialPointsSwarm* materialPointsSwarm; double upperT; double lowerT; Bool splitInInterfaceCells; int maxDeletions; int maxSplits;
+
+struct PCDVC { __PCDVC };
+
+struct deleteParticle{
+      Particle_Index indexWithinCell;
+      Particle_Index indexOnCPU;
+};
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** 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, int *res ) ;
+	void PCDVC_InitAll( void* pcdvc, Dimension_Index dim ) ;
+
+
+	/* 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 ) ;
+
+	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 5896a19b8457 -r 31abbeebf74e Utils/src/PCDVC.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/PCDVC.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">PCDVC</param>
+<param name="Author">Mirko Velic</param>
+<param name="Organisation">MCC</param>
+<param name="Project">Underworld</param>
+<param name="Location">./PICellerator/Utils/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/Underworld</param>
+<param name="Copyright">Copyright (C) 2006 Monash Cluster Computing.</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">DVCWeights</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Calculates PIC integration weights and handles Population Control in 3D and 2D using a Voronoi diagram. The integration points are set to the centroid of a Voronoi cell and
+ the weight is the volume of the cell.</param>
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+   <param name="Type">DVCWeights</param>
+</list>
+
+<!-- Example Usage -->
+<!-- Use this struct -->
+<struct name="weights">
+   <param name="Type">PCDVC</param>
+   <param name="resolution">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="splitInInterfaceCells">True</param>
+   <param name="MaterialPointsSwarm">materialSwarm</param>
+</struct>
+
+<!-- or one can use this struct instead -->
+<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="splitInInterfaceCells">True</param>
+   <param name="MaterialPointsSwarm">materialSwarm</param>
+</struct>
+<!-- where the X Y Z resolutions may be all different -->
+<!-- upperT and lowerT represent upper and lower volume percentage thresholds
+     for population control criteria -->
+
+<!-- Then do this -->
+<!-- The file InputFiles/PIC_Components/MaterialPointSwarm.xml
+     should alreay have this in it -->
+<struct name="localLayout">
+	<param name="Type">MappedParticleLayout</param>
+</struct>
+<struct name="picIntegrationPoints">
+	<param name="Type">IntegrationPointsSwarm</param>
+	<param name="CellLayout">elementCellLayout</param>
+	<param name="ParticleLayout">localLayout</param>
+	<param name="FiniteElement_Mesh">mesh-linear</param>
+	<param name="WeightsCalculator">weights</param>
+	<param name="TimeIntegrator">timeIntegrator</param>
+	<param name="IntegrationPointMapper">mapper</param>
+</struct>
+
+
+<!-- You need this too -->
+<struct name="mapper">
+   <param name="Type">CoincidentMapper</param>
+   <param name="IntegrationPointsSwarm">materialPoints</param>
+   <param name="MaterialPointsSwarm">materialSwarm</param>
+</struct>
+
+<!-- See MaterialPointsSwarm.xml in Underworld/InputFiles/PIC_Components for an example -->
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/Utils.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/Utils.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,56 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003-2006, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street,
+**	Melbourne, 3053, Australia.
+** Copyright (c) 2005-2006, Monash Cluster Computing, Building 28, Monash University Clayton Campus,
+**	Victoria, 3800, Australia
+**
+** Primary Contributing Organisations:
+**	Victorian Partnership for Advanced Computing Ltd, Computational Software Development - http://csd.vpac.org
+**	Australian Computational Earth Systems Simulator - http://www.access.edu.au
+**	Monash Cluster Computing - http://www.mcc.monash.edu.au
+**
+** Contributors:
+**	Robert Turnbull, Research Assistant, Monash University. (robert.turnbull at sci.monash.edu.au)
+**	Patrick D. Sunter, Software Engineer, VPAC. (patrick at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	David May, PhD Student, Monash University (david.may at sci.monash.edu.au)
+**	Vincent Lemiale, Postdoctoral Fellow, Monash University. (vincent.lemiale at sci.monash.edu.au)
+**	Julian Giordani, Research Assistant, Monash University. (julian.giordani at sci.monash.edu.au)
+**	Louis Moresi, Associate Professor, Monash University. (louis.moresi at sci.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	David Stegman, Postdoctoral Fellow, Monash University. (david.stegman at sci.monash.edu.au)
+**	Wendy Sharples, PhD Student, Monash University (wendy.sharples at sci.monash.edu.au)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+
+
+#ifndef __PICellerator_Utils_h__
+#define __PICellerator_Utils_h__
+
+	#include "types.h"
+	#include "BuoyancyForceTerm.h"
+	#include "BuoyancyForceTermThermoChem.h"
+	#include "MaterialSwarmVariable.h"
+
+	#include "Init.h"
+	#include "Finalise.h"
+        #include "PCDVC.h"
+
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,66 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# External Libraries and Headers
+EXTERNAL_INCLUDES = ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS}
+EXTERNAL_LIBS = ${STGERMAIN_FEM_LIBS} ${STGERMAIN_LIBS} ${MPI_LIBS} ${XML_LIBS}
+
+# Work out name to call library
+lib = ${PROJECT}$(shell basename `pwd | sed s/src//g`)
+libdynamic = yes
+libstatic = yes
+
+# Name of directory to place header files
+includes := ${PROJECT}/$(shell basename `pwd | sed s/src//g`)
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Utils/src/types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/src/types.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,62 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Public types for this module.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: types.h 420 2007-02-09 05:09:54Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Utils_types_h__
+#define __PICellerator_Utils_types_h__
+	
+	typedef struct MaterialSwarmVariable            MaterialSwarmVariable;
+	typedef struct BuoyancyForceTerm                BuoyancyForceTerm;
+	typedef struct BuoyancyForceTermThermoChem      BuoyancyForceTermThermoChem;
+        typedef struct PCDVC                        PCDVC;
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e 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	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e Utils/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,62 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+
+# External Libraries and Headers
+EXTERNAL_INCLUDES = ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS}
+EXTERNAL_LIBS = ${STGERMAIN_FEM_LIBS} ${STGERMAIN_LIBS} ${MPI_LIBS} ${XML_LIBS}
+
+#packages
+packages = STGFEM STGERMAIN PETSC MPI XML MATH
+
+checks = $(wildcard *.sh)
+
+tests = libPICelleratorUtils
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Utils/tests/testElementIntegral.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testElementIntegral.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,77 @@
+<?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/ElementLayout.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">mesh-linear</param>
+		</struct>
+		<struct name="localLayout">
+			<param name="Type">MappedParticleLayout</param>
+		</struct>
+		<struct name="swarm">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">localLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="WeightsCalculator">weights</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="IntegrationPointMapper">mapper</param>
+			
+			<param name="VelocityField">VelocityField</param>
+		</struct>
+		<struct name="mapper">
+			<param name="Type">CoincidentMapper</param>
+			<param name="IntegrationPointsSwarm">swarm</param>
+			<param name="MaterialPointsSwarm">picIntegrationPoints</param>
+		</struct>
+		<struct name="particleLayout">
+			<param name="Type">RandomParticleLayout</param>
+			<param name="cellParticleCount">particleCount</param>
+		</struct>
+		<struct name="picIntegrationPoints">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">particleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+		</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 5896a19b8457 -r 31abbeebf74e Utils/tests/testPCDVC.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testPCDVC.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,24 @@
+<?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">3</param>
+			<param name="maxSplits">3</param>
+			<param name="MaterialPointsSwarm">picIntegrationPoints</param>
+		</struct>
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Utils/tests/testPCDVC_Circle.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testPCDVC_Circle.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 "PICellerator testPCDVC.xml --FunctionName=CircleInterface --mean-tolerance=0.001 --standardDeviation-tolerance=0.001 --mean-expectedValue=0.162 --standardDeviation-expectedValue=0.063" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Utils/tests/testPCDVC_ExpIface.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testPCDVC_ExpIface.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 "PICellerator testPCDVC.xml --FunctionName=ExponentialInterface --mean-tolerance=0.001 --standardDeviation-tolerance=0.001 --mean-expectedValue=0.07 --standardDeviation-expectedValue=0.05" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Utils/tests/testPCDVC_Poly.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Utils/tests/testPCDVC_Poly.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 "PICellerator testPCDVC.xml --FunctionName=PolynomialFunction --mean-tolerance=0.001 --standardDeviation-tolerance=0.001 --mean-expectedValue=0.012 --standardDeviation-expectedValue=0.002" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,53 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := src tests
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/AdaptiveVoronoi.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/AdaptiveVoronoi.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,744 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: AdaptiveVoronoi.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "types.h"
+#include "DiscreteVoronoi.h"
+#include "AdaptiveVoronoi.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+#define UNCLAIMED                    ((unsigned int) -1)
+#define FINISHED                     ((unsigned int) -1)
+
+/* Cell Vertex Index Macros */
+#define LEFT_BOTTOM_FRONT            0
+#define RIGHT_BOTTOM_FRONT           1
+#define RIGHT_TOP_FRONT              2
+#define LEFT_TOP_FRONT               3
+
+/* Cell Vertex Index Macros - For 3D Only */
+#define LEFT_BOTTOM_BACK             4
+#define RIGHT_BOTTOM_BACK            5
+#define RIGHT_TOP_BACK               6
+#define LEFT_TOP_BACK                7
+
+/* New Vertex Index Macros */
+#define MIDDLE_MIDDLE_FRONT          0
+#define LEFT_MIDDLE_FRONT            1
+#define RIGHT_MIDDLE_FRONT           2
+#define MIDDLE_BOTTOM_FRONT          3
+#define MIDDLE_TOP_FRONT             4
+
+/* New Vertex Index Macros - For 3D Only */
+#define LEFT_BOTTOM_MIDDLE           5
+#define RIGHT_BOTTOM_MIDDLE          6
+#define RIGHT_TOP_MIDDLE             7
+#define LEFT_TOP_MIDDLE              8
+#define MIDDLE_MIDDLE_MIDDLE         9
+#define LEFT_MIDDLE_MIDDLE           10
+#define RIGHT_MIDDLE_MIDDLE          11
+#define MIDDLE_BOTTOM_MIDDLE         12
+#define MIDDLE_TOP_MIDDLE            13
+
+#define MIDDLE_MIDDLE_BACK           14
+#define LEFT_MIDDLE_BACK             15
+#define RIGHT_MIDDLE_BACK            16
+#define MIDDLE_BOTTOM_BACK           17
+#define MIDDLE_TOP_BACK              18
+
+
+/* Textual name of this class */
+const Type AdaptiveVoronoi_Type = "AdaptiveVoronoi";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+AdaptiveVoronoi* _AdaptiveVoronoi_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,		
+		DiscreteVoronoi_CalculateForCellFunction*          _calculate,		
+		DiscreteVoronoi_GetParticleIndexFunction*          _getParticleIndex,
+		DiscreteVoronoi_GetVolumeFunction*                 _getVolume,
+		DiscreteVoronoi_GetCentroidFunction*               _getCentroid,	
+		Name                                               name )
+{
+	AdaptiveVoronoi* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(AdaptiveVoronoi) );
+	self = (AdaptiveVoronoi*)_DiscreteVoronoi_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			_getParticleIndex,
+			_getVolume,
+			_getCentroid,			
+			name );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _AdaptiveVoronoi_Init( void* adaptiveVoronoi, Iteration_Index maxIterations ) {
+	AdaptiveVoronoi* self = (AdaptiveVoronoi*)adaptiveVoronoi;
+	
+	self->isConstructed = True;
+
+	self->maxIterations          = maxIterations;
+	self->cellVertexCount        = ( self->dim == 2 ? 4 : 8 );
+	self->newVertexCountForSplit = ( self->dim == 2 ? 5 : 19 );
+}
+
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _AdaptiveVoronoi_Delete( void* adaptiveVoronoi ) {
+	AdaptiveVoronoi* self = (AdaptiveVoronoi*)adaptiveVoronoi;
+	
+	/* Delete parent */
+	_DiscreteVoronoi_Delete( self );
+
+	Memory_Free( self->cells );
+	Memory_Free( self->verticies );
+	Memory_Free( self->cellList );
+}
+
+
+void _AdaptiveVoronoi_Print( void* adaptiveVoronoi, Stream* stream ) {
+	AdaptiveVoronoi* self = (AdaptiveVoronoi*)adaptiveVoronoi;
+	
+	/* Print parent */
+	_DiscreteVoronoi_Print( self, stream );
+}
+
+void* _AdaptiveVoronoi_Copy( void* adaptiveVoronoi, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	AdaptiveVoronoi*	self = (AdaptiveVoronoi*)adaptiveVoronoi;
+	AdaptiveVoronoi*	newAdaptiveVoronoi;
+	
+	newAdaptiveVoronoi = (AdaptiveVoronoi*)_DiscreteVoronoi_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newAdaptiveVoronoi;
+}
+
+void* _AdaptiveVoronoi_DefaultNew( Name name ) {
+	return (void*) _AdaptiveVoronoi_New(
+			sizeof(AdaptiveVoronoi),
+			AdaptiveVoronoi_Type,
+			_AdaptiveVoronoi_Delete,
+			_AdaptiveVoronoi_Print,
+			_AdaptiveVoronoi_Copy,
+			_AdaptiveVoronoi_DefaultNew,
+			_AdaptiveVoronoi_Construct,
+			_AdaptiveVoronoi_Build,
+			_AdaptiveVoronoi_Initialise,
+			_AdaptiveVoronoi_Execute,
+			_AdaptiveVoronoi_Destroy,
+			_AdaptiveVoronoi_CalculateForCell,
+			_AdaptiveVoronoi_GetParticleIndex,
+			_AdaptiveVoronoi_GetVolume,
+			_AdaptiveVoronoi_GetCentroid,
+			name );
+}
+
+
+void _AdaptiveVoronoi_Construct( void* adaptiveVoronoi, Stg_ComponentFactory* cf, void* data ) {
+	AdaptiveVoronoi*	     self          = (AdaptiveVoronoi*) adaptiveVoronoi;
+	Iteration_Index          maxIterations;
+
+	_DiscreteVoronoi_Construct( self, cf, data );
+
+	maxIterations = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "maxIterations", 3 );
+	
+	_AdaptiveVoronoi_Init( self, maxIterations );
+}
+
+void _AdaptiveVoronoi_Build( void* adaptiveVoronoi, void* data ) {
+	AdaptiveVoronoi*	self = (AdaptiveVoronoi*)adaptiveVoronoi;
+
+	_DiscreteVoronoi_Build( self, data );
+
+	/* Allocate Memory */
+	self->cellsAllocatedCount = 5;
+	self->cells = Memory_Alloc_Array( AdaptiveVoronoiUnclaimedCell, self->cellsAllocatedCount, "cell list" );
+
+	self->verticiesAllocatedCount = 15;
+	self->verticies = Memory_Alloc_Array( AdaptiveVoronoiVertex, self->verticiesAllocatedCount, "AdaptiveVoronoiVertex" );
+
+	self->claimedCellsAllocated = 5;
+	self->cellList = Memory_Alloc_Array( AdaptiveVoronoiClaimedCell, self->claimedCellsAllocated, "claimedCellList" );
+}
+
+void _AdaptiveVoronoi_Initialise( void* adaptiveVoronoi, void* data ) {
+	AdaptiveVoronoi*	self = (AdaptiveVoronoi*)adaptiveVoronoi;
+	
+	_DiscreteVoronoi_Initialise( self, data );
+}
+void _AdaptiveVoronoi_Execute( void* adaptiveVoronoi, void* data ) {
+	AdaptiveVoronoi*	self = (AdaptiveVoronoi*)adaptiveVoronoi;
+	
+	_DiscreteVoronoi_Execute( self, data );
+}
+void _AdaptiveVoronoi_Destroy( void* adaptiveVoronoi, void* data ) {
+	AdaptiveVoronoi*	self = (AdaptiveVoronoi*)adaptiveVoronoi;
+	
+	_DiscreteVoronoi_Destroy( self, data );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+void _AdaptiveVoronoi_CalculateForCell( void* adaptiveVoronoi, void* _swarm, Cell_LocalIndex lCell_I ) {
+	AdaptiveVoronoi*             self            = (AdaptiveVoronoi*)  adaptiveVoronoi;
+	Index                        currentCellIndex;
+
+	/* Initialise Current Info */
+	self->swarm                  = (Swarm*) _swarm;
+	self->cell_I                 = lCell_I;
+	self->claimedCellCount       = 0;
+	AdaptiveVoronoi_InitialiseFirstCell( self );
+
+	/* Do AdaptiveVoronoi */
+	currentCellIndex = 0;
+	while ( currentCellIndex != FINISHED )
+		currentCellIndex = AdaptiveVoronoi_Loop( self, currentCellIndex );
+}
+
+Particle_InCellIndex _AdaptiveVoronoi_GetParticleIndex( void* discreteVoronoi, Voronoi_CellIndex vCell_I ){
+	AdaptiveVoronoi*             self            = (AdaptiveVoronoi*)  discreteVoronoi;
+
+	return self->cellList[ vCell_I ].particle_I;
+}
+
+double _AdaptiveVoronoi_GetVolume(void* discreteVoronoi, Voronoi_CellIndex vCell_I ){
+	AdaptiveVoronoi*             self       = (AdaptiveVoronoi*)  discreteVoronoi;
+	AdaptiveVoronoiClaimedCell*  cell       = &self->cellList[ vCell_I ];
+
+	if (self->dim == 2)
+		return StGermain_ConvexQuadrilateralArea( 
+			cell->vertex[0], 
+			cell->vertex[1], 
+			cell->vertex[2], 
+			cell->vertex[3],
+			self->dim); 
+	else 
+		return StGermain_ParallelepipedVolume(
+			cell->vertex[0], 
+			cell->vertex[1], 
+			cell->vertex[3], 
+			cell->vertex[4] );
+}
+
+void _AdaptiveVoronoi_GetCentroid(void* discreteVoronoi, Voronoi_CellIndex vCell_I, Coord centroid ){
+	AdaptiveVoronoi*             self            = (AdaptiveVoronoi*)  discreteVoronoi;
+
+	memcpy( centroid, self->cellList[ vCell_I ].centroid, self->dim * sizeof(double) );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
+
+Bool AdaptiveVoronoi_NeedSplitCell( AdaptiveVoronoi* self, AdaptiveVoronoiUnclaimedCell* cell ) {
+	Vertex_Index           cellVertexCount = self->cellVertexCount;
+	Vertex_Index           vertex_I;
+	AdaptiveVoronoiVertex* vertex;
+	AdaptiveVoronoiVertex* testVertex;
+
+	/* Get First Vertex of Cell to test all other verticies against */
+	testVertex = &self->verticies[ cell->vertex_I[ 0 ] ];
+
+	for ( vertex_I = 0 ; vertex_I < cellVertexCount ; vertex_I++ ) {
+		vertex = &self->verticies[ cell->vertex_I[ vertex_I ] ];
+	
+		/* Check if this guy has been claimed */
+		if ( vertex->particle_I == UNCLAIMED ) 
+			vertex->particle_I = Swarm_FindClosestParticleInCell( self->swarm, self->cell_I, self->dim, vertex->coord, NULL );
+					
+		/* Check if this vertex is claimed by the same particle as first vertex */
+		if ( vertex->particle_I != testVertex->particle_I )
+			return True;
+		
+	}
+	return False;
+}
+	
+void AdaptiveVoronoi_InitialiseFirstCell( AdaptiveVoronoi* self ) {
+	AdaptiveVoronoiUnclaimedCell* firstCell = &self->cells[0];
+	Vertex_Index                  cVertex_I;
+	Cell_Index                    cell_I    = self->cell_I;
+
+	/* Initialise data */
+	memset( self->cells, 0,     sizeof( AdaptiveVoronoiUnclaimedCell ) * self->cellsAllocatedCount );
+	memset( self->verticies, 0, sizeof( AdaptiveVoronoiVertex )        * self->verticiesAllocatedCount );
+
+	/* Set up cell */
+	firstCell->level      = 0;
+	firstCell->nextCell_I = FINISHED;
+	
+	for ( cVertex_I = 0 ; cVertex_I < self->cellVertexCount ; cVertex_I++ ) {
+		/* Assign Vertex to Cell */
+		firstCell->vertex_I[ cVertex_I ] = cVertex_I;
+
+		/* Set up position of cell */
+		memcpy( self->verticies[ cVertex_I ].coord, self->swarm->cellPointTbl[cell_I][ cVertex_I ], sizeof(Coord) );
+
+		/* Initialise particle index so we know that this guy is unclaimed */
+		self->verticies[ cVertex_I ].particle_I = UNCLAIMED;
+	}
+
+	self->cellsCount     = 1;
+	self->verticiesCount = self->cellVertexCount;
+}
+
+
+void AdaptiveVoronoi_SplitCell( AdaptiveVoronoi* self, Index parentCell_I ) {
+	Cell_Index                      newCell_I;
+	Vertex_Index                    cellVertexCount            = self->cellVertexCount;
+	double*                         vertexList[8];
+	AdaptiveVoronoiUnclaimedCell*   currentCell                = NULL;
+	AdaptiveVoronoiUnclaimedCell*   newCells                   = NULL;
+	AdaptiveVoronoiUnclaimedCell*   parentCell                 = NULL;
+	AdaptiveVoronoiVertex*          newVerticies               = NULL;
+	AdaptiveVoronoiVertex*          currentVertex              = NULL;
+	AdaptiveVoronoiVertex*          vertex_LEFT_BOTTOM_FRONT   = NULL;
+	AdaptiveVoronoiVertex*          vertex_RIGHT_BOTTOM_FRONT  = NULL;
+	AdaptiveVoronoiVertex*          vertex_RIGHT_TOP_FRONT     = NULL;
+	AdaptiveVoronoiVertex*          vertex_LEFT_TOP_FRONT      = NULL;
+	Dimension_Index                 dim                        = self->dim;
+
+	/* Allocate Memory */
+	if ( self->cellsAllocatedCount < self->cellsCount + cellVertexCount ) {
+		self->cellsAllocatedCount = self->cellsCount + cellVertexCount * 5;
+		self->cells = Memory_Realloc_Array( self->cells, AdaptiveVoronoiUnclaimedCell, self->cellsAllocatedCount );
+	}
+	if ( self->verticiesAllocatedCount < self->verticiesCount + self->newVertexCountForSplit ) {
+		self->verticiesAllocatedCount = self->verticiesCount + 5 * self->newVertexCountForSplit;
+		self->verticies = Memory_Realloc_Array( self->verticies, AdaptiveVoronoiVertex, self->verticiesAllocatedCount );
+	}
+
+	/* Get pointers to memory */
+	newCells     = &self->cells[ self->cellsCount ];
+	parentCell   = &self->cells[ parentCell_I ];
+	newVerticies = &self->verticies[ self->verticiesCount ];
+
+	/* Initialise Memory */
+	memset( newCells,     0, sizeof(AdaptiveVoronoiUnclaimedCell) * cellVertexCount );
+	memset( newVerticies, 0, sizeof(AdaptiveVoronoiVertex)        * self->newVertexCountForSplit );
+
+	for ( newCell_I = 0 ; newCell_I < cellVertexCount ; newCell_I++ ) {
+		currentCell = &newCells[ newCell_I ];
+		
+		/* Increment Level */
+		currentCell->level = parentCell->level + 1;
+
+		/* Set Linked List */
+		currentCell->nextCell_I = self->cellsCount + newCell_I + 1;
+		
+		/* Assign Vertex Which is the Same as the parent cell */
+		currentCell->vertex_I[ newCell_I ] = parentCell->vertex_I[ newCell_I ];
+	}
+	/* Reset last guy to point to parents next cell */
+	currentCell->nextCell_I = parentCell->nextCell_I;
+	/* Set Parent Cell to point to first child */
+	parentCell->nextCell_I  = self->cellsCount;
+
+	/* Grab pointers to verticies of parent cell */
+	vertex_LEFT_BOTTOM_FRONT  = &self->verticies[ parentCell->vertex_I[ LEFT_BOTTOM_FRONT  ] ];
+	vertex_RIGHT_BOTTOM_FRONT = &self->verticies[ parentCell->vertex_I[ RIGHT_BOTTOM_FRONT ] ];
+	vertex_RIGHT_TOP_FRONT    = &self->verticies[ parentCell->vertex_I[ RIGHT_TOP_FRONT    ] ];
+	vertex_LEFT_TOP_FRONT     = &self->verticies[ parentCell->vertex_I[ LEFT_TOP_FRONT     ] ];
+	
+	/* Setup New Verticies for children cells */
+	currentVertex = &newVerticies[ MIDDLE_MIDDLE_FRONT ];
+	currentVertex->particle_I = UNCLAIMED;
+	vertexList[0] = vertex_LEFT_BOTTOM_FRONT->coord;
+	vertexList[1] = vertex_RIGHT_BOTTOM_FRONT->coord;
+	vertexList[2] = vertex_RIGHT_TOP_FRONT->coord;
+	vertexList[3] = vertex_LEFT_TOP_FRONT->coord;
+	StGermain_AverageCoord( currentVertex->coord, vertexList, 4, dim );
+
+	currentVertex = &newVerticies[ LEFT_MIDDLE_FRONT ];
+	currentVertex->particle_I = UNCLAIMED;
+	vertexList[0] = vertex_LEFT_BOTTOM_FRONT->coord;
+	vertexList[1] = vertex_LEFT_TOP_FRONT->coord;
+	StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );
+
+	currentVertex = &newVerticies[ RIGHT_MIDDLE_FRONT ];
+	currentVertex->particle_I = UNCLAIMED;
+	vertexList[0] = vertex_RIGHT_BOTTOM_FRONT->coord;
+	vertexList[1] = vertex_RIGHT_TOP_FRONT->coord;
+	StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );
+
+	currentVertex = &newVerticies[ MIDDLE_BOTTOM_FRONT ];
+	currentVertex->particle_I = UNCLAIMED;
+	vertexList[0] = vertex_LEFT_BOTTOM_FRONT->coord;
+	vertexList[1] = vertex_RIGHT_BOTTOM_FRONT->coord;
+	StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );
+
+	currentVertex = &newVerticies[ MIDDLE_TOP_FRONT ];
+	currentVertex->particle_I = UNCLAIMED;
+	vertexList[0] = vertex_LEFT_TOP_FRONT->coord;
+	vertexList[1] = vertex_RIGHT_TOP_FRONT->coord;
+	StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );
+
+	/* Assign New Verticies */
+	currentCell = &newCells[ LEFT_BOTTOM_FRONT ];
+	currentCell->vertex_I[ RIGHT_BOTTOM_FRONT ] = self->verticiesCount + MIDDLE_BOTTOM_FRONT ;
+	currentCell->vertex_I[ RIGHT_TOP_FRONT    ] = self->verticiesCount + MIDDLE_MIDDLE_FRONT ;
+	currentCell->vertex_I[ LEFT_TOP_FRONT     ] = self->verticiesCount + LEFT_MIDDLE_FRONT   ;
+
+	currentCell = &newCells[ RIGHT_BOTTOM_FRONT ];
+	currentCell->vertex_I[ LEFT_BOTTOM_FRONT  ] = self->verticiesCount + MIDDLE_BOTTOM_FRONT ;
+	currentCell->vertex_I[ LEFT_TOP_FRONT     ] = self->verticiesCount + MIDDLE_MIDDLE_FRONT ;
+	currentCell->vertex_I[ RIGHT_TOP_FRONT    ] = self->verticiesCount + RIGHT_MIDDLE_FRONT  ;
+
+	currentCell = &newCells[ LEFT_TOP_FRONT ];
+	currentCell->vertex_I[ LEFT_BOTTOM_FRONT  ] = self->verticiesCount + LEFT_MIDDLE_FRONT   ;
+	currentCell->vertex_I[ RIGHT_BOTTOM_FRONT ] = self->verticiesCount + MIDDLE_MIDDLE_FRONT ;
+	currentCell->vertex_I[ RIGHT_TOP_FRONT    ] = self->verticiesCount + MIDDLE_TOP_FRONT    ;
+
+	currentCell = &newCells[ RIGHT_TOP_FRONT ];
+	currentCell->vertex_I[ LEFT_BOTTOM_FRONT  ] = self->verticiesCount + MIDDLE_MIDDLE_FRONT ;
+	currentCell->vertex_I[ RIGHT_BOTTOM_FRONT ] = self->verticiesCount + RIGHT_MIDDLE_FRONT  ;
+	currentCell->vertex_I[ LEFT_TOP_FRONT     ] = self->verticiesCount + MIDDLE_TOP_FRONT    ;
+
+	if (self->dim == 3){
+		AdaptiveVoronoiVertex* vertex_LEFT_BOTTOM_BACK;
+		AdaptiveVoronoiVertex* vertex_RIGHT_BOTTOM_BACK;
+		AdaptiveVoronoiVertex* vertex_RIGHT_TOP_BACK;
+		AdaptiveVoronoiVertex* vertex_LEFT_TOP_BACK;
+
+		/* Grab pointers to verticies of parent cell */
+		vertex_LEFT_BOTTOM_BACK  = &self->verticies[ parentCell->vertex_I[ LEFT_BOTTOM_BACK  ] ];
+		vertex_RIGHT_BOTTOM_BACK = &self->verticies[ parentCell->vertex_I[ RIGHT_BOTTOM_BACK ] ];
+		vertex_RIGHT_TOP_BACK    = &self->verticies[ parentCell->vertex_I[ RIGHT_TOP_BACK    ] ];
+		vertex_LEFT_TOP_BACK     = &self->verticies[ parentCell->vertex_I[ LEFT_TOP_BACK     ] ];
+
+		/* Setup New Verticies for children cells */
+		currentVertex = &newVerticies[ LEFT_BOTTOM_MIDDLE ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_BOTTOM_FRONT->coord;
+		vertexList[1] = vertex_LEFT_BOTTOM_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );
+
+		currentVertex = &newVerticies[ RIGHT_BOTTOM_MIDDLE ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_RIGHT_BOTTOM_FRONT->coord;
+		vertexList[1] = vertex_RIGHT_BOTTOM_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );
+
+		currentVertex = &newVerticies[ RIGHT_TOP_MIDDLE ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_RIGHT_TOP_FRONT->coord;
+		vertexList[1] = vertex_RIGHT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );		
+
+		currentVertex = &newVerticies[ LEFT_TOP_MIDDLE ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_TOP_FRONT->coord;
+		vertexList[1] = vertex_LEFT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );		
+
+		currentVertex = &newVerticies[ MIDDLE_MIDDLE_MIDDLE ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_BOTTOM_FRONT->coord;
+		vertexList[1] = vertex_RIGHT_BOTTOM_FRONT->coord;
+		vertexList[2] = vertex_RIGHT_TOP_FRONT->coord;
+		vertexList[3] = vertex_LEFT_TOP_FRONT->coord;
+		vertexList[4] = vertex_LEFT_BOTTOM_BACK->coord;
+		vertexList[5] = vertex_RIGHT_BOTTOM_BACK->coord;
+		vertexList[6] = vertex_RIGHT_TOP_BACK->coord;
+		vertexList[7] = vertex_LEFT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 8, dim );				
+
+		currentVertex = &newVerticies[ LEFT_MIDDLE_MIDDLE ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_BOTTOM_FRONT->coord;
+		vertexList[1] = vertex_LEFT_TOP_FRONT->coord;
+		vertexList[2] = vertex_LEFT_BOTTOM_BACK->coord;
+		vertexList[3] = vertex_LEFT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 4, dim );	
+		
+		currentVertex = &newVerticies[ RIGHT_MIDDLE_MIDDLE ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_RIGHT_BOTTOM_FRONT->coord;
+		vertexList[1] = vertex_RIGHT_TOP_FRONT->coord;
+		vertexList[2] = vertex_RIGHT_BOTTOM_BACK->coord;
+		vertexList[3] = vertex_RIGHT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 4, dim );
+		
+		currentVertex = &newVerticies[ MIDDLE_BOTTOM_MIDDLE ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_BOTTOM_FRONT->coord;
+		vertexList[1] = vertex_RIGHT_BOTTOM_FRONT->coord;
+		vertexList[2] = vertex_LEFT_BOTTOM_BACK->coord;
+		vertexList[3] = vertex_RIGHT_BOTTOM_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 4, dim );		
+		
+		currentVertex = &newVerticies[ MIDDLE_TOP_MIDDLE ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_TOP_FRONT->coord;
+		vertexList[1] = vertex_RIGHT_TOP_FRONT->coord;
+		vertexList[2] = vertex_LEFT_TOP_BACK->coord;
+		vertexList[3] = vertex_RIGHT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 4, dim );			
+
+		currentVertex = &newVerticies[ MIDDLE_MIDDLE_BACK ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_BOTTOM_BACK->coord;
+		vertexList[1] = vertex_RIGHT_BOTTOM_BACK->coord;
+		vertexList[2] = vertex_RIGHT_TOP_BACK->coord;
+		vertexList[3] = vertex_LEFT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 4, dim );			
+
+		currentVertex = &newVerticies[ LEFT_MIDDLE_BACK ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_BOTTOM_BACK->coord;
+		vertexList[1] = vertex_LEFT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );				
+
+		currentVertex = &newVerticies[ RIGHT_MIDDLE_BACK ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_RIGHT_BOTTOM_BACK->coord;
+		vertexList[1] = vertex_RIGHT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );			
+
+		currentVertex = &newVerticies[ MIDDLE_BOTTOM_BACK ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_BOTTOM_BACK->coord;
+		vertexList[1] = vertex_RIGHT_BOTTOM_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );	
+		
+		currentVertex = &newVerticies[ MIDDLE_TOP_BACK ];
+		currentVertex->particle_I = UNCLAIMED;
+		vertexList[0] = vertex_LEFT_TOP_BACK->coord;
+		vertexList[1] = vertex_RIGHT_TOP_BACK->coord;
+		StGermain_AverageCoord( currentVertex->coord, vertexList, 2, dim );			
+		
+		/* Assign New Verticies to children cells - For Front Face Cells */
+		currentCell = &newCells[ LEFT_BOTTOM_FRONT ];
+		currentCell->vertex_I[ LEFT_BOTTOM_BACK   ] = self->verticiesCount + LEFT_BOTTOM_MIDDLE  ;
+		currentCell->vertex_I[ RIGHT_BOTTOM_BACK  ] = self->verticiesCount + MIDDLE_BOTTOM_MIDDLE;
+		currentCell->vertex_I[ RIGHT_TOP_BACK     ] = self->verticiesCount + MIDDLE_MIDDLE_MIDDLE;
+		currentCell->vertex_I[ LEFT_TOP_BACK      ] = self->verticiesCount + LEFT_MIDDLE_MIDDLE  ;
+
+		currentCell = &newCells[ RIGHT_BOTTOM_FRONT ];
+		currentCell->vertex_I[ LEFT_BOTTOM_BACK   ] = self->verticiesCount + MIDDLE_BOTTOM_MIDDLE;
+		currentCell->vertex_I[ RIGHT_BOTTOM_BACK  ] = self->verticiesCount + RIGHT_BOTTOM_MIDDLE ;
+		currentCell->vertex_I[ RIGHT_TOP_BACK     ] = self->verticiesCount + RIGHT_MIDDLE_MIDDLE ;
+		currentCell->vertex_I[ LEFT_TOP_BACK      ] = self->verticiesCount + MIDDLE_MIDDLE_MIDDLE;
+		
+		currentCell = &newCells[ RIGHT_TOP_FRONT ];
+		currentCell->vertex_I[ LEFT_BOTTOM_BACK   ] = self->verticiesCount + MIDDLE_MIDDLE_MIDDLE;
+		currentCell->vertex_I[ RIGHT_BOTTOM_BACK  ] = self->verticiesCount + RIGHT_MIDDLE_MIDDLE ;
+		currentCell->vertex_I[ RIGHT_TOP_BACK     ] = self->verticiesCount + RIGHT_TOP_MIDDLE    ;		
+		currentCell->vertex_I[ LEFT_TOP_BACK      ] = self->verticiesCount + MIDDLE_TOP_MIDDLE   ;		
+
+		currentCell = &newCells[ LEFT_TOP_FRONT ];
+		currentCell->vertex_I[ LEFT_BOTTOM_BACK   ] = self->verticiesCount + LEFT_MIDDLE_MIDDLE  ;
+		currentCell->vertex_I[ RIGHT_BOTTOM_BACK  ] = self->verticiesCount + MIDDLE_MIDDLE_MIDDLE;
+		currentCell->vertex_I[ RIGHT_TOP_BACK     ] = self->verticiesCount + MIDDLE_TOP_MIDDLE   ;
+		currentCell->vertex_I[ LEFT_TOP_BACK      ] = self->verticiesCount + LEFT_TOP_MIDDLE     ;
+
+		/* Assign New Verticies to children cells - For Back Face Cells */
+		currentCell = &newCells[ LEFT_BOTTOM_BACK ];
+		currentCell->vertex_I[ LEFT_BOTTOM_FRONT  ] = self->verticiesCount + LEFT_BOTTOM_MIDDLE  ;
+		currentCell->vertex_I[ RIGHT_BOTTOM_FRONT ] = self->verticiesCount + MIDDLE_BOTTOM_MIDDLE;
+		currentCell->vertex_I[ RIGHT_TOP_FRONT    ] = self->verticiesCount + MIDDLE_MIDDLE_MIDDLE;
+		currentCell->vertex_I[ LEFT_TOP_FRONT     ] = self->verticiesCount + LEFT_MIDDLE_MIDDLE  ;
+		currentCell->vertex_I[ RIGHT_BOTTOM_BACK  ] = self->verticiesCount + MIDDLE_BOTTOM_BACK  ;
+		currentCell->vertex_I[ RIGHT_TOP_BACK     ] = self->verticiesCount + MIDDLE_MIDDLE_BACK  ;
+		currentCell->vertex_I[ LEFT_TOP_BACK      ] = self->verticiesCount + LEFT_MIDDLE_BACK    ;
+
+		currentCell = &newCells[ RIGHT_BOTTOM_BACK ];
+		currentCell->vertex_I[ LEFT_BOTTOM_FRONT  ] = self->verticiesCount + MIDDLE_BOTTOM_MIDDLE;
+		currentCell->vertex_I[ RIGHT_BOTTOM_FRONT ] = self->verticiesCount + RIGHT_BOTTOM_MIDDLE ;
+		currentCell->vertex_I[ RIGHT_TOP_FRONT    ] = self->verticiesCount + RIGHT_MIDDLE_MIDDLE ;
+		currentCell->vertex_I[ LEFT_TOP_FRONT     ] = self->verticiesCount + MIDDLE_MIDDLE_MIDDLE;
+		currentCell->vertex_I[ LEFT_BOTTOM_BACK   ] = self->verticiesCount + MIDDLE_BOTTOM_BACK  ;
+		currentCell->vertex_I[ RIGHT_TOP_BACK     ] = self->verticiesCount + RIGHT_MIDDLE_BACK   ;
+		currentCell->vertex_I[ LEFT_TOP_BACK      ] = self->verticiesCount + MIDDLE_MIDDLE_BACK  ;
+
+		currentCell = &newCells[ RIGHT_TOP_BACK ];
+		currentCell->vertex_I[ LEFT_BOTTOM_FRONT  ] = self->verticiesCount + MIDDLE_MIDDLE_MIDDLE;
+		currentCell->vertex_I[ RIGHT_BOTTOM_FRONT ] = self->verticiesCount + RIGHT_MIDDLE_MIDDLE ;
+		currentCell->vertex_I[ RIGHT_TOP_FRONT    ] = self->verticiesCount + RIGHT_TOP_MIDDLE    ;		
+		currentCell->vertex_I[ LEFT_TOP_FRONT     ] = self->verticiesCount + MIDDLE_TOP_MIDDLE   ;			
+		currentCell->vertex_I[ LEFT_BOTTOM_BACK   ] = self->verticiesCount + MIDDLE_MIDDLE_BACK  ;
+		currentCell->vertex_I[ RIGHT_BOTTOM_BACK  ] = self->verticiesCount + RIGHT_MIDDLE_BACK   ;
+		currentCell->vertex_I[ LEFT_TOP_BACK      ] = self->verticiesCount + MIDDLE_TOP_BACK     ;
+
+		currentCell = &newCells[ LEFT_TOP_BACK ];
+		currentCell->vertex_I[ LEFT_BOTTOM_FRONT  ] = self->verticiesCount + LEFT_MIDDLE_MIDDLE  ;
+		currentCell->vertex_I[ RIGHT_BOTTOM_FRONT ] = self->verticiesCount + MIDDLE_MIDDLE_MIDDLE;
+		currentCell->vertex_I[ RIGHT_TOP_FRONT    ] = self->verticiesCount + MIDDLE_TOP_MIDDLE   ;
+		currentCell->vertex_I[ LEFT_TOP_FRONT     ] = self->verticiesCount + LEFT_TOP_MIDDLE     ;
+		currentCell->vertex_I[ LEFT_BOTTOM_BACK   ] = self->verticiesCount + LEFT_MIDDLE_BACK    ;
+		currentCell->vertex_I[ RIGHT_BOTTOM_BACK  ] = self->verticiesCount + MIDDLE_MIDDLE_BACK  ;
+		currentCell->vertex_I[ RIGHT_TOP_BACK     ] = self->verticiesCount + MIDDLE_TOP_BACK     ;
+	}
+
+	/* Add numbers to cells */
+	self->cellsCount     += cellVertexCount;
+	self->verticiesCount += self->newVertexCountForSplit;
+}
+
+void AdaptiveVoronoi_ClaimCell( 
+		AdaptiveVoronoi*              self,
+		AdaptiveVoronoiUnclaimedCell* cell, 
+		Particle_InCellIndex          particle_I )
+{
+	AdaptiveVoronoiClaimedCell* claimedCell;
+	double*                     centroid;
+	Dimension_Index             dim             = self->dim;
+	Index                       cVertex_I;
+	Index                       cellVertexCount = self->cellVertexCount;
+	double                      factor          = 1.0/ (double)cellVertexCount;
+	AdaptiveVoronoiVertex*      vertex;
+
+	/* Get Pointers */
+	claimedCell = AdaptiveVoronoi_NewClaimedCell( self );
+	centroid    = claimedCell->centroid;
+
+	/* Find Centroid and store verticies */ 
+	centroid[ I_AXIS ] = centroid[ J_AXIS ] = centroid[ K_AXIS ] = 0.0;
+	for ( cVertex_I = 0 ; cVertex_I < cellVertexCount ; cVertex_I++ ) {
+		vertex = &self->verticies[ cell->vertex_I[ cVertex_I ] ];
+
+		centroid[ I_AXIS ] += vertex->coord[ I_AXIS ];
+		centroid[ J_AXIS ] += vertex->coord[ J_AXIS ];
+		if (dim == 3)
+			centroid[ K_AXIS ] += vertex->coord[ K_AXIS ];
+		
+		/* Store Verticies */
+		memcpy( claimedCell->vertex[ cVertex_I ] , vertex->coord, sizeof(Coord) );
+	}
+	centroid[ I_AXIS ] *= factor;
+	centroid[ J_AXIS ] *= factor;
+	if (dim == 3)
+		centroid[ K_AXIS ] *= factor;
+
+	/* Claim the cell if it isn't claimed already */
+	if ( particle_I == UNCLAIMED ) 
+		particle_I = Swarm_FindClosestParticleInCell( self->swarm, self->cell_I, self->dim, centroid, NULL );
+
+	/* Add data to cell */
+	claimedCell->particle_I = particle_I;
+}
+
+Voronoi_CellIndex AdaptiveVoronoi_Loop( AdaptiveVoronoi* self, Index cell_I ) {
+	AdaptiveVoronoiUnclaimedCell* cell = &self->cells[ cell_I ];
+
+	/* If we've split as many times as we are allowed - then just claim cell */
+	if (cell->level >= self->maxIterations) 
+		AdaptiveVoronoi_ClaimCell(self, cell, UNCLAIMED );
+	else {
+		/* Check to see whether we should split this cell */
+		if (AdaptiveVoronoi_NeedSplitCell( self, cell )) 
+			AdaptiveVoronoi_SplitCell( self, cell_I );
+		else
+			AdaptiveVoronoi_ClaimCell( self, cell, self->verticies[ cell->vertex_I[0] ].particle_I );
+	}
+	/* reassign pointer, in case there has been a realloc */
+	cell = &self->cells[ cell_I ];
+
+	return cell->nextCell_I;
+}
+
+void AdaptiveVoronoi_PrintLinkedList( AdaptiveVoronoi* self, Stream* stream ){
+	Cell_Index                    cell_I = 0;
+	AdaptiveVoronoiUnclaimedCell* cell;
+
+	do {
+		cell = &self->cells[ cell_I ];
+		Journal_Printf( stream, "cell %u points to cell %u\n", cell_I, cell->nextCell_I );
+		cell_I = cell->nextCell_I;
+	} while ( cell_I != FINISHED );
+	
+}
+
+
+AdaptiveVoronoiClaimedCell* AdaptiveVoronoi_NewClaimedCell( AdaptiveVoronoi* self ) {
+	if ( self->claimedCellsAllocated <= self->claimedCellCount ) {
+		self->claimedCellsAllocated = self->claimedCellCount + 5;
+		self->cellList = Memory_Realloc_Array( self->cellList, AdaptiveVoronoiClaimedCell, self->claimedCellsAllocated );
+	}
+
+	self->claimedCellCount++;
+
+	return &self->cellList[ self->claimedCellCount - 1 ];
+}
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/AdaptiveVoronoi.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/AdaptiveVoronoi.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,165 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: AdaptiveVoronoi.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Voronoi_AdaptiveVoronoi_h__
+#define __PICellerator_Voronoi_AdaptiveVoronoi_h__
+
+	/* Textual name of this class */
+	extern const Type AdaptiveVoronoi_Type;
+
+	typedef struct {
+		Particle_InCellIndex particle_I;
+		Coord                centroid;
+		Coord                vertex[8];
+	} AdaptiveVoronoiClaimedCell;
+
+	typedef struct {
+		Iteration_Index    level;
+		Vertex_Index       vertex_I[8];
+		Voronoi_CellIndex  nextCell_I;
+	} AdaptiveVoronoiUnclaimedCell;
+
+	typedef struct {
+		Particle_Index particle_I;
+		Coord          coord;
+	} AdaptiveVoronoiVertex;
+
+	/* AdaptiveVoronoi information */
+	#define __AdaptiveVoronoi \
+		/* General info */ \
+		__DiscreteVoronoi \
+		/* Virtual Info */\
+		\
+		/* General Info */\
+		Iteration_Index                  maxIterations;          \
+		Vertex_Index                     cellVertexCount;        \
+		Vertex_Index                     newVertexCountForSplit; \
+		/* Claimed Cell Info */ \
+		AdaptiveVoronoiClaimedCell*      cellList;               \
+		Voronoi_CellIndex                claimedCellsAllocated;  \
+		/* Stored Cell Info */\
+		Voronoi_CellIndex                cellsCount;             \
+		Voronoi_CellIndex                cellsAllocatedCount;    \
+		AdaptiveVoronoiUnclaimedCell*    cells;                  \
+		/* Stored Vertex Info */\
+		Vertex_Index                     verticiesCount;         \
+		Vertex_Index                     verticiesAllocatedCount;\
+		AdaptiveVoronoiVertex*           verticies;              \
+		/* Current Info */ \
+		Swarm*                           swarm;                  \
+		Cell_LocalIndex                  cell_I;                 \
+
+	struct AdaptiveVoronoi { __AdaptiveVoronoi };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	AdaptiveVoronoi* _AdaptiveVoronoi_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,		
+		DiscreteVoronoi_CalculateForCellFunction*          _calculate,		
+		DiscreteVoronoi_GetParticleIndexFunction*          _getParticleIndex,
+		DiscreteVoronoi_GetVolumeFunction*                 _getVolume,
+		DiscreteVoronoi_GetCentroidFunction*               _getCentroid,	
+		Name                                               name );
+
+	/* Stg_Class_Delete AdaptiveVoronoi implementation */
+	void _AdaptiveVoronoi_Delete( void* adaptiveVoronoi );
+	void _AdaptiveVoronoi_Print( void* adaptiveVoronoi, Stream* stream );
+	#define AdaptiveVoronoi_Copy( self ) \
+		(AdaptiveVoronoi*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define AdaptiveVoronoi_DeepCopy( self ) \
+		(AdaptiveVoronoi*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _AdaptiveVoronoi_Copy( void* adaptiveVoronoi, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void* _AdaptiveVoronoi_DefaultNew( Name name ) ;
+	void _AdaptiveVoronoi_Construct( void* adaptiveVoronoi, Stg_ComponentFactory* cf, void* data ) ;
+	void _AdaptiveVoronoi_Build( void* adaptiveVoronoi, void* data ) ;
+	void _AdaptiveVoronoi_Initialise( void* adaptiveVoronoi, void* data ) ;
+	void _AdaptiveVoronoi_Execute( void* adaptiveVoronoi, void* data );
+	void _AdaptiveVoronoi_Destroy( void* adaptiveVoronoi, void* data ) ;
+	
+	void _AdaptiveVoronoi_CalculateForCell( void* adaptiveVoronoi, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	Particle_InCellIndex _AdaptiveVoronoi_GetParticleIndex( void* discreteVoronoi, Voronoi_CellIndex vCell_I );
+	double _AdaptiveVoronoi_GetVolume(void* discreteVoronoi, Voronoi_CellIndex vCell_I );
+	void _AdaptiveVoronoi_GetCentroid(void* discreteVoronoi, Voronoi_CellIndex vCell_I, Coord centroid );
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	void AdaptiveVoronoi_InitialiseFirstCell( AdaptiveVoronoi* self ) ;
+	Bool AdaptiveVoronoi_NeedSplitCell( AdaptiveVoronoi* self, AdaptiveVoronoiUnclaimedCell* cell ) ;
+	void AdaptiveVoronoi_SplitCell( AdaptiveVoronoi* self, Index parentCell_I ) ;
+	void AdaptiveVoronoi_ClaimCell( 
+		AdaptiveVoronoi*              self,
+		AdaptiveVoronoiUnclaimedCell* cell, 
+		Particle_InCellIndex          particle_I );
+	Voronoi_CellIndex AdaptiveVoronoi_Loop( AdaptiveVoronoi* self, Index cell_I ) ;
+	void AdaptiveVoronoi_PrintLinkedList( AdaptiveVoronoi* self, Stream* stream );
+	AdaptiveVoronoiClaimedCell* AdaptiveVoronoi_NewClaimedCell( AdaptiveVoronoi* self ) ;
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/AdaptiveVoronoi.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/AdaptiveVoronoi.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">AdaptiveVoronoi</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Voronoi/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">DiscreteVoronoi</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">maxIterations</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">3</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/CellularAutomataVoronoi.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/CellularAutomataVoronoi.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,947 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: CellularAutomataVoronoi.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "types.h"
+#include "DiscreteVoronoi.h"
+#include "CellularAutomataVoronoi.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+const unsigned int CELLULAR_AUTOMATA_UNCLAIMED = ((unsigned int) -1);
+#define NO_CHECK                     ((unsigned int) -2)
+#define VICTOR                       0
+#define LOSER                        1
+
+#define MEMORY_DELTA                 5
+
+/* Textual name of this class */
+const Type CellularAutomataVoronoi_Type = "CellularAutomataVoronoi";
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+CellularAutomataVoronoi* _CellularAutomataVoronoi_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,		
+	DiscreteVoronoi_CalculateForCellFunction*          _calculate,
+	DiscreteVoronoi_GetParticleIndexFunction*          _getParticleIndex,
+	DiscreteVoronoi_GetVolumeFunction*                 _getVolume,
+	DiscreteVoronoi_GetCentroidFunction*               _getCentroid,
+	Name                                               name )
+{
+	CellularAutomataVoronoi* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(CellularAutomataVoronoi) );
+	self = (CellularAutomataVoronoi*)_DiscreteVoronoi_New( 
+		_sizeOfSelf,
+		type,
+		_delete,
+		_print,
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,		
+		_calculate,
+		_getParticleIndex,
+		_getVolume,
+		_getCentroid,
+		name );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _CellularAutomataVoronoi_Init( void* cellularAutomataVoronoi, IJK resolution, Bool diagonalNeighbours ) {
+	CellularAutomataVoronoi* self = (CellularAutomataVoronoi*)cellularAutomataVoronoi;
+
+	self->diagonalNeighbours = diagonalNeighbours;
+
+	if (self->dim == 2)
+		resolution[ K_AXIS ] = 1;
+
+	memcpy( self->resolution, resolution, sizeof(IJK) );
+
+	/* Calculate Total number of cells */
+	self->claimedCellCount = resolution[ I_AXIS ] * resolution[ J_AXIS ] * resolution[ K_AXIS ];
+
+	/* Allocate for the volumes of each cell. */
+	self->cellVolumes = Memory_Alloc_Array( double, self->claimedCellCount, "CellularAutomataVoronoi::cellVolumes" );
+}
+
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _CellularAutomataVoronoi_Delete( void* cellularAutomataVoronoi ) {
+	CellularAutomataVoronoi*     self = (CellularAutomataVoronoi*)cellularAutomataVoronoi;
+	Voronoi_CellIndex            vCell_I;
+	CellularAutomataVoronoiCell* cell;
+	
+	/* Delete Neighbours and Battle History */
+	for ( vCell_I = 0 ; vCell_I < self->claimedCellCount ; vCell_I++ ) {
+		cell = &self->cellList[ vCell_I ];
+		Memory_Free( cell->neighbourCellList );
+		Memory_Free( cell->battleHistory.battlePair );
+	}
+	
+	Memory_Free( self->cellList );
+	Memory_Free( self->cellsToGrow.array );
+	Memory_Free( self->cellsToCheck.array );
+	FreeArray( self->cellVolumes );
+	
+	/* Delete parent */
+	_DiscreteVoronoi_Delete( self );
+}
+
+
+void _CellularAutomataVoronoi_Print( void* cellularAutomataVoronoi, Stream* stream ) {
+	CellularAutomataVoronoi* self = (CellularAutomataVoronoi*)cellularAutomataVoronoi;
+	
+	/* Print parent */
+	_DiscreteVoronoi_Print( self, stream );
+}
+
+void* _CellularAutomataVoronoi_Copy( void* cellularAutomataVoronoi, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	CellularAutomataVoronoi*	self = (CellularAutomataVoronoi*)cellularAutomataVoronoi;
+	CellularAutomataVoronoi*	newCellularAutomataVoronoi;
+	
+	newCellularAutomataVoronoi = (CellularAutomataVoronoi*)_DiscreteVoronoi_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newCellularAutomataVoronoi;
+}
+
+void* _CellularAutomataVoronoi_DefaultNew( Name name ) {
+	return (void*) _CellularAutomataVoronoi_New(
+		sizeof(CellularAutomataVoronoi),
+		CellularAutomataVoronoi_Type,
+		_CellularAutomataVoronoi_Delete,
+		_CellularAutomataVoronoi_Print,
+		_CellularAutomataVoronoi_Copy,
+		_CellularAutomataVoronoi_DefaultNew,
+		_CellularAutomataVoronoi_Construct,
+		_CellularAutomataVoronoi_Build,
+		_CellularAutomataVoronoi_Initialise,
+		_CellularAutomataVoronoi_Execute,
+		_CellularAutomataVoronoi_Destroy,
+		_CellularAutomataVoronoi_CalculateForCell,
+		_CellularAutomataVoronoi_GetParticleIndex,
+		_CellularAutomataVoronoi_GetVolume,
+		_CellularAutomataVoronoi_GetCentroid,
+		name );
+}
+
+
+void _CellularAutomataVoronoi_Construct( void* cellularAutomataVoronoi, Stg_ComponentFactory* cf, void* data ) {
+	CellularAutomataVoronoi*	     self          = (CellularAutomataVoronoi*) cellularAutomataVoronoi;
+	unsigned int                     defaultResolution;
+	IJK                              resolution;
+
+	_DiscreteVoronoi_Construct( self, cf, data );
+
+	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 );
+	
+	_CellularAutomataVoronoi_Init( 
+		self, 
+		resolution, 
+		Stg_ComponentFactory_GetBool( cf, self->name, "diagonalNeighbours", True ) );
+}
+
+void _CellularAutomataVoronoi_Build( void* cellularAutomataVoronoi, void* data ) {
+	CellularAutomataVoronoi*	self = (CellularAutomataVoronoi*)cellularAutomataVoronoi;
+
+	_DiscreteVoronoi_Build( self, data );
+
+	/* Allocate Memory for cells */
+	self->cellList = Memory_Alloc_Array( CellularAutomataVoronoiCell, self->claimedCellCount, "cellList" );
+	memset( self->cellList, 0, sizeof( CellularAutomataVoronoiCell ) * self->claimedCellCount );
+
+	CellularAutomataVoronoiCellList_Build( &self->cellsToGrow );
+	CellularAutomataVoronoiCellList_Build( &self->cellsToCheck );
+}
+
+void _CellularAutomataVoronoi_Initialise( void* cellularAutomataVoronoi, void* data ) {
+	CellularAutomataVoronoi*     self = (CellularAutomataVoronoi*)cellularAutomataVoronoi;
+	IJK                          vIJK;
+	Voronoi_CellIndex            vCell_I;
+	CellularAutomataVoronoiCell* cell;
+
+	_DiscreteVoronoi_Initialise( self, data );
+
+	for ( vIJK[ K_AXIS ] = 0 ; vIJK[ K_AXIS ] < self->resolution[ K_AXIS ] ; vIJK[ K_AXIS ]++ ) {
+		for ( vIJK[ J_AXIS ] = 0 ; vIJK[ J_AXIS ] < self->resolution[ J_AXIS ] ; vIJK[ J_AXIS ]++ ) {
+			for ( vIJK[ I_AXIS ] = 0 ; vIJK[ I_AXIS ] < self->resolution[ I_AXIS ] ; vIJK[ I_AXIS ]++ ) {
+				Dimension_3DTo1D( vIJK, self->resolution, &vCell_I );
+				cell = &self->cellList[ vCell_I ];
+
+				/* Set up battle history */
+				cell->battleHistory.battlesAllocated = 3;
+				cell->battleHistory.battlePair = 
+					Memory_Alloc_Array( BattlePair, cell->battleHistory.battlesAllocated, "battlePairArray" );
+
+				/* Set up the neighbours - 
+				 * We don't have to worry about cells being on side walls of the element here because that is 
+				 * taken care of in CellularAutomataVoronoi_AddNeighbourToCell */
+				if ( self->diagonalNeighbours ) {
+					int add[3];
+					/* Use loop to get all 26 neighbours (8 in 2D) */
+					for ( add[ I_AXIS ] = -1 ; add[ I_AXIS ] <= 1 ; add[ I_AXIS ]++ ) {
+						for ( add[ J_AXIS ] = -1 ; add[ J_AXIS ] <= 1 ; add[ J_AXIS ]++ ) {
+							for ( add[ K_AXIS ] = -1 ; add[ K_AXIS ] <= 1 ; add[ K_AXIS ]++ ) {
+								
+								/* Make sure that this isn't the same cell as itself */
+								if ( add[ I_AXIS ] == 0 && add[ J_AXIS ] == 0 && add[ K_AXIS ] == 0 )
+									continue;
+
+								CellularAutomataVoronoi_AddNeighbourToCell( self, cell, 
+													    vIJK[I_AXIS]+add[I_AXIS], vIJK[J_AXIS]+add[J_AXIS], vIJK[K_AXIS]+add[K_AXIS]);
+							}
+						}
+					}
+				}
+				else {
+					/* Not using neighbours as diagonals - There are 6 in 3D and 4 in 2D */
+					CellularAutomataVoronoi_AddNeighbourToCell( self, cell, vIJK[I_AXIS] - 1, vIJK[J_AXIS], vIJK[K_AXIS]);
+					CellularAutomataVoronoi_AddNeighbourToCell( self, cell, vIJK[I_AXIS] + 1, vIJK[J_AXIS], vIJK[K_AXIS]);
+						
+					CellularAutomataVoronoi_AddNeighbourToCell( self, cell, vIJK[I_AXIS], vIJK[J_AXIS] - 1, vIJK[K_AXIS]);
+					CellularAutomataVoronoi_AddNeighbourToCell( self, cell, vIJK[I_AXIS], vIJK[J_AXIS] + 1, vIJK[K_AXIS]);
+						
+					CellularAutomataVoronoi_AddNeighbourToCell( self, cell, vIJK[I_AXIS], vIJK[J_AXIS], vIJK[K_AXIS] - 1);
+					CellularAutomataVoronoi_AddNeighbourToCell( self, cell, vIJK[I_AXIS], vIJK[J_AXIS], vIJK[K_AXIS] + 1);
+				}
+			}
+		}
+	}
+}
+void _CellularAutomataVoronoi_Execute( void* cellularAutomataVoronoi, void* data ) {
+	CellularAutomataVoronoi*	self = (CellularAutomataVoronoi*)cellularAutomataVoronoi;
+	
+	_DiscreteVoronoi_Execute( self, data );
+}
+void _CellularAutomataVoronoi_Destroy( void* cellularAutomataVoronoi, void* data ) {
+	CellularAutomataVoronoi*	self = (CellularAutomataVoronoi*)cellularAutomataVoronoi;
+	
+	_DiscreteVoronoi_Destroy( self, data );
+}
+
+void _CellularAutomataVoronoi_CalculateForCell( void* cellularAutomataVoronoi, void* swarm, Cell_LocalIndex lCell_I ) {
+	CellularAutomataVoronoi*             self            = (CellularAutomataVoronoi*)  cellularAutomataVoronoi;
+
+	/* Initialise all values on cells */
+	CellularAutomataVoronoi_InitialiseCell( self, swarm, lCell_I );
+
+	/* Seed Cellular Automata */
+	CellularAutomataVoronoi_Seed( self );
+	
+	/* Do CellularAutomataVoronoi - Keep claiming cells until there are no more being claimed */
+	do {
+		CellularAutomataVoronoi_GrowCells( self );
+		CellularAutomataVoronoi_CheckCells( self );
+	} while ( self->cellsToGrow.cellCount != 0 );
+}
+
+Particle_InCellIndex _CellularAutomataVoronoi_GetParticleIndex( void* discreteVoronoi, Voronoi_CellIndex vCell_I ){
+	CellularAutomataVoronoi*             self            = (CellularAutomataVoronoi*)  discreteVoronoi;
+
+	return self->cellList[ vCell_I ].claimedParticle;
+}
+
+double _CellularAutomataVoronoi_GetVolume(void* discreteVoronoi, Voronoi_CellIndex vCell_I ){
+	CellularAutomataVoronoi*             self            = (CellularAutomataVoronoi*)  discreteVoronoi;
+
+	return self->cellVolumes[vCell_I];
+}
+
+void _CellularAutomataVoronoi_GetCentroid(void* discreteVoronoi, Voronoi_CellIndex vCell_I, Coord centroid ){
+	CellularAutomataVoronoi*             self            = (CellularAutomataVoronoi*)  discreteVoronoi;
+
+	memcpy( centroid, self->cellList[ vCell_I ].centroid, self->dim * sizeof(double) );
+}
+
+/* Other functions */
+void CellularAutomataVoronoi_CheckCells( void* cellularAutomataVoronoi ) {
+	CellularAutomataVoronoi*             self            = (CellularAutomataVoronoi*)  cellularAutomataVoronoi;
+	Voronoi_CellIndex                    checkCellCount;
+	Voronoi_CellIndex                    checkCell_I;
+	CellularAutomataVoronoiCell*         cell;
+	Particle_InCellIndex                 claimedParticle;
+	Particle_InCellIndex                 particleToCheck;
+	
+	checkCellCount = self->cellsToCheck.cellCount;
+
+	for ( checkCell_I = 0 ; checkCell_I < checkCellCount ; checkCell_I++ ) {
+		cell            = self->cellsToCheck.array[ checkCell_I ];
+		claimedParticle = cell->claimedParticle;
+		particleToCheck = cell->particleToCheck;
+
+		/* If this cell is unclaimed - then claim it for this particle */
+		if ( claimedParticle == CELLULAR_AUTOMATA_UNCLAIMED ) {
+			cell->claimedParticle = particleToCheck;
+			CellularAutomataVoronoiCellList_AddCell( &self->cellsToGrow, cell );
+		}
+		else {
+			/* This cell has already been claimed - therefore there needs to be battle between these particles
+			 * to see who gets to own it */
+			if ( particleToCheck == CellularAutomataVoronoi_Battle( self, cell, claimedParticle, particleToCheck ) ) {
+				cell->claimedParticle = particleToCheck;
+				CellularAutomataVoronoiCellList_AddCell( &self->cellsToGrow, cell );
+			}
+		}
+		cell->particleToCheck = NO_CHECK;
+	}
+
+	/* Now that we've looked through all the cells to check if they should be claimed - 
+	 * we can set the number to be checked back to zero */
+	self->cellsToCheck.cellCount = 0;
+}
+
+void CellularAutomataVoronoi_GrowCells( void* cellularAutomataVoronoi ) {
+	CellularAutomataVoronoi*             self            = (CellularAutomataVoronoi*)  cellularAutomataVoronoi;
+	Voronoi_CellIndex                    growCellCount;
+	Voronoi_CellIndex                    growCell_I;
+	Voronoi_CellIndex                    neighbourCount;
+	Voronoi_CellIndex                    neighbour_I;
+	CellularAutomataVoronoiCell*         cell;
+	CellularAutomataVoronoiCell*         neighbour;
+	Particle_InCellIndex                 claimedParticle;
+	
+	growCellCount = self->cellsToGrow.cellCount;
+
+	for ( growCell_I = 0 ; growCell_I < growCellCount ; growCell_I++ ) {
+		cell            = self->cellsToGrow.array[ growCell_I ];
+		neighbourCount  = cell->neighbourCount;
+		claimedParticle = cell->claimedParticle;
+	
+		for ( neighbour_I = 0 ; neighbour_I < neighbourCount ; neighbour_I++ ) {
+			neighbour = cell->neighbourCellList[ neighbour_I ];
+
+			/* If this particle has already claimed this cell - then ignore it */
+			if ( neighbour->claimedParticle == claimedParticle )
+				continue;
+
+			/* If this cell is already going to try this particle - then we don't need to do it twice */
+			if ( neighbour->particleToCheck == claimedParticle )
+				continue;
+			
+			/* If this cell is going to try a different particle - then do battle */
+			if ( neighbour->particleToCheck != NO_CHECK ) {
+				neighbour->particleToCheck = 
+					CellularAutomataVoronoi_Battle( self, neighbour, neighbour->particleToCheck, claimedParticle );
+				continue;
+			}
+
+			/* Otherwise - Add this cell as one of the ones to be checked */
+			neighbour->particleToCheck = claimedParticle;
+			CellularAutomataVoronoiCellList_AddCell( &self->cellsToCheck, neighbour );
+		}
+	}
+
+	/* Now that we've looked through all the cells to grow 
+	 * we can set the number to grow back to zero */
+	self->cellsToGrow.cellCount = 0;
+}
+
+
+Particle_InCellIndex CellularAutomataVoronoi_Battle( 
+	void*                                              cellularAutomataVoronoi, 
+	CellularAutomataVoronoiCell*                       cell, 
+	Particle_InCellIndex                               champion_I, 
+	Particle_InCellIndex                               contender_I )
+{
+	CellularAutomataVoronoi*  self            = (CellularAutomataVoronoi*)  cellularAutomataVoronoi;
+	double*                   cellCentroid;
+	void*                     champion;
+	void*                     contender;
+	Coord                     championCoord;
+	Coord                     contenderCoord;
+	double                    distanceToChampion;
+	double                    distanceToContender;
+	Index                     battle_I;
+	Index                     battleCount = cell->battleHistory.battleCount;
+	Swarm*                    swarm;
+	Cell_LocalIndex           lCell_I;
+	Particle_InCellIndex*     battlePair;
+
+	FiniteElement_Mesh*       mesh;
+
+	/* Check if battle has already been fought */
+	for ( battle_I = 0 ; battle_I < battleCount ; battle_I++ ) {
+		battlePair = cell->battleHistory.battlePair[battle_I];
+		if (       ( champion_I == battlePair[LOSER ] && contender_I == battlePair[VICTOR] )
+			   || ( champion_I == battlePair[VICTOR] && contender_I == battlePair[LOSER ] ) )
+			return battlePair[VICTOR];
+	}
+	
+	swarm               = self->swarm;
+	lCell_I             = self->lCell_I;
+	cellCentroid        = cell->centroid;
+	champion            = Swarm_ParticleInCellAt( swarm, lCell_I, champion_I );
+	contender           = Swarm_ParticleInCellAt( swarm, lCell_I, contender_I );
+	mesh                = (FiniteElement_Mesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh); /* Assume ElementCellLayout */
+	
+	if ( swarm->particleLayout->coordSystem == GlobalCoordSystem ) {
+		memcpy( championCoord, ((GlobalParticle*)champion)->coord, sizeof(Coord) );
+		memcpy( contenderCoord, ((GlobalParticle*)contender)->coord, sizeof(Coord) );
+	}
+	else {
+		/* LocalCoordSystem need to convert to global */
+		FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord(
+			mesh,
+			swarm->dim,
+			lCell_I,
+			((LocalParticle*)champion)->xi,
+			championCoord );
+		FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord(
+			mesh,
+			swarm->dim,
+			lCell_I,
+			((LocalParticle*)contender)->xi,
+			contenderCoord );
+	}
+						
+
+
+	/* Calculate 'distances' from cell to each particle in the battle 
+	 * ('distance' isn't actually the true distance - but the distance squared */
+	distanceToChampion = 
+		(championCoord[I_AXIS] - cellCentroid[I_AXIS])*(championCoord[I_AXIS] - cellCentroid[I_AXIS]) +
+		(championCoord[J_AXIS] - cellCentroid[J_AXIS])*(championCoord[J_AXIS] - cellCentroid[J_AXIS]) ;
+	
+	distanceToContender = 
+		(contenderCoord[I_AXIS] - cellCentroid[I_AXIS])*(contenderCoord[I_AXIS] - cellCentroid[I_AXIS]) +
+		(contenderCoord[J_AXIS] - cellCentroid[J_AXIS])*(contenderCoord[J_AXIS] - cellCentroid[J_AXIS]) ;
+
+	if ( self->dim == 3 ) {
+		distanceToChampion += 
+			(championCoord[K_AXIS] - cellCentroid[K_AXIS])*(championCoord[K_AXIS] - cellCentroid[K_AXIS]);
+		distanceToContender += 
+			(contenderCoord[K_AXIS] - cellCentroid[K_AXIS])*(contenderCoord[K_AXIS] - cellCentroid[K_AXIS]);
+	}
+
+	/* Check if we need to add memory to battle history */
+	if ( cell->battleHistory.battleCount >= cell->battleHistory.battlesAllocated ) {
+		cell->battleHistory.battlesAllocated = cell->battleHistory.battleCount + 2;
+		cell->battleHistory.battlePair = 
+			Memory_Realloc_Array( cell->battleHistory.battlePair, BattlePair, cell->battleHistory.battlesAllocated );
+	}
+	battlePair = cell->battleHistory.battlePair[ cell->battleHistory.battleCount ];
+	cell->battleHistory.battleCount++;
+
+	/* Record victory */
+	if ( distanceToContender < distanceToChampion ) {
+		battlePair[ VICTOR ] = contender_I;
+		battlePair[ LOSER  ] = champion_I;
+	}
+	else {
+		battlePair[ VICTOR ] = champion_I;
+		battlePair[ LOSER  ] = contender_I;
+	}
+
+	return battlePair[ VICTOR ];
+}
+
+void CellularAutomataVoronoi_InitialiseCell( void* cellularAutomataVoronoi, Swarm* swarm, Cell_LocalIndex lCell_I ) {
+	CellularAutomataVoronoi*             self            = (CellularAutomataVoronoi*)  cellularAutomataVoronoi;
+	CellularAutomataVoronoiCell*         cell;
+	Voronoi_CellIndex                    vCell_I;
+	Dimension_Index                      dim_I;
+	Dimension_Index                      dim = self->dim;
+	Index*                               resolution      = self->resolution;
+	IJK                                  ijk_I;
+
+	/* Find spacing of sub-cells in the parent domain. */
+	for ( dim_I = 0 ; dim_I < dim ; dim_I++ )
+		self->dx[ dim_I ] = 2.0 / ((double) resolution[ dim_I ]);
+
+	/* Update 'Current' info */
+	self->swarm   = swarm;
+	self->lCell_I = lCell_I;
+
+	/* Reset Lists */
+	self->cellsToGrow.cellCount  = 0;
+	self->cellsToCheck.cellCount = 0;
+
+	/* Reset Cells */
+	for ( vCell_I = 0 ; vCell_I < self->claimedCellCount ; vCell_I++ ) {
+		Dimension_1DTo3D( vCell_I, resolution, ijk_I );
+		cell = &self->cellList[ vCell_I ];
+
+		cell->claimedParticle = CELLULAR_AUTOMATA_UNCLAIMED;
+		cell->particleToCheck = NO_CHECK;
+		cell->battleHistory.battleCount = 0;
+	}
+
+	/* Calculate the volume and centroid of each sub-cell. */
+	CellularAutomataVoronoi_CalcSubCells( self, swarm, lCell_I );
+}
+
+void CellularAutomataVoronoi_AddNeighbourToCell( void* cellularAutomataVoronoi, CellularAutomataVoronoiCell* cell, Index iIndex, Index jIndex, Index kIndex ) {
+	CellularAutomataVoronoi*             self            = (CellularAutomataVoronoi*)  cellularAutomataVoronoi;
+	Index*                               resolution      = self->resolution;
+	Voronoi_CellIndex                    neighbourIndex;
+
+	if ( iIndex < resolution[ I_AXIS ] && jIndex < resolution[ J_AXIS ] && kIndex < resolution[ K_AXIS ] ) {
+		/* See if memory needs to be allocated */
+		if ( cell->neighbourCount >= cell->neighboursAllocated ) {
+			cell->neighboursAllocated = cell->neighbourCount + 1;
+			cell->neighbourCellList = 
+				Memory_Realloc_Array( cell->neighbourCellList, CellularAutomataVoronoiCell*, cell->neighboursAllocated );
+		}
+
+		/* Add neigbour to cell's list */
+		Dimension_3DTo1D_3( iIndex, jIndex, kIndex, resolution[0], resolution[1], resolution[2], &neighbourIndex );
+		cell->neighbourCellList[ cell->neighbourCount ] = &self->cellList[ neighbourIndex ];
+		cell->neighbourCount++;
+	}
+}
+
+void CellularAutomataVoronoi_Seed( void* cellularAutomataVoronoi ) {
+	CellularAutomataVoronoi*             self              = (CellularAutomataVoronoi*)  cellularAutomataVoronoi;
+	Swarm*                               swarm             = self->swarm;
+	Cell_LocalIndex                      lCell_I           = self->lCell_I;
+	void*                                particle;
+	Particle_InCellIndex                 cParticle_I;
+	Particle_InCellIndex                 cellParticleCount = swarm->cellParticleCountTbl[lCell_I];
+	IJK                                  vCell_IJK         = {0,0,0};
+	Voronoi_CellIndex                    vCell_I;
+	CellularAutomataVoronoiCell*         cell;
+	Dimension_Index                      dim               = self->dim;
+	Dimension_Index                      dim_I;
+	Index*                               resolution        = self->resolution;
+	FiniteElement_Mesh*                  mesh;
+	Coord                                localCoord;
+
+	mesh                = (FiniteElement_Mesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh); /* Assume ElementCellLayout */
+
+	/* Loop over all the particles in the cell - assigning it to the a voronoi cell it is in */
+	for ( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+		particle = Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+
+		if ( swarm->particleLayout->coordSystem == GlobalCoordSystem ) {
+			/* Must convert global to local. */
+			FiniteElement_Mesh_CalcLocalCoordFromGlobalCoord( mesh, 
+									  lCell_I, 
+									  ((GlobalParticle*)particle)->coord, 
+									  localCoord );
+		}
+		else {
+			/* Now we need to coordinate in locals. */
+			memcpy( localCoord, ((LocalParticle*)particle)->xi, sizeof(Coord) );
+		}
+
+		/* Find which discrete voronoi cell this particle is in */
+		for ( dim_I = 0 ; dim_I < dim ; dim_I++ ) {
+			vCell_IJK[ dim_I ] = (Index)((localCoord[dim_I] + 1.0) / self->dx[dim_I]);
+			
+			/* Check if particle is right on edge of element */
+			if ( vCell_IJK[ dim_I ] == resolution[ dim_I ] )
+				vCell_IJK[ dim_I ]--;
+		}
+		Dimension_3DTo1D( vCell_IJK, resolution, &vCell_I );
+
+		/* Get pointer to this cell */
+		cell = &self->cellList[ vCell_I ];
+
+		/* Check if there is another particle in this cell - Then do growing and checking stage before anything else */
+		if ( cell->claimedParticle != CELLULAR_AUTOMATA_UNCLAIMED ) {
+			Particle_InCellIndex previousClaimedParticle = cell->claimedParticle;
+			CellularAutomataVoronoi_GrowCells( self );
+			CellularAutomataVoronoi_CheckCells( self );
+			cell->claimedParticle = cParticle_I;
+			CellularAutomataVoronoiCellList_AddCell( &self->cellsToGrow, cell );
+			CellularAutomataVoronoi_GrowCells( self );
+			CellularAutomataVoronoi_CheckCells( self );
+
+			cell->claimedParticle = CellularAutomataVoronoi_Battle( self, cell, previousClaimedParticle, cParticle_I );
+		}
+		else {
+			cell->claimedParticle = cParticle_I;
+			CellularAutomataVoronoiCellList_AddCell( &self->cellsToGrow, cell );
+		}
+	}
+}
+
+void CellularAutomataVoronoi_AsciiArt( void* cellularAutomataVoronoi ) {
+	CellularAutomataVoronoi*             self              = (CellularAutomataVoronoi*)  cellularAutomataVoronoi;
+	IJK                                  vCell_IJK         = { 0,0,0 };
+	Stream*                              stream            = Journal_MyStream( Info_Type, self );
+	Voronoi_CellIndex                    vCell_I;
+	CellularAutomataVoronoiCell*         cell;
+	char                                 c;
+
+	assert( self->dim == 2 );
+		
+	/* Draw Line at top of box */
+	Journal_Printf( stream, " " );
+	for ( vCell_IJK[ I_AXIS ] = 0 ; vCell_IJK[ I_AXIS ] < self->resolution[ I_AXIS ] ; vCell_IJK[ I_AXIS ]++ ) {
+		Journal_Printf( stream, "_" );
+	}
+	Journal_Printf( stream, "\n" );
+
+	for ( vCell_IJK[J_AXIS] = self->resolution[J_AXIS] - 1 ; vCell_IJK[ J_AXIS ] != (Index) -1 ; vCell_IJK[ J_AXIS ]-- ) {
+		Journal_Printf( stream, "|" );
+		for ( vCell_IJK[ I_AXIS ] = 0 ; vCell_IJK[ I_AXIS ] < self->resolution[ I_AXIS ] ; vCell_IJK[ I_AXIS ]++ ) {
+			Dimension_3DTo1D( vCell_IJK, self->resolution, &vCell_I );
+			cell = &self->cellList[ vCell_I ];
+
+			if ( cell->claimedParticle == CELLULAR_AUTOMATA_UNCLAIMED ) {
+				if ( cell->particleToCheck == NO_CHECK ) {
+					c = ' ';
+				}
+				else {
+					c = '*';
+				}
+			}
+			else { /* Cell is claimed */
+				if ( cell->particleToCheck == NO_CHECK ) {
+					c = '0' + cell->claimedParticle;
+				}
+				else {
+					c = '?';
+				}
+			}
+
+
+			Journal_Printf( stream, "%c", c );
+		}
+		Journal_Printf( stream, "|\n" );
+	}
+	/* Draw Line at bottom of box */
+	Journal_Printf( stream, " " );
+	for ( vCell_IJK[ I_AXIS ] = 0 ; vCell_IJK[ I_AXIS ] < self->resolution[ I_AXIS ] ; vCell_IJK[ I_AXIS ]++ )
+		Journal_Printf( stream, "-" );
+	Journal_Printf( stream, "\n" );
+}
+
+
+void CellularAutomataVoronoiCellList_Build( CellularAutomataVoronoiCellList* cellList ) {
+	cellList->cellsAllocated = MEMORY_DELTA;
+	cellList->array = Memory_Alloc_Array( CellularAutomataVoronoiCell*, cellList->cellsAllocated, "CellList" );
+}
+
+void CellularAutomataVoronoiCellList_AddCell( CellularAutomataVoronoiCellList* cellList, CellularAutomataVoronoiCell* cell ) {
+	/* See if memory needs to be allocated */
+	if ( cellList->cellCount >= cellList->cellsAllocated ) {
+		cellList->cellsAllocated = cellList->cellCount + MEMORY_DELTA;
+		cellList->array = Memory_Realloc_Array( cellList->array, CellularAutomataVoronoiCell*, cellList->cellsAllocated );
+	}
+
+	/* Add cell to this list */
+	cellList->array[ cellList->cellCount ] = cell;
+			
+	/* Increment count for list */
+	cellList->cellCount++;
+}
+
+void CellularAutomataVoronoi_CalcSubCells( CellularAutomataVoronoi* self, Swarm* swarm, unsigned cellInd ) {
+	/* Sanity check. */
+	assert( self );
+	assert( swarm );
+
+	if( self->dim == 2 )
+		CellularAutomataVoronoi_CalcSubCells2D( self, swarm, cellInd );
+	else
+		CellularAutomataVoronoi_CalcSubCells3D( self, swarm, cellInd );
+}
+
+void CellularAutomataVoronoi_CalcSubCells2D( CellularAutomataVoronoi* self, Swarm* swarm, unsigned cellInd ) {
+	FiniteElement_Mesh*	mesh;
+	unsigned		nSubCells;
+	unsigned*		res;
+	double**		gCrds;
+	double**		lCrds;
+	unsigned		d_i, d_j;
+
+	/* Sanity check. */
+	assert( self );
+	assert( swarm );
+
+	/* Shortcuts. */
+	nSubCells = self->claimedCellCount;
+	res = self->resolution;
+	mesh = (FiniteElement_Mesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh);
+
+	/* NOTE: It is assumed in an earlier function that the cell layout is based on the
+	   mesh's elements; I continue that assumption here. */
+
+	/* Need space for the coordinates that comprise this sub-cell. */
+	gCrds = Memory_Alloc_2DArray( double, 4, 3, "" );
+	lCrds = Memory_Alloc_2DArray( double, 4, 3, "" );
+
+	/* Calculate the volume of each cell. */
+	for( d_j = 0; d_j < res[1]; d_j++ ) {
+		lCrds[0][1] = (double)d_j * self->dx[1] - 1.0;
+		lCrds[1][1] = (double)d_j * self->dx[1] - 1.0;
+		lCrds[2][1] = (double)(d_j + 1) * self->dx[1] - 1.0;
+		lCrds[3][1] = (double)(d_j + 1) * self->dx[1] - 1.0;
+
+		for( d_i = 0; d_i < res[0]; d_i++ ) {
+			unsigned	subCellInd = d_j * res[0] + d_i;
+			unsigned	c_i;
+
+			lCrds[0][0] = (double)d_i * self->dx[0] - 1.0;
+			lCrds[1][0] = (double)(d_i + 1) * self->dx[0] - 1.0;
+			lCrds[2][0] = (double)d_i * self->dx[0] - 1.0;
+			lCrds[3][0] = (double)(d_i + 1) * self->dx[0] - 1.0;
+
+			/* Map the local coordinates back to globals. */
+			for( c_i = 0; c_i < 4; c_i++ ) {
+				FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, 
+										  self->dim, 
+										  cellInd, 
+										  lCrds[c_i], 
+										  gCrds[c_i] );
+			}
+
+			/* Calculate the volume. */
+			self->cellVolumes[subCellInd] = CellularAutomataVoronoi_QuadArea( self, gCrds );
+
+			/* Calculate centroid. */
+			CellularAutomataVoronoi_QuadCentroid( self, gCrds, self->cellList[subCellInd].centroid );
+		}
+	}
+
+	/* Free memory. */
+	FreeArray( gCrds );
+	FreeArray( lCrds );
+}
+
+void CellularAutomataVoronoi_CalcSubCells3D( CellularAutomataVoronoi* self, Swarm* swarm, unsigned cellInd ) {
+	const double		volWeight = 8.0;
+	const double		sign[3][8] = {{-1, 1, -1, 1, -1, 1, -1, 1}, 
+					      {-1, -1, 1, 1, -1, -1, 1, 1}, 
+					      {-1, -1, -1, -1, 1, 1, 1, 1}};
+	FiniteElement_Mesh*	mesh;
+	unsigned		nSubCells;
+	unsigned*		res;
+	double**		gCrds;
+	double**		lCrds;
+	Coord*			gCrdPtrs[8];
+	ElementType*		elType;
+	unsigned		d_i, d_j, d_k;
+
+	/* Sanity check. */
+	assert( self );
+	assert( swarm );
+
+	/* Shortcuts. */
+	nSubCells = self->claimedCellCount;
+	res = self->resolution;
+	mesh = (FiniteElement_Mesh*)(((ElementCellLayout*)swarm->cellLayout)->mesh);
+	elType = FiniteElement_Mesh_ElementTypeAt( mesh, cellInd );
+
+	/* NOTE: It is assumed in an earlier function that the cell layout is based on the
+	   mesh's elements; I continue that assumption here. */
+
+	/* Need space for the coordinates that comprise this sub-cell. */
+	gCrds = Memory_Alloc_2DArray( double, 8, 3, "" );
+	lCrds = Memory_Alloc_2DArray( double, 8, 3, "" );
+
+	/* Calculate the volume of each cell. */
+	for( d_k = 0; d_k < res[2]; d_k++ ) {
+		lCrds[0][2] = (double)d_k * self->dx[2] - 1.0;
+		lCrds[1][2] = (double)d_k * self->dx[2] - 1.0;
+		lCrds[2][2] = (double)d_k * self->dx[2] - 1.0;
+		lCrds[3][2] = (double)d_k * self->dx[2] - 1.0;
+		lCrds[4][2] = (double)(d_k + 1) * self->dx[2] - 1.0;
+		lCrds[5][2] = (double)(d_k + 1) * self->dx[2] - 1.0;
+		lCrds[6][2] = (double)(d_k + 1) * self->dx[2] - 1.0;
+		lCrds[7][2] = (double)(d_k + 1) * self->dx[2] - 1.0;
+
+		for( d_j = 0; d_j < res[1]; d_j++ ) {
+			lCrds[0][1] = (double)d_j * self->dx[1] - 1.0;
+			lCrds[1][1] = (double)d_j * self->dx[1] - 1.0;
+			lCrds[2][1] = (double)(d_j + 1) * self->dx[1] - 1.0;
+			lCrds[3][1] = (double)(d_j + 1) * self->dx[1] - 1.0;
+			lCrds[4][1] = (double)d_j * self->dx[1] - 1.0;
+			lCrds[5][1] = (double)d_j * self->dx[1] - 1.0;
+			lCrds[6][1] = (double)(d_j + 1) * self->dx[1] - 1.0;
+			lCrds[7][1] = (double)(d_j + 1) * self->dx[1] - 1.0;
+
+			for( d_i = 0; d_i < res[0]; d_i++ ) {
+				unsigned	subCellInd = d_k * res[0] * res[1] + d_j * res[0] + d_i;
+				double		jac[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
+				double		jacDet;
+				unsigned	c_i;
+
+				/* Calculate the local coordinates. */
+				lCrds[0][0] = (double)d_i * self->dx[0] - 1.0;
+				lCrds[1][0] = (double)(d_i + 1) * self->dx[0] - 1.0;
+				lCrds[2][0] = (double)d_i * self->dx[0] - 1.0;
+				lCrds[3][0] = (double)(d_i + 1) * self->dx[0] - 1.0;
+				lCrds[4][0] = (double)d_i * self->dx[0] - 1.0;
+				lCrds[5][0] = (double)(d_i + 1) * self->dx[0] - 1.0;
+				lCrds[6][0] = (double)d_i * self->dx[0] - 1.0;
+				lCrds[7][0] = (double)(d_i + 1) * self->dx[0] - 1.0;
+
+				/* Map the local coordinates back to globals. */
+				for( c_i = 0; c_i < 8; c_i++ ) {
+					/* Build a list of global coordinate pointers. */
+					gCrdPtrs[c_i] = (Coord*)(gCrds + c_i);
+
+					/* Convert to local coordinates. */
+					FiniteElement_Mesh_CalcGlobalCoordFromLocalCoord( mesh, 
+											  self->dim, 
+											  cellInd, 
+											  lCrds[c_i], 
+											  gCrds[c_i] );
+
+					/* Calculate the jacobian. */
+					jac[0][0] += 0.125 * sign[0][c_i] * gCrds[c_i][0];
+					jac[1][0] += 0.125 * sign[1][c_i] * gCrds[c_i][0];
+					jac[2][0] += 0.125 * sign[2][c_i] * gCrds[c_i][0];
+					jac[0][1] += 0.125 * sign[0][c_i] * gCrds[c_i][1];
+					jac[1][1] += 0.125 * sign[1][c_i] * gCrds[c_i][1];
+					jac[2][1] += 0.125 * sign[2][c_i] * gCrds[c_i][1];
+					jac[0][2] += 0.125 * sign[0][c_i] * gCrds[c_i][2];
+					jac[1][2] += 0.125 * sign[1][c_i] * gCrds[c_i][2];
+					jac[2][2] += 0.125 * sign[2][c_i] * gCrds[c_i][2];
+				}
+
+				/* Calculate centroid. */
+				CellularAutomataVoronoi_HexCentroid( self, gCrds, self->cellList[subCellInd].centroid );
+
+				/* Calculate the volume. Doing this for irregular hexahedron is a little tricky. */
+				jacDet = jac[0][0] * (jac[1][1] * jac[2][2] - jac[2][1] * jac[1][2]) - 
+					jac[1][0] * (jac[0][1] * jac[2][2] - jac[2][1] * jac[0][2]) + 
+					jac[2][0] * (jac[0][1] * jac[1][2] - jac[1][1] * jac[0][2]);
+				self->cellVolumes[subCellInd] = volWeight * jacDet;
+			}
+		}
+	}
+
+	/* Free memory. */
+	FreeArray( gCrds );
+	FreeArray( lCrds );
+}
+
+double CellularAutomataVoronoi_QuadArea( CellularAutomataVoronoi* self, double** gCrds ) {
+	double	area;
+	double	vecs[4][2];
+	double	diags[2][2];
+
+	/* Sanity check. */
+	assert( self );
+	assert( gCrds );
+
+	vecs[0][0] = gCrds[1][0] - gCrds[0][0];	vecs[0][1] = gCrds[1][1] - gCrds[0][1];
+	vecs[1][0] = gCrds[3][0] - gCrds[1][0];	vecs[1][1] = gCrds[3][1] - gCrds[1][1];
+	vecs[2][0] = gCrds[2][0] - gCrds[3][0];	vecs[2][1] = gCrds[2][1] - gCrds[3][1];
+	vecs[3][0] = gCrds[0][0] - gCrds[2][0];	vecs[3][1] = gCrds[0][1] - gCrds[2][1];
+
+	diags[0][0] = vecs[0][0] + vecs[1][0];	diags[0][1] = vecs[0][1] + vecs[1][1];
+	diags[1][0] = vecs[1][0] + vecs[2][0];	diags[1][1] = vecs[1][1] + vecs[2][1];
+
+	/* Calculate the area from the diagonals. */
+	area = diags[0][0] * diags[1][1] - diags[0][1] * diags[1][0];
+	area *= (area < 0.0) ? -0.5 : 0.5;
+
+	return area;
+}
+
+void CellularAutomataVoronoi_QuadCentroid( CellularAutomataVoronoi* self, double** gCrds, Coord centroid ) {
+	unsigned	c_i;
+
+	/* Sanity check. */
+	assert( self );
+	assert( gCrds );
+
+	/* The centroid of a convex quadrilateral is the average of it's corners. */
+	centroid[0] = gCrds[0][0];
+	centroid[1] = gCrds[0][1];
+	for( c_i = 1; c_i < 4; c_i++ ) {
+		centroid[0] += gCrds[c_i][0];
+		centroid[1] += gCrds[c_i][1];
+	}
+	centroid[0] *= 0.25;
+	centroid[1] *= 0.25;
+}
+
+void CellularAutomataVoronoi_HexCentroid( CellularAutomataVoronoi* self, double** gCrds, Coord centroid ) {
+	unsigned	c_i;
+
+	/* Sanity check. */
+	assert( self );
+	assert( gCrds );
+
+	/* The centroid of a convex hexahedron is the average of it's corners. */
+	centroid[0] = gCrds[0][0];
+	centroid[1] = gCrds[0][1];
+	centroid[2] = gCrds[0][2];
+	for( c_i = 1; c_i < 8; c_i++ ) {
+		centroid[0] += gCrds[c_i][0];
+		centroid[1] += gCrds[c_i][1];
+		centroid[2] += gCrds[c_i][2];
+	}
+	centroid[0] *= 0.125;
+	centroid[1] *= 0.125;
+	centroid[2] *= 0.125;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/CellularAutomataVoronoi.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/CellularAutomataVoronoi.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,174 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: CellularAutomataVoronoi.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Voronoi_CellularAutomataVoronoi_h__
+#define __PICellerator_Voronoi_CellularAutomataVoronoi_h__
+
+	/* Textual name of this class */
+	extern const Type CellularAutomataVoronoi_Type;
+
+	extern const unsigned int CELLULAR_AUTOMATA_UNCLAIMED;
+
+	typedef Particle_InCellIndex                           BattlePair[2];
+
+	typedef struct {
+		BattlePair*                                        battlePair;
+		Index                                              battleCount;
+		Index                                              battlesAllocated;
+	} CellularAutomataVoronoiBattleHistory;
+	
+	typedef struct CellularAutomataVoronoiCell             CellularAutomataVoronoiCell;
+	struct CellularAutomataVoronoiCell {
+		Coord                                              centroid;
+		CellularAutomataVoronoiBattleHistory               battleHistory;
+		CellularAutomataVoronoiCell**                      neighbourCellList;
+		Voronoi_CellIndex                                  neighbourCount;
+		Voronoi_CellIndex                                  neighboursAllocated;
+		Particle_InCellIndex                               claimedParticle;
+		Particle_InCellIndex                               particleToCheck;
+	};
+
+	typedef struct {
+		CellularAutomataVoronoiCell**                      array;
+		Voronoi_CellIndex                                  cellCount;
+		Voronoi_CellIndex                                  cellsAllocated;
+	} CellularAutomataVoronoiCellList;
+
+	/* CellularAutomataVoronoi information */
+	#define __CellularAutomataVoronoi \
+		/* General info */ \
+		__DiscreteVoronoi \
+		/* Virtual Info */\
+		\
+		/* Other Info */\
+		IJK                                                resolution;             \
+		Bool                                               diagonalNeighbours;     \
+		CellularAutomataVoronoiCell*                       cellList;               \
+		XYZ                                                dx;                     \
+		double*                                            cellVolumes;            \
+		CellularAutomataVoronoiCellList                    cellsToGrow;            \
+		CellularAutomataVoronoiCellList                    cellsToCheck;           \
+		/* Current Info */ \
+		Swarm*                                             swarm;                  \
+		Cell_LocalIndex                                    lCell_I;                \
+		
+	struct CellularAutomataVoronoi { __CellularAutomataVoronoi };
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	CellularAutomataVoronoi* _CellularAutomataVoronoi_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,		
+		DiscreteVoronoi_CalculateForCellFunction*          _calculate,
+		DiscreteVoronoi_GetParticleIndexFunction*          _getParticleIndex,
+		DiscreteVoronoi_GetVolumeFunction*                 _getVolume,
+		DiscreteVoronoi_GetCentroidFunction*               _getCentroid,
+		Name                                               name );			
+
+	/* Stg_Class implementations */
+	void _CellularAutomataVoronoi_Delete( void* cellularAutomataVoronoi );
+	void _CellularAutomataVoronoi_Print( void* cellularAutomataVoronoi, Stream* stream );
+	#define CellularAutomataVoronoi_Copy( self ) \
+		(CellularAutomataVoronoi*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define CellularAutomataVoronoi_DeepCopy( self ) \
+		(CellularAutomataVoronoi*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _CellularAutomataVoronoi_Copy( void* cellularAutomataVoronoi, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void* _CellularAutomataVoronoi_DefaultNew( Name name ) ;
+void _CellularAutomataVoronoi_Construct( void* cellularAutomataVoronoi, Stg_ComponentFactory* cf, void* data ) ;
+	void _CellularAutomataVoronoi_Build( void* cellularAutomataVoronoi, void* data ) ;
+	void _CellularAutomataVoronoi_Initialise( void* cellularAutomataVoronoi, void* data ) ;
+	void _CellularAutomataVoronoi_Execute( void* cellularAutomataVoronoi, void* data );
+	void _CellularAutomataVoronoi_Destroy( void* cellularAutomataVoronoi, void* data ) ;
+	
+	/* Discrete Voronoi implementations */
+	void _CellularAutomataVoronoi_CalculateForCell( void* cellularAutomataVoronoi, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	Particle_InCellIndex _CellularAutomataVoronoi_GetParticleIndex( void* discreteVoronoi, Voronoi_CellIndex vCell_I );
+	double _CellularAutomataVoronoi_GetVolume(void* discreteVoronoi, Voronoi_CellIndex vCell_I );
+	void _CellularAutomataVoronoi_GetCentroid(void* discreteVoronoi, Voronoi_CellIndex vCell_I, Coord centroid );
+
+	/* Other functions */
+	void CellularAutomataVoronoi_CheckCells( void* cellularAutomataVoronoi ) ;
+	void CellularAutomataVoronoi_GrowCells( void* cellularAutomataVoronoi ) ;
+	Particle_InCellIndex CellularAutomataVoronoi_Battle(
+		void*                                              cellularAutomataVoronoi, 
+		CellularAutomataVoronoiCell*                       cell, 
+		Particle_InCellIndex                               champion_I, 
+		Particle_InCellIndex                               contender_I );
+
+	void CellularAutomataVoronoi_InitialiseCell( void* cellularAutomataVoronoi, Swarm* swarm, Cell_LocalIndex lCell_I ) ;
+	void CellularAutomataVoronoi_AddNeighbourToCell( void* cellularAutomataVoronoi, CellularAutomataVoronoiCell* cell, Index iIndex, Index jIndex, Index kIndex ) ;
+	void CellularAutomataVoronoi_Seed( void* cellularAutomataVoronoi ) ;
+
+	void CellularAutomataVoronoi_AsciiArt( void* cellularAutomataVoronoi ) ;
+
+	void CellularAutomataVoronoiCellList_Build( CellularAutomataVoronoiCellList* cellList ) ;
+	void CellularAutomataVoronoiCellList_AddCell( CellularAutomataVoronoiCellList* cellList, CellularAutomataVoronoiCell* cell ) ;
+
+	void CellularAutomataVoronoi_CalcSubCells( CellularAutomataVoronoi* self, Swarm* swarm, unsigned cellInd );
+	void CellularAutomataVoronoi_CalcSubCells2D( CellularAutomataVoronoi* self, Swarm* swarm, unsigned cellInd );
+	void CellularAutomataVoronoi_CalcSubCells3D( CellularAutomataVoronoi* self, Swarm* swarm, unsigned cellInd );
+	double CellularAutomataVoronoi_QuadArea( CellularAutomataVoronoi* self, double** gCrds );
+	void CellularAutomataVoronoi_QuadCentroid( CellularAutomataVoronoi* self, double** gCrds, Coord centroid );
+	void CellularAutomataVoronoi_HexCentroid( CellularAutomataVoronoi* self, double** gCrds, Coord centroid );
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/CellularAutomataVoronoi.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/CellularAutomataVoronoi.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">CellularAutomataVoronoi</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Voronoi/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">DiscreteVoronoi</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolution", 10 );
+	<struct>
+                <param name="Name">resolution</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">10</param>
+		<param name="Description">Sets the number of discrete voronoi cells in all dimensions to be the same (orthotropic). Note if you specify individual resolutions as well then those values will override this orthotropic resolution.</param>
+	</struct>
+	<struct>
+                <param name="Name">resolutionX</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">Sets the number of discrete voronoi cells in the X direction.</param>
+	</struct>
+	<struct>
+                <param name="Name">resolutionY</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">Sets the number of discrete voronoi cells in the Y direction.</param>
+	</struct>
+	<struct>
+                <param name="Name">resolutionZ</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">defaultResolution</param>
+		<param name="Description">Sets the number of discrete voronoi cells in the Z direction.</param>
+	</struct>
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">PICellerator/Apps/PIC_Components/MaterialPointSwarm.xml</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/DiscreteVoronoi.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/DiscreteVoronoi.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,257 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: DiscreteVoronoi.c 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "DiscreteVoronoi.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+/* Textual name of this class */
+const Type DiscreteVoronoi_Type = "DiscreteVoronoi";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+
+DiscreteVoronoi* _DiscreteVoronoi_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,		
+		DiscreteVoronoi_CalculateForCellFunction*          _calculateForCell,
+		DiscreteVoronoi_GetParticleIndexFunction*          _getParticleIndex,
+		DiscreteVoronoi_GetVolumeFunction*                 _getVolume,
+		DiscreteVoronoi_GetCentroidFunction*               _getCentroid,
+		Name                                               name )
+{
+	DiscreteVoronoi* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(DiscreteVoronoi) );
+	self = (DiscreteVoronoi*)_Stg_Component_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			name ,
+			NON_GLOBAL );
+	
+	/* General info */
+
+	/* Virtual Info */
+	self->_calculateForCell = _calculateForCell;
+	self->_getParticleIndex = _getParticleIndex;
+	self->_getVolume        = _getVolume;
+	self->_getCentroid      = _getCentroid;
+	
+	return self;
+}
+
+void _DiscreteVoronoi_Init( void* discreteVoronoi, Dimension_Index dim ) {
+	DiscreteVoronoi* self = (DiscreteVoronoi*)discreteVoronoi;
+	
+	self->isConstructed = True;
+	self->dim = dim;
+}
+
+
+void DiscreteVoronoi_InitAll( void* discreteVoronoi, Dimension_Index dim ){
+	DiscreteVoronoi* self = (DiscreteVoronoi*)discreteVoronoi;
+
+	_DiscreteVoronoi_Init( self, dim );
+}
+	
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _DiscreteVoronoi_Delete( void* discreteVoronoi ) {
+	DiscreteVoronoi* self = (DiscreteVoronoi*)discreteVoronoi;
+	
+	/* Delete parent */
+	_Stg_Component_Delete( self );
+}
+
+
+void _DiscreteVoronoi_Print( void* discreteVoronoi, Stream* stream ) {
+	DiscreteVoronoi* self = (DiscreteVoronoi*)discreteVoronoi;
+	
+	/* Print parent */
+	_Stg_Component_Print( self, stream );
+}
+
+
+void* _DiscreteVoronoi_Copy( void* discreteVoronoi, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	DiscreteVoronoi*	self = (DiscreteVoronoi*)discreteVoronoi;
+	DiscreteVoronoi*	newDiscreteVoronoi;
+	
+	newDiscreteVoronoi = (DiscreteVoronoi*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newDiscreteVoronoi;
+}
+
+
+
+void _DiscreteVoronoi_Construct( void* discreteVoronoi, Stg_ComponentFactory* cf, void* data ) {
+	DiscreteVoronoi*	 self          = (DiscreteVoronoi*) discreteVoronoi;
+	Dimension_Index      dim;
+
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+
+	_DiscreteVoronoi_Init( self, dim );
+}
+
+void _DiscreteVoronoi_Build( void* discreteVoronoi, void* data ) {
+}
+void _DiscreteVoronoi_Initialise( void* discreteVoronoi, void* data ) {
+}
+void _DiscreteVoronoi_Execute( void* discreteVoronoi, void* data ) {
+}
+void _DiscreteVoronoi_Destroy( void* discreteVoronoi, void* data ) {
+}
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+void DiscreteVoronoi_CalculateForCell( void* discreteVoronoi, void* _swarm, Cell_LocalIndex lCell_I ) {
+	DiscreteVoronoi*	 self          = (DiscreteVoronoi*) discreteVoronoi;
+
+	self->_calculateForCell( self, _swarm, lCell_I );
+}
+
+DiscreteVoronoiParticleInfo* DiscreteVoronoi_CreateParticleInfo( void* discreteVoronoi, void* _swarm, Cell_LocalIndex lCell_I ) {
+	DiscreteVoronoi*	         self          = (DiscreteVoronoi*) discreteVoronoi;
+	Swarm*                       swarm         = (Swarm*)                 _swarm;
+	DiscreteVoronoiParticleInfo* particleInfoArray;
+	DiscreteVoronoiParticleInfo* currParticleInfo;
+	Particle_InCellIndex         cellParticleCount = swarm->cellParticleCountTbl[lCell_I];
+	Particle_InCellIndex         cParticle_I;
+	Voronoi_CellIndex            vCell_I;
+	double                       volume;
+	Coord                        centroid;
+	Dimension_Index              dim           = self->dim;
+
+	particleInfoArray = Memory_Alloc_Array( DiscreteVoronoiParticleInfo, cellParticleCount, "particle info" );
+	memset(particleInfoArray, 0, sizeof( DiscreteVoronoiParticleInfo ) * cellParticleCount );
+	
+	/* Add volumes and centroids */
+	for ( vCell_I = 0 ; vCell_I < self->claimedCellCount ; vCell_I++ ) {
+		/* Get Information for this voronoi cell */
+		cParticle_I = DiscreteVoronoi_GetParticleIndex( self, vCell_I );
+		volume = DiscreteVoronoi_GetVolume( self, vCell_I );
+		DiscreteVoronoi_GetCentroid( self, vCell_I, centroid );
+
+		currParticleInfo = &particleInfoArray[ cParticle_I ];
+		
+		currParticleInfo->volume += volume;
+
+		currParticleInfo->centroid[ I_AXIS ] += volume * centroid[ I_AXIS ];
+		currParticleInfo->centroid[ J_AXIS ] += volume * centroid[ J_AXIS ];
+		if ( dim == 3 )
+			currParticleInfo->centroid[ K_AXIS ] += volume * centroid[ K_AXIS ];
+
+		currParticleInfo->voronoiCellCount++;
+	}
+
+	/* Set particle numbers and normalise centroids */
+	for ( cParticle_I = 0 ; cParticle_I < cellParticleCount ; cParticle_I++ ) {
+		currParticleInfo = &particleInfoArray[ cParticle_I ];
+	
+		currParticleInfo->particle_I = cParticle_I;
+		volume = currParticleInfo->volume;
+		
+		/* Sort out coordinate for centroid */
+		if ( currParticleInfo->voronoiCellCount > 0 ) {
+			currParticleInfo->centroid[ I_AXIS ] /= volume;
+			currParticleInfo->centroid[ J_AXIS ] /= volume;
+			if ( dim == 3 )
+				currParticleInfo->centroid[ K_AXIS ] /= volume;
+		}
+		else {
+			GlobalParticle* particle = (GlobalParticle*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+			/* If this particle hasn't claimed any voronoi cells - 
+			 * then the centroid is co-incident with the particle */
+			memcpy( currParticleInfo->centroid, particle->coord, dim*sizeof(double) );
+		}
+	}
+
+	return particleInfoArray;
+}
+
+int _DiscreteVoronoiParticleInfo_CompareVolume(const void * _pInfoA, const void * _pInfoB) {
+	DiscreteVoronoiParticleInfo* pInfoA = (DiscreteVoronoiParticleInfo*) _pInfoA;
+	DiscreteVoronoiParticleInfo* pInfoB = (DiscreteVoronoiParticleInfo*) _pInfoB;
+
+	if ( pInfoA->volume < pInfoB->volume )
+		return -1;
+	else 
+		return 1;
+}
+	
+/* Sorts the particle info list in order of volume - from smallest volume to largest */
+void DiscreteVoronoiParticleInfo_SortByVolume( DiscreteVoronoiParticleInfo* particleInfo, Particle_InCellIndex cellParticleCount ) {
+	qsort(particleInfo, cellParticleCount, sizeof(DiscreteVoronoiParticleInfo), _DiscreteVoronoiParticleInfo_CompareVolume);
+}
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/DiscreteVoronoi.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/DiscreteVoronoi.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,149 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: DiscreteVoronoi.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Voronoi_DiscreteVoronoi_h__
+#define __PICellerator_Voronoi_DiscreteVoronoi_h__
+
+	typedef void (DiscreteVoronoi_CalculateForCellFunction)
+		( void* discreteVoronoi, void* _swarm, Cell_LocalIndex lCell_I );
+	typedef Particle_InCellIndex (DiscreteVoronoi_GetParticleIndexFunction)    
+		( void* discreteVoronoi, Voronoi_CellIndex vCell_I );
+	typedef double (DiscreteVoronoi_GetVolumeFunction)     
+		( void* discreteVoronoi, Voronoi_CellIndex vCell_I );
+	typedef void (DiscreteVoronoi_GetCentroidFunction)     
+		( void* discreteVoronoi, Voronoi_CellIndex vCell_I, Coord centroid );
+
+	/* Textual name of this class */
+	extern const Type DiscreteVoronoi_Type;
+
+	/* DiscreteVoronoi information */
+	#define __DiscreteVoronoi \
+		/* General info */ \
+		__Stg_Component \
+		/* Virtual Info */\
+		DiscreteVoronoi_CalculateForCellFunction*  _calculateForCell;        \
+		DiscreteVoronoi_GetParticleIndexFunction*  _getParticleIndex;        \
+		DiscreteVoronoi_GetVolumeFunction*         _getVolume;               \
+		DiscreteVoronoi_GetCentroidFunction*       _getCentroid;             \
+		/* Other Info */\
+		Dimension_Index                            dim;                      \
+		Voronoi_CellIndex                          claimedCellCount; 
+
+	struct DiscreteVoronoi { __DiscreteVoronoi };
+	
+	struct DiscreteVoronoiParticleInfo {
+		Coord                centroid;
+		double               volume;
+		Particle_InCellIndex particle_I;
+		Voronoi_CellIndex    voronoiCellCount;
+	};
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	DiscreteVoronoi* _DiscreteVoronoi_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,		
+		DiscreteVoronoi_CalculateForCellFunction*  _calculate,
+		DiscreteVoronoi_GetParticleIndexFunction*  _getParticleIndex,
+		DiscreteVoronoi_GetVolumeFunction*         _getVolume,
+		DiscreteVoronoi_GetCentroidFunction*       _getCentroid,
+		Name                                       name );
+	
+	void _DiscreteVoronoi_Init( void* discreteVoronoi , Dimension_Index dim) ;
+	void DiscreteVoronoi_InitAll( void* discreteVoronoi, Dimension_Index dim );
+
+	/* Stg_Class_Delete DiscreteVoronoi implementation */
+	void _DiscreteVoronoi_Delete( void* discreteVoronoi );
+	void _DiscreteVoronoi_Print( void* discreteVoronoi, Stream* stream );
+	#define DiscreteVoronoi_Copy( self ) \
+		(DiscreteVoronoi*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define DiscreteVoronoi_DeepCopy( self ) \
+		(DiscreteVoronoi*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _DiscreteVoronoi_Copy( void* discreteVoronoi, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+void _DiscreteVoronoi_Construct( void* shape, Stg_ComponentFactory* cf, void* data ) ;
+	void _DiscreteVoronoi_Build( void* discreteVoronoi, void* data ) ;
+	void _DiscreteVoronoi_Initialise( void* discreteVoronoi, void* data ) ;
+	void _DiscreteVoronoi_Execute( void* discreteVoronoi, void* data );
+	void _DiscreteVoronoi_Destroy( void* discreteVoronoi, void* data ) ;
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+
+	/* Wrappers for virtual functions */
+	void DiscreteVoronoi_CalculateForCell( void* discreteVoronoi, void* _swarm, Cell_LocalIndex lCell_I );
+	#define DiscreteVoronoi_GetParticleIndex( discreteVoronoi, vCell_I ) \
+		( ( (DiscreteVoronoi*) discreteVoronoi )->_getParticleIndex( discreteVoronoi, vCell_I ) )
+	#define DiscreteVoronoi_GetVolume( discreteVoronoi, vCell_I ) \
+		( ( (DiscreteVoronoi*) discreteVoronoi )->_getVolume( discreteVoronoi, vCell_I ) )
+	#define DiscreteVoronoi_GetCentroid( discreteVoronoi, vCell_I, centroid ) \
+		( ( (DiscreteVoronoi*) discreteVoronoi )->_getCentroid( discreteVoronoi, vCell_I, centroid ) )
+
+	
+	DiscreteVoronoiParticleInfo* DiscreteVoronoi_CreateParticleInfo( void* discreteVoronoi, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	void DiscreteVoronoiParticleInfo_SortByVolume( DiscreteVoronoiParticleInfo* particleInfo, Particle_InCellIndex cellParticleCount ) ;
+	
+	#define DiscreteVoronoiParticleInfo_Delete( particleInfo ) \
+		Memory_Free( (particleInfo) )
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/DiscreteVoronoi.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/DiscreteVoronoi.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">DiscreteVoronoi</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Voronoi/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">dim</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">0</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/Finalise.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/Finalise.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Finalise.c 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+
+#include "types.h"
+#include "Finalise.h"
+
+#include <stdio.h>
+
+Bool PICellerator_Voronoi_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/Finalise.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/Finalise.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,60 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Finalise.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Voronoi_Finalise_h__
+#define __PICellerator_Voronoi_Finalise_h__
+	
+	Bool PICellerator_Voronoi_Finalise( void ) ;
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/Init.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/Init.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,66 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Init.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "Voronoi.h"
+
+#include <stdio.h>
+
+Bool PICellerator_Voronoi_Init( int* argc, char** argv[] ) {
+	Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
+
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+
+	Stg_ComponentRegister_Add( componentsRegister, AdaptiveVoronoi_Type,         "0", _AdaptiveVoronoi_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, CellularAutomataVoronoi_Type, "0", _CellularAutomataVoronoi_DefaultNew );
+
+	RegisterParent( DiscreteVoronoi_Type, Stg_Component_Type );
+	RegisterParent( AdaptiveVoronoi_Type, DiscreteVoronoi_Type );
+	RegisterParent( CellularAutomataVoronoi_Type, DiscreteVoronoi_Type );
+	
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/Init.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/Init.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	performs and pre-running initialisation necessary in this directory.
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Init.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Voronoi_Init_h__
+#define __PICellerator_Voronoi_Init_h__
+	
+	Bool PICellerator_Voronoi_Init( int* argc, char** argv[] );
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/Voronoi.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/Voronoi.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,63 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Voronoi.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Voronoi_h__
+#define __PICellerator_Voronoi_h__
+
+	#include "types.h"
+	#include "Init.h"
+	#include "Finalise.h"
+	#include "DiscreteVoronoi.h"
+	#include "AdaptiveVoronoi.h"
+	#include "CellularAutomataVoronoi.h"
+
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,65 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN MPI XML
+
+# Work out name to call library
+lib = ${PROJECT}$(shell basename `pwd | sed s/src//g`)
+libstatic = yes
+libdynamic = yes
+
+# Name of directory to place header files
+includes := ${PROJECT}/$(shell basename `pwd | sed s/src//g`)
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/src/types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/src/types.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,69 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Basic framework types.
+**
+** Assumptions:
+**	None as yet.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: types.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Voronoi_types_h__
+#define __PICellerator_Voronoi_types_h__
+
+	typedef struct DiscreteVoronoi              DiscreteVoronoi;
+	typedef struct DiscreteVoronoiParticleInfo  DiscreteVoronoiParticleInfo;
+	typedef struct AdaptiveVoronoi              AdaptiveVoronoi;
+	typedef struct CellularAutomataVoronoi      CellularAutomataVoronoi;
+
+	/* Types, for readability */
+	typedef Index                             Voronoi_CellIndex;
+	typedef Index                             Vertex_Index;
+
+#endif
+
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/expected/testAdaptiveVoronoi2D.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/expected/testAdaptiveVoronoi2D.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+totalAreaError = 0.0
+particlesCorrectlyAssociated = True
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/expected/testCellularAutomataVoronoi2D.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/expected/testCellularAutomataVoronoi2D.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+totalAreaError = 0.0
+particlesCorrectlyAssociated = True
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,55 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := plugins
+
+checks = $(wildcard *.sh)
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/plugins/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/plugins/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,57 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN MPI XML 
+
+# Note don't put the .c extension. just the base name of the plugin
+plugins := testDiscreteVoronoi
+
+include ${PROJ_ROOT}/Makefile.vmake
+
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/plugins/testDiscreteVoronoi.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/plugins/testDiscreteVoronoi.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,154 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: testDiscreteVoronoi.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+const Type TestDiscreteVoronoi_Type = "TestDiscreteVoronoi";
+
+void PICellerator_testDiscreteVoronoi( DiscretisationContext* context ) {
+	Swarm*              swarm;
+	DiscreteVoronoi*    discreteVoronoi;
+	Bool                particlesCorrectlyAssociated = True;
+	double              totalAreaError               = 0.0;
+	Cell_Index          lCell_I;
+	Stream*             stream                       = Journal_Register( Info_Type, CURR_MODULE_NAME );
+	Particle_InCellIndex assignedParticle, closestParticle;
+
+	/* Get Stg_Components */
+	swarm = (Swarm*)                     LiveComponentRegister_Get( context->CF->LCRegister, "swarm" );
+	assert(swarm);
+	discreteVoronoi = (DiscreteVoronoi*) LiveComponentRegister_Get( context->CF->LCRegister, "discreteVoronoi" );
+	assert(discreteVoronoi);
+
+	for ( lCell_I = 0 ; lCell_I < swarm->cellLocalCount ; lCell_I++ ) {
+		double                      area = 0.0;
+		Cell_Index                  vCell_I;
+		Voronoi_CellIndex           claimedCellsCount;
+		double                      cellArea;
+		Coord                       centroid;
+
+		/* Do Voronoi */
+		DiscreteVoronoi_CalculateForCell( discreteVoronoi, swarm, lCell_I );
+		claimedCellsCount = discreteVoronoi->claimedCellCount;
+		
+		/* Test Area */
+		for ( vCell_I = 0 ; vCell_I < claimedCellsCount ; vCell_I++ ) {
+			area += DiscreteVoronoi_GetVolume( discreteVoronoi, vCell_I );
+			DiscreteVoronoi_GetCentroid( discreteVoronoi, vCell_I, centroid );
+
+			assignedParticle = DiscreteVoronoi_GetParticleIndex( discreteVoronoi, vCell_I );
+			closestParticle = Swarm_FindClosestParticleInCell( swarm, lCell_I, context->dim, centroid, NULL );
+			if ( assignedParticle != closestParticle ) {
+				particlesCorrectlyAssociated = False;
+				Journal_Printf( stream, "Dodgy voronoi cell in element %u and cell %u -- assigned particle = %u closest particle = %u - centroid = %g %g %g\n", 
+						lCell_I, vCell_I, assignedParticle, closestParticle, centroid[0], centroid[1], centroid[2] );
+			}
+					
+		}
+		if (context->dim == 2)
+			cellArea = StGermain_ConvexQuadrilateralArea( 
+					(double*)swarm->cellPointTbl[lCell_I][0],
+					(double*)swarm->cellPointTbl[lCell_I][1],
+					(double*)swarm->cellPointTbl[lCell_I][2],
+					(double*)swarm->cellPointTbl[lCell_I][3],
+					context->dim);
+		else 
+			cellArea = StGermain_ParallelepipedVolume( 
+					(double*)swarm->cellPointTbl[lCell_I][0],
+					(double*)swarm->cellPointTbl[lCell_I][1],
+					(double*)swarm->cellPointTbl[lCell_I][3],
+					(double*)swarm->cellPointTbl[lCell_I][4] );
+
+		totalAreaError += fabs( area - cellArea );
+	}
+
+	/* Write to file */
+	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "output.dat" );
+	if ( totalAreaError < 1.0e-8 )
+		Journal_Printf( stream, "totalAreaError = 0.0\n" );
+	else 
+		Journal_PrintValue( stream, totalAreaError );
+	Journal_PrintBool( stream, particlesCorrectlyAssociated );
+}
+	
+
+void _testDiscreteVoronoi_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	DiscretisationContext* context;
+	context = (DiscretisationContext*)Stg_ComponentFactory_ConstructByName( cf, "context", DiscretisationContext, True, data );
+	ContextEP_ReplaceAll( context, AbstractContext_EP_Execute, PICellerator_testDiscreteVoronoi );
+}
+
+
+void* _testDiscreteVoronoi_DefaultNew( Name name ) {
+	return _Codelet_New(
+			sizeof( Codelet ),
+			TestDiscreteVoronoi_Type,
+			_Codelet_Delete,
+			_Codelet_Print,
+			_Codelet_Copy,
+			_testDiscreteVoronoi_DefaultNew,
+			_testDiscreteVoronoi_Construct,
+			_Codelet_Build,
+			_Codelet_Initialise,
+			_Codelet_Execute,
+			_Codelet_Destroy,
+			name );
+}
+
+
+Index testDiscreteVoronoi_Register( PluginsManager* pluginsManager ) {
+	Index result;
+
+	result = PluginsManager_Submit( pluginsManager, TestDiscreteVoronoi_Type, "0",
+		_testDiscreteVoronoi_DefaultNew );
+
+	return result;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/testAdaptiveVoronoi.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/testAdaptiveVoronoi.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>testDiscreteVoronoi.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="discreteVoronoi">
+			<param name="Type">AdaptiveVoronoi</param>
+			<param name="maxIterations">maxIterations</param>
+		</struct>		
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/testAdaptiveVoronoi2D.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/testAdaptiveVoronoi2D.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testAdaptiveVoronoi2D.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 "PICellerator testAdaptiveVoronoi.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/testCellularAutomataVoronoi.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/testCellularAutomataVoronoi.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>testDiscreteVoronoi.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="discreteVoronoi">
+			<param name="Type">CellularAutomataVoronoi</param>
+			<param name="resolution">25</param>
+			<param name="diagonalNeighbours">true</param>
+		</struct>		
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/testCellularAutomataVoronoi2D.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/testCellularAutomataVoronoi2D.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testCellularAutomataVoronoi2D.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 "PICellerator testCellularAutomataVoronoi.xml" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Voronoi/tests/testDiscreteVoronoi.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Voronoi/tests/testDiscreteVoronoi.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,59 @@
+<?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/ElementLayout.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">mesh-linear</param>
+		</struct>
+		<struct name="particleLayout">
+			<param name="Type">RandomParticleLayout</param>
+			<param name="cellParticleCount">particleCount</param>
+		</struct>
+		<struct name="swarm">
+			<param name="Type">Swarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">particleLayout</param>
+		</struct>
+	</struct>
+
+	<list name="plugins">
+		<param>testDiscreteVoronoi</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="maxTimeSteps"> 1 </param>
+	<param name="dumpEvery"> 1 </param>
+	<param name="outputPath"> ./output </param>
+	<param name="dim"> 2 </param>
+	
+	<param name="particleCount"> 10 </param>
+
+	<!-- Mesh Stuff -->
+	<param name="elementResI"> 20 </param>
+	<param name="elementResJ"> 20 </param>
+	<param name="elementResK"> 1 </param>
+	
+	<param name="shadowDepth"> 1 </param>
+	<param name="minX"> -1.0 </param>
+	<param name="minY"> -1.0 </param>
+	<param name="minZ"> -1.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>
+	<param name="buildElementNodeTbl"> True </param>
+	
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,53 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := src tests
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/ConstantWeights.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/ConstantWeights.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,223 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: ConstantWeights.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "types.h"
+#include "WeightsCalculator.h"
+#include "ConstantWeights.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type ConstantWeights_Type = "ConstantWeights";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+ConstantWeights* ConstantWeights_New( Name name, Dimension_Index dim ) {
+	ConstantWeights* self = (ConstantWeights*) _ConstantWeights_DefaultNew( name );
+
+	ConstantWeights_InitAll( self, dim );
+
+	return 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 );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _ConstantWeights_Init( void* 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 );
+}
+
+
+void _ConstantWeights_Print( void* constantWeights, Stream* 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;
+}
+
+void* _ConstantWeights_DefaultNew( Name name ) {
+	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_Construct( void* constantWeights, Stg_ComponentFactory* cf, void* data ) {
+	ConstantWeights*	     self          = (ConstantWeights*) constantWeights;
+
+	_WeightsCalculator_Construct( self, cf, data );
+	
+	_ConstantWeights_Init( self );
+}
+
+void _ConstantWeights_Build( void* constantWeights, void* data ) {
+	ConstantWeights*	self = (ConstantWeights*)constantWeights;
+
+	_WeightsCalculator_Build( self, data );
+}
+void _ConstantWeights_Initialise( void* constantWeights, void* data ) {
+	ConstantWeights*	self = (ConstantWeights*)constantWeights;
+	
+	_WeightsCalculator_Initialise( self, data );
+}
+void _ConstantWeights_Execute( void* constantWeights, void* 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 );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/ConstantWeights.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/ConstantWeights.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,119 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: ConstantWeights.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Weights_ConstantWeightsClass_h__
+#define __PICellerator_Weights_ConstantWeightsClass_h__
+
+	/* Textual name of this class */
+	extern const Type ConstantWeights_Type;
+
+	/* ConstantWeights information */
+	#define __ConstantWeights \
+		/* 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 );
+
+	void _ConstantWeights_Init( void* constantWeights  ) ;
+	void ConstantWeights_InitAll( void* constantWeights, Dimension_Index dim ) ;
+
+
+	/* 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_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_Destroy( void* constantWeights, void* data ) ;
+	
+		
+	void _ConstantWeights_Calculate( void* constantWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/ConstantWeights.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/ConstantWeights.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">ConstantWeights</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Weights/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">WeightsCalculator</param>
+<param name="Reference">...</param>
+<param name="Summary">...</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 5896a19b8457 -r 31abbeebf74e Weights/src/DVCWeights.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/DVCWeights.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,964 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2006, 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
+*%
+** Author:
+**              Mirko Velic - Mirko.Velic at sci.monash.edu.au
+**
+**  Assumptions:
+**  	 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
+**                 a pointer inside that function 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+/****************************************************************************************************************
+
+  The algorithm here-in computes a discrete voronoi diagram per FEM cell given a set of local
+  particle positions, in 3D and 2D. The volumes of the Voronoi regions are used as integration weights for
+  the integration point swarm and the integration points are the centroids of the same volumes.
+
+  For a description of this algorithm, see the article by Velic et.al.
+     "A Fast Robust Algorithm for computing Discrete Voronoi Diagrams in N-dimensions"
+  
+  Warning:
+
+  Be very careful of making changes here. It may have undesirable consequences in regard to the
+  speed of this implementation. Speed is very important here. You may be tempted to merge the
+  2D and 3D functions. Don't do it unless you can do it without using control statements.
+  This implementation uses von-Neumann neighbourhoods for boundary chain growth. Do not be tempted 
+  to implement "diagonal" neighbourhood growth cycles. For this is an abomination unto me.
+*****************************************************************************************************************/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include "types.h"
+#include "WeightsCalculator.h"
+#include "DVCWeights.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type DVCWeights_Type = "DVCWeights";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+DVCWeights* DVCWeights_New( Name name, Dimension_Index dim ) {
+	DVCWeights* self = (DVCWeights*) _DVCWeights_DefaultNew( name );
+
+	DVCWeights_InitAll( self, dim );
+	return self;
+}
+
+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 );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	return self;
+}
+
+void _DVCWeights_Init( void* dvcWeights, int *res ) {
+	DVCWeights* self = (DVCWeights*)dvcWeights;
+	self->isConstructed = True;
+
+	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 );
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _DVCWeights_Delete( void* dvcWeights ) {
+	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 );
+}
+
+
+
+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;
+}
+
+void* _DVCWeights_DefaultNew( Name name ) {
+	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_Construct( void* dvcWeights, Stg_ComponentFactory* cf, void *data ) {
+
+	DVCWeights*	     self          = (DVCWeights*) dvcWeights;
+
+	int defaultResolution;
+	int resolution[3];
+
+
+	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 );
+}
+
+void _DVCWeights_Build( void* dvcWeights, void* data ) {
+	DVCWeights*	self = (DVCWeights*)dvcWeights;
+	_WeightsCalculator_Build( self, data );
+}
+void _DVCWeights_Initialise( void* dvcWeights, void* data ) {
+	DVCWeights*	self = (DVCWeights*)dvcWeights;
+	_WeightsCalculator_Initialise( self, data );
+}
+void _DVCWeights_Execute( void* dvcWeights, void* data ) {
+	DVCWeights*	self = (DVCWeights*)dvcWeights;
+	_WeightsCalculator_Execute( self, data );
+}
+void _DVCWeights_Destroy( void* dvcWeights, void* data ) {
+	DVCWeights*	self = (DVCWeights*)dvcWeights;
+	_WeightsCalculator_Destroy( self, data );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
+/** 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;
+
+  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);
+}
+/** 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;
+
+  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);
+}
+
+/** 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,dist2;
+  struct chain *bchain = &(*bbchain)[p_i];
+  struct cell *cells = *ccells;
+  int *temp;
+
+  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 + INC)*sizeof(int) );
+	     bchain->new_claimed_cells = temp;
+	     bchain->new_claimed_cells_malloced += INC;
+	     temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + INC)*sizeof(int) );
+	     bchain->new_bound_cells = temp;
+	     bchain->new_bound_cells_malloced += 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_DistanceSquared(x0,y0,z0,x1,y1,z1);
+	dist2 = _DVCWeights_DistanceSquared(x0,y0,z0,x2,y2,z2);
+	if(dist1 > dist2){
+	  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,dist2;
+  struct chain *bchain = &(*bbchain)[p_i];
+  struct cell2d *cells = *ccells;
+  int *temp;
+
+  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 + INC)*sizeof(int) );
+	     bchain->new_claimed_cells = temp;
+	     bchain->new_claimed_cells_malloced += INC;
+	     temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + INC)*sizeof(int) );
+	     bchain->new_bound_cells = temp;
+	     bchain->new_bound_cells_malloced += 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_DistanceSquared2D(x0,y0,x1,y1);
+	dist2 = _DVCWeights_DistanceSquared2D(x0,y0,x2,y2);
+	if(dist1 > dist2){
+	  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;
+
+  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;
+
+  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.*/
+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;
+
+  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;
+
+    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 + INC)*sizeof(int) );
+		 bchain->new_claimed_cells = temp;
+		 bchain->new_claimed_cells_malloced += INC;
+		 temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + INC)*sizeof(int) );
+		 bchain->new_bound_cells = temp;
+		 bchain->new_bound_cells_malloced += 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*/
+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;
+
+  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;
+
+    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 + INC)*sizeof(int) );
+		 bchain->new_claimed_cells = temp;
+		 bchain->new_claimed_cells_malloced += INC;
+		 temp = (int *)realloc( bchain->new_bound_cells, (bchain->new_bound_cells_malloced + INC)*sizeof(int) );
+		 bchain->new_bound_cells = temp;
+		 bchain->new_bound_cells_malloced += 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.*/
+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;
+
+  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-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; 
+}
+
+
+/** Construct the grid over the element. This grid is fixed. 
+  (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;
+
+  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;
+      }
+    }
+  }
+  *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){
+	double  position0[3], position1[3], vectorDistance[3];
+	double  dist;
+	Vector_SetScalar( position0, x0, y0, z0 );	
+	Vector_SetScalar( position1, x1, y1, z1 );
+	StGermain_VectorSubtraction( vectorDistance, position0, position1, 3 ) ;
+	dist = StGermain_VectorDotProduct(vectorDistance, vectorDistance, 3);
+	return dist;
+}
+
+/** Calculate the sqaure of the distance between two points in 2D*/
+double _DVCWeights_DistanceSquared2D(double x0, double y0,double x1, double y1){
+	double  position0[2], position1[2], vectorDistance[2];
+	double dist;
+	Vector_SetScalar2D( position0, x0, y0);	
+	Vector_SetScalar2D( position1, x1, y1);
+	StGermain_VectorSubtraction( vectorDistance, position0, position1, 2 ) ;
+	dist = StGermain_VectorDotProduct(vectorDistance, vectorDistance, 2);
+	return dist;
+}
+
+/** 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, "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(INC*sizeof(int));
+	 (*bchain)[i].new_claimed_cells_malloced = INC;
+	 (*bchain)[i].new_bound_cells = (int *)malloc(INC*sizeof(int));
+	 (*bchain)[i].new_bound_cells_malloced = 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__);
+      }
+
+}
+/** 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, "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(INC*sizeof(int));
+	 (*bchain)[i].new_claimed_cells_malloced = INC;
+	 (*bchain)[i].new_bound_cells = (int *)malloc(INC*sizeof(int));
+	 (*bchain)[i].new_bound_cells_malloced = 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__);
+      }
+
+}
+
+/** Create the Voronoi diagram by growing the voronoi cells from the particle locations.
+  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;
+
+      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;
+      
+      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. */
+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;
+
+   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
+   
+   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
+}
+
+/* Calculate the integration weighting for each particle by contructing
+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;
+
+	numx = self->resX;
+	numy = self->resY;
+	numz = self->resZ;
+
+	nump = cParticleCount = swarm->cellParticleCountTbl[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++){
+
+	      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);
+
+}
+
+/* Calculate the integration weighting for each particle by contructing
+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;
+
+	numx = self->resX;
+	numy = self->resY;
+
+	nump = cParticleCount = swarm->cellParticleCountTbl[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++){
+
+	      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);
+
+}
+
+void _DVCWeights_Calculate( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I ){
+      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);
+      }
+}
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/DVCWeights.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/DVCWeights.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,263 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2006, 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
+*%
+** Author:
+**              Mirko Velic - Mirko.Velic at sci.monash.edu.au
+**
+**  Assumptions:
+**  	 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.
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+/****************************************************************************************************************
+
+  The algorithm here-in computes a discrete voronoi diagram per FEM cell given a set of local
+  particle positions, in 3D and 2D. The volumes of the Voronoi regions are used as integration weights for
+  the integration point swarm and the integration points are the centroids of the same volumes.
+
+  For a description of this algorithm, see the article by Velic et.al.
+     "A Fast Robust Algorithm for computing Discrete Voronoi Diagrams in N-dimensions"
+
+
+
+*****************************************************************************************************************/
+
+#ifndef __PICellerator_Weights_DVCWeightsClass_h__
+#define __PICellerator_Weights_DVCWeightsClass_h__
+
+	/* 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;
+
+	struct DVCWeights { __DVCWeights };
+	
+#define INC 50
+	
+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;
+};
+struct cell2d{
+  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;
+};
+struct particle{
+  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;
+};
+/* 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 );
+
+	double _DVCWeights_DistanceSquared(
+				double x0, double y0, double z0, 
+				double x1, double y1, double z1);
+	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);
+	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 );
+
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** 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 ) ;
+
+
+	/* 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 ) ;
+	
+		
+	void _DVCWeights_Calculate( void* dvcWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
+
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/DVCWeights.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/DVCWeights.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,57 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">DVCWeights</param>
+<param name="Author">...</param>
+<param name="Organisation">MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Weights/src/</param>
+<param name="Project Web">http://mcc.monash.edu.au/Underworld</param>
+<param name="Copyright">Copyright (C) 2006 Monash Cluster Computing.</param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">WeightsCalculator</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">Calculates PIC integration weights in 3D and 2D using a Voronoi diagram. The integration points are set to the centroid of a Voronoi cell and
+ the weight is the volume of the cell.</param>
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Example Usage -->
+<struct name="weights">
+   <param name="Type">DVCWeights</param>
+   <param name="resolution">10</param>
+</struct>
+<!-- or one can call this with -->
+<struct name="weights">
+   <param name="Type">DVCWeights</param>
+   <param name="resolutionX">10</param>
+   <param name="resolutionY">10</param>
+   <param name="resolutionZ">10</param>
+</struct>
+
+<struct name="materialPoints">
+   <param name="Type">IntegrationPointsSwarm</param>
+   <param name="CellLayout">elementCellLayout</param>
+   <param name="ParticleLayout">localLayout</param>
+   <param name="FiniteElement_Mesh">mesh-linear</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">materialPoints</param>
+   <param name="MaterialPointsSwarm">materialSwarm</param>
+</struct>
+
+<!-- See MaterialPointsSwarm.xml in Underworld/InputFiles/PIC_Components for an example -->
+<!-- where the X Y Z resolutions may be all different -->
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/DiscreteVoronoiWeights.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/DiscreteVoronoiWeights.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,227 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: DiscreteVoronoiWeights.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include <PICellerator/Voronoi/Voronoi.h>
+
+#include "types.h"
+#include "WeightsCalculator.h"
+#include "DiscreteVoronoiWeights.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type DiscreteVoronoiWeights_Type = "DiscreteVoronoiWeights";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+DiscreteVoronoiWeights* _DiscreteVoronoiWeights_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 )
+{
+	DiscreteVoronoiWeights* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(DiscreteVoronoiWeights) );
+	self = (DiscreteVoronoiWeights*)_WeightsCalculator_New( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			name );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _DiscreteVoronoiWeights_Init( void* discreteVoronoiWeights, DiscreteVoronoi* discreteVoronoi ) {
+	DiscreteVoronoiWeights* self = (DiscreteVoronoiWeights*)discreteVoronoiWeights;
+	
+	self->isConstructed = True;
+	self->discreteVoronoi = discreteVoronoi;
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+void* _DiscreteVoronoiWeights_DefaultNew( Name name ) {
+	return (void*) _DiscreteVoronoiWeights_New(
+			sizeof(DiscreteVoronoiWeights),
+			DiscreteVoronoiWeights_Type,
+			_WeightsCalculator_Delete,
+			_WeightsCalculator_Print,
+			_WeightsCalculator_Copy,
+			_DiscreteVoronoiWeights_DefaultNew,
+			_DiscreteVoronoiWeights_Construct,
+			_DiscreteVoronoiWeights_Build,
+			_DiscreteVoronoiWeights_Initialise,
+			_WeightsCalculator_Execute,
+			_WeightsCalculator_Destroy,
+			_DiscreteVoronoiWeights_Calculate,
+			name );
+}
+
+
+void _DiscreteVoronoiWeights_Construct( void* discreteVoronoiWeights, Stg_ComponentFactory* cf, void* data ) {
+	DiscreteVoronoiWeights*	     self            = (DiscreteVoronoiWeights*) discreteVoronoiWeights;
+	DiscreteVoronoi*             discreteVoronoi;
+
+	_WeightsCalculator_Construct( self, cf, data );
+
+	discreteVoronoi =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "DiscreteVoronoi", DiscreteVoronoi, True, data ) ;
+	_DiscreteVoronoiWeights_Init( self, discreteVoronoi );
+}
+
+void _DiscreteVoronoiWeights_Build( void* discreteVoronoiWeights, void* data ) {
+	DiscreteVoronoiWeights*	     self            = (DiscreteVoronoiWeights*) discreteVoronoiWeights;
+
+	/* Ensure that the discrete voronoi object I'm using is built */
+	Stg_Component_Build( self->discreteVoronoi, data, False );
+	_WeightsCalculator_Build( self, data );
+}
+
+void _DiscreteVoronoiWeights_Initialise( void* discreteVoronoiWeights, void* data ) {
+	DiscreteVoronoiWeights*	     self            = (DiscreteVoronoiWeights*) discreteVoronoiWeights;
+
+	/* Ensure that the discrete voronoi object I'm using is initialised */
+	Stg_Component_Initialise( self->discreteVoronoi, data, False );
+	_WeightsCalculator_Initialise( self, data );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+void _DiscreteVoronoiWeights_Calculate( void* discreteVoronoiWeights, void* _swarm, Cell_LocalIndex lCell_I ) {
+	DiscreteVoronoiWeights*     self            = (DiscreteVoronoiWeights*)  discreteVoronoiWeights;
+	Swarm*                      swarm           = (Swarm*) _swarm;
+	FiniteElement_Mesh*         feMesh          = (FiniteElement_Mesh*)((ElementCellLayout*)swarm->cellLayout)->mesh;
+	Voronoi_CellIndex           claimedVoronoiCellsCount;
+	Voronoi_CellIndex           voronoiCell_I;
+	ElementType*                elementType;
+	IntegrationPoint*           particle;
+	double                      volume;
+	double                      detJac;	
+	Dimension_Index             dim             = swarm->dim;
+	Particle_InCellIndex        cParticle_I;
+	#ifdef CAUTIOUS
+	Stream*                     errorStream = Journal_Register( Error_Type, self->type );
+	#endif
+
+	/* If the cell has no particles of the current swarm - just return */
+	if ( swarm->cellParticleCountTbl[lCell_I] == 0) {
+		return;
+	}
+
+	WeightsCalculator_ZeroWeightsInCell( self, swarm, lCell_I );
+	elementType    = FeMesh_ElementTypeAt( feMesh, lCell_I );
+
+	/* Do Discrete Voronoi for this Cell */
+	DiscreteVoronoi_CalculateForCell( self->discreteVoronoi, swarm, lCell_I );
+	claimedVoronoiCellsCount = self->discreteVoronoi->claimedCellCount;
+
+	for ( voronoiCell_I = 0 ; voronoiCell_I < claimedVoronoiCellsCount ; voronoiCell_I++ ) {
+		
+		cParticle_I = DiscreteVoronoi_GetParticleIndex( self->discreteVoronoi, voronoiCell_I );
+
+		#ifdef CAUTIOUS
+		Journal_Firewall( cParticle_I != CELLULAR_AUTOMATA_UNCLAIMED, errorStream,
+			"Error - in %s(): while calculating weights for swarm \"%s\", in local cell %u, "
+			"DiscreteVoronoi_GetParticleIndex() returned a cell particle index of UNCLAIMED for "
+			"voronoi cell %u, which suggestes Voronoi thinks this element is empty, however the "
+			"swarm's cellParticleCount for that element is %u.\n",
+			__func__, swarm->name, lCell_I, voronoiCell_I, 
+			swarm->cellParticleCountTbl[lCell_I] );
+			
+		Journal_Firewall( cParticle_I < swarm->cellParticleCountTbl[lCell_I], errorStream,
+			"Error - in %s(): while calculating weights for swarm \"%s\", in local cell %u, "
+			"DiscreteVoronoi_GetParticleIndex() returned a cell particle index of %u for "
+			"voronoi cell %u, which is >= the swarm's cellParticleCount for that cell of %u.\n",
+			__func__, swarm->name, lCell_I, cParticle_I, voronoiCell_I, 
+			swarm->cellParticleCountTbl[lCell_I] );
+		#endif
+		
+		particle = (IntegrationPoint*) Swarm_ParticleInCellAt( swarm, lCell_I, cParticle_I );
+
+		/* Calculate Volume for Voronoi Cell */
+		volume = DiscreteVoronoi_GetVolume( self->discreteVoronoi, voronoiCell_I );
+		
+		/* Calculate Determinant of Jacobian */
+		detJac = ElementType_JacobianDeterminant( elementType, feMesh, lCell_I, particle->xi, dim );
+
+		/* Add this volume to particle's weight - with modification for local coordinate transformation */
+		particle->weight += volume/detJac;
+	}
+
+}
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/DiscreteVoronoiWeights.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/DiscreteVoronoiWeights.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,104 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: DiscreteVoronoiWeights.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Weights_DiscreteVoronoiWeightsClass_h__
+#define __PICellerator_Weights_DiscreteVoronoiWeightsClass_h__
+
+	/* Textual name of this class */
+	extern const Type DiscreteVoronoiWeights_Type;
+
+	/* DiscreteVoronoiWeights information */
+	#define __DiscreteVoronoiWeights \
+		/* Parent info */ \
+		__WeightsCalculator \
+		/* Virtual Info */\
+		\
+		/* General Info */\
+		DiscreteVoronoi*        discreteVoronoi;
+
+	struct DiscreteVoronoiWeights { __DiscreteVoronoiWeights };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	DiscreteVoronoiWeights* _DiscreteVoronoiWeights_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* _DiscreteVoronoiWeights_DefaultNew( Name name ) ;
+void _DiscreteVoronoiWeights_Construct( void* discreteVoronoiWeights, Stg_ComponentFactory* cf, void* data ) ;
+	void _DiscreteVoronoiWeights_Build( void* discreteVoronoiWeights, void* data ) ;
+	void _DiscreteVoronoiWeights_Initialise( void* discreteVoronoiWeights, void* data ) ;
+		
+	void _DiscreteVoronoiWeights_Calculate( void* discreteVoronoiWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/DiscreteVoronoiWeights.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/DiscreteVoronoiWeights.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">DiscreteVoronoiWeights</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Weights/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">WeightsCalculator</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">DiscreteVoronoi</param>
+		<param name="Type">DiscreteVoronoi</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 121 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/Finalise.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/Finalise.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,57 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Finalise.c 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "Finalise.h"
+
+#include <stdio.h>
+
+Bool PICellerator_Weights_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/Finalise.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/Finalise.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,60 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Finalise.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Weights_Finalise_h__
+#define __PICellerator_Weights_Finalise_h__
+	
+	Bool PICellerator_Weights_Finalise( void ) ;
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/Init.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/Init.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,75 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Init.c 380 2006-11-23 00:47:17Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+
+#include "Weights.h"
+
+#include <stdio.h>
+
+Bool PICellerator_Weights_Init( int* argc, char** argv[] ) {
+	Stg_ComponentRegister* componentsRegister = Stg_ComponentRegister_Get_ComponentRegister();
+
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+
+	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, DiscreteVoronoiWeights_Type,   "0", _DiscreteVoronoiWeights_DefaultNew );
+	Stg_ComponentRegister_Add( componentsRegister, DVCWeights_Type,   			  "0", _DVCWeights_DefaultNew );
+	
+	RegisterParent( WeightsCalculator_Type,      Stg_Component_Type );
+	RegisterParent( ConstantWeights_Type,        WeightsCalculator_Type );
+	RegisterParent( VolumeWeights_Type,          WeightsCalculator_Type );
+	RegisterParent( IterativeWeights_Type,       WeightsCalculator_Type );
+	RegisterParent( MomentBalanceWeights_Type,   WeightsCalculator_Type );
+	RegisterParent( DiscreteVoronoiWeights_Type, WeightsCalculator_Type );
+	RegisterParent( DVCWeights_Type,             WeightsCalculator_Type );
+	
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/Init.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/Init.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	performs and pre-running initialisation necessary in this directory.
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Init.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Weights_Init_h__
+#define __PICellerator_Weights_Init_h__
+	
+	Bool PICellerator_Weights_Init( int* argc, char** argv[] );
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/IterativeWeights.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/IterativeWeights.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,299 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: IterativeWeights.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "types.h"
+#include "WeightsCalculator.h"
+#include "ConstantWeights.h"
+#include "IterativeWeights.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+/** IterativeWeights is an implementation of Frederic Dufour's weights routine from Ellipsis which is described
+ * in his PhD Thesis Section 2.6.1 pp. 63-66 */
+
+/* Textual name of this class */
+const Type IterativeWeights_Type = "IterativeWeights";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+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 );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+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;
+	}
+
+	self->maxIterations = maxIterations;
+	self->tolerance = tolerance;
+	self->alpha = alpha;
+	
+	Journal_Firewall( self->dim == 2, 
+			Journal_Register( Error_Type, self->type ),
+			"%s only works in 2D.\n", self->type );
+	
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _IterativeWeights_Delete( void* iterativeWeights ) {
+	IterativeWeights* self = (IterativeWeights*)iterativeWeights;
+	
+	if (self->freeInitialWeights )
+		Stg_Class_Delete( self->initialWeights );
+	/* Delete parent */
+	_ConstantWeights_Delete( self );
+}
+
+
+void _IterativeWeights_Print( void* iterativeWeights, Stream* stream ) {
+	IterativeWeights* self = (IterativeWeights*)iterativeWeights;
+	
+	/* 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;
+	
+	newIterativeWeights = (IterativeWeights*)_ConstantWeights_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newIterativeWeights;
+}
+
+void* _IterativeWeights_DefaultNew( Name name ) {
+	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_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 );
+
+	initialWeights =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "InitialWeights", WeightsCalculator, False, data ) ;
+
+	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 );
+}
+
+void _IterativeWeights_Build( void* iterativeWeights, void* data ) {
+	IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
+
+	_ConstantWeights_Build( self, data );
+}
+void _IterativeWeights_Initialise( void* iterativeWeights, void* data ) {
+	IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
+	
+	_ConstantWeights_Initialise( self, data );
+}
+void _IterativeWeights_Execute( void* iterativeWeights, void* data ) {
+	IterativeWeights*	self = (IterativeWeights*)iterativeWeights;
+	
+	_ConstantWeights_Execute( self, data );
+}
+void _IterativeWeights_Destroy( void* iterativeWeights, void* 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;
+
+	/* 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 );
+
+		/* 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;
+
+		/* 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 ( 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 );
+	}
+}
+
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+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;
+
+	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 );
+
+		/* Scale weights so that sum of weights = cellLocalVolume */
+		particle->weight *= self->cellLocalVolume/weightsTotal;
+	}
+}
+	
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/IterativeWeights.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/IterativeWeights.h	Mon Mar 26 09:24:36 2007 +0000
@@ -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
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: IterativeWeights.h 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Weights_IterativeWeightsClass_h__
+#define __PICellerator_Weights_IterativeWeightsClass_h__
+
+	/* Textual name of this class */
+	extern const Type IterativeWeights_Type;
+
+	/* IterativeWeights information */
+	#define __IterativeWeights \
+		/* General info */ \
+		__ConstantWeights \
+		/* Virtual Info */\
+		WeightsCalculator*                        initialWeights;    \
+		Iteration_Index                           maxIterations;     \
+		double                                    tolerance;         \
+		double                                    alpha;             \
+		Bool                                      freeInitialWeights;\
+		
+
+	struct IterativeWeights { __IterativeWeights };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	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_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 ) ;
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	void IterativeWeights_ScaleForConstantConstraint( void* iterativeWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/IterativeWeights.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/IterativeWeights.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">IterativeWeights</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Weights/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">ConstantWeights</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">maxIterations</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">10</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">tolerance</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.01</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">alpha</param>
+		<param name="Type">Double</param>
+		<param name="Default">0.8</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">InitialWeights</param>
+		<param name="Type">WeightsCalculator</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 173 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/MomentBalanceWeights.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/MomentBalanceWeights.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,518 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: MomentBalanceWeights.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "types.h"
+#include "WeightsCalculator.h"
+#include "MomentBalanceWeights.h"
+#include "ConstantWeights.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type MomentBalanceWeights_Type = "MomentBalanceWeights";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+MomentBalanceWeights* MomentBalanceWeights_New( Name name, Dimension_Index dim, WeightsCalculator* backupWeights ) {
+	MomentBalanceWeights* self = (MomentBalanceWeights*) _MomentBalanceWeights_DefaultNew( name );
+
+	MomentBalanceWeights_InitAll( self, dim, backupWeights );
+
+	return self;
+}
+
+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( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			name );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _MomentBalanceWeights_Init( void* momentBalanceWeights, WeightsCalculator* backupWeights ) {
+	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, 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 );
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _MomentBalanceWeights_Delete( void* momentBalanceWeights ) {
+	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 );
+}
+
+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;
+}
+
+void* _MomentBalanceWeights_DefaultNew( Name name ) {
+	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_Construct( void* momentBalanceWeights, Stg_ComponentFactory* cf, void* data ) {
+	MomentBalanceWeights*	     self          = (MomentBalanceWeights*) momentBalanceWeights;
+	WeightsCalculator*           backupWeights;
+
+	_WeightsCalculator_Construct( self, cf, data );
+	
+	backupWeights =  Stg_ComponentFactory_ConstructByKey( cf, self->name, "BackupWeights", WeightsCalculator, False, data );
+
+	_MomentBalanceWeights_Init( self, backupWeights );
+}
+
+void _MomentBalanceWeights_Build( void* momentBalanceWeights, void* data ) {
+	MomentBalanceWeights*	self = (MomentBalanceWeights*)momentBalanceWeights;
+
+	_WeightsCalculator_Build( self, data );
+}
+void _MomentBalanceWeights_Initialise( void* momentBalanceWeights, void* data ) {
+	MomentBalanceWeights*	self = (MomentBalanceWeights*)momentBalanceWeights;
+	
+	_WeightsCalculator_Initialise( self, data );
+}
+void _MomentBalanceWeights_Execute( void* momentBalanceWeights, void* data ) {
+	MomentBalanceWeights*	self = (MomentBalanceWeights*)momentBalanceWeights;
+	
+	_WeightsCalculator_Execute( self, data );
+}
+void _MomentBalanceWeights_Destroy( void* momentBalanceWeights, void* data ) {
+	MomentBalanceWeights*	self = (MomentBalanceWeights*)momentBalanceWeights;
+	
+	_WeightsCalculator_Destroy( self, data );
+}
+
+
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
+typedef struct {
+	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
+} 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 ) )
+
+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}| */
+
+	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;
+
+		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++;
+	}
+
+	/* 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 */
+
+	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);
+
+	/* 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;
+
+	/* 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;
+	}
+}
+
+
+#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}| */
+
+	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;
+
+		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++;
+	}
+
+	/* 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 = 
+	 * */
+
+	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);
+
+	/* 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;
+
+	/* 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;
+	}
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/MomentBalanceWeights.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/MomentBalanceWeights.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,118 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** 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;
+
+	/* MomentBalanceWeights information */
+	#define __MomentBalanceWeights \
+		/* General info */ \
+		__WeightsCalculator \
+		/* Virtual Info */\
+		\
+		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 );
+
+	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 ) \
+		(MomentBalanceWeights*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _MomentBalanceWeights_Copy( void* momentBalanceWeights, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	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_Destroy( void* momentBalanceWeights, void* data ) ;
+	
+		
+	void _MomentBalanceWeights_Calculate( void* momentBalanceWeights, void* _swarm, Cell_LocalIndex lCell_I ) ;
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Private functions
+	*/
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Public functions
+	*/
+	
+	
+#endif 
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/MomentBalanceWeights.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/MomentBalanceWeights.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,40 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">MomentBalanceWeights</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Weights/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">WeightsCalculator</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">No</param>
+		<param name="Name">BackupWeights</param>
+		<param name="Type">WeightsCalculator</param>
+		<param name="Description">...</param>
+	</struct>
+
+<!-- PLEASE, check the above struct information is accurate, in line number 175 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/VolumeWeights.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/VolumeWeights.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,245 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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) ) {
+	IrregTopology* self = (IrregTopology*)ir
+**	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
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** $Id: VolumeWeights.c 189 2005-10-20 00:39:29Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "types.h"
+#include "WeightsCalculator.h"
+#include "VolumeWeights.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+
+/* Textual name of this class */
+const Type VolumeWeights_Type = "VolumeWeights";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+VolumeWeights* VolumeWeights_New( Name name, Dimension_Index dim, Stg_Shape* shape, FiniteElement_Mesh* mesh ) {
+	VolumeWeights* self = (VolumeWeights*) _VolumeWeights_DefaultNew( name );
+
+	VolumeWeights_InitAll( self, dim, shape, mesh );
+
+	return 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( 
+			_sizeOfSelf,
+			type,
+			_delete,
+			_print,
+			_copy,
+			_defaultConstructor,
+			_construct,
+			_build,
+			_initialise,
+			_execute,
+			_destroy,		
+			_calculate,
+			name );
+
+	
+	/* General info */
+
+	/* Virtual Info */
+	
+	return self;
+}
+
+void _VolumeWeights_Init( void* weights, Stg_Shape* shape, FiniteElement_Mesh* mesh ) {
+	VolumeWeights* self = (VolumeWeights*)weights;
+	
+	self->isConstructed = True;
+
+	self->shape = shape;
+	self->mesh  = mesh;
+
+}
+void VolumeWeights_InitAll( void* weights, Dimension_Index dim, Stg_Shape* shape, FiniteElement_Mesh* mesh ) {
+	VolumeWeights* self = (VolumeWeights*)weights;
+
+	WeightsCalculator_InitAll( self, dim );
+	_VolumeWeights_Init( self, shape, mesh );
+}
+
+/*------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _VolumeWeights_Delete( void* weights ) {
+	VolumeWeights* self = (VolumeWeights*)weights;
+	
+	/* Delete parent */
+	_WeightsCalculator_Delete( self );
+}
+
+
+void _VolumeWeights_Print( void* weights, Stream* stream ) {
+	VolumeWeights* self = (VolumeWeights*)weights;
+	
+	/* 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;
+	
+	newVolumeWeights = (VolumeWeights*)_WeightsCalculator_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	return (void*)newVolumeWeights;
+}
+
+void* _VolumeWeights_DefaultNew( Name name ) {
+	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_Construct( void* weights, Stg_ComponentFactory* cf, void* data ) {
+	VolumeWeights*	     self          = (VolumeWeights*) weights;
+	Stg_Shape*           shape;
+	FiniteElement_Mesh*  mesh;
+
+	_WeightsCalculator_Construct( self, cf, data );
+
+	shape = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Shape", Stg_Shape, True, data );
+	mesh  = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Mesh", FiniteElement_Mesh, True, data );
+/*
+	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 );
+}
+
+void _VolumeWeights_Build( void* weights, void* data ) {
+	VolumeWeights*	self = (VolumeWeights*)weights;
+
+	_WeightsCalculator_Build( self, data );
+}
+void _VolumeWeights_Initialise( void* weights, void* data ) {
+	VolumeWeights*	self = (VolumeWeights*)weights;
+	
+	_WeightsCalculator_Initialise( self, data );
+}
+void _VolumeWeights_Execute( void* weights, void* data ) {
+	VolumeWeights*	self = (VolumeWeights*)weights;
+	
+	_WeightsCalculator_Execute( self, data );
+}
+void _VolumeWeights_Destroy( void* weights, void* 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;
+	IJK                          size; /* mesh resolution */
+	
+	MPI_Allreduce( 
+		&(swarm->particleLocalCount),
+		&(numberOfParticles),
+		1,
+		MPI_UNSIGNED,
+		MPI_SUM,
+		MPI_COMM_WORLD );
+
+	volume = Stg_Shape_CalculateVolume( shape );
+
+	memcpy(&size, &(((IJKTopology*)self->mesh->layout->nodeLayout->topology)->size), sizeof(IJK) );
+	
+	dx = 1.0 / (double)(size[0] - 1); /* size of an element */
+	dy = 1.0 / (double)(size[1] - 1);
+	if ( self->dim > 2 ) {
+		dz = 1.0 / (double)(size[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 ) );
+
+	WeightsCalculator_SetWeightsValueAllInCell( self, swarm, lCell_I, weight );
+}
+
+/*-------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/VolumeWeights.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/VolumeWeights.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,90 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 file may be distributed under the terms of the VPAC Public License
+** as defined by VPAC of Australia and appearing in the file
+** LICENSE.VPL included in the packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+*/
+/** \file
+**  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;
+
+	/* VolumeWeights information */
+	#define __VolumeWeights \
+		__WeightsCalculator \
+		Stg_Shape*              shape; \
+		FiniteElement_Mesh*     mesh; 
+
+	struct VolumeWeights { __VolumeWeights };
+	
+	
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	VolumeWeights* VolumeWeights_New( Name name, Dimension_Index dim, Stg_Shape* shape, FiniteElement_Mesh* 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, FiniteElement_Mesh* mesh ) ;
+	void VolumeWeights_InitAll( void* weights, Dimension_Index dim, Stg_Shape* shape, FiniteElement_Mesh* 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_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 5896a19b8457 -r 31abbeebf74e Weights/src/VolumeWeights.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/VolumeWeights.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">VolumeWeights</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Weights/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">WeightsCalculator</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Shape</param>
+		<param name="Type">Stg_Shape</param>
+		<param name="Description">...</param>
+	</struct>
+
+	<struct>
+		<param name="Essential">True</param>
+		<param name="Name">Mesh</param>
+		<param name="Type">FiniteElement_Mesh</param>
+		<param name="Description">...</param>
+	</struct>
+<!-- PLEASE, check the above struct information is accurate, in line number 121 of the c file and then remove this comment afterwards -->
+
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/Weights.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/Weights.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,67 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Weights.h 380 2006-11-23 00:47:17Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Weights_h__
+#define __PICellerator_Weights_h__
+
+	#include "types.h"
+	#include "Init.h"
+	#include "Finalise.h"
+	#include "WeightsCalculator.h"
+	#include "ConstantWeights.h"
+	#include "VolumeWeights.h"
+	#include "DiscreteVoronoiWeights.h"
+	#include "IterativeWeights.h"
+	#include "MomentBalanceWeights.h"
+	#include "DVCWeights.h"
+	
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/WeightsCalculator.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/WeightsCalculator.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,486 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: WeightsCalculator.c 374 2006-10-12 08:59:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+
+#include "types.h"
+#include "WeightsCalculator.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+/* Textual name of this class */
+const Type WeightsCalculator_Type = "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 )
+{
+	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 */
+
+	/* Virtual Info */
+	self->_calculate = _calculate;
+	
+	return self;
+}
+
+void _WeightsCalculator_Init( void* weightsCalculator, Dimension_Index dim ) {
+	WeightsCalculator* self = (WeightsCalculator*)weightsCalculator;
+	
+	self->isConstructed = True;
+	self->dim = 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 );
+}
+
+
+void _WeightsCalculator_Print( void* weightsCalculator, Stream* 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;
+}
+
+
+
+void _WeightsCalculator_Construct( void* weightsCalculator, Stg_ComponentFactory* cf, void* data ) {
+	WeightsCalculator*	 self          = (WeightsCalculator*) weightsCalculator;
+	Dimension_Index      dim;
+
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+
+	_WeightsCalculator_Init( self, dim );
+}
+
+void _WeightsCalculator_Build( void* weightsCalculator, void* data ) {
+	//WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+
+}
+void _WeightsCalculator_Initialise( void* weightsCalculator, void* data ) {
+	//WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+	
+}
+void _WeightsCalculator_Execute( void* weightsCalculator, void* data ) {
+//	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+	
+}
+void _WeightsCalculator_Destroy( void* weightsCalculator, void* data ) {
+	//WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+	
+}
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+void WeightsCalculator_CalculateCell( void* weightsCalculator, void* swarm, Cell_LocalIndex lCell_I ) {
+	WeightsCalculator*	self = (WeightsCalculator*)weightsCalculator;
+
+	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, self->type );
+	Processor_Index      formerStreamPrintingRank = 0;
+
+	Journal_Printf( 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_Printf( stream, "Calculating weights for the particles in the %u global cells\n",
+		cellGlobalCount );
+	Stream_Indent( stream );
+
+	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
+
+		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_Printf( 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;
+
+	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 );
+
+		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;
+
+	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 (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;
+
+	/* 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;
+}
+
+#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 );
+
+	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 Error */
+			error += fabs(leftHandSide - rightHandSide);
+
+			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 );
+
+	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;
+}
+
+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 ) ;
+
+		if ( swarm->dim == 3 )
+			leftHandSide += particle->weight * pow( xi[ K_AXIS ], (double) power_k );
+
+	}
+	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 ) ;
+
+		if ( swarm->dim == 3 )
+			localCoordSum += pow( xi[ K_AXIS ], (double) power_k );
+
+	}
+	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;
+
+	/* 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;
+}
+
+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];	
+
+	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 5896a19b8457 -r 31abbeebf74e Weights/src/WeightsCalculator.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/WeightsCalculator.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,135 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**
+** 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* weightsCalculator, void* swarm, Cell_LocalIndex lCell_I );
+
+	/* Textual name of this class */
+	extern const Type WeightsCalculator_Type;
+
+	/* 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 );
+	
+	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* 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* 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* 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 5896a19b8457 -r 31abbeebf74e Weights/src/WeightsCalculator.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/WeightsCalculator.meta	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">WeightsCalculator</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC and MCC</param>
+<param name="Project">PICellerator</param>
+<param name="Location">./PICellerator/Weights/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/PICellerator/WebHome</param>
+<param name="Copyright">Copyright (C) 2005 VPAC and Monash Cluster Computing.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">Stg_Component</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">dim</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">0</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,65 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN MPI XML
+
+# Work out name to call library
+lib = ${PROJECT}$(shell basename `pwd | sed s/src//g`)
+libstatic = yes
+libdynamic = yes
+
+# Name of directory to place header files
+includes := ${PROJECT}/$(shell basename `pwd | sed s/src//g`)
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Weights/src/types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/src/types.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,70 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Basic framework types.
+**
+** Assumptions:
+**	None as yet.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: types.h 380 2006-11-23 00:47:17Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Weights_types_h__
+#define __PICellerator_Weights_types_h__
+
+	typedef struct WeightsCalculator            WeightsCalculator;
+	typedef struct ConstantWeights              ConstantWeights;
+	typedef struct VolumeWeights                VolumeWeights;
+	typedef struct IterativeWeights             IterativeWeights;
+	typedef struct DiscreteVoronoiWeights       DiscreteVoronoiWeights;
+	typedef struct MomentBalanceWeights         MomentBalanceWeights;
+	typedef struct DVCWeights                   DVCWeights;
+	
+	/* Types, for readability */
+	typedef Index                             Constraint_Index;
+
+#endif
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testConstantWeightsCircle.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testConstantWeightsCircle.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.091215
+Standard Deviation is within tolerance, 0.000001 of 0.066458
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testConstantWeightsExpIface.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testConstantWeightsExpIface.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.155483
+Standard Deviation is within tolerance, 0.000001 of 0.116796
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testConstantWeightsPoly.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testConstantWeightsPoly.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.017475
+Standard Deviation is within tolerance, 0.000001 of 0.013738
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testDVCWeightsCircle.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testDVCWeightsCircle.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.005000 of 0.090837
+Standard Deviation is within tolerance, 0.001000 of 0.055628
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testDVCWeightsExpIface.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testDVCWeightsExpIface.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.001000 of 0.047945
+Standard Deviation is within tolerance, 0.001000 of 0.035636
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testDVCWeightsPoly.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testDVCWeightsPoly.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.001000 of 0.007747
+Standard Deviation is within tolerance, 0.001000 of 0.001464
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testDiscreteVoronoiWeightsCircle.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testDiscreteVoronoiWeightsCircle.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.092640
+Standard Deviation is within tolerance, 0.000001 of 0.063171
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testDiscreteVoronoiWeightsExpIface.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testDiscreteVoronoiWeightsExpIface.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.074954
+Standard Deviation is within tolerance, 0.000001 of 0.059645
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testDiscreteVoronoiWeightsPoly.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testDiscreteVoronoiWeightsPoly.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.011722
+Standard Deviation is within tolerance, 0.000001 of 0.009212
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testIterativeWeightsCircle.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testIterativeWeightsCircle.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.101720
+Standard Deviation is within tolerance, 0.000001 of 0.070065
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testIterativeWeightsExpIface.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testIterativeWeightsExpIface.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.088927
+Standard Deviation is within tolerance, 0.000001 of 0.066810
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testIterativeWeightsPoly.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testIterativeWeightsPoly.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.017526
+Standard Deviation is within tolerance, 0.000001 of 0.013522
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testMomentBalanceWeightsCircle.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testMomentBalanceWeightsCircle.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.097814
+Standard Deviation is within tolerance, 0.000001 of 0.068607
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testMomentBalanceWeightsExpIface.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testMomentBalanceWeightsExpIface.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.094671
+Standard Deviation is within tolerance, 0.000001 of 0.075287
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/expected/testMomentBalanceWeightsPoly.0of1.output.dat.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/expected/testMomentBalanceWeightsPoly.0of1.output.dat.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,2 @@
+Mean is within tolerance, 0.000001 of 0.016697
+Standard Deviation is within tolerance, 0.000001 of 0.013041
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/CircleInterface-ConstantWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/CircleInterface-ConstantWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.2057 0.15103
+9 	 0.13364 0.10562
+16 	 0.10318 0.075814
+25 	 0.080789 0.059822
+36 	 0.06702 0.050672
+49 	 0.059354 0.043738
+64 	 0.052897 0.039176
+81 	 0.046422 0.033891
+100 	 0.04056 0.029668
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/CircleInterface-DiscreteVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/CircleInterface-DiscreteVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.1965 0.10585
+9 	 0.14104 0.082751
+16 	 0.10762 0.072219
+25 	 0.081058 0.056531
+36 	 0.066951 0.047801
+49 	 0.054185 0.039996
+64 	 0.045118 0.033991
+81 	 0.03811 0.029457
+100 	 0.034787 0.026459
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/CircleInterface-IterativeVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/CircleInterface-IterativeVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.40246 0.80697
+9 	 0.16665 0.098246
+16 	 0.1178 0.076052
+25 	 0.08504 0.05876
+36 	 0.069266 0.049479
+49 	 0.055573 0.041057
+64 	 0.045924 0.034707
+81 	 0.03851 0.029915
+100 	 0.035117 0.026792
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/CircleInterface-IterativeWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/CircleInterface-IterativeWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.39348 0.53304
+9 	 0.1746 0.11087
+16 	 0.11811 0.082432
+25 	 0.086841 0.062704
+36 	 0.070575 0.052493
+49 	 0.061397 0.044612
+64 	 0.054111 0.040231
+81 	 0.047217 0.034798
+100 	 0.040846 0.030284
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/CircleInterface-MomentBalanceWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/CircleInterface-MomentBalanceWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.20509 0.14928
+9 	 0.14767 0.099675
+16 	 0.1119 0.078508
+25 	 0.084965 0.061561
+36 	 0.069878 0.051479
+49 	 0.060641 0.044404
+64 	 0.053647 0.03983
+81 	 0.046893 0.034583
+100 	 0.040654 0.030184
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/CircleInterface.gnu
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/CircleInterface.gnu	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,113 @@
+set terminal png
+set output "CircleInterface.png"
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 lt -1 lw 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key right top Right noreverse enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles
+unset label
+unset arrow
+unset style line
+unset style arrow
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis lt -2 lw 1.000
+set yzeroaxis lt -2 lw 1.000
+set x2zeroaxis lt -2 lw 1.000
+set y2zeroaxis lt -2 lw 1.000
+set tics in
+set ticslevel 0.5
+set ticscale 1 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border mirror norotate autofreq
+set ytics border mirror norotate autofreq
+set ztics border nomirror norotate autofreq
+set nox2tics
+set noy2tics
+set cbtics border mirror norotate autofreq
+set title "CircleInterface" 0.000000,0.000000  font ""
+set timestamp "" bottom norotate 0.000000,0.000000  ""
+set rrange [ * : * ] noreverse nowriteback  # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set xlabel "" 0.000000,0.000000  font ""
+set x2label "" 0.000000,0.000000  font ""
+set xrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set x2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set ylabel "" 0.000000,0.000000  font ""
+set y2label "" 0.000000,0.000000  font ""
+set yrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set y2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zlabel "" 0.000000,0.000000  font ""
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set cblabel "" 0.000000,0.000000  font ""
+set cbrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d scansautomatic flush begin noftriangles nohidden3d implicit corners2color mean
+unset pm3d
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin 0.9,0.2 size 0.1,0.63 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+plot "CircleInterface-ConstantWeights.dat" w l, "CircleInterface-MomentBalanceWeights.dat" w l, "CircleInterface-DiscreteVoronoiWeights.dat" w l, "CircleInterface-IterativeWeights.dat" w l, "CircleInterface-IterativeVoronoiWeights.dat" w l
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/CircleInterface.png
Binary file Weights/tests/graphs/CircleInterface.png has changed
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ConstantFunction-ConstantWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ConstantFunction-ConstantWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0 0
+9 	 0 0
+16 	 0 0
+25 	 5.9212e-16 9.9864e-23
+36 	 2.9606e-16 4.9932e-23
+49 	 5.9212e-16 9.9864e-23
+64 	 0 0
+81 	 7.4015e-16 nan
+100 	 1.6283e-15 3.53e-22
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ConstantFunction-DiscreteVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ConstantFunction-DiscreteVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 1.4877e-16 1.0441e-17
+9 	 1.4833e-16 6.6135e-18
+16 	 1.4803e-16 2.4966e-23
+25 	 1.4803e-16 2.4966e-23
+36 	 1.4803e-16 2.4966e-23
+49 	 1.4803e-16 2.4966e-23
+64 	 1.4803e-16 2.4966e-23
+81 	 1.4803e-16 2.4966e-23
+100 	 1.4803e-16 2.4966e-23
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ConstantFunction-IterativeVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ConstantFunction-IterativeVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 7.8456e-17 1.4315e-16
+9 	 8.1712e-17 9.0443e-17
+16 	 1.1324e-16 1.0465e-16
+25 	 1.393e-16 1.1819e-16
+36 	 1.7586e-16 1.4494e-16
+49 	 2.1746e-16 1.7232e-16
+64 	 2.407e-16 1.8946e-16
+81 	 2.8111e-16 2.1486e-16
+100 	 2.8718e-16 2.2226e-16
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ConstantFunction-IterativeWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ConstantFunction-IterativeWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 7.2535e-17 1.3272e-16
+9 	 8.112e-17 8.9027e-17
+16 	 1.1902e-16 1.0994e-16
+25 	 1.4403e-16 1.2493e-16
+36 	 1.7956e-16 1.3741e-16
+49 	 2.0117e-16 1.6775e-16
+64 	 2.3848e-16 1.9047e-16
+81 	 2.5432e-16 2.0621e-16
+100 	 2.857e-16 2.2377e-16
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ConstantFunction-MomentBalanceWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ConstantFunction-MomentBalanceWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 3.5527e-18 2.3603e-17
+9 	 5.5659e-17 8.0076e-17
+16 	 1.1517e-16 1.0723e-16
+25 	 1.7852e-16 1.4087e-16
+36 	 2.29e-16 1.7836e-16
+49 	 2.9991e-16 2.2814e-16
+64 	 3.9494e-16 2.8249e-16
+81 	 4.7488e-16 3.4813e-16
+100 	 5.8812e-16 4.3427e-16
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ConstantFunction.gnu
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ConstantFunction.gnu	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,113 @@
+set terminal png
+set output "ConstantFunction.png"
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 lt -1 lw 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key right top Right noreverse enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles
+unset label
+unset arrow
+unset style line
+unset style arrow
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis lt -2 lw 1.000
+set yzeroaxis lt -2 lw 1.000
+set x2zeroaxis lt -2 lw 1.000
+set y2zeroaxis lt -2 lw 1.000
+set tics in
+set ticslevel 0.5
+set ticscale 1 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border mirror norotate autofreq
+set ytics border mirror norotate autofreq
+set ztics border nomirror norotate autofreq
+set nox2tics
+set noy2tics
+set cbtics border mirror norotate autofreq
+set title "ConstantFunction" 0.000000,0.000000  font ""
+set timestamp "" bottom norotate 0.000000,0.000000  ""
+set rrange [ * : * ] noreverse nowriteback  # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set xlabel "" 0.000000,0.000000  font ""
+set x2label "" 0.000000,0.000000  font ""
+set xrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set x2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set ylabel "" 0.000000,0.000000  font ""
+set y2label "" 0.000000,0.000000  font ""
+set yrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set y2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zlabel "" 0.000000,0.000000  font ""
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set cblabel "" 0.000000,0.000000  font ""
+set cbrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d scansautomatic flush begin noftriangles nohidden3d implicit corners2color mean
+unset pm3d
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin 0.9,0.2 size 0.1,0.63 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+plot "ConstantFunction-ConstantWeights.dat" w l, "ConstantFunction-MomentBalanceWeights.dat" w l, "ConstantFunction-DiscreteVoronoiWeights.dat" w l, "ConstantFunction-IterativeWeights.dat" w l, "ConstantFunction-IterativeVoronoiWeights.dat" w l
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ConstantFunction.png
Binary file Weights/tests/graphs/ConstantFunction.png has changed
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialFunction-ConstantWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialFunction-ConstantWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+100 	 0.036651 0.028214
+100 	 0.036651 0.028214
+100 	 0.036651 0.028214
+100 	 0.036651 0.028214
+100 	 0.036651 0.028214
+100 	 0.036651 0.028214
+100 	 0.036651 0.028214
+100 	 0.036651 0.028214
+100 	 0.036651 0.028214
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialFunction-DiscreteVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialFunction-DiscreteVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+100 	 0.0091092 0.0071819
+100 	 0.0091092 0.0071819
+100 	 0.0091092 0.0071819
+100 	 0.0091092 0.0071819
+100 	 0.0091092 0.0071819
+100 	 0.0091092 0.0071819
+100 	 0.0091092 0.0071819
+100 	 0.0091092 0.0071819
+100 	 0.0091092 0.0071819
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialFunction-IterativeVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialFunction-IterativeVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+100 	 0.0075981 0.0057009
+100 	 0.0075981 0.0057009
+100 	 0.0075981 0.0057009
+100 	 0.0075981 0.0057009
+100 	 0.0075981 0.0057009
+100 	 0.0075981 0.0057009
+100 	 0.0075981 0.0057009
+100 	 0.0075981 0.0057009
+100 	 0.0075981 0.0057009
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialFunction-IterativeWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialFunction-IterativeWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+100 	 0.017549 0.013433
+100 	 0.017549 0.013433
+100 	 0.017549 0.013433
+100 	 0.017549 0.013433
+100 	 0.017549 0.013433
+100 	 0.017549 0.013433
+100 	 0.017549 0.013433
+100 	 0.017549 0.013433
+100 	 0.017549 0.013433
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialFunction-MomentBalanceWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialFunction-MomentBalanceWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+100 	 0.017409 0.013319
+100 	 0.017409 0.013319
+100 	 0.017409 0.013319
+100 	 0.017409 0.013319
+100 	 0.017409 0.013319
+100 	 0.017409 0.013319
+100 	 0.017409 0.013319
+100 	 0.017409 0.013319
+100 	 0.017409 0.013319
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialFunction.gnu
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialFunction.gnu	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,113 @@
+set terminal png
+set output "ExponentialFunction.png"
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 lt -1 lw 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key right top Right noreverse enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles
+unset label
+unset arrow
+unset style line
+unset style arrow
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis lt -2 lw 1.000
+set yzeroaxis lt -2 lw 1.000
+set x2zeroaxis lt -2 lw 1.000
+set y2zeroaxis lt -2 lw 1.000
+set tics in
+set ticslevel 0.5
+set ticscale 1 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border mirror norotate autofreq
+set ytics border mirror norotate autofreq
+set ztics border nomirror norotate autofreq
+set nox2tics
+set noy2tics
+set cbtics border mirror norotate autofreq
+set title "ExponentialFunction" 0.000000,0.000000  font ""
+set timestamp "" bottom norotate 0.000000,0.000000  ""
+set rrange [ * : * ] noreverse nowriteback  # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set xlabel "" 0.000000,0.000000  font ""
+set x2label "" 0.000000,0.000000  font ""
+set xrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set x2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set ylabel "" 0.000000,0.000000  font ""
+set y2label "" 0.000000,0.000000  font ""
+set yrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set y2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zlabel "" 0.000000,0.000000  font ""
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set cblabel "" 0.000000,0.000000  font ""
+set cbrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d scansautomatic flush begin noftriangles nohidden3d implicit corners2color mean
+unset pm3d
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin 0.9,0.2 size 0.1,0.63 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+plot "ExponentialFunction-ConstantWeights.dat" w l, "ExponentialFunction-MomentBalanceWeights.dat" w l, "ExponentialFunction-DiscreteVoronoiWeights.dat" w l, "ExponentialFunction-IterativeWeights.dat" w l, "ExponentialFunction-IterativeVoronoiWeights.dat" w l
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialFunction.png
Binary file Weights/tests/graphs/ExponentialFunction.png has changed
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialInterface-ConstantWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialInterface-ConstantWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.35737 0.22577
+9 	 0.23361 0.16259
+16 	 0.17004 0.12237
+25 	 0.13905 0.10269
+36 	 0.11517 0.086223
+49 	 0.10129 0.077407
+64 	 0.089457 0.066308
+81 	 0.078308 0.057448
+100 	 0.069653 0.050939
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialInterface-DiscreteVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialInterface-DiscreteVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.29516 0.24055
+9 	 0.14403 0.11992
+16 	 0.089543 0.070653
+25 	 0.064827 0.049965
+36 	 0.050887 0.039911
+49 	 0.042374 0.032312
+64 	 0.03676 0.027749
+81 	 0.032027 0.023645
+100 	 0.028754 0.020782
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialInterface-IterativeVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialInterface-IterativeVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.46187 0.7517
+9 	 0.15436 0.12934
+16 	 0.09708 0.073069
+25 	 0.067421 0.051684
+36 	 0.052859 0.040428
+49 	 0.043399 0.032573
+64 	 0.036314 0.027916
+81 	 0.032088 0.02349
+100 	 0.028987 0.0203
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialInterface-IterativeWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialInterface-IterativeWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.43511 0.59312
+9 	 0.14793 0.12316
+16 	 0.10229 0.076603
+25 	 0.078198 0.060274
+36 	 0.065143 0.050664
+49 	 0.055979 0.043058
+64 	 0.047001 0.036512
+81 	 0.042171 0.030601
+100 	 0.037033 0.027331
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialInterface-MomentBalanceWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialInterface-MomentBalanceWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.35831 0.22803
+9 	 0.19138 0.15754
+16 	 0.11453 0.092123
+25 	 0.082054 0.063477
+36 	 0.068672 0.053455
+49 	 0.057286 0.044396
+64 	 0.048636 0.037142
+81 	 0.043671 0.03192
+100 	 0.038462 0.028576
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialInterface.gnu
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ExponentialInterface.gnu	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,113 @@
+set terminal png
+set output "ExponentialInterface.png"
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 lt -1 lw 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key right top Right noreverse enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles
+unset label
+unset arrow
+unset style line
+unset style arrow
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis lt -2 lw 1.000
+set yzeroaxis lt -2 lw 1.000
+set x2zeroaxis lt -2 lw 1.000
+set y2zeroaxis lt -2 lw 1.000
+set tics in
+set ticslevel 0.5
+set ticscale 1 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border mirror norotate autofreq
+set ytics border mirror norotate autofreq
+set ztics border nomirror norotate autofreq
+set nox2tics
+set noy2tics
+set cbtics border mirror norotate autofreq
+set title "ExponentialInterface" 0.000000,0.000000  font ""
+set timestamp "" bottom norotate 0.000000,0.000000  ""
+set rrange [ * : * ] noreverse nowriteback  # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set xlabel "" 0.000000,0.000000  font ""
+set x2label "" 0.000000,0.000000  font ""
+set xrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set x2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set ylabel "" 0.000000,0.000000  font ""
+set y2label "" 0.000000,0.000000  font ""
+set yrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set y2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zlabel "" 0.000000,0.000000  font ""
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set cblabel "" 0.000000,0.000000  font ""
+set cbrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d scansautomatic flush begin noftriangles nohidden3d implicit corners2color mean
+unset pm3d
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin 0.9,0.2 size 0.1,0.63 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+plot "ExponentialInterface-ConstantWeights.dat" w l, "ExponentialInterface-MomentBalanceWeights.dat" w l, "ExponentialInterface-DiscreteVoronoiWeights.dat" w l, "ExponentialInterface-IterativeWeights.dat" w l, "ExponentialInterface-IterativeVoronoiWeights.dat" w l
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ExponentialInterface.png
Binary file Weights/tests/graphs/ExponentialInterface.png has changed
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/LinearFunction-ConstantWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/LinearFunction-ConstantWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.27485 0.20278
+9 	 0.18218 0.13606
+16 	 0.13358 0.10363
+25 	 0.10582 0.080264
+36 	 0.090286 0.067984
+49 	 0.079477 0.059513
+64 	 0.068426 0.052776
+81 	 0.061088 0.046339
+100 	 0.055251 0.041923
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/LinearFunction-DiscreteVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/LinearFunction-DiscreteVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.17341 0.15809
+9 	 0.068921 0.063613
+16 	 0.036244 0.032442
+25 	 0.023305 0.019747
+36 	 0.017094 0.013677
+49 	 0.013572 0.011221
+64 	 0.011728 0.0088553
+81 	 0.010202 0.0076908
+100 	 0.0091648 0.0069417
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/LinearFunction-IterativeVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/LinearFunction-IterativeVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.00033013 0.0026858
+9 	 9.1016e-05 5.4291e-05
+16 	 8.6043e-05 5.1495e-05
+25 	 8.2394e-05 5.0897e-05
+36 	 8.2091e-05 4.8948e-05
+49 	 7.8912e-05 4.9141e-05
+64 	 8.0278e-05 5.1717e-05
+81 	 7.9239e-05 5.0548e-05
+100 	 7.7171e-05 4.9801e-05
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/LinearFunction-IterativeWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/LinearFunction-IterativeWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.00028199 0.0021736
+9 	 9.0024e-05 5.3024e-05
+16 	 8.5818e-05 5.1011e-05
+25 	 8.0152e-05 4.9494e-05
+36 	 8.3411e-05 5.1979e-05
+49 	 8.021e-05 5.0358e-05
+64 	 7.8582e-05 4.9361e-05
+81 	 7.9641e-05 5.0839e-05
+100 	 7.7283e-05 5.1672e-05
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/LinearFunction-MomentBalanceWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/LinearFunction-MomentBalanceWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.2638 0.21246
+9 	 0.064467 0.13364
+16 	 0.0072335 0.04352
+25 	 0.00072169 0.013091
+36 	 1.1979e-16 1.1488e-16
+49 	 1.3789e-16 1.2538e-16
+64 	 1.5921e-16 1.4173e-16
+81 	 1.7397e-16 1.5099e-16
+100 	 2.0828e-16 1.7058e-16
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/LinearFunction.gnu
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/LinearFunction.gnu	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,113 @@
+set terminal png
+set output "LinearFunction.png"
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 lt -1 lw 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key right top Right noreverse enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles
+unset label
+unset arrow
+unset style line
+unset style arrow
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis lt -2 lw 1.000
+set yzeroaxis lt -2 lw 1.000
+set x2zeroaxis lt -2 lw 1.000
+set y2zeroaxis lt -2 lw 1.000
+set tics in
+set ticslevel 0.5
+set ticscale 1 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border mirror norotate autofreq
+set ytics border mirror norotate autofreq
+set ztics border nomirror norotate autofreq
+set nox2tics
+set noy2tics
+set cbtics border mirror norotate autofreq
+set title "LinearFunction" 0.000000,0.000000  font ""
+set timestamp "" bottom norotate 0.000000,0.000000  ""
+set rrange [ * : * ] noreverse nowriteback  # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set xlabel "" 0.000000,0.000000  font ""
+set x2label "" 0.000000,0.000000  font ""
+set xrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set x2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set ylabel "" 0.000000,0.000000  font ""
+set y2label "" 0.000000,0.000000  font ""
+set yrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set y2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zlabel "" 0.000000,0.000000  font ""
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set cblabel "" 0.000000,0.000000  font ""
+set cbrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d scansautomatic flush begin noftriangles nohidden3d implicit corners2color mean
+unset pm3d
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin 0.9,0.2 size 0.1,0.63 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+plot "LinearFunction-ConstantWeights.dat" w l, "LinearFunction-MomentBalanceWeights.dat" w l, "LinearFunction-DiscreteVoronoiWeights.dat" w l, "LinearFunction-IterativeWeights.dat" w l, "LinearFunction-IterativeVoronoiWeights.dat" w l
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/LinearFunction.png
Binary file Weights/tests/graphs/LinearFunction.png has changed
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/PolynomialFunction-ConstantWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/PolynomialFunction-ConstantWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.036202 0.026662
+9 	 0.025709 0.019381
+16 	 0.019354 0.015073
+25 	 0.01573 0.012407
+36 	 0.012927 0.0099009
+49 	 0.011401 0.0085932
+64 	 0.010113 0.007458
+81 	 0.0090357 0.0067754
+100 	 0.0079946 0.0059134
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/PolynomialFunction-DiscreteVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/PolynomialFunction-DiscreteVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.03603 0.023173
+9 	 0.021971 0.015611
+16 	 0.014673 0.011018
+25 	 0.0097605 0.0074893
+36 	 0.0071115 0.0055014
+49 	 0.0054378 0.0041392
+64 	 0.004395 0.0034414
+81 	 0.0035149 0.0029036
+100 	 0.0031314 0.0023652
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/PolynomialFunction-IterativeVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/PolynomialFunction-IterativeVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.067749 0.10368
+9 	 0.026356 0.019496
+16 	 0.016425 0.012511
+25 	 0.010351 0.0079279
+36 	 0.0074192 0.0057014
+49 	 0.0056337 0.0042338
+64 	 0.0044293 0.0034735
+81 	 0.0035253 0.0028239
+100 	 0.0030809 0.0023573
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/PolynomialFunction-IterativeWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/PolynomialFunction-IterativeWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.066077 0.078804
+9 	 0.029004 0.022745
+16 	 0.020791 0.015855
+25 	 0.01517 0.011719
+36 	 0.012374 0.0092544
+49 	 0.010391 0.0078101
+64 	 0.0091235 0.0067574
+81 	 0.0080776 0.0058845
+100 	 0.0070281 0.0053026
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/PolynomialFunction-MomentBalanceWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/PolynomialFunction-MomentBalanceWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.036339 0.026788
+9 	 0.026335 0.019306
+16 	 0.019833 0.014694
+25 	 0.014435 0.011323
+36 	 0.011747 0.0089252
+49 	 0.0099948 0.0076434
+64 	 0.0089267 0.0066471
+81 	 0.0079372 0.0058138
+100 	 0.0069066 0.0052319
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/PolynomialFunction.gnu
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/PolynomialFunction.gnu	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,113 @@
+set terminal png
+set output "PolynomialFunction.png"
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 lt -1 lw 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key right top Right noreverse enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles
+unset label
+unset arrow
+unset style line
+unset style arrow
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis lt -2 lw 1.000
+set yzeroaxis lt -2 lw 1.000
+set x2zeroaxis lt -2 lw 1.000
+set y2zeroaxis lt -2 lw 1.000
+set tics in
+set ticslevel 0.5
+set ticscale 1 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border mirror norotate autofreq
+set ytics border mirror norotate autofreq
+set ztics border nomirror norotate autofreq
+set nox2tics
+set noy2tics
+set cbtics border mirror norotate autofreq
+set title "PolynomialFunction" 0.000000,0.000000  font ""
+set timestamp "" bottom norotate 0.000000,0.000000  ""
+set rrange [ * : * ] noreverse nowriteback  # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set xlabel "" 0.000000,0.000000  font ""
+set x2label "" 0.000000,0.000000  font ""
+set xrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set x2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set ylabel "" 0.000000,0.000000  font ""
+set y2label "" 0.000000,0.000000  font ""
+set yrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set y2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zlabel "" 0.000000,0.000000  font ""
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set cblabel "" 0.000000,0.000000  font ""
+set cbrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d scansautomatic flush begin noftriangles nohidden3d implicit corners2color mean
+unset pm3d
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin 0.9,0.2 size 0.1,0.63 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+plot "PolynomialFunction-ConstantWeights.dat" w l, "PolynomialFunction-MomentBalanceWeights.dat" w l, "PolynomialFunction-DiscreteVoronoiWeights.dat" w l, "PolynomialFunction-IterativeWeights.dat" w l, "PolynomialFunction-IterativeVoronoiWeights.dat" w l
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/PolynomialFunction.png
Binary file Weights/tests/graphs/PolynomialFunction.png has changed
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/QuadraticFunction-ConstantWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/QuadraticFunction-ConstantWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.19834 0.12875
+9 	 0.12768 0.089319
+16 	 0.093546 0.068286
+25 	 0.074786 0.054007
+36 	 0.062325 0.046017
+49 	 0.053114 0.04055
+64 	 0.04676 0.035439
+81 	 0.041762 0.031759
+100 	 0.036651 0.028214
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/QuadraticFunction-DiscreteVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/QuadraticFunction-DiscreteVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.1617 0.12346
+9 	 0.074461 0.065615
+16 	 0.042773 0.03762
+25 	 0.027765 0.024899
+36 	 0.020306 0.017315
+49 	 0.015163 0.01314
+64 	 0.01261 0.010133
+81 	 0.010535 0.0083319
+100 	 0.0091092 0.0071819
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/QuadraticFunction-IterativeVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/QuadraticFunction-IterativeVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.17363 0.18013
+9 	 0.070511 0.054884
+16 	 0.03936 0.031458
+25 	 0.025903 0.021141
+36 	 0.018547 0.014636
+49 	 0.013614 0.011089
+64 	 0.010817 0.0086628
+81 	 0.0088628 0.0069021
+100 	 0.0075981 0.0057009
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/QuadraticFunction-IterativeWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/QuadraticFunction-IterativeWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.17191 0.16148
+9 	 0.07769 0.061023
+16 	 0.048579 0.037543
+25 	 0.038908 0.028525
+36 	 0.031639 0.023221
+49 	 0.026334 0.019521
+64 	 0.022687 0.017401
+81 	 0.01966 0.014853
+100 	 0.017549 0.013433
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/QuadraticFunction-MomentBalanceWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/QuadraticFunction-MomentBalanceWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.195 0.1302
+9 	 0.091965 0.077614
+16 	 0.050938 0.042023
+25 	 0.038803 0.02945
+36 	 0.031045 0.022603
+49 	 0.025905 0.019024
+64 	 0.022457 0.017132
+81 	 0.01951 0.014756
+100 	 0.017409 0.013319
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/QuadraticFunction.gnu
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/QuadraticFunction.gnu	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,113 @@
+set terminal png
+set output "QuadraticFunction.png"
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 lt -1 lw 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key right top Right noreverse enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles
+unset label
+unset arrow
+unset style line
+unset style arrow
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis lt -2 lw 1.000
+set yzeroaxis lt -2 lw 1.000
+set x2zeroaxis lt -2 lw 1.000
+set y2zeroaxis lt -2 lw 1.000
+set tics in
+set ticslevel 0.5
+set ticscale 1 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border mirror norotate autofreq
+set ytics border mirror norotate autofreq
+set ztics border nomirror norotate autofreq
+set nox2tics
+set noy2tics
+set cbtics border mirror norotate autofreq
+set title "QuadraticFunction" 0.000000,0.000000  font ""
+set timestamp "" bottom norotate 0.000000,0.000000  ""
+set rrange [ * : * ] noreverse nowriteback  # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set xlabel "" 0.000000,0.000000  font ""
+set x2label "" 0.000000,0.000000  font ""
+set xrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set x2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set ylabel "" 0.000000,0.000000  font ""
+set y2label "" 0.000000,0.000000  font ""
+set yrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set y2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zlabel "" 0.000000,0.000000  font ""
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set cblabel "" 0.000000,0.000000  font ""
+set cbrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d scansautomatic flush begin noftriangles nohidden3d implicit corners2color mean
+unset pm3d
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin 0.9,0.2 size 0.1,0.63 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+plot "QuadraticFunction-ConstantWeights.dat" w l, "QuadraticFunction-MomentBalanceWeights.dat" w l, "QuadraticFunction-DiscreteVoronoiWeights.dat" w l, "QuadraticFunction-IterativeWeights.dat" w l, "QuadraticFunction-IterativeVoronoiWeights.dat" w l
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/QuadraticFunction.png
Binary file Weights/tests/graphs/QuadraticFunction.png has changed
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ShapeFunction-ConstantWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ShapeFunction-ConstantWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.33882 0.23187
+9 	 0.23125 0.16378
+16 	 0.17369 0.12301
+25 	 0.14478 0.10505
+36 	 0.11626 0.088561
+49 	 0.10106 0.074349
+64 	 0.087826 0.063458
+81 	 0.079159 0.057265
+100 	 0.069788 0.052432
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ShapeFunction-DiscreteVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ShapeFunction-DiscreteVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.23372 0.19563
+9 	 0.1016 0.094454
+16 	 0.055082 0.05179
+25 	 0.034082 0.029966
+36 	 0.024845 0.021313
+49 	 0.018661 0.015261
+64 	 0.01546 0.012411
+81 	 0.013584 0.010416
+100 	 0.012088 0.0093204
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ShapeFunction-IterativeVoronoiWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ShapeFunction-IterativeVoronoiWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.19636 0.23157
+9 	 0.07487 0.06771
+16 	 0.039536 0.035253
+25 	 0.022108 0.020082
+36 	 0.015406 0.013521
+49 	 0.01069 0.009597
+64 	 0.008534 0.0068124
+81 	 0.0074183 0.0056969
+100 	 0.0064637 0.0049001
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ShapeFunction-IterativeWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ShapeFunction-IterativeWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.20929 0.18546
+9 	 0.11442 0.095461
+16 	 0.083058 0.064525
+25 	 0.061775 0.047259
+36 	 0.050298 0.038505
+49 	 0.041947 0.032417
+64 	 0.035768 0.027627
+81 	 0.030972 0.024167
+100 	 0.027852 0.02139
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ShapeFunction-MomentBalanceWeights.dat
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ShapeFunction-MomentBalanceWeights.dat	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+4 	 0.33005 0.23764
+9 	 0.13835 0.15417
+16 	 0.077741 0.071994
+25 	 0.057735 0.046889
+36 	 0.047517 0.036049
+49 	 0.040031 0.031233
+64 	 0.034704 0.026806
+81 	 0.030234 0.023608
+100 	 0.027092 0.021039
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ShapeFunction.gnu
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/graphs/ShapeFunction.gnu	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,113 @@
+set terminal png
+set output "ShapeFunction.png"
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 lt -1 lw 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key right top Right noreverse enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles
+unset label
+unset arrow
+unset style line
+unset style arrow
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis lt -2 lw 1.000
+set yzeroaxis lt -2 lw 1.000
+set x2zeroaxis lt -2 lw 1.000
+set y2zeroaxis lt -2 lw 1.000
+set tics in
+set ticslevel 0.5
+set ticscale 1 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border mirror norotate autofreq
+set ytics border mirror norotate autofreq
+set ztics border nomirror norotate autofreq
+set nox2tics
+set noy2tics
+set cbtics border mirror norotate autofreq
+set title "ShapeFunction" 0.000000,0.000000  font ""
+set timestamp "" bottom norotate 0.000000,0.000000  ""
+set rrange [ * : * ] noreverse nowriteback  # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set xlabel "" 0.000000,0.000000  font ""
+set x2label "" 0.000000,0.000000  font ""
+set xrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set x2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set ylabel "" 0.000000,0.000000  font ""
+set y2label "" 0.000000,0.000000  font ""
+set yrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set y2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zlabel "" 0.000000,0.000000  font ""
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set cblabel "" 0.000000,0.000000  font ""
+set cbrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d scansautomatic flush begin noftriangles nohidden3d implicit corners2color mean
+unset pm3d
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin 0.9,0.2 size 0.1,0.63 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+plot "ShapeFunction-ConstantWeights.dat" w l, "ShapeFunction-MomentBalanceWeights.dat" w l, "ShapeFunction-DiscreteVoronoiWeights.dat" w l, "ShapeFunction-IterativeWeights.dat" w l, "ShapeFunction-IterativeVoronoiWeights.dat" w l
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/graphs/ShapeFunction.png
Binary file Weights/tests/graphs/ShapeFunction.png has changed
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,72 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# External Libraries and Headers
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT} ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS}
+EXTERNAL_LIBS = ${RPATH_LFLAGS} -L${LIB_DIR} -l${PROJECT}Weights -l${PROJECT}Voronoi -l${PROJECT}PopulationControl ${STGFEM_LIBS} ${STGERMAIN_LIBS} ${MPI_LIBS} ${XML_LIBS}
+
+
+packages = STGFEM STGERMAIN PETSC MPI XML MATH
+
+# Subdirectories
+subdirs := plugins
+
+checks = $(wildcard *.sh)
+
+def_tst = libPICelleratorWeights
+
+tests = ${def_tst}
+
+def_srcs = testDVCWeights.c
+
+SRCS = ${def_srcs}
+
+
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/plugins/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/plugins/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,57 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# External Libraries and Headers
+packages = STGFEM STGERMAIN MPI XML 
+
+# Note don't put the .c extension. just the base name of the plugin
+plugins := testElementIntegral
+
+include ${PROJ_ROOT}/Makefile.vmake
+
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/plugins/testElementIntegral.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/plugins/testElementIntegral.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,286 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: testElementIntegral.c 445 2007-03-22 01:04:29Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/Weights/Weights.h>
+
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+/* forward declaration. Implementation exists in MaterialPoints module */
+extern void _IntegrationPointsSwarm_UpdateHook( void* timeIntegrator, void* swarm );
+
+
+const Type TestElementIntegral_Type = "TestElementIntegral";
+
+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 testElementIntegral_CompareAgainstReferenceSolution(DiscretisationContext* context, Stream* stream, double mean, double standardDeviation) {
+	double meanTolerance, stdDevTolerance;
+	double expectedMean, expectedStdDev;
+	double differenceMean, differenceStdDev;	
+	/* Get the tolerance */
+	meanTolerance = Dictionary_GetDouble_WithDefault( context->dictionary, "mean-tolerance", 0.005 );
+	stdDevTolerance = Dictionary_GetDouble_WithDefault( context->dictionary, "standardDeviation-tolerance", 0.005 );
+	
+	/* Get the expected values */
+	expectedMean = Dictionary_GetDouble_WithDefault(context->dictionary, "mean-expectedValue", 0.5);
+	expectedStdDev = Dictionary_GetDouble_WithDefault(context->dictionary, "standardDeviation-expectedValue", 0.5);
+	
+	/* compare the values */
+	differenceMean = fabs(mean - expectedMean);
+	differenceStdDev = fabs(standardDeviation - expectedStdDev);
+	
+	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "output.dat" );
+	
+	if (differenceMean <= meanTolerance ) {
+		Journal_Printf(stream, "Mean is within tolerance, %f of %f\n",
+			meanTolerance, expectedMean);
+	}
+	else {
+		Journal_Printf(stream, "Mean is not within tolerance, %f of %f\n",
+			meanTolerance, expectedMean);
+		Journal_Printf(stream, "	value = ( %f ) \n", mean );
+	}
+	if ( differenceStdDev <= stdDevTolerance ) {
+		Journal_Printf(stream, "Standard Deviation is within tolerance, %f of %f\n",
+			stdDevTolerance, expectedStdDev);
+	}
+	else {
+		Journal_Printf(stream, "Standard Deviation is not within tolerance, %f of %f\n",
+			stdDevTolerance, expectedStdDev);
+		Journal_Printf(stream, "	value = ( %f ) \n", standardDeviation);
+	}
+	
+	
+}
+
+
+void PICellerator_testElementIntegral( DiscretisationContext* context ) {
+	Swarm*              integrationSwarm = (Swarm*)LiveComponentRegister_Get( context->CF->LCRegister, "swarm" );
+	Swarm*              materialSwarm    = (Swarm*)LiveComponentRegister_Get( context->CF->LCRegister, "picIntegrationPoints" );
+	FiniteElement_Mesh* mesh             = (FiniteElement_Mesh*) LiveComponentRegister_Get( context->CF->LCRegister, "mesh-linear" );
+	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;
+	Index               count            = Dictionary_GetUnsignedInt_WithDefault( context->dictionary, "SampleSize", 5000 );
+	Name                funcName;
+	Stream*             stream           = Journal_Register( Info_Type, CURR_MODULE_NAME );
+	/*ElementLayout*      elementLayout    = mesh->layout->elementLayout;*/
+	void*               data;
+
+	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, StgFEM_Native_ImportExportType, StgFEM_Native_ImportExportType,
+			MPI_COMM_WORLD, context->fieldVariable_Register );
+
+	funcName = Dictionary_GetString( context->dictionary, "FunctionName" );
+	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, CURR_MODULE_NAME ),
+				"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 mean and standardDeviation against ref. solution
+		to a tolerance taken from the xml files. */
+	testElementIntegral_CompareAgainstReferenceSolution(context, stream, mean, standardDeviation );
+
+	
+	/* Write to file */
+/*	Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, "output.dat" );
+	/Journal_Printf( stream, "%u \t %.5g %.5g\n", integrationSwarm->cellParticleCountTbl[ lElement_I ], mean, standardDeviation );
+*/	
+}
+	
+	
+void _testElementIntegral_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	DiscretisationContext* context;
+	context = (DiscretisationContext*)Stg_ComponentFactory_ConstructByName( cf, "context", DiscretisationContext, True, data ); 
+
+	ContextEP_ReplaceAll( context, AbstractContext_EP_Execute, PICellerator_testElementIntegral );
+}
+
+
+void* _testElementIntegral_DefaultNew( Name name ) {
+	return _Codelet_New(
+			sizeof( Codelet ),
+			TestElementIntegral_Type,
+			_Codelet_Delete,
+			_Codelet_Print,
+			_Codelet_Copy,
+			_testElementIntegral_DefaultNew,
+			_testElementIntegral_Construct,
+			_Codelet_Build,
+			_Codelet_Initialise,
+			_Codelet_Execute,
+			_Codelet_Destroy,
+			name );
+}
+
+
+Index testElementIntegral_Register( PluginsManager* pluginsManager ) {
+	Index result;
+
+	result = PluginsManager_Submit( pluginsManager, TestElementIntegral_Type, "0",
+		_testElementIntegral_DefaultNew );
+
+	return result;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/scripts/makeAllGraphs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/scripts/makeAllGraphs	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+weights=$1
+
+for function in ConstantFunction LinearFunction ShapeFunction PolynomialFunction QuadraticFunction ExponentialFunction ExponentialInterface CircleInterface ; do
+	echo "Creating Graph for function $function and weights routine ${weights}"
+	./makeGraph ./test${weights}.xml --FunctionName=$function
+	mv output/graph.dat graphs/$function-$weights.dat
+done
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/scripts/makeAllGraphsForAllWeights
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/scripts/makeAllGraphsForAllWeights	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+for weights in ConstantWeights MomentBalanceWeights IterativeWeights DiscreteVoronoiWeights IterativeVoronoiWeights ; do
+	echo "Creating all graphs for weights routine ${weights}"
+	./makeAllGraphs $weights
+done
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/scripts/makeGnuplotFiles
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/scripts/makeGnuplotFiles	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,119 @@
+#!/bin/bash
+
+for function in ConstantFunction LinearFunction ShapeFunction PolynomialFunction QuadraticFunction ExponentialFunction ExponentialInterface CircleInterface ; do
+	cat << EOF > graphs/$function.gnu
+set terminal png
+set output "${function}.png"
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 lt -1 lw 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key right top Right noreverse enhanced box linetype -2 linewidth 1.000 samplen 4 spacing 1 width 0 height 0 autotitles
+unset label
+unset arrow
+unset style line
+unset style arrow
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis lt -2 lw 1.000
+set yzeroaxis lt -2 lw 1.000
+set x2zeroaxis lt -2 lw 1.000
+set y2zeroaxis lt -2 lw 1.000
+set tics in
+set ticslevel 0.5
+set ticscale 1 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border mirror norotate autofreq
+set ytics border mirror norotate autofreq
+set ztics border nomirror norotate autofreq
+set nox2tics
+set noy2tics
+set cbtics border mirror norotate autofreq
+set title "${function}" 0.000000,0.000000  font ""
+set timestamp "" bottom norotate 0.000000,0.000000  ""
+set rrange [ * : * ] noreverse nowriteback  # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set xlabel "" 0.000000,0.000000  font ""
+set x2label "" 0.000000,0.000000  font ""
+set xrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set x2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set ylabel "" 0.000000,0.000000  font ""
+set y2label "" 0.000000,0.000000  font ""
+set yrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set y2range [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zlabel "" 0.000000,0.000000  font ""
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set cblabel "" 0.000000,0.000000  font ""
+set cbrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d scansautomatic flush begin noftriangles nohidden3d implicit corners2color mean
+unset pm3d
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin 0.9,0.2 size 0.1,0.63 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+plot "${function}-ConstantWeights.dat" w l, "${function}-MomentBalanceWeights.dat" w l, "${function}-DiscreteVoronoiWeights.dat" w l, "${function}-IterativeWeights.dat" w l, "${function}-IterativeVoronoiWeights.dat" w l
+
+EOF
+done
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/scripts/makeGraph
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/scripts/makeGraph	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if test -r output/graph.dat ; then
+	rm output/graph.dat
+fi
+
+for i in 4 9 16 25 36 49 64 81 100 ; do 
+	./PICellerator $@ --particleCount=$i > /dev/null
+	cat output/output.dat >> output/graph.dat
+	cat output/output.dat
+done
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testConstantWeights.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testConstantWeights.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>testElementIntegral.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="weights">
+			<param name="Type">ConstantWeights</param>
+		</struct>		
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testConstantWeightsCircle.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testConstantWeightsCircle.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testConstantWeights.xml --FunctionName=CircleInterface --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.091215 --standardDeviation-expectedValue=0.066458" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testConstantWeightsExpIface.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testConstantWeightsExpIface.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testConstantWeights.xml --FunctionName=ExponentialInterface --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.155483 --standardDeviation-expectedValue=0.116796" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testConstantWeightsPoly.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testConstantWeightsPoly.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testConstantWeights.xml --FunctionName=PolynomialFunction --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.017475 --standardDeviation-expectedValue=0.013738" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDVCWeights.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDVCWeights.0of1.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,333 @@
+StGermain Framework revision 3947. Copyright (C) 2003-2005 VPAC.
+StGermain Discretisation Library revision 3947. Copyright (C) 2003-2005 VPAC.
+StGermain Finite Element Framework revision 695. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Discretisation Framework revision 695. Copyright (C) 2003-2005 VPAC.
+StGermain SLE Library revision 695. Copyright (C) 2003-2005 VPAC.
+StGermain PETSc-LinearAlgebra Interface revision 695. Copyright (C) 2003-2005 VPAC.
+StGermain FEM Assembly Library revision 695. Copyright (C) 2003-2005 VPAC.
+-----------------------------
+3D functions:  
+-----------------------------
+
+****************************
+Test _DVCWeights_ConstructGrid function 
+****************************
+size of element:
+	 x = (-1.000000, 1.000000)
+	 y = (-1.000000, 1.000000) 
+	 z = (-1.000000, 1.000000)
+Resolution: 
+	 (x, y, z) = (2, 2, 2)
+cell[0]:	Particle Index: -1
+ 		Values: (N: 2, S: -2, E: 1, W: -2, U: 4, D: -2) 
+ 		Coords: (-0.500000, -0.500000,-0.500000) 	 Done = 0
+cell[1]:	Particle Index: -1
+ 		Values: (N: 3, S: -2, E: -2, W: 0, U: 5, D: -2) 
+ 		Coords: (0.500000, -0.500000,-0.500000) 	 Done = 0
+cell[2]:	Particle Index: -1
+ 		Values: (N: -2, S: 0, E: 3, W: -2, U: 6, D: -2) 
+ 		Coords: (-0.500000, 0.500000,-0.500000) 	 Done = 0
+cell[3]:	Particle Index: -1
+ 		Values: (N: -2, S: 1, E: -2, W: 2, U: 7, D: -2) 
+ 		Coords: (0.500000, 0.500000,-0.500000) 	 Done = 0
+cell[4]:	Particle Index: -1
+ 		Values: (N: 6, S: -2, E: 5, W: -2, U: -2, D: 0) 
+ 		Coords: (-0.500000, -0.500000,0.500000) 	 Done = 0
+cell[5]:	Particle Index: -1
+ 		Values: (N: 7, S: -2, E: -2, W: 4, U: -2, D: 1) 
+ 		Coords: (0.500000, -0.500000,0.500000) 	 Done = 0
+cell[6]:	Particle Index: -1
+ 		Values: (N: -2, S: 4, E: 7, W: -2, U: -2, D: 2) 
+ 		Coords: (-0.500000, 0.500000,0.500000) 	 Done = 0
+cell[7]:	Particle Index: -1
+ 		Values: (N: -2, S: 5, E: -2, W: 6, U: -2, D: 3) 
+ 		Coords: (0.500000, 0.500000,0.500000) 	 Done = 0
+****************************
+Test _DVCWeights_InitialiseStructs function 
+****************************
+bchain[0]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain[1]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain[2]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain[3]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain[4]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain[5]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain[6]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain[7]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+****************************
+Test _DVCWeights_ResetGrid function 
+****************************
+numz * numy * numx = 8
+cells[0].p = -1 	 cells[0].done = 0
+cells[1].p = -1 	 cells[1].done = 0
+cells[2].p = -1 	 cells[2].done = 0
+cells[3].p = -1 	 cells[3].done = 0
+cells[4].p = -1 	 cells[4].done = 0
+cells[5].p = -1 	 cells[5].done = 0
+cells[6].p = -1 	 cells[6].done = 0
+cells[7].p = -1 	 cells[7].done = 0
+****************************
+Test _DVCWeights_CreateVoronoi function 
+****************************
+pList[0]:		 coords: (x, y, z) = (0.333333, 0.333333, 0.333333)
+pList[1]:		 coords: (x, y, z) = (0.333333, 0.333333, 0.666667)
+pList[2]:		 coords: (x, y, z) = (0.333333, 0.666667, 0.333333)
+pList[3]:		 coords: (x, y, z) = (0.333333, 0.666667, 0.666667)
+pList[4]:		 coords: (x, y, z) = (0.666667, 0.333333, 0.333333)
+pList[5]:		 coords: (x, y, z) = (0.666667, 0.333333, 0.666667)
+pList[6]:		 coords: (x, y, z) = (0.666667, 0.666667, 0.333333)
+pList[7]:		 coords: (x, y, z) = (0.666667, 0.666667, 0.666667)
+
+(dx, dy, dz) = (1.000000, 1.000000, 1.000000)	da = 1.000000
+
+bchain[0]: 	 index = 7 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain[1]: 	 index = 7 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain[2]: 	 index = 7 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain[3]: 	 index = 7 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain[4]: 	 index = 7 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain[5]: 	 index = 7 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain[6]: 	 index = 7 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain[7]: 	 index = 7 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+pList[0]:
+		 coords: (x, y, z) = (0.333333, 0.333333, 0.333333)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[1]:
+		 coords: (x, y, z) = (0.333333, 0.333333, 0.666667)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[2]:
+		 coords: (x, y, z) = (0.333333, 0.666667, 0.333333)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[3]:
+		 coords: (x, y, z) = (0.333333, 0.666667, 0.666667)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[4]:
+		 coords: (x, y, z) = (0.666667, 0.333333, 0.333333)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[5]:
+		 coords: (x, y, z) = (0.666667, 0.333333, 0.666667)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[6]:
+		 coords: (x, y, z) = (0.666667, 0.666667, 0.333333)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[7]:
+		 coords: (x, y, z) = (0.666667, 0.666667, 0.666667)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+****************************
+Test _DVCWeights_GetCentroids function 
+****************************
+pList[0]:
+		 coords: (x, y, z) = (0.333333, 0.333333, 0.333333)
+		 centroids: (cx, cy, cz) = (-0.071429, -0.071429 -0.071429)
+		 weight = 7.000000
+pList[1]:
+		 coords: (x, y, z) = (0.333333, 0.333333, 0.666667)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[2]:
+		 coords: (x, y, z) = (0.333333, 0.666667, 0.333333)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[3]:
+		 coords: (x, y, z) = (0.333333, 0.666667, 0.666667)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[4]:
+		 coords: (x, y, z) = (0.666667, 0.333333, 0.333333)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[5]:
+		 coords: (x, y, z) = (0.666667, 0.333333, 0.666667)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[6]:
+		 coords: (x, y, z) = (0.666667, 0.666667, 0.333333)
+		 centroids: (cx, cy, cz) = (0.000000, 0.000000 0.000000)
+		 weight = 0.000000
+pList[7]:
+		 coords: (x, y, z) = (0.666667, 0.666667, 0.666667)
+		 centroids: (cx, cy, cz) = (0.500000, 0.500000 0.500000)
+		 weight = 1.000000
+****************************
+Test _DVCWeights_DistanceSquared function 
+****************************
+particle0:
+		 coords: (x, y, z) = (0.500000, 0.500000, 0.500000)
+particle1:
+		 coords: (x, y, z) = (0.250000, 0.250000, 0.000000)
+calculated distance^2 between particles = 0.375000 
+
+-----------------------------
+2D functions:  
+-----------------------------
+
+****************************
+Test _DVCWeights_ConstructGrid2D function 
+****************************
+size of element:
+	 x = (-1.000000, 1.000000)
+	 y = (-1.000000, 1.000000) 
+Resolution: 
+	 (x, y) = (2, 2)
+cells2d[0]:	Particle Index: -1 
+ 		Values: (N: 2, S: -2, E: 1, W: -2) 
+ 		Coords: (-0.500000, -0.500000) 	 Done = 0
+cells2d[1]:	Particle Index: -1 
+ 		Values: (N: 3, S: -2, E: -2, W: 0) 
+ 		Coords: (0.500000, -0.500000) 	 Done = 0
+cells2d[2]:	Particle Index: -1 
+ 		Values: (N: -2, S: 0, E: 3, W: -2) 
+ 		Coords: (-0.500000, 0.500000) 	 Done = 0
+cells2d[3]:	Particle Index: -1 
+ 		Values: (N: -2, S: 1, E: -2, W: 2) 
+ 		Coords: (0.500000, 0.500000) 	 Done = 0
+****************************
+Test _DVCWeights_InitialiseStructs2D function 
+****************************
+bchain2D[0]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain2D[1]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain2D[2]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+bchain2D[3]: No of new_claimed_cells = 50, No of new_bound_cells = 50
+****************************
+Test _DVCWeights_ResetGrid2D function 
+****************************
+numz * numy = 4
+cells2D[0].p = -1 	 cells2D[0].done = 0
+cells2D[1].p = -1 	 cells2D[1].done = 0
+cells2D[2].p = -1 	 cells2D[2].done = 0
+cells2D[3].p = -1 	 cells2D[3].done = 0
+****************************
+Test _DVCWeights_CreateVoronoi2D function 
+****************************
+pList2D[0]:		 coords: (x, y) = (0.333333, 0.333333)
+pList2D[1]:		 coords: (x, y) = (0.333333, 0.666667)
+pList2D[2]:		 coords: (x, y) = (0.666667, 0.333333)
+pList2D[3]:		 coords: (x, y) = (0.666667, 0.666667)
+
+(dx, dy) = (1.000000, 1.000000)	da = 1.000000
+
+bchain2D[0]: 	  index = 3 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain2D[1]: 	  index = 3 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain2D[2]: 	  index = 3 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+bchain2D[3]: 	  index = 3 
+		 sizeofboundary = 0 
+		 numclaimed = 0 
+		 totalclaimed = 1
+		 new_bound_cells_malloced = 50 
+		 new_claimed_cells_malloced = 50 
+		 done = 0
+pList2D[0]:
+		 coords: (x, y) = (0.333333, 0.333333)
+		 centroids: (cx, cy) = (0.000000, 0.000000)
+		 weight = 0.000000
+pList2D[1]:
+		 coords: (x, y) = (0.333333, 0.666667)
+		 centroids: (cx, cy) = (0.000000, 0.000000)
+		 weight = 0.000000
+pList2D[2]:
+		 coords: (x, y) = (0.666667, 0.333333)
+		 centroids: (cx, cy) = (0.000000, 0.000000)
+		 weight = 0.000000
+pList2D[3]:
+		 coords: (x, y) = (0.666667, 0.666667)
+		 centroids: (cx, cy) = (0.000000, 0.000000)
+		 weight = 0.000000
+****************************
+Test _DVCWeights_GetCentroids2D function 
+****************************
+pList2D[0]:
+		 coords: (x, y) = (0.333333, 0.333333)
+		 centroids: (cx, cy) = (-0.166667, -0.166667)
+		 weight = 3.000000
+pList2D[1]:
+		 coords: (x, y) = (0.333333, 0.666667)
+		 centroids: (cx, cy) = (0.000000, 0.000000)
+		 weight = 0.000000
+pList2D[2]:
+		 coords: (x, y) = (0.666667, 0.333333)
+		 centroids: (cx, cy) = (0.000000, 0.000000)
+		 weight = 0.000000
+pList2D[3]:
+		 coords: (x, y) = (0.666667, 0.666667)
+		 centroids: (cx, cy) = (0.500000, 0.500000)
+		 weight = 1.000000
+****************************
+Test _DVCWeights_DistanceSquared2D function 
+****************************
+particle0:
+		 coords: (x, y) = (0.500000, 0.500000)
+particle1:
+		 coords: (x, y) = (0.250000, 0.250000)
+calculated distance^2 between particles = 0.125000 
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDVCWeights.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDVCWeights.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTest "testDVCWeights" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDVCWeights.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDVCWeights.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,416 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**	Robert B. Turnbull, Monash Cluster Computing. (Robert.Turnbull at sci.monash.edu.au)
+**	Kathleen M. Humble, Computational Scientist, VPAC. (khumble 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: testTensorMath.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/Voronoi/Voronoi.h>
+#include <PICellerator/PopulationControl/PopulationControl.h>
+
+#include "PICellerator/Weights/Weights.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main( int argc, char* argv[] ) {
+	MPI_Comm CommWorld;
+	int rank;
+	int numProcessors;
+	int procToWatch;
+	Stream*  stream;
+	
+	/* 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 );
+	
+	StGermain_Init( &argc, &argv );
+	StgFEM_Init( &argc, &argv );
+    PICellerator_Voronoi_Init( &argc, &argv );
+    PICellerator_PopulationControl_Init( &argc, &argv );
+	PICellerator_Weights_Init( &argc, &argv );
+
+	/* TODO Not sure how to use the DVCWeights Init as it doesn't match the other ones */
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	stream = Journal_Register( InfoStream_Type, "testDVCWeights" );
+
+	stJournal->firewallProducesAssert = False;
+	
+	
+	if( argc >= 2 ) {
+		procToWatch = atoi( argv[1] );
+	}
+	else {
+		procToWatch = 0;
+	}
+
+	if( rank == procToWatch ) {
+	
+		double dx,dy,dz,da;
+		static struct cell *cells;/* the 3D connected grid */ 
+		struct particle *pList;/* 3D particle List */
+		struct chain *bchain;/*3D boundary chain */
+			
+		static struct cell2d *cells2D;/* the 2D connected grid */
+		struct particle2d *pList2D;/*2D particle List */
+		struct chain *bchain2D;/*2D boundary chain */
+			
+		int nump,numx,numy,numz;
+		int px, py, pz;
+		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,j,k,l;
+		double particleDistance;		
+		double particle0[3], particle1[3];
+		
+		/* Do the testing of the 3D functions*/
+
+		Journal_Printf( stream, "-----------------------------\n");	
+		Journal_Printf( stream, "3D functions:  \n");
+		Journal_Printf( stream, "-----------------------------\n\n");	
+
+
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_ConstructGrid function \n");
+		Journal_Printf( stream, "****************************\n");
+		
+		/*Define the resolution */
+		
+		numx = 2;
+		numy = 2;
+		numz = 2;
+
+		Journal_Printf( stream, "size of element:\n\t x = (%f, %f)\n\t y = (%f, %f) \n\t z = (%f, %f)\n",
+			BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+		Journal_Printf( stream, "Resolution: \n\t (x, y, z) = (%d, %d, %d)\n", numx, numy, numz);
+		
+     		_DVCWeights_ConstructGrid(&cells,numz,numy,numx,BBXMIN,BBYMIN,BBZMIN,BBXMAX,BBYMAX,BBZMAX);		
+		
+		/* Print out the grid somehow */
+		for (i = 0; i < (numx * numy * numz); i++ ) {
+			Journal_Printf(stream, "cell[%d]:\tParticle Index: %d\n", 
+					i, cells[i].p);
+			Journal_Printf(stream, " \t\tValues: (N: %d, S: %d, E: %d, W: %d, U: %d, D: %d) \n", 
+					cells[i].N, cells[i].S, cells[i].E, cells[i].W,cells[i].U, cells[i].D );
+			Journal_Printf(stream, " \t\tCoords: (%f, %f,%f) \t Done = %d\n", 
+					cells[i].x, cells[i].y, cells[i].z, cells[i].done);			
+		}
+
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_InitialiseStructs function \n");
+		Journal_Printf( stream, "****************************\n");
+		
+		/*Define the number of particles */
+		px = 2;
+		py = 2; 
+		pz = 2;
+		nump = px * py * pz;
+		
+		_DVCWeights_InitialiseStructs( &bchain, &pList, nump);
+		for (i = 0; i < nump; i++) {
+			Journal_Printf( stream, "bchain[%d]: ", i);
+			Journal_Printf( stream, "No of new_claimed_cells = %d, ", 
+				bchain[i].new_claimed_cells_malloced);
+			Journal_Printf( stream, "No of new_bound_cells = %d\n",
+				bchain[i].new_bound_cells_malloced);
+		}
+		
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_ResetGrid function \n");
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "numz * numy * numx = %d\n", numz*numy*numx);
+		
+		_DVCWeights_ResetGrid(&cells,numz*numy*numx);
+
+		for ( i = 0; i < numz*numy*numx; i++) {
+			Journal_Printf( stream, "cells[%d].p = %d \t cells[%d].done = %d\n",
+				i, cells[i].p, i, cells[i].done);
+			
+		}
+		
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_CreateVoronoi function \n");
+		Journal_Printf( stream, "****************************\n");
+
+		dx = (BBXMAX - BBXMIN)/numx;
+		dy = (BBYMAX - BBYMIN)/numy;
+		dz = (BBZMAX - BBZMIN)/numz;
+		da = dx*dy*dz;
+		/*Initialise particle coords */
+		l = 0;
+		for(i = 0; i < px ;i++){
+	    	for ( j = 0; j < py ; j++) {
+				for ( k = 0; k < pz; k++ ) { 
+	      			pList[l].x = (1 + i) / (px + 1.0);
+	      			pList[l].y = (1 + j) / ( py + 1.0);
+	      			pList[l].z = (1 + k) / (pz + 1.0);
+					l++;
+				}
+		  	}
+	  	}
+		for ( i = 0; i < nump; i++) {	    
+			Journal_Printf( stream, "pList[%d]:", i);
+			Journal_Printf( stream, "\t\t coords: (x, y, z) = (%f, %f, %f)\n",
+				pList[i].x, pList[i].y, pList[i].z);
+
+		}
+		Journal_Printf( stream, "\n(dx, dy, dz) = (%f, %f, %f)	da = %f\n\n",
+			dx, dy, dz, da);		
+		_DVCWeights_CreateVoronoi( &bchain, &pList, &cells, dx, dy, dz, nump, numx, numy, numz, BBXMIN, BBXMAX, BBYMIN, BBYMAX, BBZMIN, BBZMAX);
+		
+		/* print out bchain changes */
+		for (i = 0; i < nump; i++) {
+			Journal_Printf( stream, "bchain[%d]: \t index = %d \n",
+					i, bchain[i].index);
+			Journal_Printf( stream, "\t\t sizeofboundary = %d \n\t\t numclaimed = %d \n",
+					bchain[i].sizeofboundary, bchain[i].numclaimed);
+			Journal_Printf( stream, "\t\t totalclaimed = %d\n", bchain[i].totalclaimed);
+			Journal_Printf( stream, "\t\t new_bound_cells_malloced = %d \n",
+					bchain[i].new_bound_cells_malloced);
+			Journal_Printf( stream, "\t\t new_claimed_cells_malloced = %d \n",
+					bchain[i].new_claimed_cells_malloced);
+			Journal_Printf( stream, "\t\t done = %d\n", bchain[i].done);
+		}
+		/* Print out particle values */
+		for (i = 0; i < nump; i++) {
+		
+			Journal_Printf( stream, "pList[%d]:\n", i);
+			Journal_Printf( stream, "\t\t coords: (x, y, z) = (%f, %f, %f)\n",
+				pList[i].x, pList[i].y, pList[i].z);
+			Journal_Printf( stream, "\t\t centroids: (cx, cy, cz) = (%f, %f %f)\n",
+				pList[i].cx, pList[i].cy, pList[i].cz);
+			Journal_Printf( stream, "\t\t weight = %f\n", pList[i].w);
+		
+		}
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_GetCentroids function \n");
+		Journal_Printf( stream, "****************************\n");
+
+		_DVCWeights_GetCentroids( cells, pList,numz,numy,numx,nump,da);
+		for (i = 0; i < nump; i++) {
+		
+			Journal_Printf( stream, "pList[%d]:\n", i);
+			Journal_Printf( stream, "\t\t coords: (x, y, z) = (%f, %f, %f)\n",
+				pList[i].x, pList[i].y, pList[i].z);
+			Journal_Printf( stream, "\t\t centroids: (cx, cy, cz) = (%f, %f %f)\n",
+				pList[i].cx, pList[i].cy, pList[i].cz);
+			Journal_Printf( stream, "\t\t weight = %f\n", pList[i].w);
+		
+		}
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_DistanceSquared function \n");
+		Journal_Printf( stream, "****************************\n");
+		particle0[0] = 0.5;	particle0[1] = 0.5;	particle0[2] = 0.5;
+		particle1[0] = 0.25; particle1[1] = 0.25; 	particle1[2] = 0; 		
+		Journal_Printf( stream, "particle0:\n");
+		Journal_Printf( stream, "\t\t coords: (x, y, z) = (%f, %f, %f)\n",
+				particle0[0], particle0[1], particle0[2]);
+		Journal_Printf( stream, "particle1:\n");
+		Journal_Printf( stream, "\t\t coords: (x, y, z) = (%f, %f, %f)\n",
+				particle1[0], particle1[1], particle1[2]);
+		
+		particleDistance = _DVCWeights_DistanceSquared(
+			particle0[0], particle0[1], particle0[2],
+			particle1[0], particle1[1], particle1[2]);
+		Journal_Printf( stream, "calculated distance^2 between particles = %f \n", particleDistance);
+		
+		free(bchain);
+		free(pList);
+		
+		Journal_Printf( stream, "\n-----------------------------\n");	
+		Journal_Printf( stream, "2D functions:  \n");
+		Journal_Printf( stream, "-----------------------------\n\n");
+
+		/*********************************/
+		/* Test construct grid 2D */
+
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_ConstructGrid2D function \n");
+		Journal_Printf( stream, "****************************\n");
+		
+		/*Define the resolution */
+		
+		numx = 2;
+		numy = 2;
+
+		Journal_Printf( stream, "size of element:\n\t x = (%f, %f)\n\t y = (%f, %f) \n",
+			BBXMIN, BBXMAX, BBYMIN, BBYMAX);
+		Journal_Printf( stream, "Resolution: \n\t (x, y) = (%d, %d)\n", numx, numy);
+		
+     		_DVCWeights_ConstructGrid2D(&cells2D,numy,numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);		
+		
+		/* Print out the grid somehow */
+		for (i = 0; i < (numx * numy ); i++ ) {
+			Journal_Printf(stream, "cells2d[%d]:\tParticle Index: %d \n", 
+					i, cells2D[i].p);
+			Journal_Printf(stream, " \t\tValues: (N: %d, S: %d, E: %d, W: %d) \n", 
+					cells2D[i].N, cells2D[i].S, cells2D[i].E, cells2D[i].W );
+			Journal_Printf(stream, " \t\tCoords: (%f, %f) \t Done = %d\n", 
+					cells2D[i].x, cells2D[i].y, cells[i].done);			
+		}
+
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_InitialiseStructs2D function \n");
+		Journal_Printf( stream, "****************************\n");
+		
+		/*Define size of swarm-to-be */
+		px = 2;
+		py = 2; 
+		nump = px * py ;
+		
+		_DVCWeights_InitialiseStructs2D( &bchain2D, &pList2D, nump);
+		for (i = 0; i < nump; i++) {
+			Journal_Printf( stream, "bchain2D[%d]: ", i);
+			Journal_Printf( stream, "No of new_claimed_cells = %d, ", 
+				bchain2D[i].new_claimed_cells_malloced);
+			Journal_Printf( stream, "No of new_bound_cells = %d\n",
+				bchain2D[i].new_bound_cells_malloced);
+		}
+		
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_ResetGrid2D function \n");
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "numz * numy = %d\n", numz*numy);
+		
+		_DVCWeights_ResetGrid2D(&cells2D,numx*numy);
+
+		for ( i = 0; i < numx*numy; i++) {
+			Journal_Printf( stream, "cells2D[%d].p = %d \t cells2D[%d].done = %d\n",
+				i, cells2D[i].p, i, cells2D[i].done);
+			
+		}
+		
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_CreateVoronoi2D function \n");
+		Journal_Printf( stream, "****************************\n");
+
+		dx = (BBXMAX - BBXMIN)/numx;
+		dy = (BBYMAX - BBYMIN)/numy;
+		da = dx*dy;
+		/*Initialise particle coords */
+		l = 0;
+		for(i = 0; i < px ;i++){
+	    	for ( j = 0; j < py ; j++) {
+	      		pList2D[l].x = (1 + i) / (px + 1.0);
+	      		pList2D[l].y = (1 + j) / ( py + 1.0);
+				l++;
+		  	}
+	  	}
+		for ( i = 0; i < nump; i++) {	    
+			Journal_Printf( stream, "pList2D[%d]:", i);
+			Journal_Printf( stream, "\t\t coords: (x, y) = (%f, %f)\n",
+				pList2D[i].x, pList2D[i].y);
+
+		}
+		Journal_Printf( stream, "\n(dx, dy) = (%f, %f)	da = %f\n\n",
+			dx, dy, da);		
+		_DVCWeights_CreateVoronoi2D( &bchain2D, &pList2D, &cells2D, dx, dy, nump, numx, numy, BBXMIN, BBXMAX, BBYMIN, BBYMAX);
+		
+		/* print out bchain changes */
+		for (i = 0; i < nump; i++) {
+			Journal_Printf( stream, "bchain2D[%d]: \t  index = %d \n",
+					i, bchain2D[i].index);
+			Journal_Printf( stream, "\t\t sizeofboundary = %d \n\t\t numclaimed = %d \n",
+					bchain2D[i].sizeofboundary, bchain2D[i].numclaimed);
+			Journal_Printf( stream, "\t\t totalclaimed = %d\n", bchain2D[i].totalclaimed);
+			Journal_Printf( stream, "\t\t new_bound_cells_malloced = %d \n",
+					bchain2D[i].new_bound_cells_malloced);
+			Journal_Printf( stream, "\t\t new_claimed_cells_malloced = %d \n",
+					bchain2D[i].new_claimed_cells_malloced);
+			Journal_Printf( stream, "\t\t done = %d\n", bchain2D[i].done);
+		}
+		/* Print out particle values */
+		for (i = 0; i < nump; i++) {
+		
+			Journal_Printf( stream, "pList2D[%d]:\n", i);
+			Journal_Printf( stream, "\t\t coords: (x, y) = (%f, %f)\n",
+				pList2D[i].x, pList2D[i].y);
+			Journal_Printf( stream, "\t\t centroids: (cx, cy) = (%f, %f)\n",
+				pList2D[i].cx, pList2D[i].cy);
+			Journal_Printf( stream, "\t\t weight = %f\n", pList2D[i].w);
+		
+		}
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_GetCentroids2D function \n");
+		Journal_Printf( stream, "****************************\n");
+
+		_DVCWeights_GetCentroids2D( cells2D, pList2D,numy,numx,nump,da);
+		for (i = 0; i < nump; i++) {
+		
+			Journal_Printf( stream, "pList2D[%d]:\n", i);
+			Journal_Printf( stream, "\t\t coords: (x, y) = (%f, %f)\n",
+				pList2D[i].x, pList2D[i].y);
+			Journal_Printf( stream, "\t\t centroids: (cx, cy) = (%f, %f)\n",
+				pList2D[i].cx, pList2D[i].cy);
+			Journal_Printf( stream, "\t\t weight = %f\n", pList2D[i].w);
+		
+		}
+		Journal_Printf( stream, "****************************\n");
+		Journal_Printf( stream, "Test _DVCWeights_DistanceSquared2D function \n");
+		Journal_Printf( stream, "****************************\n");
+		
+		Journal_Printf( stream, "particle0:\n");
+		Journal_Printf( stream, "\t\t coords: (x, y) = (%f, %f)\n",
+				particle0[0], particle0[1]);
+		Journal_Printf( stream, "particle1:\n");
+		Journal_Printf( stream, "\t\t coords: (x, y) = (%f, %f)\n",
+				particle1[0], particle1[1]);
+		
+		particleDistance = _DVCWeights_DistanceSquared2D(
+			particle0[0], particle0[1],
+			particle1[0], particle1[1] );
+		Journal_Printf( stream, "calculated distance^2 between particles = %f \n", particleDistance);
+		
+		
+		
+		free(bchain2D);
+		free(pList2D);
+
+	}
+		
+	
+	DiscretisationGeometry_Finalise();
+	
+	Base_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDVCWeights.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDVCWeights.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>testElementIntegral.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="weights">
+			<param name="Type">DVCWeights</param>
+		</struct>		
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDVCWeightsCircle.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDVCWeightsCircle.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 "PICellerator testDVCWeights.xml --FunctionName=CircleInterface --mean-tolerance=0.005 --standardDeviation-tolerance=0.001 --mean-expectedValue=0.090837 --standardDeviation-expectedValue=0.055628" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDVCWeightsExpIface.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDVCWeightsExpIface.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 "PICellerator testDVCWeights.xml --FunctionName=ExponentialInterface --mean-tolerance=0.001 --standardDeviation-tolerance=0.001 --mean-expectedValue=0.047945 --standardDeviation-expectedValue=0.035636" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDVCWeightsPoly.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDVCWeightsPoly.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 "PICellerator testDVCWeights.xml --FunctionName=PolynomialFunction --mean-tolerance=0.001 --standardDeviation-tolerance=0.001 --mean-expectedValue=0.0077474 --standardDeviation-expectedValue=0.0014641" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDiscreteVoronoiWeights.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDiscreteVoronoiWeights.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>testElementIntegral.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="discreteVoronoi">
+			<param name="Type">CellularAutomataVoronoi</param>
+			<param name="resolution">16</param>
+			<param name="diagonalNeighbours">true</param>
+		</struct>		
+		<struct name="weights">
+			<param name="Type">DiscreteVoronoiWeights</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+		</struct>		
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDiscreteVoronoiWeightsCircle.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDiscreteVoronoiWeightsCircle.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testDiscreteVoronoiWeightsCircle.0of1.sh 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testDiscreteVoronoiWeights.xml --FunctionName=CircleInterface --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.09264 --standardDeviation-expectedValue=0.063171" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDiscreteVoronoiWeightsExpIface.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDiscreteVoronoiWeightsExpIface.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testDiscreteVoronoiWeightsExpIface.0of1.sh 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testDiscreteVoronoiWeights.xml --FunctionName=ExponentialInterface --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.074954 --standardDeviation-expectedValue=0.059645" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testDiscreteVoronoiWeightsPoly.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testDiscreteVoronoiWeightsPoly.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testDiscreteVoronoiWeightsPoly.0of1.sh 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testDiscreteVoronoiWeights.xml --FunctionName=PolynomialFunction --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.011722 --standardDeviation-expectedValue=0.0092122" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testElementIntegral.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testElementIntegral.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,77 @@
+<?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/ElementLayout.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">mesh-linear</param>
+		</struct>
+		<struct name="localLayout">
+			<param name="Type">MappedParticleLayout</param>
+		</struct>
+		<struct name="swarm">
+			<param name="Type">IntegrationPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">localLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+			<param name="WeightsCalculator">weights</param>
+			<param name="TimeIntegrator">timeIntegrator</param>
+			<param name="IntegrationPointMapper">mapper</param>
+			
+			<param name="VelocityField">VelocityField</param>
+		</struct>
+		<struct name="mapper">
+			<param name="Type">CoincidentMapper</param>
+			<param name="IntegrationPointsSwarm">swarm</param>
+			<param name="MaterialPointsSwarm">picIntegrationPoints</param>
+		</struct>
+		<struct name="particleLayout">
+			<param name="Type">RandomParticleLayout</param>
+			<param name="cellParticleCount">particleCount</param>
+		</struct>
+		<struct name="picIntegrationPoints">
+			<param name="Type">MaterialPointsSwarm</param>
+			<param name="CellLayout">elementCellLayout</param>
+			<param name="ParticleLayout">particleLayout</param>
+			<param name="FiniteElement_Mesh">mesh-linear</param>
+		</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 5896a19b8457 -r 31abbeebf74e Weights/tests/testIterativeVoronoiWeights.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testIterativeVoronoiWeights.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>testElementIntegral.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="discreteVoronoi">
+			<param name="Type">AdaptiveVoronoi</param>
+			<param name="maxIterations">adaptiveSteps</param>
+		</struct>		
+		<struct name="discreteVoronoiWeights">
+			<param name="Type">DiscreteVoronoiWeights</param>
+			<param name="DiscreteVoronoi">discreteVoronoi</param>
+		</struct>		
+		<struct name="weights">
+			<param name="Type">IterativeWeights</param>
+			<param name="maxIterations">100</param>
+			<param name="tolerance">0.001</param>
+			<param name="InitialWeights">discreteVoronoiWeights</param>
+		</struct>		
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testIterativeWeights.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testIterativeWeights.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>testElementIntegral.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="weights">
+			<param name="Type">IterativeWeights</param>
+			<param name="maxIterations">100</param>
+			<param name="tolerance">0.001</param>
+		</struct>		
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testIterativeWeightsCircle.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testIterativeWeightsCircle.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testIterativeWeightsCircle.0of1.sh 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testIterativeWeights.xml --FunctionName=CircleInterface --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.10172 --standardDeviation-expectedValue=0.070065" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testIterativeWeightsExpIface.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testIterativeWeightsExpIface.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testIterativeWeightsExpIface.0of1.sh 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testIterativeWeights.xml --FunctionName=ExponentialInterface --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.088927 --standardDeviation-expectedValue=0.06681" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testIterativeWeightsPoly.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testIterativeWeightsPoly.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testIterativeWeightsPoly.0of1.sh 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testIterativeWeights.xml --FunctionName=PolynomialFunction --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.017526 --standardDeviation-expectedValue=0.013522" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testMomentBalanceWeights.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testMomentBalanceWeights.xml	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+	
+	<include>testElementIntegral.xml</include>
+	
+	<struct name="components" mergeType="merge">
+		<struct name="weights">
+			<param name="Type">MomentBalanceWeights</param>
+		</struct>		
+	</struct>
+
+</StGermainData>
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testMomentBalanceWeightsCircle.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testMomentBalanceWeightsCircle.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testMomentBalanceWeightsCircle.0of1.sh 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testMomentBalanceWeights.xml --FunctionName=CircleInterface --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.097814 --standardDeviation-expectedValue=0.068607" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testMomentBalanceWeightsExpIface.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testMomentBalanceWeightsExpIface.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testMomentBalanceWeightsExpIface.0of1.sh 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testMomentBalanceWeights.xml --FunctionName=ExponentialInterface --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.094671 --standardDeviation-expectedValue=0.075287" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e Weights/tests/testMomentBalanceWeightsPoly.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Weights/tests/testMomentBalanceWeightsPoly.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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: testMomentBalanceWeightsPoly.0of1.sh 406 2007-01-15 03:03:20Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TEST_SCRIPT=./VMake/executableTester.sh
+until test -r ${TEST_SCRIPT} ; do
+        TEST_SCRIPT=../${TEST_SCRIPT}
+done
+. ${TEST_SCRIPT}
+
+runAndHandleSystemTestStdLocations "PICellerator testMomentBalanceWeights.xml --FunctionName=PolynomialFunction --mean-tolerance=0.000001 --standardDeviation-tolerance=0.000001 --mean-expectedValue=0.016697 --standardDeviation-expectedValue=0.013041" "$0" "$@"
diff -r 5896a19b8457 -r 31abbeebf74e build-functions.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-functions.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1 @@
+VMake/build-functions.sh
\ No newline at end of file
diff -r 5896a19b8457 -r 31abbeebf74e configure.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/configure.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1 @@
+VMake/configure.sh
\ No newline at end of file
diff -r 5896a19b8457 -r 31abbeebf74e doc/C_full.doxyconf.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/C_full.doxyconf.in	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1098 @@
+# Doxyfile 1.3.5
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = PICellerator
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = 
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, 
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en 
+# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese, 
+# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING   = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is used 
+# as the annotated text. Otherwise, the brief description is used as-is. If left 
+# blank, the following values are used ("$name" is automatically replaced with the 
+# name of the entity): "The $name class" "The $name widget" "The $name file" 
+# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = YES
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
+# members of a class in the documentation of that class as if those members were 
+# ordinary class members. Constructors, destructors and assignment operators of 
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH        = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
+# only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT = 
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
+# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc
+
+FILE_PATTERNS          = *.c *.h
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = build
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories.
+
+EXCLUDE_PATTERNS       = *Python* JournalDummy.* JournalWrappers.*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.
+
+INPUT_FILTER           = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 3
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = _
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = header.html
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = footer.html
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = doxygen.css
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = YES
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed.
+
+PREDEFINED             = DEBUG 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse the 
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = PICellerator.doxytag
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. Note that this 
+# option is superseded by the HAVE_DOT option below. This is only a fallback. It is 
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 800
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes that 
+# lay further from the root node will be omitted. Note that setting this option to 
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also 
+# note that a graph may be further truncated if the graph's image dimensions are 
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). 
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
diff -r 5896a19b8457 -r 31abbeebf74e doc/Makefile.def
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/Makefile.def	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,24 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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 file may be distributed under the terms of the VPAC Public License
+## as defined by VPAC of Australia and appearing in the file
+## LICENSE.VPL included in the packaging of this file.
+##
+## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+##
+## $Id: Makefile.def 2338 2004-11-19 04:51:11Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+def_doxinputs = C_full.doxyconf.in
diff -r 5896a19b8457 -r 31abbeebf74e doc/doxygen.css
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/doxygen.css	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,260 @@
+div.header {
+	background: #DFDFFF;
+	border: 1px solid #9595B5;
+	color: #000000;
+	font-size: small;
+	font-family: sans-serif;
+	font-style: normal;
+	margin-bottom: 1em;
+	padding-top: 3px;
+	padding-bottom: 3px;
+	padding-left: 10px;
+	text-align: left;
+}
+div.hnav {
+	float: left;
+}
+div.hindex {
+	padding-right: 10px;
+	text-align: right;
+}
+A.header{
+       color: #252e78;
+}
+A.header:visited {
+       color: #25782e;
+}
+A.header:hover {
+	background-color: #DFDFFF;
+}
+div.footer{
+	background: #DFDFFF;
+	border: 1px solid #9595B5;
+	color: #000000;
+	font-size: small;
+	font-family: sans-serif;
+	font-style: normal;
+	margin-top: 5em;
+	padding-top: 3px;
+	padding-bottom: 3px;
+	text-align: center;
+}
+
+H1 {
+	text-align: center;
+	font-family: Geneva, Arial, Helvetica, sans-serif;
+}
+H2 {
+	font-family: Geneva, Arial, Helvetica, sans-serif;
+}
+CAPTION { font-weight: bold }
+DIV.qindex {
+	width: 100%;
+	background-color: #eeeeff;
+	border: 1px solid #B0B0B0;
+	text-align: center;
+	margin: 2px;
+	padding: 2px;
+	line-height: 120%;
+}
+
+A.qindex {
+       text-decoration: none;
+       font-weight: bold;
+       color: #1A419D;
+       padding: 2px;
+}
+A.qindex:visited {
+       text-decoration: none;
+       font-weight: bold;
+       color: #1A419D
+       padding: 2px;
+}
+A.qindex:hover {
+	text-decoration: none;
+	background-color: #ddddff;
+	padding: 2px;
+}
+A.qindexHL {
+	text-decoration: none;
+	font-weight: bold;
+	background-color: #6666cc;
+	color: #ffffff;
+	padding: 2px 6px;
+	border: 1px double #9295C2;
+}
+A.qindexHL:hover {
+	text-decoration: none;
+	background-color: #6666cc;
+	color: #ffffff;
+	padding: 2px 6px;
+}
+
+A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
+A.el { text-decoration: none; font-weight: bold }
+A.elRef { font-weight: bold }
+A.code { text-decoration: none; font-weight: normal; color: #1A419D}
+A.codeRef { font-weight: normal; color: #1A419D}
+A:hover { text-decoration: none; background-color: #f2f2ff }
+DL.el { margin-left: -1cm }
+PRE.fragment {
+	border: 1px solid #CCCCCC;
+	background-color: #f5f5f5;
+	margin-top: 4px;
+	margin-bottom: 4px;
+	margin-left: 2px;
+	margin-right: 8px;
+	padding-left: 6px;
+	padding-right: 6px;
+	padding-top: 4px;
+	padding-bottom: 4px;
+}
+DIV.fragment {
+	border: 1px solid #CCCCCC;
+	background-color: #f5f5f5;
+	padding: 6px;
+}
+DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
+TD.md { background-color: #F4F4FB; font-weight: bold; }
+TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; }
+TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; }
+DIV.groupHeader {
+       margin-left: 16px;
+       margin-top: 12px;
+       margin-bottom: 6px;
+       font-weight: bold;
+	font-family: Geneva, Arial, Helvetica, sans-serif;
+}
+DIV.groupText { margin-left: 16px; font-style: italic; font-size: 14px }
+BODY {
+	background: white;
+	color: black;
+	margin-right: 20px;
+	margin-left: 20px;
+}
+TD.indexkey {
+	background-color: #eeeeff;
+	font-weight: bold;
+	padding-right  : 10px;
+	padding-top    : 2px;
+	padding-left   : 10px;
+	padding-bottom : 2px;
+	margin-left    : 0px;
+	margin-right   : 0px;
+	margin-top     : 2px;
+	margin-bottom  : 2px;
+	border: 1px solid #CCCCCC;
+}
+TD.indexvalue {
+	background-color: #eeeeff;
+	font-style: italic;
+	padding-right  : 10px;
+	padding-top    : 2px;
+	padding-left   : 10px;
+	padding-bottom : 2px;
+	margin-left    : 0px;
+	margin-right   : 0px;
+	margin-top     : 2px;
+	margin-bottom  : 2px;
+	border: 1px solid #CCCCCC;
+}
+TR.memlist {
+   background-color: #f0f0f0; 
+}
+P.formulaDsp { text-align: center; }
+IMG.formulaDsp { }
+IMG.formulaInl { vertical-align: middle; }
+SPAN.keyword       { color: #008000 }
+SPAN.keywordtype   { color: #604020 }
+SPAN.keywordflow   { color: #e08000 }
+SPAN.comment       { color: #800000 }
+SPAN.preprocessor  { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral   { color: #008080 }
+.mdTable {
+	border: 1px solid #868686;
+	background-color: #F4F4FB;
+}
+.mdRow {
+	padding: 8px 10px;
+}
+.mdescLeft {
+       padding: 0px 8px 4px 8px;
+	font-size: 14px;
+	font-style: italic;
+	background-color: #FAFAFA;
+	border-top: 1px none #E0E0E0;
+	border-right: 1px none #E0E0E0;
+	border-bottom: 1px none #E0E0E0;
+	border-left: 1px none #E0E0E0;
+	margin: 0px;
+}
+.mdescRight {
+       padding: 0px 8px 4px 8px;
+	font-size: 14px;
+	font-style: italic;
+	background-color: #FAFAFA;
+	border-top: 1px none #E0E0E0;
+	border-right: 1px none #E0E0E0;
+	border-bottom: 1px none #E0E0E0;
+	border-left: 1px none #E0E0E0;
+	margin: 0px;
+}
+.memItemLeft {
+	padding: 1px 0px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-style: solid;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-size: 12px;
+}
+.memItemRight {
+	padding: 1px 8px 0px 8px;
+	margin: 4px;
+	border-top-width: 1px;
+	border-right-width: 1px;
+	border-bottom-width: 1px;
+	border-left-width: 1px;
+	border-top-style: solid;
+	border-top-color: #E0E0E0;
+	border-right-color: #E0E0E0;
+	border-bottom-color: #E0E0E0;
+	border-left-color: #E0E0E0;
+	border-right-style: none;
+	border-bottom-style: none;
+	border-left-style: none;
+	background-color: #FAFAFA;
+	font-family: Geneva, Arial, Helvetica, sans-serif;
+	font-size: 13px;
+}
+.search     { color: #003399;
+              font-weight: bold;
+}
+FORM.search {
+              margin-bottom: 0px;
+              margin-top: 0px;
+}
+INPUT.search { font-size: 75%;
+               color: #000080;
+               font-weight: normal;
+               background-color: #eeeeff;
+}
+TD.tiny      { font-size: 75%;
+}
+a {
+	color: #252E78;
+}
+a:visited {
+	color: #3D2185;
+}
diff -r 5896a19b8457 -r 31abbeebf74e doc/footer.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/footer.html	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,6 @@
+<div class="footer">
+$projectname documentation generated by <a href="http://www.doxygen.org">doxygen</a> at $datetime
+</div>
+
+</body>
+</html>
diff -r 5896a19b8457 -r 31abbeebf74e doc/generateForWeb.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/generateForWeb.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+export PROJ_ROOT=`pwd | sed 's/doc$//'`
+export REVLINE=`svn info | grep Revision`
+
+# Find the "INPUT" field and add the root project dir to it
+cat "web.doxyconf.in" | sed 's:\(^[ \t]*INPUT[ \t]*=\):\1 '"${PROJ_ROOT}:"  > "web.doxyconf.in.1"
+
+# Find the "STRIP_FROM_PATH" field and add the root project dir to it
+cat "web.doxyconf.in.1" | sed 's:\(^[ \t]*STRIP_FROM_PATH[ \t]*=\):\1 '"${PROJ_ROOT}:"  > "web.doxyconf.in.2"
+
+# Find the "PROJECT_NUMBER" field and add the project revision to it
+cat "web.doxyconf.in.2" | sed 's+\(^[ \t]*PROJECT_NUMBER[ \t]*=\)+\1 '"${REVLINE}+"  > "web.doxyconf.in.3"
+
+# Run doxygen
+doxygen "web.doxyconf.in.3"
+
+
+# Clean up
+rm -f "web.doxyconf.in.1" "web.doxyconf.in.2" "web.doxyconf.in.3"
+
diff -r 5896a19b8457 -r 31abbeebf74e doc/header.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/header.html	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,21 @@
+<html>
+<body>
+<html>
+	<head>
+		<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+		<title>$title</title>
+		<link href="doxygen.css" rel="stylesheet" type="text/css">
+	</head>
+<body>
+<div class="header">
+	<div class="hnav">
+		<a class="header" href="http://csd.vpac.org">VPAC - Computational Software Development</a>
+	</div>
+	<div class="hindex">
+		<a class="header" href="main.html">Main</a> |
+		<a class="header" href="http://csd.vpac.org/twiki/bin/view/PICellerator/WebHome">PICellerator plugin</a> |
+		<a class="header" href="http://csd.vpac.org/twiki/bin/view/Stgfem/WebHome">StgFEM FrameWork</a> |
+		<a class="header" href="http://csd.vpac.org/twiki/bin/view/Stgermain/WebHome">StGermain FrameWork</a> |
+	</div>
+</div>
+
diff -r 5896a19b8457 -r 31abbeebf74e doc/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,57 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+ifndef PROJ_ROOT
+	PROJ_ROOT=..
+endif
+include ${PROJ_ROOT}/Makefile.system
+
+# test that Doxygen is installed and working 
+
+
+include Makefile.def
+DOXINPUTS = ${def_doxinputs}
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e doc/web.doxyconf.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/web.doxyconf.in	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,1098 @@
+# Doxyfile 1.3.5
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = PICellerator
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = 
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, 
+# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en 
+# (Japanese with English messages), Korean, Norwegian, Polish, Portuguese, 
+# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING   = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is used 
+# as the annotated text. Otherwise, the brief description is used as-is. If left 
+# blank, the following values are used ("$name" is automatically replaced with the 
+# name of the entity): "The $name class" "The $name widget" "The $name file" 
+# "is" "provides" "specifies" "contains" "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = YES
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited 
+# members of a class in the documentation of that class as if those members were 
+# ordinary class members. Constructors, destructors and assignment operators of 
+# the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. It is allowed to use relative paths in the argument list.
+
+STRIP_FROM_PATH        = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources 
+# only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources 
+# only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = NO
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text.
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT = 
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp 
+# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc
+
+FILE_PATTERNS          = *.c *.h
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = build
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories 
+# that are symbolic links (a Unix filesystem feature) are excluded from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories.
+
+EXCLUDE_PATTERNS       = *Python* JournalDummy.* JournalWrappers.*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.
+
+INPUT_FILTER           = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 3
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = _
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = header.html
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = footer.html
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = doxygen.css
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man_api
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_PREDEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed.
+
+PREDEFINED             = DEBUG 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse the 
+# parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = PICellerator.doxytag
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or 
+# super classes. Setting the tag to NO turns the diagrams off. Note that this 
+# option is superseded by the HAVE_DOT option below. This is only a fallback. It is 
+# recommended to install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = YES
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found on the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_WIDTH    = 800
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT   = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes that 
+# lay further from the root node will be omitted. Note that setting this option to 
+# 1 or 2 may greatly reduce the computation time needed for large code bases. Also 
+# note that a graph may be further truncated if the graph's image dimensions are 
+# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). 
+# If 0 is used for the depth value (the default), the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/Makefile.def
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/Makefile.def	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,10 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Victorian Partnership for Advanced Computing (VPAC) Ltd, Australia
+## (C) 2003 All Rights Reserved
+##
+## <copyright-release-tag>
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+def_sub = src tests
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,55 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+ifndef PROJ_ROOT
+	PROJ_ROOT=..
+endif
+include ${PROJ_ROOT}/Makefile.system
+
+include Makefile.def
+
+subdirs = ${def_sub}
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/src/Finalise.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/src/Finalise.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,63 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Finalise.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "PICellerator.h"
+
+#include <stdio.h>
+
+Bool PICellerator_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+	PICellerator_Utils_Finalise();
+	PICellerator_MaterialPoints_Finalise();
+	PICellerator_Weights_Finalise();
+	PICellerator_PopulationControl_Finalise();
+	PICellerator_Voronoi_Finalise();
+	
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/src/Finalise.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/src/Finalise.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Finalises any outstanding memory etc of this module
+**
+** Assumptions:
+**	This module mustn't be used after Finalise called
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Finalise.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Finalise_h__
+#define __PICellerator_Finalise_h__
+	
+	Bool PICellerator_Finalise( void );
+	
+#endif /* __PICellerator_Finalise_h__ */
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/src/Init.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/src/Init.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,84 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: Init.c 427 2007-02-23 02:37:11Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+
+#include "PICellerator.h"
+
+#include <stdio.h>
+
+/** Initialises this package, then any init for this package
+such as streams etc */
+Bool PICellerator_Init( int* argc, char** argv[] ) {
+	int tmp;
+	char* directory;
+
+	PICellerator_Voronoi_Init( argc, argv );
+	PICellerator_PopulationControl_Init( argc, argv );
+	PICellerator_Weights_Init( argc, argv );
+	PICellerator_MaterialPoints_Init( argc, argv );
+	PICellerator_Utils_Init( argc, argv );
+	
+	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, "Context" ), 
+		"Particle-In-Cellerator (FEM/PIC framework) revision %s. Copyright (C) 2005 VPAC & Monash Cluster Computing.\n", VERSION );
+	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" ) ;
+	sprintf(directory, "%s%s", LIB_DIR, "/StGermain" );
+	XML_IO_Handler_AddDirectory( "PICellerator", directory );
+	Memory_Free(directory);
+	
+	/* Add the plugin path to the global plugin list */
+	PluginsManager_AddDirectory( "PICellerator", LIB_DIR );
+
+	return True;
+}
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/src/Init.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/src/Init.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	Initialises this library, ready for use
+**
+** Assumptions:
+**	The Init() function will be run before any other function in this library.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Init.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Init_h__
+#define __PICellerator_Init_h__
+	
+	Bool PICellerator_Init( int* argc, char** argv[] );
+	
+#endif /* __PICellerator_Init_h__ */
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/src/PICellerator.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/src/PICellerator.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,68 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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:
+**	External header file to this library
+**
+** Assumptions:
+**	None so far.
+**
+** Comments:
+**	None so far.
+**
+** $Id: PICellerator.h 272 2006-04-04 00:12:06Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_h__
+#define __PICellerator_h__
+	
+	#include "Voronoi/Voronoi.h"
+	#include "PopulationControl/PopulationControl.h"
+	#include "Weights/Weights.h"
+	#include "MaterialPoints/MaterialPoints.h"
+	#include "Utils/Utils.h"
+
+	#include "Init.h"
+	#include "Finalise.h"
+
+#endif /* __PICellerator_h__ */
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/src/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/src/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,71 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 427 2007-02-23 02:37:11Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+ifndef PROJ_ROOT
+	PROJ_ROOT=../..
+endif
+include ${PROJ_ROOT}/Makefile.system
+
+lib = ${PROJECT}
+libstatic = yes
+libdynamic = yes
+includes = ${PROJECT}
+
+SRCS = \
+	Init.c \
+	Finalise.c 
+
+HDRS = Init.h \
+	Finalise.h \
+	PICellerator.h \
+
+PROJ_OBJLISTS = PICelleratorVoronoi PICelleratorPopulationControl PICelleratorWeights PICelleratorMaterialPoints PICelleratorUtils
+EXTERNAL_LIBS = -L${LIB_DIR} 
+
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT} -DLIB_DIR=\"${LIB_DIR}\" 
+
+packages = STGFEM STGERMAIN MPI XML MATH
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/tests/expected/testLibPICellerator.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/tests/expected/testLibPICellerator.0of1.expected	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,12 @@
+StGermain Framework revision 4012. Copyright (C) 2003-2005 VPAC.
+StGermain Discretisation Library 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 5896a19b8457 -r 31abbeebf74e libPICellerator/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/tests/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,61 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+SHELL := /bin/bash
+# obtain defaults for required variables according to system and project location, and then run the build.
+ifndef PROJ_ROOT
+	PROJ_ROOT=../..
+endif
+include ${PROJ_ROOT}/Makefile.system
+
+tests = lib${PROJECT}
+
+checks = $(wildcard *.sh)
+
+SRCS = $(wildcard *.c)
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT} ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} -DLIB_DIR=\"${LIB_DIR}\"
+EXTERNAL_LIBS = ${RPATH_LFLAGS} -L${LIB_DIR} -l${PROJECT} ${STGFEM_LIBS} ${STGERMAIN_LIBS} ${MPI_LIBS} ${XML_LIBS}
+
+packages = STGFEM STGERMAIN MPI XML MATH
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e libPICellerator/tests/testLibPICellerator.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/tests/testLibPICellerator.0of1.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -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 5896a19b8457 -r 31abbeebf74e libPICellerator/tests/testLibPICellerator.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libPICellerator/tests/testLibPICellerator.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,133 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 <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 5896a19b8457 -r 31abbeebf74e makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,58 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+override PROJ_ROOT=.
+include ${PROJ_ROOT}/Makefile.system
+
+subdirs = Voronoi PopulationControl Weights MaterialPoints Utils libPICellerator src plugins Apps
+
+ifeq (true,$(shell if test -x $(DOXYGEN); then echo true; fi ))
+        subdirs += doc
+else
+        warn := $(shell echo Not entering doc directory as doxygen not found. 1>&2 )
+        warn := $(shell echo To generate doxgen docs, please set the DOXYGEN environment variable then re-run configure.sh. 1>&2 )
+endif
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e plugins/Application/Application.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/Application/Application.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,175 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**	Kent Humphries, Software Engineer, VPAC. (kenth 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: StandardConditionFunctions.c 532 2006-04-04 00:21:59Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+#ifdef HAVE_PYTHON
+#include <Python.h>
+#endif
+
+#include <mpi.h>
+//EP_APPLICATIONS_FINALISE defined in StGermain.h
+#include <StGermain/StGermain.h>
+//Must include StgFEM library, but WON'T call Stg_FEM_Init in this plugin.
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PICellerator.h>
+#include "Application.h"
+
+#include <stdio.h>
+//for strcmp
+#include <string.h>
+
+//All StGermain Application Plugins should use this finalise.
+//char EP_APPLICATIONS_FINALISE[] = "StGermain_EP_ApplicationsFinalise";
+const Type PICellerator_Application_Type = "PICellerator_Application";
+
+void _PICellerator_Application_Construct( void* component, Stg_ComponentFactory* cf, void* data ) 
+ {
+	AbstractContext* currAbstractContext;
+	PICelleratorContext* context = NULL;
+	int tmp = 0;
+
+        AbstractContext* prevContext;
+        EntryPoint* applicationsFinalise_EP;
+
+	//Get the existing abstract context, as defined by StGermain.
+	//Get it up here, so the communicator can be used for messages.
+	prevContext = (AbstractContext*)Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data ); 
+
+	/* Ensures copyright info always come first in output */
+	MPI_Barrier( prevContext->communicator ); 
+
+        /* PICellerator's init message */
+        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, "Context" ),
+                "PICellerator revision %s. "
+		"Copyright (C) 2005 VPAC & Monash Cluster Computing.\n", 
+		    VERSION );
+        Stream_Flush( Journal_Register( InfoStream_Type, "Context" ) );
+        Stream_SetPrintingRank( Journal_Register( InfoStream_Type, "Context" ), tmp );
+
+	/* Ensures copyright info always come first in output */
+        MPI_Barrier( prevContext->communicator ); 
+
+	//Only need to initialise a new context, and copy all relevant registers over IF this is the first application
+	//plugin to be constructed.
+	//The first application plugin to be constructed is Guaranteed to have the 'largest' context.
+	//			(ie is an inherited child of ALL other application plugins about to be loaded)
+	if( prevContext->type == AbstractContext_Type )
+	{
+		//Set the existing abstract context.
+		currAbstractContext = prevContext;
+		//Create a new, empty PICelleratorContext.
+		context = PICelleratorContext_New( "context", 0, 0, currAbstractContext->communicator, cf->rootDict );
+	
+		context->dictionary = cf->rootDict;
+	
+		//Initialise Abstract parts of PICelleratorContext
+		_AbstractContext_Init((AbstractContext*)context, 0, 0, MPI_COMM_WORLD );
+		//Initialise Discretisation parts of PICelleratorContext
+		_DiscretisationContext_Init((DiscretisationContext*)context );
+		//Initialise FiniteElement parts of PICelleratorContext
+		_FiniteElementContext_Init( (FiniteElementContext*)context );
+		//Initialise PIcellerator parts of PICelleratorContext
+		_PICelleratorContext_Init( context );
+	
+	       	//Need to get the old CF from currAbstractContext, and use that in my new context.
+	        //Now I CANNOT delete this currAbstractContext or I'll lose the CF. :(
+	        context->CF = currAbstractContext->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*) currAbstractContext)->name, 
+					KEEP, 
+					(Stg_Component*) context);
+	
+		//Recreate the registerRegister link in CF.
+		context->CF->registerRegister = context->register_Register;
+
+		//Create the EntryPoint for all application plugins' finalise functions to hook into.
+	        applicationsFinalise_EP = EntryPoint_New( EP_APPLICATIONS_FINALISE, EntryPoint_VoidPtr_CastType );
+	        EntryPoint_Register_Add(context->entryPoint_Register, (void*)applicationsFinalise_EP);
+
+	} //close of if(context->type == AbstractContext_Type)
+	else //prevContext was NOT an abstract context -> that is does NOT need to be replaced
+		context = (PICelleratorContext*) prevContext;
+
+
+        EntryPoint_Append( Context_GetEntryPoint( context, EP_APPLICATIONS_FINALISE ),
+                           "PICellerator App Finalise",
+                           PICellerator_Application_Finalise,
+                           "PICellerator_App_Construct" );
+}
+
+void PICellerator_Application_Finalise() 
+{
+	Stream* finaliseStream = 
+			Journal_Register(Info_Type, "PICellerator_Application");
+	Journal_Printf( finaliseStream, 
+		      "Finalised: Particle-In-Cellerator (FEM/PIC Framework).\n");
+
+	PICellerator_Finalise();
+}
+
+void* _PICellerator_Application_DefaultNew( Name name ) {
+	return Codelet_New(
+			PICellerator_Application_Type,
+			_PICellerator_Application_DefaultNew,
+			_PICellerator_Application_Construct,
+			_Codelet_Build,
+			_Codelet_Initialise,
+			_Codelet_Execute,
+			_Codelet_Destroy,
+			name );
+}
+
+Index PICellerator_Application_Register( PluginsManager* pluginsManager ) 
+{
+	//Initialise the PICellerator context.
+        PICellerator_Init( NULL, NULL);
+	#ifdef HAVE_PYTHON
+	Py_Initialize();
+	#endif
+
+	return PluginsManager_Submit( pluginsManager, PICellerator_Application_Type, "0", _PICellerator_Application_DefaultNew );
+}
+
diff -r 5896a19b8457 -r 31abbeebf74e plugins/Application/Application.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/Application/Application.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,64 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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
+**
+*/
+/** \file
+** Role:
+**	Defines any header info, such as new structures, needed by this plugin
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __PICellerator_Application_h__
+#define __PICellerator_Application_h__
+
+extern const Type PICellerator_Application_Type;
+
+typedef struct {
+	__Codelet
+} PICellerator_Application;
+
+Index PICellerator_Application_Register( PluginsManager* pluginsManager );
+
+void PICellerator_Application_Finalise();
+
+#endif	
diff -r 5896a19b8457 -r 31abbeebf74e plugins/Application/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/Application/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,66 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 535 2006-04-11 13:07:34Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+modName := $(shell basename `pwd` )
+modName := $(shell echo ${modName} | cut -c 1 | tr '[:lower:]' '[:upper:]' )$(shell echo ${modName} | cut -c 2- ) 
+
+mod = ${PROJECT}_${modName}
+includes = ${PROJECT}/${modName}
+
+SRCS = $(wildcard *.c)
+HDRS = $(wildcard *.h)
+
+EXTERNAL_LIBS = -lPICellerator ${EXPORT_DYNAMIC_LFLAGS}
+
+EXTERNAL_INCLUDES = -DMODULE_EXT=\"${MODULE_EXT}\"
+
+packages = STGFEM STGERMAIN PETSC MPI XML MATH DL HYPRE
+
+ifdef HAVE_PYTHON
+        packages += PYTHON
+endif
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,193 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: CalculateParticleDisplacement.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PICellerator.h>
+
+#include "CalculateParticleDisplacement.h"
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+const Type PICellerator_CalculateParticleDisplacement_Type = "PICellerator_CalculateParticleDisplacement";
+
+void _PICellerator_CalculateParticleDisplacement_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+	CalculateParticleDisplacementPlugin*  self = (CalculateParticleDisplacementPlugin*)component;
+	DiscretisationContext*                context;
+	MaterialPointsSwarm*                  materialPointsSwarm;
+	StandardParticle                      particle;
+	ParticleDisplacementInfo*             particleExt;
+	
+	context = (DiscretisationContext*)Stg_ComponentFactory_ConstructByName( cf, "context", DiscretisationContext, 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, "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,
+		"OriginalCoord",
+		(ArithPointer) &particleExt->originalCoord - (ArithPointer) &particle,
+		Variable_DataType_Double,
+		materialPointsSwarm->dim,
+		"OriginalCoordX",
+		"OriginalCoordY",
+		"OriginalCoordZ" );
+		
+	self->particleDisplacementSwarmVariable = Swarm_NewVectorVariable(
+		materialPointsSwarm,
+		"Displacement",
+		(ArithPointer) &particleExt->displacement - (ArithPointer) &particle,
+		Variable_DataType_Double,
+		materialPointsSwarm->dim,
+		"DisplacementX",
+		"DisplacementY",
+		"DisplacementZ" );
+
+	/* Create this here, rather than in XML, since if we tried to create it in XML it couldn't
+	find the Displacement swarm variable at configure-time */
+	/* OperatorSwarmVariables don't automatically prefix the swarm's name to the name
+	you give, so we have to add it manually here */
+	self->particleDisplacementMagSwarmVariable = OperatorSwarmVariable_NewUnary(
+		"materialSwarm-DisplacementMagnitude",
+		self->particleDisplacementSwarmVariable,
+		"Magnitude" );
+	
+	/* Need to make sure this guy is build/initialised */
+}
+
+
+void _PICellerator_CalculateParticleDisplacement_StoreOriginalPos( PICelleratorContext* context ) {
+	CalculateParticleDisplacementPlugin*  self;
+	MaterialPointsSwarm*                  materialPointsSwarm;
+	GlobalParticle*                       particle;
+	double*                               originalCoord;
+	ParticleDisplacementInfo*             particleDisplacementInfo; 
+	Particle_Index                        lParticle_I;
+
+	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, "materialSwarm" );
+	assert( materialPointsSwarm );
+	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 );
+		particleDisplacementInfo = ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr,
+			particle, self->particleDisplacementInfo_Handle );
+		originalCoord = particleDisplacementInfo->originalCoord;
+
+		memcpy( originalCoord, particle->coord, sizeof(Coord) );
+		memset( particleDisplacementInfo->displacement, 0, sizeof(XYZ) );
+	}
+}
+
+
+void _PICellerator_CalculateParticleDisplacement_UpdateDisplacement( PICelleratorContext* context ) {
+	CalculateParticleDisplacementPlugin*  self;
+	MaterialPointsSwarm*                  materialPointsSwarm;
+	GlobalParticle*                       particle;
+	double*                               originalCoord;
+	double*                               coord;
+	Particle_Index                        lParticle_I;
+	ParticleDisplacementInfo*             particleDisplacementInfo = NULL;
+	Dimension_Index                       dim_I;
+
+	/* Add original pos to particle */
+	materialPointsSwarm = (MaterialPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, "materialSwarm" );
+	assert( materialPointsSwarm );
+	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 );
+		coord         = particle->coord;
+		particleDisplacementInfo = ExtensionManager_Get( materialPointsSwarm->particleExtensionMgr, particle,
+			self->particleDisplacementInfo_Handle );
+		originalCoord = particleDisplacementInfo->originalCoord;	
+
+		for ( dim_I = 0; dim_I < materialPointsSwarm->dim; dim_I++ ) {
+			particleDisplacementInfo->displacement[dim_I] = coord[dim_I] - originalCoord[dim_I];
+		}
+	}
+}
+
+
+void* _PICellerator_CalculateParticleDisplacement_DefaultNew( Name name ) {
+	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, "0",
+		_PICellerator_CalculateParticleDisplacement_DefaultNew );
+
+	return result;
+}
diff -r 5896a19b8457 -r 31abbeebf74e plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/CalculateParticleDisplacement/CalculateParticleDisplacement.h	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,24 @@
+
+	typedef struct ParticleDisplacementInfo {
+		Coord     originalCoord;
+		XYZ       displacement;
+	} ParticleDisplacementInfo;
+
+	/** The CalculateParticleDisplacementPlugin extends upon the Codelet class */
+	#define __CalculateParticleDisplacementPlugin \
+		__Codelet \
+		\
+		ExtensionInfo_Index     particleDisplacementInfo_Handle; \
+		SwarmVariable*          particleOriginalCoordSwarmVariable; \
+		SwarmVariable*          particleDisplacementSwarmVariable;  \
+		OperatorSwarmVariable*  particleDisplacementMagSwarmVariable;
+
+	typedef struct CalculateParticleDisplacementPlugin 
+		{ __CalculateParticleDisplacementPlugin } CalculateParticleDisplacementPlugin;
+
+	extern const Type PICellerator_CalculateParticleDisplacement_Type;
+
+	void _PICellerator_CalculateParticleDisplacement_StoreOriginalPos( PICelleratorContext* context );
+	void _PICellerator_CalculateParticleDisplacement_UpdateDisplacement( PICelleratorContext* context );
+	
+	
diff -r 5896a19b8457 -r 31abbeebf74e plugins/CalculateParticleDisplacement/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/CalculateParticleDisplacement/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,78 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := $(shell find * -type d -prune ! -name .svn ) 
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# What to call the plugin
+modName := $(shell basename `pwd`)
+mod = ${PROJECT}_${modName}
+
+# Where to put header files
+includes = ${PROJECT}/${modName}
+
+# External Libraries and Headers
+EXTERNAL_INCLUDES = ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${PETSC_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} 
+EXTERNAL_LIBS = \
+	${STGFEM_RPATH} ${STGFEM_LIBS} \
+	${STGFEM_RPATH} ${STGERMAIN_LIBS} \
+	${PETSC_RPATH} ${PETSC_LIBS} \
+	${MPI_RPATH} ${MPI_LIBS} \
+	${XML_LIBS} 
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e plugins/Output/MaterialCentroid/MaterialCentroid.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/Output/MaterialCentroid/MaterialCentroid.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,130 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: MaterialCentroid.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include <PICellerator/PICellerator.h>
+#include <assert.h>
+
+const Type PICellerator_MaterialCentroid_Type = "PICellerator_MaterialCentroid";
+
+void MaterialCentroid( PICelleratorContext* context ) {
+	static IntegrationPointsSwarm*      swarm;
+	static Material*            material;
+	Coord                       centroid;
+	double                      volume;
+	static Bool                 beenHere              = False;
+	Stream*                     stream                = Journal_Register( Info_Type, "MaterialCentroid" );
+
+	if (!beenHere) {
+		Name                 swarmName;
+		Name                 materialName;
+		Name                 filename;
+
+		swarmName = Dictionary_GetString_WithDefault( context->dictionary, "MaterialCentroid_Swarm", "picIntegrationPoints" );
+		
+		/* Get Swarm */
+		swarm = (IntegrationPointsSwarm*) LiveComponentRegister_Get( context->CF->LCRegister, swarmName );
+		assert( swarm );
+	
+		/* Get Material */
+		materialName = Dictionary_GetString( context->dictionary, "CentroidMaterial" );
+		material = Materials_Register_GetByName( swarm->materials_Register, materialName );
+		assert( material );
+		
+		/* Set up stream */
+		Stg_asprintf( &filename, "%sCentroid.dat", materialName );
+		Stream_RedirectFile_WithPrependedPath( stream, context->outputPath, filename );
+		Memory_Free( filename );
+		Stream_SetAutoFlush( stream, True );
+
+		/* Print header to stream */
+		Journal_Printf( stream, 
+				"#       Timestep            Time          Volume       CentroidX       CentroidY       CentroidZ\n" );
+
+		beenHere = True;
+	}
+		
+	volume = Material_Volume( material, swarm, centroid );
+
+	Journal_Printf( stream, "    %12.6g    %12.6g    %12.6g    %12.6g    %12.6g    %12.6g\n",
+			(double)context->timeStep, context->currentTime, volume, centroid[ I_AXIS ], centroid[ J_AXIS ], centroid[ K_AXIS ] );
+}
+
+
+void _PICellerator_MaterialCentroid_Construct( void* component, Stg_ComponentFactory* cf, void* data ) {
+
+	AbstractContext* context;
+
+	context = Stg_ComponentFactory_ConstructByName( cf, "context", AbstractContext, True, data ); 
+	ContextEP_Append( context, AbstractContext_EP_FrequentOutput, MaterialCentroid );
+}
+
+
+void* _PICellerator_MaterialCentroid_DefaultNew( Name name ) {
+	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, "0",
+		_PICellerator_MaterialCentroid_DefaultNew );
+
+	return result;
+}
diff -r 5896a19b8457 -r 31abbeebf74e plugins/Output/MaterialCentroid/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/Output/MaterialCentroid/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,78 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := $(shell find * -type d -prune ! -name .svn ) 
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# What to call the plugin
+modName := $(shell basename `pwd`)
+mod = ${PROJECT}_${modName}
+
+# Where to put header files
+includes = ${PROJECT}/${modName}
+
+# External Libraries and Headers
+EXTERNAL_INCLUDES = ${STGFEM_INCLUDES} ${STGERMAIN_INCLUDES} ${PETSC_INCLUDES} ${MPI_INCLUDES} ${XML_CFLAGS} 
+EXTERNAL_LIBS = \
+	${STGFEM_RPATH} ${STGFEM_LIBS} \
+	${STGFEM_RPATH} ${STGERMAIN_LIBS} \
+	${PETSC_RPATH} ${PETSC_LIBS} \
+	${MPI_RPATH} ${MPI_LIBS} \
+	${XML_LIBS} 
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e plugins/Output/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/Output/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,53 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := $(shell find * -type d -follow -prune ! -name .svn )
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e plugins/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,53 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 277 2006-04-11 11:28:01Z PatrickSunter $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := $(shell find * -type d -follow -prune ! -name .svn )
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 5896a19b8457 -r 31abbeebf74e project-config.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/project-config.sh	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,48 @@
+#!/bin/sh
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Victorian Partnership for Advanced Computing (VPAC) Ltd, Australia
+## (C) 2003 All Rights Reserved
+##
+## California Institute of Technology (Caltech), USA
+## (C) 2003 All Rights Reserved
+##
+## Authors:
+## 	Stevan M. Quenette, Senior Software Engineer, VPAC.
+##	Stevan M. Quenette, Visitor in Geophysics, Caltech.
+##
+## <copyright-release-tag>
+##
+## Role:
+##	Obtain the project configuration.
+##
+## $Id: project-config.sh 376 2006-10-18 06:58:41Z SteveQuenette $
+##
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+	emulate sh
+	NULLCMD=:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+	set -o posix
+fi
+
+. './build-functions.sh'
+
+setValue PROJECT 'PICellerator'
+
+# Setup Makefile shortcuts
+. ./VMake/Config/makefile-shortcuts.sh
+
+# Do configurations
+. ./VMake/Config/StGermain-config.sh
+. ./VMake/Config/StgFEM-config.sh
+
+. ./VMake/Config/compiler-config.sh
+. ./VMake/Config/math-config.sh
+. ./VMake/Config/PETSc-config.sh
+. ./VMake/Config/mpi-config.sh
+. ./VMake/Config/xml-config.sh
+. ./VMake/Config/python-config.sh --optional
diff -r 5896a19b8457 -r 31abbeebf74e src/Makefile.def
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Makefile.def	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,17 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Victorian Partnership for Advanced Computing (VPAC) Ltd, Australia
+## (C) 2003 All Rights Reserved
+##
+## <copyright-release-tag>
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+def_bin = PICellerator
+
+def_srcs = \
+	main.c
+
+def_hdrs = 
+	
+def_libs = 
diff -r 5896a19b8457 -r 31abbeebf74e src/main.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main.c	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,133 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: main.c 376 2006-10-18 06:58:41Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifdef HAVE_PYTHON
+#include <Python.h>
+#endif
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StgFEM/StgFEM.h>
+#include "PICellerator/PICellerator.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main( int argc, char* argv[] ) {
+	/* StGermain standard bits & pieces */
+	MPI_Comm             CommWorld;
+	int                  rank;
+	int                  numProcessors;
+	Dictionary*          dictionary;
+	XML_IO_Handler*      ioHandler;
+	int	                 tmp         =  0;
+	PICelleratorContext* context = NULL;
+	
+	char* errMessage = "Component dictionary must have unique names\n";
+
+	/* Initialise PETSc, get world info */
+	MPI_Init( &argc, &argv );
+	MPI_Comm_dup( MPI_COMM_WORLD, &CommWorld );
+	MPI_Comm_size( CommWorld, &numProcessors );
+	MPI_Comm_rank( CommWorld, &rank );
+	
+	StGermain_Init( &argc, &argv );
+	StgFEM_Init( &argc, &argv );
+	PICellerator_Init( &argc, &argv );
+	#ifdef HAVE_PYTHON
+	Py_Initialize();
+	#endif
+
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	/* StgFEM's init message */
+	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, "Context" ), 
+		"PICellerator revision %s. Copyright (C) 2005 VPAC & Monash Cluster Computing.\n", VERSION );
+	Stream_Flush( Journal_Register( InfoStream_Type, "Context" ) );
+	Stream_SetPrintingRank( Journal_Register( InfoStream_Type, "Context" ), tmp );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	/* Create the application's dictionary */
+	dictionary = Dictionary_New();
+
+	/* Read input */
+	ioHandler = XML_IO_Handler_New();
+	IO_Handler_ReadAllFromCommandLine( ioHandler, argc, argv, dictionary );
+	Journal_ReadFromDictionary( dictionary );
+
+	/* Construction phase -----------------------------------------------------------------------------------------------*/
+	context = PICelleratorContext_New( "context", 0, 0, CommWorld, dictionary );
+	Stg_Component_Construct( context, 0 /* dummy */, &context, True );
+	
+	/* Building phase ---------------------------------------------------------------------------------------------------*/
+	Stg_Component_Build( context, 0 /* dummy */, False );
+	
+	/* Initialisaton phase ----------------------------------------------------------------------------------------------*/
+	Stg_Component_Initialise( context, 0 /* dummy */, False );
+	
+	/* Run (Solve) phase ------------------------------------------------------------------------------------------------*/
+	AbstractContext_Dump( context );
+	Stg_Component_Execute( context, 0 /* dummy */, False );
+
+	/* Destruct phase ---------------------------------------------------------------------------------------------------*/
+	Stg_Component_Destroy( context, 0 /* dummy */, False );
+	Stg_Class_Delete( context );
+	Stg_Class_Delete( dictionary );
+
+	#ifdef HAVE_PYTHON
+	Py_Finalize();
+	#endif
+	PICellerator_Finalise();
+	StgFEM_Finalise();
+	StGermain_Finalise();
+		
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0; /* success */
+}
diff -r 5896a19b8457 -r 31abbeebf74e src/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/makefile	Mon Mar 26 09:24:36 2007 +0000
@@ -0,0 +1,70 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## 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: makefile 422 2007-02-12 04:15:13Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+include Makefile.def
+
+# obtain defaults for required variables according to system and project location, and then run the build.
+ifndef PROJ_ROOT
+	PROJ_ROOT=..
+endif
+include ${PROJ_ROOT}/Makefile.system
+
+bin = ${def_bin}
+
+SRCS = ${def_srcs}
+
+PROJ_LIBS = ${def_libs}
+
+EXTERNAL_LIBS =  -lPICellerator ${EXPORT_DYNAMIC_LFLAGS} 
+
+EXTERNAL_INCLUDES = -DMODULE_EXT=\"${MODULE_EXT}\"
+
+packages = STGFEM STGERMAIN PETSC MPI XML MATH DL HYPRE
+
+ifdef HAVE_PYTHON
+	packages += PYTHON
+endif
+
+include ${PROJ_ROOT}/Makefile.vmake
+



More information about the CIG-COMMITS mailing list