[cig-commits] commit:

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


changeset:   2:5667007f4799
user:        SteveQuenette
date:        Wed Oct 10 07:21:38 2007 +0000
files:       Geometry/makefile Geometry/src/BlockGeometry.c Geometry/src/BlockGeometry.h Geometry/src/BlockGeometry.meta Geometry/src/ComplexMath.c Geometry/src/ComplexMath.h Geometry/src/ComplexVectorMath.c Geometry/src/ComplexVectorMath.h Geometry/src/Delaunay.c Geometry/src/Delaunay.h Geometry/src/Delaunay.meta Geometry/src/Dimension.c Geometry/src/Dimension.h Geometry/src/Edge.c Geometry/src/Edge.h Geometry/src/Finalise.c Geometry/src/Finalise.h Geometry/src/FullTensorMath.c Geometry/src/FullTensorMath.h Geometry/src/Geometry.h Geometry/src/GeometryClass.c Geometry/src/GeometryClass.h Geometry/src/GeometryClass.meta Geometry/src/Hex.c Geometry/src/Hex.h Geometry/src/IJK26Topology.c Geometry/src/IJK26Topology.h Geometry/src/IJK26Topology.meta Geometry/src/IJK6Topology.c Geometry/src/IJK6Topology.h Geometry/src/IJK6Topology.meta Geometry/src/IJKTopology.c Geometry/src/IJKTopology.h Geometry/src/IJKTopology.meta Geometry/src/Init.c Geometry/src/Init.h Geometry/src/IrregGeometry.c Geometry/src/IrregGeometry.h Geometry/src/IrregGeometry.meta Geometry/src/IrregTopology.c Geometry/src/IrregTopology.h Geometry/src/IrregTopology.meta Geometry/src/Line.c Geometry/src/Line.h Geometry/src/ParallelDelaunay.c Geometry/src/ParallelDelaunay.h Geometry/src/ParallelDelaunay.meta Geometry/src/Plane.c Geometry/src/Plane.h Geometry/src/QuadEdge.c Geometry/src/QuadEdge.h Geometry/src/RMatrix.c Geometry/src/RMatrix.h Geometry/src/RefinedRegionsGeometry.c Geometry/src/RefinedRegionsGeometry.h Geometry/src/RefinedRegionsGeometry.meta Geometry/src/ShellGeometry.c Geometry/src/ShellGeometry.h Geometry/src/ShellGeometry.meta Geometry/src/Simplex.c Geometry/src/Simplex.h Geometry/src/Simplex.meta Geometry/src/TensorMath.c Geometry/src/TensorMath.h Geometry/src/TensorMultMath.c Geometry/src/TensorMultMath.h Geometry/src/Topology.c Geometry/src/Topology.h Geometry/src/Topology.meta Geometry/src/TrigMath.c Geometry/src/TrigMath.h Geometry/src/VectorMath.c Geometry/src/VectorMath.h Geometry/src/isinf.h Geometry/src/makefile Geometry/src/stg_lapack.h Geometry/src/types.h Geometry/src/units.h Geometry/tests/Makefile.def Geometry/tests/data/points.xml Geometry/tests/makefile Geometry/tests/small.txt Geometry/tests/testBlockGeometry.0of1.expected Geometry/tests/testBlockGeometry.0of1.sh Geometry/tests/testBlockGeometry.c Geometry/tests/testComplexMath.0of1.expected Geometry/tests/testComplexMath.0of1.sh Geometry/tests/testComplexMath.c Geometry/tests/testComplexVectorMath.0of1.expected Geometry/tests/testComplexVectorMath.0of1.sh Geometry/tests/testComplexVectorMath.c Geometry/tests/testDelaunay.0of1.expected Geometry/tests/testDelaunay.0of1.sh Geometry/tests/testDelaunay.c Geometry/tests/testDimensionMacros.0of1.expected Geometry/tests/testDimensionMacros.0of1.sh Geometry/tests/testDimensionMacros.c Geometry/tests/testEdge.0of1.expected Geometry/tests/testEdge.0of1.sh Geometry/tests/testEdge.c Geometry/tests/testFullTensorMath.0of1.FullTensorMath.txt.expected Geometry/tests/testFullTensorMath.0of1.expected Geometry/tests/testFullTensorMath.0of1.sh Geometry/tests/testFullTensorMath.c Geometry/tests/testIJK26Topology.0of1.expected Geometry/tests/testIJK26Topology.0of1.sh Geometry/tests/testIJK26Topology.c Geometry/tests/testIJK6Topology.0of1.expected Geometry/tests/testIJK6Topology.0of1.sh Geometry/tests/testIJK6Topology.c Geometry/tests/testIrregGeometry.0of1.expected Geometry/tests/testIrregGeometry.0of1.sh Geometry/tests/testIrregGeometry.c Geometry/tests/testLine.0of1.expected Geometry/tests/testLine.0of1.sh Geometry/tests/testLine.c Geometry/tests/testParallelDelaunay.0of1.expected Geometry/tests/testParallelDelaunay.0of1.sh Geometry/tests/testParallelDelaunay.0of2.expected Geometry/tests/testParallelDelaunay.0of2.sh Geometry/tests/testParallelDelaunay.c Geometry/tests/testPlane.0of1.expected Geometry/tests/testPlane.0of1.sh Geometry/tests/testPlane.c Geometry/tests/testRMatrix.c Geometry/tests/testRefinedRegionsGeometry.0of1.expected Geometry/tests/testRefinedRegionsGeometry.0of1.sh Geometry/tests/testRefinedRegionsGeometry.c Geometry/tests/testShellGeometry.0of1.expected Geometry/tests/testShellGeometry.0of1.sh Geometry/tests/testShellGeometry.c Geometry/tests/testTensorMath.0of1.expected Geometry/tests/testTensorMath.0of1.sh Geometry/tests/testTensorMath.c Geometry/tests/testTensorMultMath.0of1.expected Geometry/tests/testTensorMultMath.0of1.sh Geometry/tests/testTensorMultMath.c Geometry/tests/testTrigMath.0of1.expected Geometry/tests/testTrigMath.0of1.sh Geometry/tests/testTrigMath.c Geometry/tests/testVectorMath.0of1.expected Geometry/tests/testVectorMath.0of1.sh Geometry/tests/testVectorMath.c Makefile.system Makefile.vmake Mesh/Python/Mesh.py Mesh/Python/__init__.py Mesh/Python/makefile Mesh/makefile Mesh/src/CartesianGenerator.c Mesh/src/CartesianGenerator.h Mesh/src/CartesianGenerator.meta Mesh/src/CommTopology.c Mesh/src/CommTopology.h Mesh/src/CommTopology.meta Mesh/src/CompressionAdaptor.c Mesh/src/CompressionAdaptor.h Mesh/src/CompressionAdaptor.meta Mesh/src/Decomp.c Mesh/src/Decomp.def Mesh/src/Decomp.h Mesh/src/Decomp.meta Mesh/src/DecompTransfer.c Mesh/src/DecompTransfer.h Mesh/src/DecompTransfer.meta Mesh/src/Decomp_Sync.c Mesh/src/Decomp_Sync.h Mesh/src/Decomp_Sync.meta Mesh/src/Decomp_Sync_Array.c Mesh/src/Decomp_Sync_Array.h Mesh/src/Decomp_Sync_Claim.c Mesh/src/Decomp_Sync_Claim.h Mesh/src/Decomp_Sync_Claim.meta Mesh/src/Decomp_Sync_Negotiate.c Mesh/src/Decomp_Sync_Negotiate.h Mesh/src/Decomp_Sync_Negotiate.meta Mesh/src/Decomposer.c Mesh/src/Decomposer.h Mesh/src/DictionaryGenerator.c Mesh/src/DictionaryGenerator.h Mesh/src/DictionaryGenerator.meta Mesh/src/Finalise.c Mesh/src/Finalise.h Mesh/src/Grid.c Mesh/src/Grid.h Mesh/src/Grid.meta Mesh/src/HMesh.c Mesh/src/HMesh.h Mesh/src/HMesh.meta Mesh/src/IGraph.c Mesh/src/IGraph.def Mesh/src/IGraph.h Mesh/src/IGraph.meta Mesh/src/Init.c Mesh/src/Init.h Mesh/src/Mesh.h Mesh/src/MeshAdaptor.c Mesh/src/MeshAdaptor.h Mesh/src/MeshAdaptor.meta Mesh/src/MeshClass.c Mesh/src/MeshClass.h Mesh/src/MeshClass.meta Mesh/src/MeshGenerator.c Mesh/src/MeshGenerator.h Mesh/src/MeshGenerator.meta Mesh/src/MeshTopology.c Mesh/src/MeshTopology.def Mesh/src/MeshTopology.h Mesh/src/MeshTopology.meta Mesh/src/MeshVariable.c Mesh/src/MeshVariable.h Mesh/src/MeshVariable.meta Mesh/src/Mesh_Algorithms.c Mesh/src/Mesh_Algorithms.h Mesh/src/Mesh_Algorithms.meta Mesh/src/Mesh_CentroidAlgorithms.c Mesh/src/Mesh_CentroidAlgorithms.h Mesh/src/Mesh_CentroidAlgorithms.meta Mesh/src/Mesh_CentroidType.c Mesh/src/Mesh_CentroidType.h Mesh/src/Mesh_ElementType.c Mesh/src/Mesh_ElementType.h Mesh/src/Mesh_ElementType.meta Mesh/src/Mesh_HexAlgorithms.c Mesh/src/Mesh_HexAlgorithms.h Mesh/src/Mesh_HexAlgorithms.meta Mesh/src/Mesh_HexType.c Mesh/src/Mesh_HexType.h Mesh/src/Mesh_RegularAlgorithms.c Mesh/src/Mesh_RegularAlgorithms.h Mesh/src/Mesh_RegularAlgorithms.meta Mesh/src/SurfaceAdaptor.c Mesh/src/SurfaceAdaptor.h Mesh/src/SurfaceAdaptor.meta Mesh/src/Sync.c Mesh/src/Sync.def Mesh/src/Sync.h Mesh/src/makefile Mesh/src/shortcuts.h Mesh/src/types.h Mesh/tests/data/trisurf.xml Mesh/tests/makefile Mesh/tests/testCartesianGenerator.0of1.expected Mesh/tests/testCartesianGenerator.0of1.sh Mesh/tests/testCartesianGenerator.0of2.expected Mesh/tests/testCartesianGenerator.0of2.sh Mesh/tests/testCartesianGenerator.0of3.expected Mesh/tests/testCartesianGenerator.0of3.sh Mesh/tests/testCartesianGenerator.0of4.expected Mesh/tests/testCartesianGenerator.0of4.sh Mesh/tests/testCartesianGenerator.c Mesh/tests/testDecomp.0of1.expected Mesh/tests/testDecomp.0of1.sh Mesh/tests/testDecomp.0of2.expected Mesh/tests/testDecomp.0of2.sh Mesh/tests/testDecomp.0of3.expected Mesh/tests/testDecomp.0of3.sh Mesh/tests/testDecomp.0of4.expected Mesh/tests/testDecomp.0of4.sh Mesh/tests/testDecomp.c Mesh/tests/testDecompTransfer.c.tmp Mesh/tests/testMesh.0of1.expected Mesh/tests/testMesh.0of1.sh Mesh/tests/testMesh.0of2.expected Mesh/tests/testMesh.0of2.sh Mesh/tests/testMesh.0of3.expected Mesh/tests/testMesh.0of3.sh Mesh/tests/testMesh.0of4.expected Mesh/tests/testMesh.0of4.sh Mesh/tests/testMesh.c Mesh/tests/testMesh.c.tmp Mesh/tests/testMeshTopology.c Mesh/tests/testMesh_RegularAlgorithms.c.tmp Python/Bindings/Makefile.def Python/Bindings/Mesh/Makefile.def Python/Bindings/Mesh/bindings.c Python/Bindings/Mesh/bindings.h Python/Bindings/Mesh/init.c Python/Bindings/Mesh/makefile Python/Bindings/Mesh/misc.c Python/Bindings/Mesh/misc.h Python/Bindings/__init__.py Python/Bindings/makefile Python/Makefile.def Python/__init__.py Python/makefile Shape/makefile Shape/src/BelowCosinePlane.c Shape/src/BelowCosinePlane.h Shape/src/BelowCosinePlane.meta Shape/src/BelowPlane.c Shape/src/BelowPlane.h Shape/src/BelowPlane.meta Shape/src/Box.c Shape/src/Box.h Shape/src/Box.meta Shape/src/ConvexHull.c Shape/src/ConvexHull.h Shape/src/ConvexHull.meta Shape/src/Cylinder.c Shape/src/Cylinder.h Shape/src/Cylinder.meta Shape/src/Everywhere.c Shape/src/Everywhere.h Shape/src/Everywhere.meta Shape/src/Finalise.c Shape/src/Finalise.h Shape/src/Init.c Shape/src/Init.h Shape/src/Intersection.c Shape/src/Intersection.h Shape/src/Intersection.meta Shape/src/PolygonShape.c Shape/src/PolygonShape.h Shape/src/PolygonShape.meta Shape/src/PythonShape.c Shape/src/PythonShape.h Shape/src/PythonShape.meta Shape/src/Shape.h Shape/src/ShapeClass.c Shape/src/ShapeClass.h Shape/src/ShapeClass.meta Shape/src/Sphere.c Shape/src/Sphere.h Shape/src/Sphere.meta Shape/src/Superellipsoid.c Shape/src/Superellipsoid.h Shape/src/Superellipsoid.meta Shape/src/Union.c Shape/src/Union.h Shape/src/Union.meta Shape/src/makefile Shape/src/types.h Shape/tests/Viewport.xml Shape/tests/expected/testBox2D.0of1.output.dat.expected Shape/tests/expected/testBox3D.0of1.output.dat.expected Shape/tests/expected/testConvexHull2D.0of1.output.dat.expected Shape/tests/expected/testConvexHull3D.0of1.output.dat.expected Shape/tests/expected/testCylinder.0of1.output.dat.expected Shape/tests/expected/testIntersection2D.0of1.output.dat.expected Shape/tests/expected/testIntersection2DDoubleNot.0of1.output.dat.expected Shape/tests/expected/testIntersection2DSingleNot.0of1.output.dat.expected Shape/tests/expected/testIntersection3D.0of1.output.dat.expected Shape/tests/expected/testIntersection3DDoubleNot.0of1.output.dat.expected Shape/tests/expected/testIntersection3DSingleNot.0of1.output.dat.expected Shape/tests/expected/testPolygonShape2D.0of1.output.dat.expected Shape/tests/expected/testPolygonShape3D.0of1.output.dat.expected Shape/tests/expected/testPython2D.0of1.output.dat.expected Shape/tests/expected/testPython3D.0of1.output.dat.expected Shape/tests/expected/testSphere2D-invert.0of1.output.dat.expected Shape/tests/expected/testSphere2D.0of1.output.dat.expected Shape/tests/expected/testSphere3D.0of1.output.dat.expected Shape/tests/expected/testSuperellipsoid2D.0of1.output.dat.expected Shape/tests/expected/testSuperellipsoid3D.0of1.output.dat.expected Shape/tests/expected/testUnion2D.0of1.output.dat.expected Shape/tests/expected/testUnion2DSingleNot.0of1.output.dat.expected Shape/tests/expected/testUnion3D.0of1.output.dat.expected Shape/tests/expected/testUnion3DSingleNot.0of1.output.dat.expected Shape/tests/makefile Shape/tests/output/window.mpeg Shape/tests/testBox.xml Shape/tests/testBox2D.0of1.sh Shape/tests/testBox3D.0of1.sh Shape/tests/testConvexHull.xml Shape/tests/testConvexHull2D.0of1.sh Shape/tests/testConvexHull3D.0of1.sh Shape/tests/testConvexHull3D.xml Shape/tests/testCylinder.0of1.sh Shape/tests/testCylinder.xml Shape/tests/testIntersection.xml Shape/tests/testIntersection2D.0of1.sh Shape/tests/testIntersection2DDoubleNot.0of1.sh Shape/tests/testIntersection2DSingleNot.0of1.sh Shape/tests/testIntersection3D.0of1.sh Shape/tests/testIntersection3DDoubleNot.0of1.sh Shape/tests/testIntersection3DSingleNot.0of1.sh Shape/tests/testIntersectionDoubleNot.xml Shape/tests/testIntersectionSingleNot.xml Shape/tests/testPolygonShape.xml Shape/tests/testPolygonShape2D.0of1.sh Shape/tests/testPolygonShape3D.0of1.sh Shape/tests/testPython2D.0of1.sh Shape/tests/testPython2D.xml Shape/tests/testPython3D.0of1.sh Shape/tests/testPython3D.xml Shape/tests/testShape.c Shape/tests/testShape.xml Shape/tests/testSphere-invert.xml Shape/tests/testSphere.xml Shape/tests/testSphere2D-invert.0of1.sh Shape/tests/testSphere2D.0of1.sh Shape/tests/testSphere3D.0of1.sh Shape/tests/testSuperellipsoid.xml Shape/tests/testSuperellipsoid2D.0of1.sh Shape/tests/testSuperellipsoid3D.0of1.sh Shape/tests/testUnion.xml Shape/tests/testUnion2D.0of1.sh Shape/tests/testUnion2DSingleNot.0of1.sh Shape/tests/testUnion3D.0of1.sh Shape/tests/testUnion3DSingleNot.0of1.sh Shape/tests/testUnionSingleNot.xml StGermainDiscretisationImportVersion Swarm/makefile Swarm/src/CellLayout.c Swarm/src/CellLayout.h Swarm/src/CellLayout.meta Swarm/src/ElementCellLayout.c Swarm/src/ElementCellLayout.h Swarm/src/ElementCellLayout.meta Swarm/src/FileParticleLayout.c Swarm/src/FileParticleLayout.h Swarm/src/FileParticleLayout.meta Swarm/src/Finalise.c Swarm/src/Finalise.h Swarm/src/GaussBorderParticleLayout.c Swarm/src/GaussBorderParticleLayout.h Swarm/src/GaussBorderParticleLayout.meta Swarm/src/GaussParticleLayout.c Swarm/src/GaussParticleLayout.h Swarm/src/GaussParticleLayout.meta Swarm/src/GlobalParticleLayout.c Swarm/src/GlobalParticleLayout.h Swarm/src/GlobalParticleLayout.meta Swarm/src/Init.c Swarm/src/Init.h Swarm/src/IntegrationPoint.c Swarm/src/IntegrationPoint.h Swarm/src/LineParticleLayout.c Swarm/src/LineParticleLayout.h Swarm/src/LineParticleLayout.meta Swarm/src/ManualParticleLayout.c Swarm/src/ManualParticleLayout.h Swarm/src/ManualParticleLayout.meta Swarm/src/MeshParticleLayout.c Swarm/src/MeshParticleLayout.h Swarm/src/MeshParticleLayout.meta Swarm/src/OperatorSwarmVariable.c Swarm/src/OperatorSwarmVariable.h Swarm/src/OperatorSwarmVariable.meta Swarm/src/ParticleCommHandler.c Swarm/src/ParticleCommHandler.h Swarm/src/ParticleCommHandler.meta Swarm/src/ParticleLayout.c Swarm/src/ParticleLayout.h Swarm/src/ParticleLayout.meta Swarm/src/ParticleMovementHandler.c Swarm/src/ParticleMovementHandler.h Swarm/src/ParticleMovementHandler.meta Swarm/src/ParticleShadowSync.c Swarm/src/ParticleShadowSync.h Swarm/src/ParticleShadowSync.meta Swarm/src/PerCellParticleLayout.c Swarm/src/PerCellParticleLayout.h Swarm/src/PerCellParticleLayout.meta Swarm/src/PlaneParticleLayout.c Swarm/src/PlaneParticleLayout.h Swarm/src/PlaneParticleLayout.meta Swarm/src/Random.c Swarm/src/Random.h Swarm/src/RandomParticleLayout.c Swarm/src/RandomParticleLayout.h Swarm/src/RandomParticleLayout.meta Swarm/src/ShadowInfo.h Swarm/src/SingleCellLayout.c Swarm/src/SingleCellLayout.h Swarm/src/SingleCellLayout.meta Swarm/src/SpaceFillerParticleLayout.c Swarm/src/SpaceFillerParticleLayout.h Swarm/src/SpaceFillerParticleLayout.meta Swarm/src/StandardParticle.c Swarm/src/StandardParticle.h Swarm/src/Swarm.h Swarm/src/SwarmClass.c Swarm/src/SwarmClass.h Swarm/src/SwarmClass.meta Swarm/src/SwarmDump.c Swarm/src/SwarmDump.h Swarm/src/SwarmDump.meta Swarm/src/SwarmOutput.c Swarm/src/SwarmOutput.h Swarm/src/SwarmOutput.meta Swarm/src/SwarmShapeVC.c Swarm/src/SwarmShapeVC.h Swarm/src/SwarmShapeVC.meta Swarm/src/SwarmVariable.c Swarm/src/SwarmVariable.h Swarm/src/SwarmVariable.meta Swarm/src/SwarmVariable_Register.c Swarm/src/SwarmVariable_Register.h Swarm/src/Swarm_Register.c Swarm/src/Swarm_Register.h Swarm/src/TriGaussParticleLayout.c Swarm/src/TriGaussParticleLayout.h Swarm/src/TriGaussParticleLayout.meta Swarm/src/TriSingleCellLayout.c Swarm/src/TriSingleCellLayout.h Swarm/src/TriSingleCellLayout.meta Swarm/src/UnionParticleLayout.c Swarm/src/UnionParticleLayout.h Swarm/src/UnionParticleLayout.meta Swarm/src/WithinShapeParticleLayout.c Swarm/src/WithinShapeParticleLayout.h Swarm/src/WithinShapeParticleLayout.meta Swarm/src/makefile Swarm/src/shortcuts.h Swarm/src/types.h Swarm/tests/Bouncer/Bouncer.c Swarm/tests/Bouncer/makefile Swarm/tests/Makefile.def Swarm/tests/SingleAttractor/SingleAttractor.c Swarm/tests/SingleAttractor/makefile Swarm/tests/Spinner/Spinner.c Swarm/tests/Spinner/makefile Swarm/tests/VaryingCornerAttractors/VaryingCornerAttractors.c Swarm/tests/VaryingCornerAttractors/makefile Swarm/tests/expected/testLineParticleLayout.0of1.output.dat.expected Swarm/tests/expected/testSpaceFillerParticleLayout.0of1.spaceFillerParticleLayout.dat.expected Swarm/tests/expected/testSpaceFillerParticleLayout.0of2.spaceFillerParticleLayout.dat.expected Swarm/tests/expected/testSpaceFillerParticleLayout.1of2.spaceFillerParticleLayout.dat.expected Swarm/tests/expected/testSwarmOutput.0of1.swarmOutput.00000.dat.expected Swarm/tests/expected/testSwarmOutput.0of1.swarmOutput.00001.dat.expected Swarm/tests/expected/testSwarmOutput.0of1.swarmOutput.00002.dat.expected Swarm/tests/expected/testSwarmOutput.0of1.swarmOutput.00003.dat.expected Swarm/tests/expected/testSwarmOutput.0of1.swarmOutput.00004.dat.expected Swarm/tests/expected/testSwarmOutput.0of2.swarmOutput.00000.dat.expected Swarm/tests/expected/testSwarmOutput.0of2.swarmOutput.00001.dat.expected Swarm/tests/expected/testSwarmOutput.0of2.swarmOutput.00002.dat.expected Swarm/tests/expected/testSwarmOutput.0of2.swarmOutput.00003.dat.expected Swarm/tests/expected/testSwarmOutput.0of2.swarmOutput.00004.dat.expected Swarm/tests/makefile Swarm/tests/output/input-2007.10.10-16.02.14.xml Swarm/tests/output/input-2007.10.10-16.02.16.xml Swarm/tests/output/input-2007.10.10-16.02.17.xml Swarm/tests/output/input-2007.10.10-16.02.19.xml Swarm/tests/output/input-2007.10.10-16.02.20.xml Swarm/tests/output/input-2007.10.10-16.02.21.xml Swarm/tests/output/input-2007.10.10-17.13.09.xml Swarm/tests/output/input-2007.10.10-17.13.11.xml Swarm/tests/output/input-2007.10.10-17.13.13.xml Swarm/tests/output/input-2007.10.10-17.13.14.xml Swarm/tests/output/input-2007.10.10-17.13.15.xml Swarm/tests/output/input-2007.10.10-17.13.16.xml Swarm/tests/output/input-2007.10.10-17.14.10.xml Swarm/tests/output/input-2007.10.10-17.14.13.xml Swarm/tests/output/input-2007.10.10-17.14.14.xml Swarm/tests/output/input-2007.10.10-17.14.16.xml Swarm/tests/output/input-2007.10.10-17.14.17.xml Swarm/tests/output/input-2007.10.10-17.14.18.xml Swarm/tests/output/input.xml Swarm/tests/output/swarmOutput.00000.dat Swarm/tests/output/swarmOutput.00001.dat Swarm/tests/output/swarmOutput.00002.dat Swarm/tests/output/swarmOutput.00003.dat Swarm/tests/output/swarmOutput.00004.dat Swarm/tests/output/testSwarm.00000.dat Swarm/tests/testElementCellLayout0.0of1.expected Swarm/tests/testElementCellLayout0.0of1.sh Swarm/tests/testElementCellLayout0.0of2.expected Swarm/tests/testElementCellLayout0.0of2.sh Swarm/tests/testElementCellLayout0.1of2.expected Swarm/tests/testElementCellLayout0.1of2.sh Swarm/tests/testElementCellLayout0.c Swarm/tests/testGaussLayout.0of1.expected Swarm/tests/testGaussLayout.0of1.sh Swarm/tests/testGaussLayout.c Swarm/tests/testGaussLayoutSingleCell.0of1.expected Swarm/tests/testGaussLayoutSingleCell.0of1.sh Swarm/tests/testGaussLayoutSingleCell.c Swarm/tests/testLineParticleLayout.0of1.sh Swarm/tests/testLineParticleLayout.xml Swarm/tests/testManualParticleLayout.0of1.expected Swarm/tests/testManualParticleLayout.0of1.sh Swarm/tests/testManualParticleLayout.0of2.expected Swarm/tests/testManualParticleLayout.0of2.sh Swarm/tests/testManualParticleLayout.1of2.expected Swarm/tests/testManualParticleLayout.1of2.sh Swarm/tests/testManualParticleLayout.c Swarm/tests/testParticleCoords.c Swarm/tests/testParticleCoords.xml Swarm/tests/testSingleCellLayout0.0of1.expected Swarm/tests/testSingleCellLayout0.0of1.sh Swarm/tests/testSingleCellLayout0.c Swarm/tests/testSpaceFillerParticleLayout.0of1.sh Swarm/tests/testSpaceFillerParticleLayout.0of2.sh Swarm/tests/testSpaceFillerParticleLayout.1of2.sh Swarm/tests/testSpaceFillerParticleLayout.c Swarm/tests/testSwarm.0of1.expected Swarm/tests/testSwarm.0of1.sh Swarm/tests/testSwarm.0of2.diffs Swarm/tests/testSwarm.0of2.expected Swarm/tests/testSwarm.0of2.sh Swarm/tests/testSwarm.1of2.diffs Swarm/tests/testSwarm.1of2.expected Swarm/tests/testSwarm.1of2.sh Swarm/tests/testSwarm.c Swarm/tests/testSwarmDumpAndLoad.0of1.expected Swarm/tests/testSwarmDumpAndLoad.0of1.sh Swarm/tests/testSwarmDumpAndLoad.0of2.expected Swarm/tests/testSwarmDumpAndLoad.0of2.sh Swarm/tests/testSwarmDumpAndLoad.1of2.expected Swarm/tests/testSwarmDumpAndLoad.1of2.sh Swarm/tests/testSwarmDumpAndLoad.c Swarm/tests/testSwarmOutput.0of1.sh Swarm/tests/testSwarmOutput.0of2.sh Swarm/tests/testSwarmOutput.c Swarm/tests/testSwarmOutput.xml Swarm/tests/testSwarmParticleAdvection.c Swarm/tests/testSwarmParticleAdvectionBouncer.xml Swarm/tests/testSwarmParticleAdvectionSingleAttractor.0of1.expected Swarm/tests/testSwarmParticleAdvectionSingleAttractor.0of1.sh Swarm/tests/testSwarmParticleAdvectionSingleAttractor.0of2.expected Swarm/tests/testSwarmParticleAdvectionSingleAttractor.0of2.sh Swarm/tests/testSwarmParticleAdvectionSingleAttractor.0of3.expected Swarm/tests/testSwarmParticleAdvectionSingleAttractor.0of3.sh Swarm/tests/testSwarmParticleAdvectionSingleAttractor.1of2.expected Swarm/tests/testSwarmParticleAdvectionSingleAttractor.1of2.sh Swarm/tests/testSwarmParticleAdvectionSingleAttractor.1of3.expected Swarm/tests/testSwarmParticleAdvectionSingleAttractor.1of3.sh Swarm/tests/testSwarmParticleAdvectionSingleAttractor.2of3.expected Swarm/tests/testSwarmParticleAdvectionSingleAttractor.2of3.sh Swarm/tests/testSwarmParticleAdvectionSingleAttractor.xml Swarm/tests/testSwarmParticleAdvectionSpinner.xml Swarm/tests/testSwarmParticleAdvectionSpinnerSphere.xml Swarm/tests/testSwarmParticleAdvectionVaryingCorners.xml Swarm/tests/testSwarmParticleShadowSync.0of2.expected Swarm/tests/testSwarmParticleShadowSync.0of2.sh Swarm/tests/testSwarmParticleShadowSync.0of3.expected Swarm/tests/testSwarmParticleShadowSync.0of3.sh Swarm/tests/testSwarmParticleShadowSync.c Swarm/tests/testSwarmParticleShadowSync.xml Swarm/tests/testWithinShapeParticleLayout.0of1.expected Swarm/tests/testWithinShapeParticleLayout.0of1.sh Swarm/tests/testWithinShapeParticleLayout.0of2.expected Swarm/tests/testWithinShapeParticleLayout.0of2.sh Swarm/tests/testWithinShapeParticleLayout.1of2.expected Swarm/tests/testWithinShapeParticleLayout.1of2.sh Swarm/tests/testWithinShapeParticleLayout.c Utils/makefile Utils/src/AllElementsVC.c Utils/src/AllElementsVC.h Utils/src/AllElementsVC.meta Utils/src/AllNodesVC.c Utils/src/AllNodesVC.h Utils/src/AllNodesVC.meta Utils/src/CellRemesher.c Utils/src/CellRemesher.h Utils/src/CellRemesher.meta Utils/src/CornerVC.c Utils/src/CornerVC.h Utils/src/CornerVC.meta Utils/src/DiscretisationContext.meta Utils/src/DofLayout.c Utils/src/DofLayout.h Utils/src/DofLayout.meta Utils/src/DomainContext.c Utils/src/DomainContext.h Utils/src/EmbeddedSurface.c Utils/src/EmbeddedSurface.h Utils/src/FieldVariable.c Utils/src/FieldVariable.h Utils/src/FieldVariable.meta Utils/src/FieldVariable_Register.c Utils/src/FieldVariable_Register.h Utils/src/Finalise.c Utils/src/Finalise.h Utils/src/FrictionVC.c Utils/src/FrictionVC.h Utils/src/FrictionVC.meta Utils/src/Init.c Utils/src/Init.h Utils/src/InnerWallVC.c Utils/src/InnerWallVC.h Utils/src/InnerWallVC.meta Utils/src/LinearRegression.c Utils/src/LinearRegression.h Utils/src/MeshShapeVC.c Utils/src/MeshShapeVC.h Utils/src/MeshShapeVC.meta Utils/src/NewRemesher.c Utils/src/NewRemesher.def Utils/src/NewRemesher.h Utils/src/Operator.c Utils/src/Operator.h Utils/src/OperatorFieldVariable.c Utils/src/OperatorFieldVariable.h Utils/src/OperatorFieldVariable.meta Utils/src/RegularMeshUtils.c Utils/src/RegularMeshUtils.h Utils/src/RegularRemesher.c Utils/src/RegularRemesher.def Utils/src/RegularRemesher.h Utils/src/RegularRemesherCmpt.c Utils/src/RegularRemesherCmpt.h Utils/src/RegularRemesherCmpt.meta Utils/src/Remesher.c Utils/src/Remesher.h Utils/src/Remesher.meta Utils/src/SemiRegDeform.c Utils/src/SemiRegDeform.h Utils/src/SemiRegDeform.meta Utils/src/ShapeAdvector.c Utils/src/ShapeAdvector.h Utils/src/ShapeAdvector.meta Utils/src/SobolGenerator.c Utils/src/SobolGenerator.h Utils/src/SplitFrictionWallVC.c Utils/src/SplitFrictionWallVC.h Utils/src/SplitFrictionWallVC.meta Utils/src/StripRemesher.c Utils/src/StripRemesher.h Utils/src/StripRemesher.meta Utils/src/TimeIntegratee.c Utils/src/TimeIntegratee.h Utils/src/TimeIntegratee.meta Utils/src/TimeIntegrator.c Utils/src/TimeIntegrator.h Utils/src/TimeIntegrator.meta Utils/src/Utils.h Utils/src/WallVC.c Utils/src/WallVC.h Utils/src/WallVC.meta Utils/src/makefile Utils/src/types.h Utils/tests/Makefile.def Utils/tests/data/allVC.xml Utils/tests/data/compositeVC.xml Utils/tests/data/cornerVC.xml Utils/tests/data/wallVC.xml Utils/tests/expected/testSobolGenerator.0of1.RightmostBit.dat.expected Utils/tests/expected/testSobolGenerator.0of1.testGenerator0.expected Utils/tests/expected/testSobolGenerator.0of1.testGenerator1.expected Utils/tests/expected/testSobolGenerator.0of1.testGenerator2.expected Utils/tests/expected/testSobolGenerator.0of1.testGenerator3.expected Utils/tests/expected/testSobolGenerator.0of1.testGenerator4.expected Utils/tests/expected/testSobolGenerator.0of1.testGenerator5.expected Utils/tests/makefile Utils/tests/output/input-2007.10.10-15.21.36.xml Utils/tests/output/input-2007.10.10-17.13.05.xml Utils/tests/output/input-2007.10.10-17.14.06.xml Utils/tests/output/input.xml Utils/tests/output/testDofSave.vx.dat.0000 Utils/tests/output/testDofSave.vy.dat.0000 Utils/tests/output/testDofSave.vz.dat.0000 Utils/tests/output/testDofSave.x.dat.0000 Utils/tests/output/testDofSave.y.dat.0000 Utils/tests/output/testDofSave.z.dat.0000 Utils/tests/testAllNodesVC.0of1.expected Utils/tests/testAllNodesVC.0of1.sh Utils/tests/testAllNodesVC.0of2.expected Utils/tests/testAllNodesVC.0of2.sh Utils/tests/testAllNodesVC.0of3.expected Utils/tests/testAllNodesVC.0of3.sh Utils/tests/testAllNodesVC.1of2.expected Utils/tests/testAllNodesVC.1of2.sh Utils/tests/testAllNodesVC.1of3.expected Utils/tests/testAllNodesVC.1of3.sh Utils/tests/testAllNodesVC.2of3.expected Utils/tests/testAllNodesVC.2of3.sh Utils/tests/testAllNodesVC.c Utils/tests/testCompositeVC-dictionary.0of1.expected Utils/tests/testCompositeVC-dictionary.0of1.sh Utils/tests/testCompositeVC-dictionary.c Utils/tests/testCompositeVC.0of1.expected Utils/tests/testCompositeVC.0of1.sh Utils/tests/testCompositeVC.0of2.expected Utils/tests/testCompositeVC.0of2.sh Utils/tests/testCompositeVC.0of3.expected Utils/tests/testCompositeVC.0of3.sh Utils/tests/testCompositeVC.1of2.expected Utils/tests/testCompositeVC.1of2.sh Utils/tests/testCompositeVC.1of3.expected Utils/tests/testCompositeVC.1of3.sh Utils/tests/testCompositeVC.2of3.expected Utils/tests/testCompositeVC.2of3.sh Utils/tests/testCompositeVC.c Utils/tests/testCornerVC.0of1.expected Utils/tests/testCornerVC.0of1.sh Utils/tests/testCornerVC.0of2.expected Utils/tests/testCornerVC.0of2.sh Utils/tests/testCornerVC.0of3.expected Utils/tests/testCornerVC.0of3.sh Utils/tests/testCornerVC.1of2.expected Utils/tests/testCornerVC.1of2.sh Utils/tests/testCornerVC.1of3.expected Utils/tests/testCornerVC.1of3.sh Utils/tests/testCornerVC.2of3.expected Utils/tests/testCornerVC.2of3.sh Utils/tests/testCornerVC.c Utils/tests/testDofLayout-remap.0of1.expected Utils/tests/testDofLayout-remap.0of1.sh Utils/tests/testDofLayout-remap.c Utils/tests/testDofLayout-saveAndLoad.0of1.expected Utils/tests/testDofLayout-saveAndLoad.0of1.sh Utils/tests/testDofLayout-saveAndLoad.c Utils/tests/testDofLayout.0of1.expected Utils/tests/testDofLayout.0of1.sh Utils/tests/testDofLayout.c Utils/tests/testEmbeddedSurface.c Utils/tests/testFieldVariable_Register.0of1.expected Utils/tests/testFieldVariable_Register.0of1.sh Utils/tests/testFieldVariable_Register.c Utils/tests/testMeshCoarsener_Hexa.0of1.expected Utils/tests/testMeshCoarsener_Hexa.0of2.expected Utils/tests/testMeshCoarsener_Hexa.1of2.expected Utils/tests/testMeshCoarsener_Hexa.c Utils/tests/testOperatorFieldVariable.0of1.expected Utils/tests/testOperatorFieldVariable.0of1.sh Utils/tests/testOperatorFieldVariable.c Utils/tests/testRegularMeshUtils.0of1.expected Utils/tests/testRegularMeshUtils.0of1.sh Utils/tests/testRegularMeshUtils.0of2.expected Utils/tests/testRegularMeshUtils.0of2.sh Utils/tests/testRegularMeshUtils.1of2.expected Utils/tests/testRegularMeshUtils.1of2.sh Utils/tests/testRegularMeshUtils.c Utils/tests/testRegularRemesher.c Utils/tests/testSemiRegDeform.c Utils/tests/testSobolGenerator.0of1.sh Utils/tests/testSobolGenerator.c Utils/tests/testTimeIntegration.c Utils/tests/testTimeIntegrationEuler.0of1.expected Utils/tests/testTimeIntegrationEuler.0of1.sh Utils/tests/testTimeIntegrationRK2.0of1.expected Utils/tests/testTimeIntegrationRK2.0of1.sh Utils/tests/testTimeIntegrationRK4.0of1.expected Utils/tests/testTimeIntegrationRK4.0of1.sh Utils/tests/testWallVC.0of1.expected Utils/tests/testWallVC.0of1.sh Utils/tests/testWallVC.0of2.expected Utils/tests/testWallVC.0of2.sh Utils/tests/testWallVC.0of3.expected Utils/tests/testWallVC.0of3.sh Utils/tests/testWallVC.1of2.expected Utils/tests/testWallVC.1of2.sh Utils/tests/testWallVC.1of3.expected Utils/tests/testWallVC.1of3.sh Utils/tests/testWallVC.2of3.expected Utils/tests/testWallVC.2of3.sh Utils/tests/testWallVC.c build-functions.sh configure.sh libStgDomain/Toolbox/Toolbox.c libStgDomain/Toolbox/Toolbox.h libStgDomain/Toolbox/Toolbox.meta libStgDomain/Toolbox/makefile libStgDomain/makefile libStgDomain/src/Finalise.c libStgDomain/src/Finalise.h libStgDomain/src/Init.c libStgDomain/src/Init.h libStgDomain/src/StgDomain.h libStgDomain/src/makefile libStgDomain/tests/Makefile.def libStgDomain/tests/makefile libStgDomain/tests/testLibDiscretisation.0of1.expected libStgDomain/tests/testLibDiscretisation.0of1.sh libStgDomain/tests/testLibDiscretisation.c makefile project-config.sh
description:
Initial commit and port of StGermain/Discretisation into its own project: StgDomain. It is taken from StGermain repos version number 4190.


diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/makefile	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,39 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+##
+## Authors:
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: makefile 3462 2006-02-19 06:53:24Z WalterLandry $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# 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
+
+subdirs = src tests
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/BlockGeometry.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/BlockGeometry.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,360 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: BlockGeometry.c 3882 2006-10-26 04:41:18Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "GeometryClass.h"
+#include "BlockGeometry.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+
+/* Textual name of this class */
+const Type BlockGeometry_Type = "BlockGeometry";
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+BlockGeometry* BlockGeometry_DefaultNew( Name name )
+{
+	return (BlockGeometry*)_BlockGeometry_New(
+		sizeof(BlockGeometry), 
+		BlockGeometry_Type, 
+		_BlockGeometry_Delete, 
+		_BlockGeometry_Print,
+		_BlockGeometry_Copy,
+		(Stg_Component_DefaultConstructorFunction*)BlockGeometry_DefaultNew,
+		_BlockGeometry_Construct,
+		_BlockGeometry_Build,
+		_BlockGeometry_Initialise,
+		_BlockGeometry_Execute,
+		_BlockGeometry_Destroy,
+		name,
+		False,
+		_BlockGeometry_BuildPoints,
+		_BlockGeometry_PointAt,
+		NULL );
+}
+
+BlockGeometry* BlockGeometry_New(
+		Name name,
+		Dictionary*					dictionary )
+{
+	return _BlockGeometry_New( 
+		sizeof(BlockGeometry), 
+		BlockGeometry_Type, 
+		_BlockGeometry_Delete, 
+		_BlockGeometry_Print,
+		_BlockGeometry_Copy,
+		(Stg_Component_DefaultConstructorFunction*)BlockGeometry_DefaultNew,
+		_BlockGeometry_Construct,
+		_BlockGeometry_Build,
+		_BlockGeometry_Initialise,
+		_BlockGeometry_Execute,
+		_BlockGeometry_Destroy,
+		name,
+		True,
+		_BlockGeometry_BuildPoints,
+		_BlockGeometry_PointAt,
+		dictionary );
+}
+
+
+void BlockGeometry_Init(
+		BlockGeometry*					self,
+		Name						name,
+		Dictionary*					dictionary )
+{
+	/* General info */
+	self->type = BlockGeometry_Type;
+	self->_sizeOfSelf = sizeof(BlockGeometry);
+	self->_deleteSelf = False;
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	self->_delete = _BlockGeometry_Delete;
+	self->_print = _BlockGeometry_Print;
+	self->_copy = _BlockGeometry_Copy;
+	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)BlockGeometry_DefaultNew;
+	self->_construct = _BlockGeometry_Construct;
+	self->_build = _BlockGeometry_Build;
+	self->_initialise = _BlockGeometry_Initialise;
+	self->_execute = _BlockGeometry_Execute;
+	self->_destroy = _BlockGeometry_Destroy;
+	self->buildPoints = _BlockGeometry_BuildPoints;
+	self->pointAt = _BlockGeometry_PointAt;
+	
+	_Stg_Class_Init( (Stg_Class*)self );
+	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+	_Stg_Component_Init( (Stg_Component*)self );
+	
+	_Geometry_Init( (Geometry*)self );
+	
+	/* BlockGeometry info */
+	_BlockGeometry_Init( self, NULL );
+}
+
+
+BlockGeometry* _BlockGeometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary )
+{
+	BlockGeometry* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(BlockGeometry) );
+	self = (BlockGeometry*)_Geometry_New(
+		_sizeOfSelf,
+		type,
+		_delete,
+		_print,
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,
+		name,
+		initFlag,
+		buildPoints,
+		pointAt,
+		dictionary );
+	
+	/* General info */
+	
+	/* Virtual info */
+	
+	/* BlockGeometry info */
+	if( initFlag ){
+		_BlockGeometry_Init( self, NULL );
+	}
+	
+	return self;
+}
+
+void _BlockGeometry_Init( BlockGeometry* self, IJK size ) {
+	/* General and Virtual info should already be set */
+	
+	/* BlockGeometry info */
+	self->isConstructed = False;
+
+	if ( size ) {
+		memcpy( self->size, size, sizeof(IJK) );
+	}
+	else {
+		self->size[ I_AXIS ] = Dictionary_GetUnsignedInt_WithDefault( self->dictionary, "meshSizeI", 2 );
+		self->size[ J_AXIS ] = Dictionary_GetUnsignedInt_WithDefault( self->dictionary, "meshSizeJ", 2 );
+		self->size[ K_AXIS ] = Dictionary_GetUnsignedInt_WithDefault( self->dictionary, "meshSizeK", 2 );
+	}
+	self->pointCount = self->size[I_AXIS] * self->size[J_AXIS] * self->size[K_AXIS];
+	assert( self->pointCount );
+	
+	self->min[ I_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "minX", 0.0f );
+	self->min[ J_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "minY", 0.0f );
+	self->min[ K_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "minZ", 0.0f );
+
+	self->max[ I_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "maxX", 1.0f );
+	self->max[ J_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "maxY", 1.0f );
+	self->max[ K_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "maxZ", 1.0f );
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _BlockGeometry_Delete( void* blockGeometry ) {
+	BlockGeometry* self = (BlockGeometry*)blockGeometry;
+	
+	/* Stg_Class_Delete parent */
+	_Geometry_Delete( self );
+}
+
+
+void _BlockGeometry_Print( void* blockGeometry, Stream* stream ) {
+	BlockGeometry* self = (BlockGeometry*)blockGeometry;
+	
+	/* Set the Journal for printing informations */
+	Stream* blockGeometryStream;
+	blockGeometryStream = Journal_Register( InfoStream_Type, "BlockGeometryStream" );
+
+	/* Print parent */
+	_Geometry_Print( self, stream );
+	
+	/* General info */
+	Journal_Printf( stream, "BlockGeometry (ptr): (%p)\n", self );
+	
+	/* Virtual info */
+	
+	/* BlockGeometry info */
+}
+
+void _BlockGeometry_Construct( void* blockGeometry, Stg_ComponentFactory *cf, void* data ){
+	BlockGeometry*  self   = (BlockGeometry*)blockGeometry;
+	IJK             size;
+	int             shift;
+	Dimension_Index dim;
+	Dimension_Index dim_I;
+
+	self->dictionary = cf->rootDict;
+
+	/* Get Size from Dictionary */
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+		
+	size[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "sizeI", 1 );  
+	size[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "sizeJ", 1 );
+	size[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "sizeK", 1 );
+	if ( dim == 2 )
+		size[ K_AXIS ] = 1;
+
+	/* Shift the size if nessesary */
+	shift = Stg_ComponentFactory_GetInt( cf, self->name, "sizeShift", 0 );
+	for ( dim_I = I_AXIS ; dim_I < dim ; dim_I++ )
+		size[ dim_I ] += shift;
+	
+	_Geometry_Init( (Geometry*)self );
+	_BlockGeometry_Init( self, size );
+}
+	
+void _BlockGeometry_Build( void* blockGeometry, void *data ){
+	
+}
+	
+void _BlockGeometry_Initialise( void* blockGeometry, void *data ){
+	
+}
+	
+void _BlockGeometry_Execute( void* blockGeometry, void *data ){
+	
+}
+	
+void _BlockGeometry_Destroy( void* blockGeometry, void *data ){
+	
+}
+
+void* _BlockGeometry_Copy( void* blockGeometry, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	BlockGeometry*	self = (BlockGeometry*)blockGeometry;
+	BlockGeometry*	newBlockGeometry;
+	Index		idx_I;
+	
+	newBlockGeometry = (BlockGeometry*)_Geometry_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	for( idx_I = 0; idx_I < 3; idx_I++ ) {
+		newBlockGeometry->size[idx_I] = self->size[idx_I];
+		newBlockGeometry->min[idx_I] = self->min[idx_I];
+		newBlockGeometry->max[idx_I] = self->max[idx_I];
+	}
+	
+	return (void*)newBlockGeometry;
+}
+
+
+void _BlockGeometry_BuildPoints( void* blockGeometry, Coord_List points )
+{
+	BlockGeometry*  self = (BlockGeometry*)blockGeometry;
+	Index		i;
+	
+	for( i = 0; i < self->pointCount; i++ ) {
+		IJK	ijk;
+	
+		ijk[0] = i % self->size[0];
+		ijk[1] = (i / self->size[0]) % self->size[1];
+		ijk[2] = i / (self->size[0] * self->size[1]);
+	
+		points[i][0] = self->size[0] > 1 ? self->min[0] + (self->max[0] - self->min[0]) * ((double)ijk[0] / 
+			(double)(self->size[0] - 1)) : self->min[0];
+		points[i][1] = self->size[1] > 1 ? self->min[1] + (self->max[1] - self->min[1]) * ((double)ijk[1] / 
+			(double)(self->size[1] - 1)) : self->min[1];
+		points[i][2] = self->size[2] > 1 ? self->min[2] + (self->max[2] - self->min[2]) * ((double)ijk[2] / 
+			(double)(self->size[2] - 1)) : self->min[2];
+	}
+}
+
+
+void _BlockGeometry_PointAt( void* blockGeometry, Index index, Coord point )
+{
+	BlockGeometry* self = (BlockGeometry*)blockGeometry;
+	
+	if( index < self->pointCount ) {
+		IJK	ijk;
+	
+		ijk[0] = index % self->size[0];
+		ijk[1] = (index / self->size[0]) % self->size[1];
+		ijk[2] = index / (self->size[0] * self->size[1]);
+	
+		point[0] = self->size[0] > 1 ? self->min[0] + (self->max[0] - self->min[0]) * ((double)ijk[0] / 
+			(double)(self->size[0] - 1)) : self->min[0];
+		point[1] = self->size[1] > 1 ? self->min[1] + (self->max[1] - self->min[1]) * ((double)ijk[1] / 
+			(double)(self->size[1] - 1)) : self->min[1];
+		point[2] = self->size[2] > 1 ? self->min[2] + (self->max[2] - self->min[2]) * ((double)ijk[2] / 
+			(double)(self->size[2] - 1)) : self->min[2];
+	}
+	else {
+		point[0] = HUGE_VAL;
+		point[1] = HUGE_VAL;
+		point[2] = HUGE_VAL;
+	}
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/BlockGeometry.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/BlockGeometry.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,144 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: BlockGeometry.h 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_BlockGeometry_h__
+#define __Domain_Geometry_BlockGeometry_h__
+
+	/* Virtual function types */
+	
+	/* Textual name of this class */
+	extern const Type BlockGeometry_Type;
+
+	/* BlockGeometry information */
+	#define __BlockGeometry \
+		/* General info */ \
+		__Geometry \
+		\
+		/* Virtual info */ \
+		\
+		/* BlockGeometry info ... */ \
+		IJK				size; \
+		XYZ				min; \
+		XYZ				max;
+	struct BlockGeometry { __BlockGeometry };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/* Create a BlockGeometry */
+	BlockGeometry* BlockGeometry_DefaultNew( Name name );
+	
+	BlockGeometry* BlockGeometry_New(
+		Name						name,
+		Dictionary*					dictionary );
+	
+	/* Initialise a BlockGeometry */
+	void BlockGeometry_Init(
+		BlockGeometry*					self,
+		Name						name,
+		Dictionary*					dictionary );
+	
+	/* Creation implementation */
+	BlockGeometry* _BlockGeometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary );
+	
+	/* Initialisation implementation functions */
+	void _BlockGeometry_Init( BlockGeometry* self, IJK size );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/* Stg_Class_Delete BlockGeometry implementation */
+	void _BlockGeometry_Delete( void* blockGeometry );
+	
+	/* Print BlockGeometry implementation */
+	void _BlockGeometry_Print( void* blockGeometry, Stream* stream );
+	
+	void _BlockGeometry_Construct( void* blockGeometry, Stg_ComponentFactory *cf, void* data );
+	
+	void _BlockGeometry_Build( void* blockGeometry, void *data );
+	
+	void _BlockGeometry_Initialise( void* blockGeometry, void *data );
+	
+	void _BlockGeometry_Execute( void* blockGeometry, void *data );
+	
+	void _BlockGeometry_Destroy( void* blockGeometry, void *data );
+	
+	/* Copy */
+	#define BlockGeometry_Copy( self ) \
+		(BlockGeometry*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define BlockGeometry_DeepCopy( self ) \
+		(BlockGeometry*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	
+	void* _BlockGeometry_Copy( void* geometry, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void _BlockGeometry_BuildPoints( void* blockGeometry, Coord_List points );
+	
+	void _BlockGeometry_PointAt( void* blockGeometry, Index index, Coord point );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	
+	
+#endif /* __Domain_Geometry_BlockGeometry_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/BlockGeometry.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/BlockGeometry.meta	Wed Oct 10 07:21:38 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">BlockGeometry</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">Geometry</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">sizeI</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">1</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">sizeJ</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">1</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">sizeK</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">1</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">sizeShift</param>
+		<param name="Type">Int</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 9f22ec4f42ee -r 5667007f4799 Geometry/src/ComplexMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ComplexMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,206 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  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: ComplexMath.c 4081 2007-04-27 06:20:07Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "TrigMath.h"
+#include "ComplexMath.h"
+#include <math.h>
+#include <string.h>
+
+#define a 	self[ REAL_PART ]
+#define b 	self[ IMAG_PART ]
+#define c 	Y[ REAL_PART ]		
+#define d 	Y[ IMAG_PART ]		
+
+/**  
+ * X = a + b . i, Y = c + d . i
+ * X + Y = (a + b.i) + (c + d.i) = (a + c) + i(b + d) 
+destination may be stored in either X or Y */
+void Cmplx_Add( Cmplx self, Cmplx Y, Cmplx destination ) {
+	destination[ REAL_PART ] = a + c;
+	destination[ IMAG_PART ] = b + d;
+}
+
+/** 
+X = a + b i, Y = c + d i
+X - Y = (a + b.i) - (c + d.i) = (a - c) + i(b - d) 
+destination may be stored in either X or Y */
+void Cmplx_Subtract( Cmplx self, Cmplx Y, Cmplx destination ) {
+	destination[ REAL_PART ] = a - c;
+	destination[ IMAG_PART ] = b - d;
+}
+
+/** 
+X = a + b . i, Y = c + d . i
+X . Y = (a + b.i)(c + d.i) = (ac - bd) + i(ad + bc) 
+destination may be stored in either X or Y */
+void Cmplx_Multiply( Cmplx self, Cmplx Y, Cmplx destination ) {
+	double real = a * c - b * d;
+	double imag = a * d + b * c;
+	destination[ REAL_PART ] = real;
+	destination[ IMAG_PART ] = imag;
+}
+
+/** 
+X = a + b i, Y = c + d i
+X / Y = \frac{a + b i}{c + d i} = \frac{(ac + bd) + i(bc - ad)}{c^2 + d^2} 
+destination may be stored in either X or Y */
+void Cmplx_Division( Cmplx self, Cmplx Y, Cmplx destination ) {
+	double denominator = c * c + d * d;
+	double real = (a * c + b * d)/denominator;
+	double imag = (b * c - a * d)/denominator;
+	
+	destination[ REAL_PART ] = real;
+	destination[ IMAG_PART ] = imag;
+}
+/** Add real to complex number */
+void Cmplx_AddReal( Cmplx self, double real, Cmplx destination ) {
+	destination[ REAL_PART ] = real + a;
+	destination[ IMAG_PART ] = b;
+}
+/** Subtract a complex number from a real number */
+void Cmplx_RealMinusCmplx( Cmplx self, double real, Cmplx destination ) {
+	destination[ REAL_PART ] = real - a;
+	destination[ IMAG_PART ] = -b;
+}
+
+/**  
+x(a + bi) = xa + xb i */
+void Cmplx_RealMultiply( Cmplx self, double real, Cmplx destination ) {
+	destination[ REAL_PART ] = real * a;
+	destination[ IMAG_PART ] = real * b;
+}
+
+/** 
+x/(a + bi) = x/(a^2 + b^2) * (a - bi) */
+void Cmplx_RealDivideByCmplx( Cmplx self, double real, Cmplx destination ) {
+	double factor = real/(a*a + b*b);
+	destination[ REAL_PART ] = a * factor;
+	destination[ IMAG_PART ] = -b * factor;
+}
+
+/** exp( a + bi ) = exp( a ) [ cos(b) + i sin(b) ] */
+void Cmplx_Exp( Cmplx self, Cmplx destination ) {
+	double realPart = self[ REAL_PART ];
+	double imagPart = self[ IMAG_PART ];
+
+	destination[ REAL_PART ] = exp( realPart ) * cos( imagPart );
+	destination[ IMAG_PART ] = exp( realPart ) * sin( imagPart );
+}
+/** Copy complex value from one variable to another. 
+This nicely replaces = sign for assignments */
+void Cmplx_Copy( Cmplx X, Cmplx destination ) {
+	memcpy( destination, X, sizeof(Cmplx) );
+}
+
+/** Sets a complex variable to zero */
+void Cmplx_Zero( Cmplx X ) {
+	memset( X, 0, sizeof(Cmplx) );
+}
+
+/**
+X = a + b i
+\bar X = a - b i
+conjugate may be stored in X */
+void Cmplx_Conjugate( Cmplx self, Cmplx conjugate ) {
+	conjugate[ REAL_PART ] = a;
+	conjugate[ IMAG_PART ] = -b;
+}
+
+/** 
+Defined as per: Eric W. Weisstein. "Complex Argument." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/ComplexArgument.html */
+double Cmplx_Argument( Cmplx self ) {
+	double argument = atan( b / a );
+	
+	if ( a > 0.0 ) 		/* If number is in first or fourth quadrant */
+		return argument;
+	else if ( a < 0.0 ) {
+		if ( b > 0.0 ) /* Number is in Second Quadrant */
+			return argument + M_PI;  
+		else           /* Number is in Third Quadrant */
+			return argument - M_PI;  
+	}
+	/* If a == 0 then: arg(x) = 
+		\pi/2     if b > 0.0 
+		undefined if b == 0.0 
+		-\pi/2    if b < 0.0 */
+	else {
+		if      ( b > 0.0 ) return  M_PI/2;
+		else if ( b < 0.0 ) return -M_PI/2;
+		else                return  0.0;
+	}
+}
+
+/** 
+X = a + b i
+|X| = \sqrt{a^2 + b^2}
+ */
+double Cmplx_Modulus( Cmplx self ) {
+	return sqrt( a * a + b * b );
+}
+
+/** 
+X = a + b i = |X|(\cos(\theta) + i \sin( \theta )) = |X| e^{i\theta}
+X^n = (|X| e^{i\theta})^n = |X|^n e^{i n \theta} = |X|^n (cos(\theta) + i sin(\theta) )
+destination may be stored in 'self' */
+void Cmplx_RealPower( Cmplx self, double y, Cmplx destination ) {
+	double mod   = pow( Cmplx_Modulus(self), y );
+	double theta = Cmplx_Argument( self ) * y;
+
+	destination[ REAL_PART ] = mod * cos(theta);
+	destination[ IMAG_PART ] = mod * sin(theta);
+}
+
+/** 
+see Eric W. Weisstein. "Complex Exponentiation." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/ComplexExponentiation.html
+destination may be stored in either 'self' or 'power' */
+void Cmplx_CmplxPower( Cmplx self, Cmplx Y, Cmplx destination ) {
+	double argX = Cmplx_Argument( self );
+	double modXSquared = a*a + b*b;
+	double mod   = pow( modXSquared, c * 0.5 ) * exp( -argX * d );
+	double theta = argX * c + 0.5 * d * log(modXSquared);
+
+	destination[ REAL_PART ] = mod * cos(theta);
+	destination[ IMAG_PART ] = mod * sin(theta);
+}
+
+/** Rotate complex value through an angle in radians. 
+This rotates the complex number on the complex plane. */
+void Cmplx_Rotate( Cmplx self, double angle, Cmplx dest ) {
+	Cmplx rotationFactor;
+
+	rotationFactor[ REAL_PART ] = cos( angle );
+	rotationFactor[ IMAG_PART ] = sin( angle );
+
+	Cmplx_Multiply( self, rotationFactor, dest );
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/ComplexMath.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ComplexMath.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,80 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    Provides basic vector operations.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: ComplexMath.h 3735 2006-08-01 08:05:14Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_ComplexMath_h__
+#define __Domain_Geometry_ComplexMath_h__
+
+#include "units.h"
+
+/** Define names for index into complex numbers. 
+Which makes it clear what index it refers to.*/
+#define REAL_PART 0
+/** see comments for REAL_PART */
+#define IMAG_PART 1
+
+void Cmplx_Add( Cmplx X, Cmplx Y, Cmplx destination ) ;
+void Cmplx_Subtract( Cmplx X, Cmplx Y, Cmplx destination ) ;
+void Cmplx_Multiply( Cmplx X, Cmplx Y, Cmplx destination ) ;
+void Cmplx_Division( Cmplx X, Cmplx Y, Cmplx destination ) ;
+
+void Cmplx_AddReal( Cmplx X, double real, Cmplx destination ) ;
+void Cmplx_RealMinusCmplx( Cmplx X, double real, Cmplx destination ) ;
+void Cmplx_RealMultiply( Cmplx X, double real, Cmplx destination ) ;
+void Cmplx_RealDivideByCmplx( Cmplx X, double real, Cmplx destination ) ;
+void Cmplx_Exp( Cmplx X, Cmplx destination );
+void Cmplx_Copy( Cmplx X, Cmplx destination );
+void Cmplx_Zero( Cmplx X ) ;
+
+void Cmplx_Conjugate( Cmplx X, Cmplx conjugate ) ;
+
+double Cmplx_Argument( Cmplx X ) ;
+double Cmplx_Modulus( Cmplx X ) ;
+
+void Cmplx_RealPower( Cmplx X, double power, Cmplx destination ) ;
+void Cmplx_CmplxPower( Cmplx X, Cmplx power, Cmplx destination ) ;
+
+/** Calculate the square root of a complex number */
+#define Cmplx_Sqrt( self, destination ) \
+	Cmplx_RealPower( self, 0.5, destination )
+
+/** Print a complex number. 
+Currently uses %.5g formatting */ 
+#define Journal_PrintCmplx( stream, self ) \
+		Journal_Printf( stream, #self " = %.5g %c %.5g i\n", (self)[ REAL_PART ], (self)[ IMAG_PART ] >= 0.0 ? '+' : '-', fabs( (self)[ IMAG_PART ] ) )
+
+#endif
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/ComplexVectorMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ComplexVectorMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,550 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: ComplexVectorMath.c 3677 2006-07-14 11:03:24Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "ComplexMath.h"
+#include "VectorMath.h"
+#include "ComplexVectorMath.h"
+#include "TrigMath.h"
+
+#include <math.h>
+#include <assert.h>
+
+/**(Assumes <=3D),  Set one ComplexVector to another */
+void ComplexVector_Set(CoordC set, CoordC dest) {
+	dest[0][REAL_PART] = set[0][REAL_PART];
+	dest[0][IMAG_PART] = set[0][IMAG_PART];
+	dest[1][REAL_PART] = set[1][REAL_PART];
+	dest[1][IMAG_PART] = set[1][IMAG_PART];
+	dest[2][REAL_PART] = set[2][REAL_PART];
+	dest[2][IMAG_PART] = set[2][IMAG_PART];
+}
+
+/**(Assumes 3D),  Set complex numbers to entries of function.
+One drawback, scalars must already be defined as complex numbers */
+void ComplexVector_SetScalar( Cmplx a, Cmplx b, Cmplx c, CoordC dest ) {
+	dest[0][REAL_PART] = a[REAL_PART];
+	dest[0][IMAG_PART] = a[IMAG_PART];
+	dest[1][REAL_PART] = b[REAL_PART];
+	dest[1][IMAG_PART] = b[IMAG_PART];
+	dest[2][REAL_PART] = c[REAL_PART];
+	dest[2][IMAG_PART] = c[IMAG_PART];
+
+}
+
+
+/** (Assumes 3D), Add two complex vectors:  dest = a + b */
+void ComplexVector_Add( CoordC a, CoordC b, CoordC dest ) {
+	Cmplx_Add( a[0], b[0], dest[0] );
+	Cmplx_Add( a[1], b[1], dest[1] );
+	Cmplx_Add( a[2], b[2], dest[2] );
+}	
+		
+/** (Assumes 3D), Subtract two complex vectors: dest = a - b */
+void ComplexVector_Sub( CoordC a, CoordC b, CoordC dest ) {
+	Cmplx_Subtract( a[0], b[0], dest[0] );
+	Cmplx_Subtract( a[1], b[1], dest[1] );
+	Cmplx_Subtract( a[2], b[2], dest[2] );
+}
+			
+/** (Assumes 3D), Returns the dot product of two complex vectors, a and b */
+void ComplexVector_Dot(CoordC a, CoordC b, Cmplx destSum ) {
+	CoordC dest;
+
+	Cmplx_Multiply(a[0], b[0], dest[0]);
+	Cmplx_Multiply(a[1], b[1], dest[1]);
+	Cmplx_Multiply(a[2], b[2], dest[2]);
+	Cmplx_Add(dest[0], dest[1], destSum);
+	Cmplx_Add(destSum, dest[2], destSum);
+	
+}	
+	
+/** (Assumes 3D), Multiply two complex vectors: dest = a * s */
+void ComplexVector_Mult(CoordC a, Cmplx s, CoordC dest ) {
+	Cmplx_Multiply(a[0], s, dest[0]);
+	Cmplx_Multiply(a[1], s, dest[1]);
+	Cmplx_Multiply(a[2], s, dest[2]);
+}
+
+/** (Assumes 3D), Multiply complex vector by real number */ 
+void ComplexVector_MultReal(CoordC a, double valueReal, CoordC dest ) {
+	Cmplx value;
+	value[REAL_PART] = valueReal;
+	value[IMAG_PART] = 0.0;
+	Cmplx_Multiply(a[0], value, dest[0]);
+	Cmplx_Multiply(a[1], value, dest[1]);
+	Cmplx_Multiply(a[2], value, dest[2]);
+}
+
+/** (Assumes 3D), Returns the magnitude of complex vector a */
+double ComplexVector_Mag(CoordC a ) {
+	double a_0, a_1, a_2;
+	a_0 = Cmplx_Modulus(a[0]);
+	a_1 = Cmplx_Modulus(a[1]);
+	a_2 = Cmplx_Modulus(a[2]);
+	return sqrt(a_0*a_0 + a_1*a_1 + a_2*a_2); 	
+}
+
+/** (Assumes 3D), complexVector projection of a onto b, store result in dest */
+void ComplexVector_Proj(CoordC a, CoordC b, CoordC dest ) {
+		/* Calculate norm of b */
+		Cmplx tmp;
+		ComplexVector_Norm( b, dest);
+		/* Calculate proj of a onto b */
+		ComplexVector_Dot( a, b, tmp );
+		ComplexVector_Mult( dest, tmp, dest );
+}
+	
+/** (Assumes 3D), Calculates cross product of two complex vectors */	
+void ComplexVector_Cross( CoordC a, CoordC b, CoordC dest ) {
+
+	Cmplx 	ans1, ans2;
+	 
+	Cmplx_Multiply(a[1], b[2], ans1);
+	Cmplx_Multiply(a[2], b[1], ans2);
+	Cmplx_Subtract(ans1, ans2, dest[0]);
+	
+	Cmplx_Multiply(a[2], b[0], ans1);
+	Cmplx_Multiply(a[0], b[2], ans2);
+	Cmplx_Subtract(ans1, ans2, dest[1]);
+	
+	Cmplx_Multiply(a[0], b[1], ans1);
+	Cmplx_Multiply(a[1], b[0], ans2);
+	Cmplx_Subtract(ans1, ans2, dest[2]);
+
+}
+
+/** (Assumes 3D), Divide complex vector by complex number */
+void ComplexVector_Div( CoordC a, Cmplx s, CoordC dest )
+{
+	Cmplx	inv, one;
+	one[REAL_PART] = 1.0;
+	one[IMAG_PART] = 0.0;
+	
+	Cmplx_Division( one, s, inv );
+
+	
+	Cmplx_Multiply(a[0], inv, dest[0]);
+	Cmplx_Multiply(a[1], inv, dest[1]);
+	Cmplx_Multiply(a[2], inv, dest[2]);
+}
+
+/** (Assumes 3D), Normalises complex vector */
+void ComplexVector_Norm(CoordC a, CoordC dest) {
+	double invMag;
+	
+	 
+	invMag = 1.0 / ComplexVector_Mag( a );
+	ComplexVector_MultReal(a, invMag, dest);
+
+}
+
+/** (Assumes 3D), Swaps coords based on i,j,k input */
+void ComplexVector_Swizzle( CoordC src, unsigned char iInd, 
+		unsigned char jInd, unsigned char kInd, CoordC dst ) {
+	CoordC dummy;
+	assert( iInd < 3 && jInd < 3 && kInd < 3 );
+	dummy[0][REAL_PART] = src[iInd][REAL_PART];
+	dummy[0][IMAG_PART] = src[iInd][IMAG_PART];
+	dummy[1][REAL_PART] = src[jInd][REAL_PART];
+	dummy[1][IMAG_PART] = src[jInd][IMAG_PART];
+	dummy[2][REAL_PART] = src[kInd][REAL_PART];
+	dummy[2][IMAG_PART] = src[kInd][IMAG_PART];
+		
+	dst[0][REAL_PART] = dummy[0][REAL_PART];
+	dst[0][IMAG_PART] = dummy[0][IMAG_PART];	
+	dst[1][REAL_PART] = dummy[1][REAL_PART];
+	dst[1][IMAG_PART] = dummy[1][IMAG_PART];
+	dst[2][REAL_PART] = dummy[2][REAL_PART];
+	dst[2][IMAG_PART] = dummy[2][IMAG_PART];
+}
+
+
+/** StGermain_ComplexRotateVector takes an argument 'vectorToRotate', and rotates it through 
+three angles for the x, y and z coordinates.(\alpha, \beta, \gama) respectively I believe.
+The angles should be reals, and in radians.
+This function cannot use Rodrigues' Rotation Formula because that is only defined for reals.
+See: 
+http://mathworld.wolfram.com/EulerAngles.html
+http://mathworld.wolfram.com/EulerParameters.html */
+void StGermain_RotateComplexVector(Cmplx* vector, double alpha, double beta, 
+			double gama, Cmplx* rotatedVector) {
+	double rotationMatrix[3][3]; 	/* Indicies [Column][Row][Real or Imag] */
+	/*double e0, e1, e2, e3; */
+				
+	Cmplx r_0, r_1, r_2, tmp ;
+
+	rotationMatrix[0][0] =   cos(beta) * cos(gama);
+	rotationMatrix[0][1] =   cos(beta) * sin(gama); 
+	rotationMatrix[0][2] =  -sin(beta);
+				
+	rotationMatrix[1][0] = -cos(alpha) * sin(gama) + sin(alpha) * sin(beta) * cos(gama);
+	rotationMatrix[1][1] =  cos(alpha) * cos(gama) + sin(alpha) * sin(beta) * sin(gama);
+	rotationMatrix[1][2] =  sin(alpha) * cos(beta);
+	
+	rotationMatrix[2][0] =  sin(alpha) * sin(gama) + cos(alpha) * sin(beta) * cos(gama);
+	rotationMatrix[2][1] = -sin(alpha) * cos(gama) + cos(alpha) * sin(beta) * sin(gama);
+	rotationMatrix[2][2] = 	cos(alpha) * cos(beta);		
+				
+
+	/* x direction */
+	Cmplx_RealMultiply(vector[0], rotationMatrix[0][0], r_0);
+	Cmplx_RealMultiply(vector[1], rotationMatrix[0][1], r_1);
+	Cmplx_RealMultiply(vector[2], rotationMatrix[0][2], r_2);
+
+	Cmplx_Add(r_0, r_1, tmp);
+	Cmplx_Add(tmp, r_2, rotatedVector[0]);
+
+	
+	/* y direction */
+	Cmplx_RealMultiply(vector[0], rotationMatrix[1][0], r_0);
+	Cmplx_RealMultiply(vector[1], rotationMatrix[1][1], r_1);
+	Cmplx_RealMultiply(vector[2], rotationMatrix[1][2], r_2);
+
+	Cmplx_Add(r_0, r_1, tmp);
+	Cmplx_Add(tmp, r_2, rotatedVector[1]);
+	
+	/* z direction */
+	Cmplx_RealMultiply(vector[0], rotationMatrix[2][0], r_0);
+	Cmplx_RealMultiply(vector[1], rotationMatrix[2][1], r_1);
+	Cmplx_RealMultiply(vector[2], rotationMatrix[2][2], r_2);
+
+	Cmplx_Add(r_0, r_1, tmp);
+	Cmplx_Add(tmp, r_2, rotatedVector[2]);
+}		
+
+/** StGermain_RotateCoordinateAxisComplex multiplies a vector with a Rotation Matrix to rotate it around a co-ordinate axis -
+Is a simpler function than StGermain_RotateComplexVector for more specific cases where the vector is to be rotated around one of the axes of the co-ordinate system. The arguments are the same except the the 'axis' argument is of type 'Index' which could be either I_AXIS, J_AXIS or K_AXIS. Vectors have to be the size of 3 doubles.
+See, Eric W. Weisstein. "Rotation Matrix." 
+From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/RotationMatrix.htm */
+void StGermain_RotateCoordinateAxisComplex( Cmplx* vector, 
+			Index axis, double theta, Cmplx* rotatedVector ) {
+	
+	Cmplx r_1, r_2;
+	/* Rotation around one axis will always leave the component on that axis alone */
+	rotatedVector[axis][REAL_PART] = vector[axis][REAL_PART];
+	rotatedVector[axis][IMAG_PART] = vector[axis][IMAG_PART];
+	/*printf("axis %d, %2.3f", axis, vector[axis][REAL_PART]); 				 */
+	switch (axis) {
+		case K_AXIS: /* Rotate around Z axis */
+			Cmplx_RealMultiply(vector[0], cos(theta), r_1);
+			Cmplx_RealMultiply(vector[1], sin(theta), r_2);
+			Cmplx_Add(r_1, r_2, rotatedVector[0]);
+		
+			Cmplx_RealMultiply(vector[0], sin(theta), r_1);
+			Cmplx_RealMultiply(vector[1], cos(theta), r_2);
+			Cmplx_Subtract(r_2, r_1, rotatedVector[1]);
+			return;
+		case I_AXIS:  /* Rotate around X axis */
+			Cmplx_RealMultiply(vector[1], cos(theta), r_1);
+			Cmplx_RealMultiply(vector[2], sin(theta), r_2);
+			Cmplx_Add(r_1, r_2, rotatedVector[1]);
+		
+			Cmplx_RealMultiply(vector[1], sin(theta), r_1);
+			Cmplx_RealMultiply(vector[2], cos(theta), r_2);
+			Cmplx_Subtract(r_2, r_1, rotatedVector[2] );
+			return;
+		case J_AXIS: /* Rotate around Y axis */
+			Cmplx_RealMultiply(vector[0], cos(theta), r_1);
+			Cmplx_RealMultiply(vector[2], sin(theta), r_2);
+			Cmplx_Subtract(r_1, r_2, rotatedVector[0] );
+		
+			Cmplx_RealMultiply(vector[0], sin(theta), r_1);
+			Cmplx_RealMultiply(vector[2], cos(theta), r_2);
+			Cmplx_Add(r_1, r_2, rotatedVector[2]) ;
+			return;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "ComplexVectorMath" );
+			Journal_Printf( error, "Impossible axis to rotate around in %s.", __func__);
+			Journal_Firewall( False, Journal_Register( Error_Type, "ComplexVectorMath" ),
+				"Error in '%s':Impossible axis to rotate around. \n", __func__);
+		}
+	}
+}
+
+/** Subtracts one complex vector from another - 
+destination = vector1 - vector2
+Destination vector may be the same as either of the other two input vectors 
+Function is optimised for 1-3 dimensions but will work for any dimension */
+void StGermain_ComplexVectorSubtraction(Cmplx* destination, Cmplx* vector1, Cmplx* vector2, Index dim) {
+
+	switch (dim) {
+		case 3:
+			Cmplx_Subtract(vector1[2], vector2[2], destination[2]);			
+			
+		case 2:
+			Cmplx_Subtract(vector1[1], vector2[1], destination[1]);
+		case 1: 
+			Cmplx_Subtract(vector1[0], vector2[0], destination[0]);
+			return;
+		default: {
+			Index d;
+			for ( d = 0 ; d < dim ; d++ ) 
+				Cmplx_Subtract(vector1[d], vector2[d], destination[d]);
+			return;
+		}
+	}	
+}
+
+/** Adds two vectors - 
+destination = vector1 + vector2
+Destination vector may be the same as either of the other two input vectors 
+Function is optimised for 1-3 dimensions but will work for any dimension */
+void StGermain_ComplexVectorAddition(Cmplx* destination, Cmplx* vector1, Cmplx* vector2, Index dim) {
+	switch (dim) {
+		case 3: 
+			Cmplx_Add(vector1[2], vector2[2], destination[2]);	
+		case 2:
+			Cmplx_Add(vector1[1], vector2[1], destination[1]);	
+		case 1: 
+			Cmplx_Add(vector1[0], vector2[0], destination[0]);	
+			return;
+		default: {
+			Index d;
+			for ( d = 0 ; d < dim ; d++ ) 
+				Cmplx_Add(vector1[d], vector2[d], destination[d]);	
+                        /*printf("%f, %f", destination[d][REAL_PART], destination[d][IMAG_PART]); */
+			return;
+		}
+	}	
+}
+
+/** StGermain_ComplexVectorMagnitude calculates the magnitude of a vector
+|v| = \sqrt{ v . v } 
+This function uses function StGermain_ComplexVectorDotProduct to calculate v . v. 
+Vector has to be of size dim doubles */
+double StGermain_ComplexVectorMagnitude(Cmplx* vector, Index dim) {
+	Cmplx dotProduct;
+
+	StGermain_ComplexVectorDotProduct(vector, vector, dim, dotProduct);
+	return sqrt(Cmplx_Modulus(dotProduct));
+}
+
+/** StGermain_ComplexVectorDotProduct calculates the complex valued dot product of two
+complex vectors
+*/
+void StGermain_ComplexVectorDotProduct(Cmplx* vector1, Cmplx* vector2, Dimension_Index dim, Cmplx dotProduct) {
+	Cmplx tmp;
+	dotProduct[REAL_PART] = 0.0;
+	dotProduct[IMAG_PART] = 0.0;
+
+	switch (dim) {
+		case 3: {
+			Cmplx_Multiply(vector1[2], vector2[2], tmp);
+			Cmplx_Add(dotProduct, tmp, dotProduct);
+		}
+		case 2: {
+			Cmplx_Multiply(vector1[1], vector2[1], tmp);
+			Cmplx_Add(dotProduct, tmp, dotProduct);
+		}
+		case 1: {
+			Cmplx_Multiply(vector1[0], vector2[0], tmp);
+			Cmplx_Add(dotProduct, tmp, dotProduct);
+			break;
+		}
+		default: {
+			Dimension_Index d;
+			for ( d = 0 ; d < dim ; d++ ) {
+				Cmplx_Multiply(vector1[d], vector2[d], tmp);
+				Cmplx_Add(dotProduct, tmp, dotProduct);
+			}
+			break;
+		}
+	}
+	
+	
+}
+
+/** See Eric W. Weisstein. "Cross Product." 
+From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/CrossProduct.html 
+Tested against http://www.engplanet.com/redirect.html?3859 */
+void StGermain_ComplexVectorCrossProduct(Cmplx* destination, Cmplx* vector1, Cmplx* vector2) {
+	Cmplx c_1, c_2;
+	/*x direction */
+	Cmplx_Multiply(vector1[1], vector2[2], c_1);
+	Cmplx_Multiply(vector1[2], vector2[1], c_2);
+	Cmplx_Subtract(c_1, c_2, destination[0]);
+
+	/*y direction */
+	Cmplx_Multiply(vector1[2], vector2[0], c_1);
+	Cmplx_Multiply(vector1[0], vector2[2], c_2);
+	Cmplx_Subtract(c_1, c_2, destination[1]);
+	/*z direction */
+	Cmplx_Multiply(vector1[0], vector2[1], c_1);
+	Cmplx_Multiply(vector1[1], vector2[0], c_2);
+	Cmplx_Subtract(c_1, c_2, destination[2]);
+}
+
+/** StGermain_VectorCrossProductMagnitude - See Eric W. Weisstein. "Cross Product." 
+From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/CrossProduct.html 
+|a \times b| = |a||b|\sqrt{ 1 - (\hat a . \hat b)^2}
+*/
+void StGermain_ComplexVectorCrossProductMagnitude( Cmplx* vector1, Cmplx* vector2, Dimension_Index dim, Cmplx tmp ) {
+	double mag1       = StGermain_ComplexVectorMagnitude( vector1, dim );
+	double mag2       = StGermain_ComplexVectorMagnitude( vector2, dim );
+	Cmplx dotProduct, dotSquared;
+	StGermain_ComplexVectorDotProduct( vector1, vector2, dim, dotProduct );
+	
+	Cmplx_Multiply(dotProduct, dotProduct, dotSquared);
+	Cmplx_RealMultiply(dotSquared, 1.0/(mag1 * mag1 * mag2 * mag2), tmp);
+	Cmplx_RealMinusCmplx(tmp, 1.0, tmp); 
+	Cmplx_RealPower(tmp, 0.5, tmp);
+	Cmplx_RealMultiply(tmp, (mag1 * mag2), tmp);
+	
+}
+
+
+/** StGermain_ComplexScalarTripleProduct - Calculates the scalar vector product of three vectors -
+ * see Eric W. Weisstein. "Scalar Triple Product." From MathWorld--A Wolfram Web Resource. 
+	http://mathworld.wolfram.com/ScalarTripleProduct.html
+ * Assumes 3 Dimensions */
+void StGermain_ComplexScalarTripleProduct( Cmplx* vectorA, Cmplx* vectorB, Cmplx* vectorC, Cmplx tripleProduct ) {
+	XYZC crossProduct;
+	
+	StGermain_ComplexVectorCrossProduct( crossProduct, vectorB, vectorC );
+	StGermain_ComplexVectorDotProduct( vectorA, crossProduct, 3, tripleProduct );
+	 
+}
+
+
+/** StGermain_ComplexVectorNormalise calculates the magnitude of a vector
+\hat v = frac{v} / {|v|}
+This function uses function StGermain_VectorDotProduct to calculate v . v. 
+Vector has to be of size dim Cmplx */
+void StGermain_ComplexVectorNormalise(Cmplx* vector, Index dim) {
+	double mag;
+
+	mag = StGermain_ComplexVectorMagnitude( vector , dim );
+	switch (dim) {
+		case 3: 
+			Cmplx_RealMultiply(vector[2], 1.0/mag, vector[2]);
+		
+		case 2:
+			Cmplx_RealMultiply(vector[1], 1.0/mag, vector[1]);
+
+		case 1: 
+			Cmplx_RealMultiply(vector[0], 1.0/mag, vector[0]);			
+
+			break;
+		default: {
+			Index d;
+			for ( d = 0 ; d < dim ; d++ )
+				Cmplx_RealMultiply(vector[d], 1.0/mag, vector[d]);
+			break;
+		}
+	}	
+}
+
+
+
+#define STGERMAIN_COMPLEXVECTOR_ONE_THIRD 0.3333333333333333333
+
+/** StGermain_ComplexTriangleCentroid Calculates the position vector to the centroid of a triangle whose verticies are given by position vectors 
+Position vectors have to be of size dim Cmplx */
+void StGermain_ComplexTriangleCentroid( Cmplx* centroid, Cmplx* pos0, Cmplx* pos1, Cmplx* pos2, Index dim) {
+	Cmplx tmp;
+	switch (dim) {
+		case 3:
+			Cmplx_Add(pos0[2], pos1[2], tmp);
+			Cmplx_Add(pos2[2], tmp, tmp);
+			Cmplx_RealMultiply(tmp, STGERMAIN_COMPLEXVECTOR_ONE_THIRD, centroid[2]);
+			
+		case 2: 
+			Cmplx_Add(pos0[1], pos1[1], tmp);
+			Cmplx_Add(pos2[1], tmp, tmp);
+			Cmplx_RealMultiply(tmp, STGERMAIN_COMPLEXVECTOR_ONE_THIRD, centroid[1]);
+		case 1:
+			Cmplx_Add(pos0[0], pos1[0], tmp);
+			Cmplx_Add(pos2[0], tmp, tmp);
+			Cmplx_RealMultiply(tmp, STGERMAIN_COMPLEXVECTOR_ONE_THIRD, centroid[0]);
+			return;
+		default: {
+			Index d;
+			for ( d = 0 ; d < dim ; d++ ) {
+				Cmplx_Add(pos0[d], pos1[d], tmp);
+				Cmplx_Add(pos2[d], tmp, tmp);
+				Cmplx_RealMultiply(tmp, STGERMAIN_COMPLEXVECTOR_ONE_THIRD, centroid[d]);
+			}
+			return;
+		}
+	}
+}
+
+/** Prints complex Vector using %g on all entries.
+TODO: would like this to be specified from function call
+with automatic default value
+*/
+void StGermain_PrintComplexVector( Stream* stream, Cmplx* vector, Index dim ) {
+	Index d;
+
+	if ( dim <= 0 ) {
+		Journal_Printf( stream, "{<NON_POSITIVE DIMENSION %d>}\n", dim );
+		return;
+	}
+
+	Journal_Printf( stream, "{");
+	for ( d = 0 ; d < dim - 1 ; d++ ) 
+		Journal_Printf( stream, "%g + i %g, ", vector[d][REAL_PART], vector[d][IMAG_PART] );
+	
+	Journal_Printf( stream, "%g + i %g}\n", vector[d][REAL_PART], vector[d][IMAG_PART] );
+}
+
+/** Converts ComplexVector into a vector,
+but only if there are no non-zero imaginary values. */
+void ComplexVector_ToVector(CoordC complexVector, Dimension_Index dim, Coord vector) {
+	Dimension_Index index;
+	for (index = 0; index < dim; index++) {
+		if (complexVector[index][IMAG_PART] != 0.0) {
+			Journal_Firewall( False, Journal_Register( Error_Type, "ComplexVectorMath" ),
+				"Error in '%s': Complex value in complex vector at index '%s' \n", __func__, index );
+		}
+		else {
+			vector[index] = complexVector[index][REAL_PART];
+		}
+	}
+}
+
+/** Converts vector into Complex vector, seting all imaginary 
+parts to zero */
+void Vector_ToComplexVector(Coord vector, Dimension_Index dim, CoordC complexVector) {
+	Dimension_Index index;
+	for (index = 0; index < dim; index++) {
+		complexVector[index][REAL_PART] = vector[index];
+		complexVector[index][IMAG_PART] = 0.0;
+	}		
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/ComplexVectorMath.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ComplexVectorMath.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,100 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**	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
+**
+** Role:
+**    Provides basic complex vector operations.
+**
+** Assumptions:
+**    - CoordC is an array of 3 Cmplx. 
+**
+** Comments:
+**    In any operation that involves two or more input vectors, those vectors 
+**    may be one and the same; it may be assumed that such an occurence will be
+**    handled.
+**
+** $Id: ComplexVectorMath.h 3677 2006-07-14 11:03:24Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_ComplexVectorMath_h__
+#define __Domain_Geometry_ComplexVectorMath_h__
+		
+#include "ComplexMath.h"
+
+typedef Cmplx ComplexVector[3];
+
+void ComplexVector_Set(CoordC set, CoordC dest);
+void ComplexVector_SetScalar( Cmplx a, Cmplx b, Cmplx c, CoordC dest );
+void ComplexVector_Add( CoordC a, CoordC b, CoordC dest );
+void ComplexVector_Sub( CoordC a, CoordC b, CoordC dest );		
+void ComplexVector_Dot(CoordC a, CoordC b, Cmplx dest );
+void ComplexVector_Mult(CoordC a, Cmplx s, CoordC dest );
+void ComplexVector_MultReal(CoordC a, double valueReal, CoordC dest );
+double ComplexVector_Mag(CoordC a );								
+void ComplexVector_Proj(CoordC a, CoordC b, CoordC  dest );					
+	
+
+void ComplexVector_Cross( CoordC a, CoordC b, CoordC dest );
+void ComplexVector_Div( CoordC a, Cmplx s, CoordC dest );
+void ComplexVector_Norm( CoordC a, CoordC dest);
+void ComplexVector_Swizzle( CoordC src, unsigned char iInd, 
+		unsigned char jInd, unsigned char kInd, CoordC dst );
+
+
+void StGermain_RotateComplexVector(Cmplx* vector, double phi, double theta, 
+			double eta, Cmplx* rotatedVector);
+void StGermain_RotateCoordinateAxisComplex( Cmplx* vector, Index axis, double theta, Cmplx* rotatedVector ) ;
+void StGermain_ComplexVectorSubtraction(Cmplx* destination, Cmplx* vector1, Cmplx* vector2, Index dim) ;
+void StGermain_ComplexVectorAddition(Cmplx* destination, Cmplx* vector1, Cmplx* vector2, Index dim) ;
+
+double StGermain_ComplexVectorMagnitude(Cmplx* vector, Index dim) ;
+void StGermain_ComplexVectorDotProduct(Cmplx* vector1, Cmplx* vector2, Dimension_Index dim, Cmplx dotProduct) ;
+void StGermain_ComplexVectorCrossProduct(Cmplx* destination, Cmplx* vector1, Cmplx* vector2) ;
+void StGermain_ComplexVectorCrossProductMagnitude( Cmplx* vector1, Cmplx* vector2, Dimension_Index dim, Cmplx dest ) ;
+void StGermain_ComplexScalarTripleProduct( Cmplx* vectorA, Cmplx* vectorB, Cmplx* vectorC, Cmplx dest );
+
+void StGermain_ComplexVectorNormalise(Cmplx* vector, Index dim ) ;
+
+void StGermain_ComplexTriangleCentroid( Cmplx* centroid, Cmplx* pos0, Cmplx* pos1, Cmplx* pos2, Index dim) ;
+
+void ComplexVector_ToVector(CoordC complexVector, Dimension_Index dim, Coord vector) ;
+void Vector_ToComplexVector(Coord vector, Dimension_Index dim, CoordC complexVector) ;
+
+
+void StGermain_PrintComplexVector( Stream* stream, Cmplx* vector, Index dim ) ;
+
+/** Prints a named ComplexVector */
+#define StGermain_PrintNamedComplexVector(stream, vector, dim) \
+		do {	\
+			Journal_Printf( stream, #vector " - " ); \
+			StGermain_PrintComplexVector( stream, vector, dim );	\
+		} while(0)
+		
+
+		
+#endif /* __Domain_Geometry_ComplexVectorMath_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Delaunay.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Delaunay.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,1063 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+** The Delaunay class computes the constrained delaunay triangulation of a set of points
+** in 2 Dimensions along with the voronoi diagram of the point-set.
+** Assumptions:
+**
+** Comments:
+**
+** The recursive divide and conquer algorithm has been implemented from the pseudo-code
+** given in "Primitives for the manipulation of general subdivisions and the computation
+** of voronoi diagrams" by Leonidas Guibas and Jorge Stolfi.
+** ACM transtactions on graphics, Vol. 4, No. 2, April 1985, Pages 74-123
+**
+**
+** $Id: Delaunay.c 3462 2006-02-19 06:53:24Z RaquibulHassan $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "QuadEdge.h"
+#include "Delaunay.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+#include <limits.h>
+
+const Type Delaunay_Type="Delaunay";
+
+#if !defined INFINITY
+	#define INFINITY LONG_MAX
+#endif
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+/** Create a Delaunay */
+Delaunay* Delaunay_DefaultNew( Name name )
+{
+	Delaunay *d = _Delaunay_New(
+			sizeof( Delaunay ),
+			Delaunay_Type,
+			_Delaunay_Delete,
+			_Delaunay_Print,
+			_Delaunay_Copy,
+			(Stg_Component_DefaultConstructorFunction*)Delaunay_DefaultNew,
+			_Delaunay_Construct,
+			_Delaunay_Build,
+			_Delaunay_Initialise,
+			_Delaunay_Execute,
+			_Delaunay_Destroy,
+			name,
+			False,
+			NULL,
+			NULL,
+			0,
+			0,
+			NULL );
+
+	return d;
+}
+	
+Delaunay* Delaunay_New(
+	Name						name,
+	Dictionary*					dictionary,
+	CoordF						*sites,
+	int							numSites,
+	int							idOffset,
+	DelaunayAttributes			*attr )
+{
+	Delaunay *d = _Delaunay_New(
+			sizeof( Delaunay ),
+			Delaunay_Type,
+			_Delaunay_Delete,
+			_Delaunay_Print,
+			_Delaunay_Copy,
+			(Stg_Component_DefaultConstructorFunction*)Delaunay_DefaultNew,
+			_Delaunay_Construct,
+			_Delaunay_Build,
+			_Delaunay_Initialise,
+			_Delaunay_Execute,
+			_Delaunay_Destroy,
+			name,
+			True,
+			dictionary,
+			sites,
+			numSites,
+			idOffset,
+			attr );
+	
+	return d;
+}
+
+	/** Initialise a Delaunay */
+void Delaunay_Init(
+	Delaunay*					self,
+	Name						name,
+	Dictionary*					dictionary,
+	CoordF						*sites,
+	int							numSites,
+	int							idOffset,
+	DelaunayAttributes			*attr )
+{
+	int i = 0;
+
+	self->type = Delaunay_Type;
+	self->_sizeOfSelf = sizeof( Delaunay );
+	self->_deleteSelf = False;
+	self->dictionary = dictionary;
+
+	self->_delete = _Delaunay_Delete;
+	self->_print = _Delaunay_Print;
+	self->_copy = _Delaunay_Copy;
+	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)Delaunay_DefaultNew;
+	self->_construct = _Delaunay_Construct;
+	self->_build = _Delaunay_Build;
+	self->_initialise = _Delaunay_Initialise;
+	self->_execute = _Delaunay_Execute;
+	self->_destroy = _Delaunay_Destroy;
+
+	self->attributes = attr;
+	self->dictionary = dictionary;
+	
+	if( self->attributes->BuildBoundingTriangle ){
+		self->numSites = numSites + 3;
+	}
+	else{
+		self->numSites = numSites;
+	}
+	
+	self->numInputSites = numSites;
+	self->idOffset = idOffset;
+	
+	if( sites != NULL ){
+		self->sites = Memory_Alloc_Array_Unnamed( Site, self->numSites );
+		memset( self->boundingTriangle, 0, sizeof( self->boundingTriangle ) );
+
+		for( i=0; i<self->numSites; i++ ){
+			if( i < self->numInputSites ){
+				self->sites[i].coord = &(sites[i]);
+			}
+			else{
+				self->sites[i].coord = &(self->boundingTriangle[i%3]);
+			}
+			self->sites[i].id = i + self->idOffset;
+		}
+	}
+
+	_Stg_Class_Init( (Stg_Class*)self );
+	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+	_Stg_Component_Init( (Stg_Component*)self );
+	_Delaunay_Init( self );
+}
+
+/** Creation implementation */
+Delaunay* _Delaunay_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,
+	Dictionary					*dictionary,
+	CoordF						*sites,
+	int							numSites,
+	int							idOffset,
+	DelaunayAttributes			*attr )
+{
+	Delaunay *self = NULL;
+	
+	assert( _sizeOfSelf >= sizeof(Delaunay) );
+	self = (Delaunay*)_Stg_Component_New( _sizeOfSelf, type, _delete, _print, _copy, _defaultConstructor,
+			_construct, _build, _initialise, _execute, _destroy, name, NON_GLOBAL );
+
+	self->points = sites;
+	self->attributes = attr;
+	self->dictionary = dictionary;
+
+	self->numInputSites = numSites;
+	self->idOffset = idOffset;
+	
+	if( initFlag ){
+		_Delaunay_Init( self );
+	}
+
+	return self;
+}
+
+#define PI 3.1415926535897932384626
+void Delaunay_FindMinMax( Site *sites, int count, float *minX, float *minY, float *maxX, float *maxY )
+{
+	int i = 0;
+	
+	*maxX = -INFINITY;
+	*maxY = -INFINITY;
+	
+	*minX = INFINITY;
+	*minY = INFINITY;
+
+	if (sites == NULL ) return;
+	
+	for( i=0; i<count; i++ ){
+		if( *maxX < (*(sites[i].coord))[0] ){
+			*maxX = (*(sites[i].coord))[0];
+		}
+		if( *maxY < (*(sites[i].coord))[1] ){
+			*maxY = (*(sites[i].coord))[1];
+		}
+		if( *minX > (*(sites[i].coord))[0] ){
+			*minX = (*(sites[i].coord))[0];
+		}
+		if( *minY > (*(sites[i].coord))[1] ){
+			*minY = (*(sites[i].coord))[1];
+		}
+	}
+}
+
+void _Delaunay_Init( Delaunay* self )
+{
+	float maxX, minX, maxY, minY;
+	float centreX, centreY;
+	float radius;
+	int i = 0;
+	CoordF *sites = NULL;
+	
+	assert( self );
+	
+	sites = self->points;
+	
+	if( self->attributes->BuildBoundingTriangle ){
+		self->numSites = self->numInputSites + 3;
+	}
+	else{
+		self->numSites = self->numInputSites;
+	}
+
+	if( sites != NULL ){
+		self->sites = Memory_Alloc_Array_Unnamed( Site, self->numSites );
+		memset( self->boundingTriangle, 0, sizeof( self->boundingTriangle ) );
+
+		for( i=0; i<self->numSites; i++ ){
+			if( i < self->numInputSites ){
+				self->sites[i].coord = &(sites[i]);
+			}
+			else{
+				self->sites[i].coord = &(self->boundingTriangle[i%3]);
+			}
+			self->sites[i].id = i + self->idOffset;
+		}
+	}
+	
+	centreX = 0; centreY = 0; 
+	
+	Delaunay_FindMinMax( self->sites, self->numSites, &minX, &minY, &maxX, &maxY );
+
+	radius = (sqrt((maxX - minX) * (maxX - minX) + (maxY - minY) * (maxY - minY)));
+			
+	centreX = minX + (maxX - minX) / 2.0f;
+	centreY = minY + (maxY - minY) / 2.0f;
+
+	self->boundingTriangle[0][0] = centreX - tan(PI/3.0f)*radius;
+	self->boundingTriangle[0][1] = centreY - radius;
+
+	self->boundingTriangle[1][0] = centreX + tan(PI/3.0f)*radius;
+	self->boundingTriangle[1][1] = centreY - radius;
+			
+	self->boundingTriangle[2][0] = centreX;
+	self->boundingTriangle[2][1] = centreY + radius/cos(PI/3.0f);
+}
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+
+/** Stg_Class_Delete() implementation */
+void _Delaunay_Delete( void* delaunay )
+{
+	Delaunay *self = (Delaunay*)delaunay;
+	
+	assert( self );
+
+	if( self->sites ){
+		Memory_Free( self->sites );
+	}
+	
+	if( self->qp ){
+		Stg_Class_Delete( self->qp );
+	}
+
+	if( self->vp ){
+		Stg_Class_Delete( self->vp );
+	}
+
+	if( self->triangleIndices ){
+		Memory_Free( self->triangleIndices[0] );
+		Memory_Free( self->triangleIndices );
+	}
+
+	if( self->triangleNeighbours ){
+		Memory_Free( self->triangleNeighbours[0] );
+		Memory_Free( self->triangleNeighbours );
+	}
+
+	if( self->numNeighbours ){
+		Memory_Free( self->numNeighbours );
+	}
+	
+	if( self->neighbours ){
+		Memory_Free( self->neighbours[0] );
+		Memory_Free( self->neighbours );
+	}
+
+	if( self->voronoiSides ){
+		Memory_Free( self->voronoiSides[0] );
+		Memory_Free( self->voronoiSides );
+	}
+
+	if( self->voronoiArea ){
+		Memory_Free( self->voronoiArea );
+	}
+
+	if( self->hull ){
+		Memory_Free( self->hull );
+	}
+
+	_Stg_Component_Delete( self );
+}
+
+/** Stg_Class_Print() implementation */
+void _Delaunay_Print( void* delaunay, Stream* stream )
+{
+	Delaunay *self = ( Delaunay* )delaunay;
+	
+	assert( self );
+	assert( stream );
+
+	_Stg_Component_Print( self, stream );
+	Journal_Printf( stream, "Delaunay (ptr): (%p)\n", self );
+	
+	Journal_Printf( stream, "\tNum Sites %d\n", self->numSites );
+	Journal_Printf( stream, "\tNum Edges %d\n", self->numEdges );
+	Journal_Printf( stream, "\tNum Triangles %d\n", self->numTriangles );
+	Journal_Printf( stream, "\tNum Voronoi Vertices %d\n", self->numVoronoiVertices );
+}
+
+void *_Delaunay_Copy( void* delaunay, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap )
+{
+	return NULL;
+}
+
+void _Delaunay_Construct( void* delaunay, Stg_ComponentFactory* cf, void* data )
+{
+	Delaunay *self = NULL;
+	Stg_ObjectList* pointerRegister;
+	int idOffset = 0;
+	CoordF *points = NULL;
+	DelaunayAttributes *attr = NULL;
+	int numSites = 0;
+
+	self = (Delaunay*) delaunay;
+	
+	pointerRegister = Stg_ObjectList_Get( cf->registerRegister, "Pointer_Register" );
+	
+	assert( pointerRegister );
+
+	points = Stg_ObjectList_Get( pointerRegister, "dataPoints" );
+	attr = Stg_ObjectList_Get( pointerRegister, "delaunayAttributes" );
+
+	numSites = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "numSites", 0 );
+
+	assert( points );
+	assert( attr );
+	assert( numSites );
+	
+	self->dictionary = cf->rootDict;
+	self->points = points;
+	self->attributes = attr;
+
+	if( self->attributes->BuildBoundingTriangle ){
+		self->numSites = numSites + 3;
+	}
+	else{
+		self->numSites = numSites;
+	}
+	
+	self->numInputSites = numSites;
+	self->idOffset = idOffset;
+
+	_Delaunay_Init( self );
+	_Delaunay_Build( self, NULL );
+}
+
+void _Delaunay_Build( void* delaunay, void* data )
+{
+	Delaunay *self = ( Delaunay* )delaunay;
+	DelaunayAttributes *attr = NULL;
+    
+	assert( self );
+	
+	self->qp = MemoryPool_New( QuadEdge, self->numSites * 3, 10 );
+	
+	Delaunay_SortSites(self->sites, self->numSites);
+
+    Delaunay_Recurse(self, 0, self->numSites, &self->leftMost, &self->rightMost);
+
+	self->numEdges = self->qp->numElements - self->qp->numElementsFree;
+	self->numFaces = self->numEdges - self->numSites + 2;
+	self->numTriangles = 0;
+
+	attr = self->attributes;
+
+	if( attr->CreateVoronoiVertices ){
+		self->vp = MemoryPool_New( VoronoiVertex, self->numSites * 2, 10 );
+	}
+	
+	Delaunay_FindHull( self );
+	
+	if( attr->BuildTriangleIndices ){
+		Delaunay_BuildTriangleIndices( self );
+	}
+	
+	if( attr->CreateVoronoiVertices ){
+		Delaunay_BuildVoronoiVertices( self );
+		self->numVoronoiVertices = self->vp->numElements - self->vp->numElementsFree;
+	}
+	
+	Delaunay_FindNeighbours( self );
+}
+
+void _Delaunay_Initialise( void* delaunay, void* data )
+{
+	
+}
+
+void _Delaunay_Execute( void* delaunay, void* data )
+{
+	
+}
+
+void _Delaunay_Destroy( void* delaunay, void* data )
+{
+	
+}
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+
+/* Function for heap sorting the input points in ascending x-coordinate */
+void Delaunay_SortSites(Site *sites, int numSites )
+{
+   int gap, i, j;
+   Site temp;
+
+	for (gap = numSites/2; gap > 0; gap /= 2){
+		for (i = gap; i < numSites; i++){
+			for ( j = i-gap;
+				j >= 0 && ( (*(sites[j].coord))[0] != (*(sites[j+gap].coord))[0] ?
+					((*(sites[j].coord))[0] > (*(sites[j+gap].coord))[0]) : ((*(sites[j].coord))[1] > (*(sites[j+gap].coord))[1]));
+				j -= gap) 
+			{
+				memcpy( &temp, sites+j, sizeof( Site ) );
+				memcpy( sites+j, sites+j+gap, sizeof( Site ) );
+				memcpy( sites+j+gap, &temp, sizeof( Site ) );
+			}
+		}
+	}
+}
+
+/* Function to check if a point is to the right of an edge */
+int RightOf(Site *s, QuadEdgeRef e)
+{
+	double result=0;
+
+	CCW(s->coord, ((Site*)DEST(e))->coord, ((Site*)ORG(e))->coord, &result);
+
+	return result > 0.0;
+}
+
+/* Function to check if a point is to the left of an edge */
+int LeftOf(Site *s, QuadEdgeRef e)
+{
+	double result=0;
+	CCW(s->coord, ((Site*)ORG(e))->coord, ((Site*)DEST(e))->coord, &result);
+
+	return result > 0.0;
+}
+
+/* Function to check if a point is inside the circumcircle of three other points */
+int InCircle(Site *a, Site *b, Site *c, Site *d)
+{
+	double x1 = (*(a->coord))[0], y1 = (*(a->coord))[1];
+	double x2 = (*(b->coord))[0], y2 = (*(b->coord))[1];
+	double x3 = (*(c->coord))[0], y3 = (*(c->coord))[1];
+	double x4 = (*(d->coord))[0], y4 = (*(d->coord))[1];
+
+	return ((y4-y1)*(x2-x3)+(x4-x1)*(y2-y3))*((x4-x3)*(x2-x1)-(y4-y3)*(y2-y1)) >
+			((y4-y3)*(x2-x1)+(x4-x3)*(y2-y1))*((x4-x1)*(x2-x3)-(y4-y1)*(y2-y3));
+}
+
+/* This is the famous divide and conquer algorithm implemented from Guibas and Stolfi's 1985
+ * paper. Refer to ACM Transcations on graphics, Vol. 4, No. 2, April 1985, Pages 74-123 */
+void Delaunay_Recurse( Delaunay *delaunay, int sl, int sh, QuadEdgeRef *le, QuadEdgeRef *re )
+{
+	Site *sites = delaunay->sites;
+	
+	if (sh == sl+2) 
+	{
+		QuadEdgeRef a = MakeQuadEdge( delaunay->qp );
+		ORG(a) = &sites[sl]; DEST(a) = &sites[sl+1];
+		*le = a; *re = SYM(a);
+	}
+	else if (sh == sl+3) 
+	{
+		QuadEdgeRef a = MakeQuadEdge( delaunay->qp );
+		QuadEdgeRef b = MakeQuadEdge( delaunay->qp );
+		float ct;
+		CCW(sites[sl].coord, sites[sl+1].coord, sites[sl+2].coord, &ct);
+		SpliceQuadEdges(SYM(a), b);
+		ORG(a) = &sites[sl]; DEST(a) = &sites[sl+1];
+		ORG(b) = &sites[sl+1];  DEST(b) = &sites[sl+2];
+		if (ct == 0.0) 
+		{ *le = a; *re = SYM(b); }
+		else
+		{ QuadEdgeRef c = ConnectQuadEdges(delaunay->qp, b, a);
+			if (ct > 0.0) 
+			{ *le = a; *re = SYM(b); }
+			else 
+			{ *le = SYM(c); *re = c; }
+		}
+	}
+	else
+	{
+		QuadEdgeRef ldo = 0, ldi = 0, rdi = 0, rdo = 0;
+		QuadEdgeRef basel = 0, lcand = 0, rcand = 0;
+
+		int sm = (sl+sh)/2;
+
+		Delaunay_Recurse( delaunay, sl, sm, &ldo, &ldi );
+		Delaunay_Recurse( delaunay, sm, sh, &rdi, &rdo);
+
+		while (1) 
+		{
+			if (LeftOf(ORG(rdi), ldi)) ldi = LNEXT(ldi);
+			else if (RightOf(ORG(ldi), rdi)) rdi = ONEXT(SYM(rdi));
+			else break;
+		}
+
+		basel = ConnectQuadEdges(delaunay->qp, SYM(rdi), ldi);
+		if (ORG(ldi) == ORG(ldo)) ldo = SYM(basel);
+		if (ORG(rdi) == ORG(rdo)) rdo = basel;
+
+		while (1) 
+		{
+
+			lcand = ONEXT(SYM(basel));
+			if (RightOf(DEST(lcand), basel))
+				while (InCircle(DEST(basel), ORG(basel), DEST(lcand), DEST(ONEXT(lcand)))) 
+				{
+					QuadEdgeRef t = ONEXT(lcand);
+					
+					DeleteQuadEdge(delaunay->qp, lcand);
+					lcand = t;
+				}
+
+			rcand = OPREV(basel);
+			if (RightOf(DEST(rcand), basel))
+				while (InCircle(DEST(basel), ORG(basel), DEST(rcand), DEST(OPREV(rcand)))) 
+				{
+					QuadEdgeRef t = OPREV(rcand);
+
+					DeleteQuadEdge(delaunay->qp, rcand);
+					rcand = t;
+				}
+
+			if (!RightOf(DEST(lcand), basel) && !RightOf(DEST(rcand), basel)) break;
+
+			if ( !RightOf(DEST(lcand), basel) ||
+				( RightOf(DEST(rcand), basel) && 
+				InCircle(DEST(lcand), ORG(lcand), ORG(rcand), DEST(rcand))))
+				basel = ConnectQuadEdges(delaunay->qp, rcand, SYM(basel));
+			else
+				basel = ConnectQuadEdges(delaunay->qp, SYM(basel), SYM(lcand));
+		}
+		*le = ldo; *re = rdo;
+	}
+}
+
+/* Function to find the convex hull of a triangulated set of points */
+void Delaunay_FindHull( Delaunay *delaunay )
+{
+	QuadEdgeRef start = 0, le = 0;
+	
+	assert( delaunay );
+	
+	start = le = delaunay->leftMost;
+	
+	delaunay->hull = Memory_Alloc_Array_Unnamed( int, delaunay->numSites );
+	memset( delaunay->hull, 0, sizeof( int ) * delaunay->numSites );
+	
+	do{
+		delaunay->hull[((Site*)ORG(le))->id - delaunay->idOffset] = 1;
+		delaunay->hull[((Site*)DEST(le))->id - delaunay->idOffset] = 1;
+		le = RPREV(le);
+	}while(le != start);
+}
+
+/* Function for generating triangle indices from a triangulation */
+void Delaunay_BuildTriangleIndices( Delaunay *delaunay )
+{
+	int i = 0, triCount;
+	QuadEdgeRef e = 0, eStart = 0, eOnext = 0, eLnext = 0;
+	QuadEdge *edges = NULL;
+	Site *sites = NULL;
+	int maxEdges = 0;
+	unsigned int **triIndices = NULL;
+	int **edgeToTriangle = NULL;
+	int index = 0;
+
+	assert( delaunay );
+	
+	delaunay->triangleIndices = Memory_Alloc_Array_Unnamed( unsigned int*, delaunay->numFaces );
+	delaunay->triangleIndices[0] = Memory_Alloc_Array_Unnamed( unsigned int, delaunay->numFaces * 3 );
+	memset( delaunay->triangleIndices[0] , 0, sizeof(unsigned int) * delaunay->numFaces * 3 );
+	
+	if( delaunay->attributes->BuildTriangleNeighbours ){
+		delaunay->triangleNeighbours = Memory_Alloc_Array_Unnamed( unsigned int*, delaunay->numFaces );
+		delaunay->triangleNeighbours[0] = Memory_Alloc_Array_Unnamed( unsigned int, delaunay->numFaces * 3 );
+
+		edgeToTriangle = Memory_Alloc_Array_Unnamed( int*, delaunay->qp->numElements );
+		edgeToTriangle[0] = Memory_Alloc_Array_Unnamed( int, delaunay->qp->numElements * 2 );
+	}
+	
+	for( i=0; i<delaunay->numFaces; i++ ){
+		delaunay->triangleIndices[i] = delaunay->triangleIndices[0]+i*3;
+
+		if( delaunay->attributes->BuildTriangleNeighbours ){
+			delaunay->triangleNeighbours[i] = delaunay->triangleNeighbours[0]+i*3;
+			
+			delaunay->triangleNeighbours[i][0] = delaunay->numFaces-1;
+			delaunay->triangleNeighbours[i][1] = delaunay->numFaces-1;
+			delaunay->triangleNeighbours[i][2] = delaunay->numFaces-1;
+		}
+	}
+	
+	if( delaunay->attributes->BuildTriangleNeighbours ){
+		for( i=0; i<delaunay->qp->numElements; i++ ){
+			edgeToTriangle[i] = edgeToTriangle[0]+i*2;
+			
+			edgeToTriangle[i][0] = delaunay->numFaces-1;
+			edgeToTriangle[i][1] = delaunay->numFaces-1;
+		}
+	}
+		
+	triIndices = delaunay->triangleIndices;
+	
+	edges = (QuadEdge*)delaunay->qp->chunks[0].memory;
+	sites = delaunay->sites;
+	maxEdges = delaunay->qp->numElements;
+		
+	for (i = 0; i < maxEdges; i++) {
+		edges[i].count = 0;
+	}
+
+	triCount = 0;
+	for (i = 0; i < maxEdges; i++) {
+		
+		e = eStart = (QuadEdgeRef)((void*)&(edges[i]));
+		
+		if( IS_FREE(e) )continue;
+		
+		do{
+			eOnext = ONEXT(e);
+			eLnext = LNEXT(e);
+			
+			if( (COUNT(e)<2) && (COUNT(LNEXT(e))<2) && (COUNT(eOnext)<2) ){
+					if( ((((Site*)ORG(eLnext)) == ((Site*)DEST(e)))) &&
+					 ((((Site*)DEST(eLnext)) == ((Site*)DEST(eOnext)))) ){
+		
+						if( delaunay->attributes->BuildBoundingTriangle ){
+							if( (!( delaunay->hull[(((Site*)ORG(e))->id) - delaunay->idOffset] )) &&
+								(!( delaunay->hull[(((Site*)DEST(e))->id) - delaunay->idOffset] )) && 
+								(!( delaunay->hull[(((Site*)DEST(eOnext))->id) - delaunay->idOffset] )) )
+							{
+								triIndices[triCount][0] = (((Site*)ORG(e))->id);
+								triIndices[triCount][1] = (((Site*)DEST(e))->id);
+								triIndices[triCount][2] = (((Site*)DEST(eOnext))->id);
+
+								if( delaunay->attributes->BuildTriangleNeighbours ){
+									index = (int)(((QuadEdge*)((void*)e)) - (QuadEdge*)delaunay->qp->chunks[0].memory);
+									edgeToTriangle[index][COUNT(e)] = triCount;
+								
+									index = (int)(((QuadEdge*)((void*)eOnext)) - (QuadEdge*)delaunay->qp->chunks[0].memory);
+									edgeToTriangle[index][COUNT(eOnext)] = triCount;
+								
+									index = (int)(((QuadEdge*)((void*)eLnext)) - (QuadEdge*)delaunay->qp->chunks[0].memory);
+									edgeToTriangle[index][COUNT(eLnext)] = triCount;
+								}
+								
+								triCount++;
+							}
+						}
+						else{
+							triIndices[triCount][0] = (((Site*)ORG(e))->id);
+							triIndices[triCount][1] = (((Site*)DEST(e))->id);
+							triIndices[triCount][2] = (((Site*)DEST(eOnext))->id);
+							
+							if( delaunay->attributes->BuildTriangleNeighbours ){
+								index = (int)(((QuadEdge*)((void*)e)) - (QuadEdge*)delaunay->qp->chunks[0].memory);
+								edgeToTriangle[index][COUNT(e)] = triCount;
+								
+								index = (int)(((QuadEdge*)((void*)eOnext)) - (QuadEdge*)delaunay->qp->chunks[0].memory);
+								edgeToTriangle[index][COUNT(eOnext)] = triCount;
+								
+								index = (int)(((QuadEdge*)((void*)eLnext)) - (QuadEdge*)delaunay->qp->chunks[0].memory);
+								edgeToTriangle[index][COUNT(eLnext)] = triCount;
+							}
+
+							triCount++;
+						}
+
+						COUNT(e)++;
+						COUNT(LNEXT(e))++;
+						COUNT(eOnext)++;
+					}
+				}
+			e = eOnext;
+		}while( e != eStart );
+	}
+	
+	delaunay->numTriangles = triCount;
+
+	if( delaunay->attributes->BuildTriangleNeighbours ){
+		int *triangleNeighbourCount = NULL;
+
+		triangleNeighbourCount = Memory_Alloc_Array_Unnamed( int, delaunay->numFaces );
+		memset( triangleNeighbourCount, 0, sizeof( int ) * delaunay->numFaces );
+		
+		for( i=0; i<delaunay->qp->numElements; i++ ){
+			if( IS_FREE( (QuadEdgeRef)(&(delaunay->qp->chunks[0].memory[i*sizeof(QuadEdge)])) ) ) continue;
+
+		
+			if( edgeToTriangle[i][0] != (delaunay->numFaces-1) )
+				delaunay->triangleNeighbours[edgeToTriangle[i][0]][triangleNeighbourCount[edgeToTriangle[i][0]]++] = edgeToTriangle[i][1];
+		
+			if( edgeToTriangle[i][1] != (delaunay->numFaces-1) )
+				delaunay->triangleNeighbours[edgeToTriangle[i][1]][triangleNeighbourCount[edgeToTriangle[i][1]]++] = edgeToTriangle[i][0];
+		}
+		
+		Memory_Free( edgeToTriangle[0] );
+		Memory_Free( edgeToTriangle );
+		Memory_Free( triangleNeighbourCount );
+	}
+}
+
+/* Function for calculating voronoi vertices */
+void Delaunay_BuildVoronoiVertices( Delaunay *delaunay )
+{
+	int i = 0;
+	QuadEdgeRef e = 0, eStart = 0, eOnext = 0, eLnext = 0;
+	VoronoiVertex *new_voronoi_site = NULL;
+	QuadEdge *edges = NULL;
+	Site *sites = NULL;
+	int maxEdges = 0;
+
+	assert( delaunay );
+	
+	edges = (QuadEdge*)delaunay->qp->chunks[0].memory;
+	sites = delaunay->sites;
+	maxEdges = delaunay->qp->numElements;
+		
+	for (i = 0; i < maxEdges; i++) {
+		edges[i].count = 0;
+	}
+
+	for (i = 0; i < maxEdges; i++) {
+		
+		e = eStart = (QuadEdgeRef)((void*)&(edges[i]));
+		
+		if( IS_FREE(e) )continue;
+		
+		new_voronoi_site = NULL;
+		do{
+			eOnext = ONEXT(e);
+			eLnext = LNEXT(e);
+
+			if( (COUNT(e)<2) && (COUNT(LNEXT(e))<2) && (COUNT(eOnext)<2) ){
+					if( ((((Site*)ORG(eLnext)) == ((Site*)DEST(e)))) &&
+					 ((((Site*)DEST(eLnext)) == ((Site*)DEST(eOnext)))) ){
+						
+						/* voronoi */
+							
+						new_voronoi_site = MemoryPool_NewObject( VoronoiVertex, delaunay->vp );
+					
+						/* Fiding the center of the circumcircle defined by org(e), dest(eonext) and dest(e)
+						 * and retrieving the result via new_voronoi_site */
+						CIRCUM_CIRCLE( ((Site*)ORG(e))->coord, ((Site*)DEST(eOnext))->coord, ((Site*)DEST(e))->coord, &(new_voronoi_site) );
+						
+						/* Assigning the new voronoi vertex to the associated edges */
+						VDEST( e ) = new_voronoi_site;
+						VORG( eOnext ) = new_voronoi_site;
+						VDEST( eLnext ) = new_voronoi_site;
+						
+						/*         */
+						
+						/* Marking the edges so that we dont visit any edge more than twice */
+						COUNT(e)++;
+						COUNT(LNEXT(e))++;
+						COUNT(eOnext)++;
+					}
+				}
+			e = eOnext;
+		}while( e != eStart );
+	}
+}
+
+/* Function for finding the neighbours of each point, along with the sides
+ * of the voronoi cells and the surface area of the voronoi cells */
+void Delaunay_FindNeighbours( Delaunay *delaunay )
+{
+	int current_pos = 0, i = 0, count = 0, count1 = 0, numNeighboursSum;
+	int *tempNumNeighbours = NULL;
+	int maxEdges = 0, numSites = 0;
+	Site *src, *dst;
+	VoronoiVertex *vsrc, *vdst;
+	float dist = 0.0f, diffx = 0.0f, diffy = 0.0f, voronoiAreaResult = 0.0;
+	Site *sites = NULL;
+	QuadEdge *edges = NULL;
+	unsigned int *numNeighbours;
+	int *hull;
+	unsigned int **neighbours;
+	float *voronoiArea, **sides;
+	DelaunayAttributes *attr = NULL;
+
+	assert( delaunay );
+
+	attr = delaunay->attributes;
+	sites = delaunay->sites;
+	edges = (QuadEdge*)delaunay->qp->chunks[0].memory;
+	maxEdges = delaunay->qp->numElements;
+	numSites = delaunay->numSites;
+	
+	for (i = 0; i < maxEdges; i++) {
+		edges[i].count = 0;
+	}
+
+	delaunay->numNeighbours = Memory_Alloc_Array_Unnamed( unsigned int, numSites );
+	memset( delaunay->numNeighbours, 0, sizeof( unsigned int ) * numSites );
+	numNeighbours = delaunay->numNeighbours;
+	
+	hull = delaunay->hull;
+
+	numNeighboursSum = 0;
+	for( i=0; i<maxEdges; i++ ){
+		if( IS_FREE( (QuadEdgeRef)&(edges[i]) ) ) continue;
+		
+		if( edges[i].count == 0 ){
+			src = (Site*)ORG((QuadEdgeRef)((void*)(&(edges[i]))));
+			dst = (Site*)DEST((QuadEdgeRef)((void*)(&(edges[i]))));
+
+			if( (src->id < (delaunay->numInputSites+delaunay->idOffset)) 
+					&& (dst->id < (delaunay->numInputSites+delaunay->idOffset)) ){
+				
+				/* Finding the number of neighbours that each point has */
+				numNeighbours[src->id - delaunay->idOffset]++;
+				numNeighbours[dst->id - delaunay->idOffset]++;
+			
+				/* NumNeighboursSum is required for allocating just enough memory for storing the
+				 * actual neighbours and the sides of the voronoi celss */
+				numNeighboursSum += 2;
+
+			}
+
+			edges[i].count++;
+		}
+	}
+
+	/* allocating memory */
+	if( attr->CalculateVoronoiSurfaceArea ){
+		delaunay->voronoiArea = Memory_Alloc_Array_Unnamed( float, numSites );
+		memset( delaunay->voronoiArea, 0, sizeof( float ) * numSites );
+	}
+	
+	if( attr->FindNeighbours ){
+		delaunay->neighbours = Memory_Alloc_Array_Unnamed( unsigned int*, numSites );
+		delaunay->neighbours[0] = Memory_Alloc_Array_Unnamed( unsigned int, numNeighboursSum );
+		memset( delaunay->neighbours[0], 0, sizeof( unsigned int ) * numNeighboursSum );
+	}
+	
+	if( attr->CalculateVoronoiSides ){
+		delaunay->voronoiSides = Memory_Alloc_Array_Unnamed( float*, numSites );
+		delaunay->voronoiSides[0] = Memory_Alloc_Array_Unnamed( float, numNeighboursSum );
+		memset( delaunay->voronoiSides[0], 0, sizeof( float ) * numNeighboursSum );
+	}
+
+	tempNumNeighbours = Memory_Alloc_Array_Unnamed( int, numSites );
+	memcpy( tempNumNeighbours, numNeighbours, sizeof( int ) * numSites );
+
+	
+	voronoiArea = delaunay->voronoiArea;
+	neighbours = delaunay->neighbours;
+	sides = delaunay->voronoiSides;
+	
+	current_pos = 0;
+	for( i=0; i<numSites; i++ ){
+		
+		if( neighbours ) neighbours[i] = neighbours[0] + current_pos;
+		if( sides ) sides[i] = sides[0] + current_pos;
+		
+		current_pos += numNeighbours[i];
+	}
+	
+	for( i=0; i<maxEdges; i++ ){
+		if( IS_FREE( (QuadEdgeRef)&(edges[i]) ) ) continue;
+
+		src = (Site*)ORG((QuadEdgeRef)((void*)(&(edges[i]))));
+		dst = (Site*)DEST((QuadEdgeRef)((void*)(&(edges[i]))));
+
+		count = tempNumNeighbours[src->id - delaunay->idOffset];
+		count1 = tempNumNeighbours[dst->id - delaunay->idOffset];
+		
+		if( edges[i].count == 1 ){
+
+			if( (src->id < (delaunay->numInputSites+delaunay->idOffset)) 
+					&& (dst->id < (delaunay->numInputSites+delaunay->idOffset)) ){
+
+				vsrc = (VoronoiVertex*)VORG((QuadEdgeRef)((void*)(&(edges[i]))));
+				vdst = (VoronoiVertex*)VDEST((QuadEdgeRef)((void*)(&(edges[i]))));
+			
+				if( vsrc && vdst ){
+				
+					/* calculating the length of the voronoi sides */
+					if( attr->CalculateVoronoiSides ){
+					
+						diffx = ( vsrc->point[0] - vdst->point[0] );
+						diffy = ( vsrc->point[1] - vdst->point[1] );
+				
+						dist = sqrt( diffx*diffx + diffy*diffy );
+
+						sides[src->id - delaunay->idOffset][--count] = dist;
+						sides[dst->id - delaunay->idOffset][--count1] = dist;
+					}
+				
+					if( attr->CalculateVoronoiSurfaceArea ){
+					
+						/* calculating the voronoi surface area for each point, with the hull
+						 * nodes having an infinite unbounded area */
+
+						if( !(hull[src->id - delaunay->idOffset]) ){
+							CCW( src->coord, &(vsrc->point), &(vdst->point), &voronoiAreaResult );
+							voronoiArea[src->id - delaunay->idOffset] += FABS( voronoiAreaResult ) * 0.5;
+						}
+						else{
+							voronoiArea[src->id - delaunay->idOffset] = INFINITY;
+						}
+					
+						if( !(hull[dst->id - delaunay->idOffset]) ){
+							CCW( dst->coord, &(vsrc->point), &(vdst->point), &voronoiAreaResult );
+							voronoiArea[dst->id - delaunay->idOffset] += FABS( voronoiAreaResult ) * 0.5;
+						}
+						else{
+							voronoiArea[dst->id - delaunay->idOffset] = INFINITY;
+						}
+					}
+				}
+
+				/* Storing the actual neighbours of each node */
+				if( attr->FindNeighbours ){
+					neighbours[src->id - delaunay->idOffset][--tempNumNeighbours[src->id - delaunay->idOffset]] = dst->id;
+					neighbours[dst->id - delaunay->idOffset][--tempNumNeighbours[dst->id - delaunay->idOffset]] = src->id;
+				}
+			}
+			edges[i].count++;
+		}
+	}
+	Memory_Free(tempNumNeighbours);
+}
+
+/* Accessor functions below for accessing arrays inside the class */
+
+unsigned int **Delaunay_GetTriangleIndices( Delaunay *delaunay )
+{
+	assert( delaunay );
+
+	return delaunay->triangleIndices;
+}
+
+float **Delaunay_GetVoronoiSides( Delaunay *delaunay )
+{
+	assert( delaunay );
+
+	return delaunay->voronoiSides;
+}
+
+float *Delaunay_GetSurfaceArea( Delaunay *delaunay )
+{
+	assert( delaunay );
+
+	return delaunay->voronoiArea;
+}
+
+unsigned int *Delaunay_GetNumNeighbours( Delaunay *delaunay )
+{
+	assert( delaunay );
+
+	return delaunay->numNeighbours;
+}
+
+unsigned int **Delaunay_GetNeighbours( Delaunay *delaunay )
+{
+	assert( delaunay );
+
+	return delaunay->neighbours;
+}
+
+int *Delaunay_GetHull( Delaunay *delaunay )
+{
+	assert( delaunay );
+
+	return delaunay->hull;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Delaunay.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Delaunay.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,186 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	Calculates the delaunay triangulation and the voronoi diangram of a set of points.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Delaunay.h 3462 2006-02-19 06:53:24Z Raquibul Hassan$
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Delaunay_h__
+#define __Domain_Geometry_Delaunay_h__
+
+	/* Virtual function types */
+	
+	/** Textual name of this class */
+	extern const Type Delaunay_Type;
+
+	typedef struct DelaunayAttributes_t{
+		int	BuildBoundingTriangle;
+		int BuildTriangleIndices;
+		int BuildTriangleNeighbours;
+		int CreateVoronoiVertices;
+		int CalculateVoronoiSides;
+		int CalculateVoronoiSurfaceArea;
+		int FindNeighbours;
+	}DelaunayAttributes;
+
+	typedef struct Site_t{
+		CoordF *coord;
+		int id;
+	}Site;
+
+	/** Delaunay class contents (see Delaunay) */
+	#define __Delaunay \
+		__Stg_Component \
+		Dictionary			*dictionary; \
+		MemoryPool			*qp; \
+		MemoryPool			*vp; \
+		int					numSites; \
+		int					numInputSites; \
+		CoordF				*points; \
+		Site				*sites; \
+		int					idOffset; \
+		CoordF				boundingTriangle[3]; \
+		int					numEdges; \
+		int					numVoronoiSites; \
+		int					numTriangles; \
+		int					numFaces; \
+		unsigned int		**triangleIndices; \
+		unsigned int		**triangleNeighbours; \
+		int					numVoronoiVertices; \
+		unsigned int		*numNeighbours; \
+		unsigned int		**neighbours; \
+		float				**voronoiSides; \
+		float				*voronoiArea; \
+		int					*hull; \
+		QuadEdgeRef			rightMost; \
+		QuadEdgeRef			leftMost; \
+		DelaunayAttributes *attributes;
+	
+	struct Delaunay { __Delaunay };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/** Create a Delaunay */
+	Delaunay* Delaunay_DefaultNew( Name name );
+	
+	Delaunay* Delaunay_New(
+		Name						name,
+		Dictionary*					dictionary,
+		CoordF						*sites,
+		int							numSites,
+		int							idOffset,
+		DelaunayAttributes			*attr );
+	
+	/** Initialise a Delaunay */
+	void Delaunay_Init(
+		Delaunay*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		CoordF						*sites,
+		int							numSites,
+		int							idOffset,
+		DelaunayAttributes			*attr );
+	
+	/** Creation implementation */
+	Delaunay* _Delaunay_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,
+		Dictionary					*dictionary,
+		CoordF						*sites,
+		int							numSites,
+		int							idOffset,
+		DelaunayAttributes			*attr );
+	
+	void _Delaunay_Init( Delaunay* self );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/** Stg_Class_Delete() implementation */
+	void _Delaunay_Delete( void* delaunay );
+	
+	/** Stg_Class_Print() implementation */
+	void _Delaunay_Print( void* delaunay, Stream* stream );
+	
+	void *_Delaunay_Copy( void* delaunay, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void _Delaunay_Construct( void* delaunay, Stg_ComponentFactory* cf, void* data );
+	
+	void _Delaunay_Build( void* delaunay, void* data );
+	
+	void _Delaunay_Initialise( void* delaunay, void* data );
+	
+	void _Delaunay_Execute( void* delaunay, void* data );
+	
+	void _Delaunay_Destroy( void* delaunay, void* data );
+
+	unsigned int **Delaunay_GetTriangleIndices( Delaunay *delaunay );
+	float **Delaunay_GetVoronoiSides( Delaunay *delaunay );
+	float *Delaunay_GetSurfaceArea( Delaunay *delaunay );
+	unsigned int *Delaunay_GetNumNeighbours( Delaunay *delaunay );
+	unsigned int **Delaunay_GetNeighbours( Delaunay *delaunay );
+	int *Delaunay_GetHull( Delaunay *delaunay );
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	void Delaunay_SortSites(Site *sites, int numSites );
+	int RightOf(Site *s, QuadEdgeRef e);
+	int LeftOf(Site *s, QuadEdgeRef e);
+	int InCircle(Site *a, Site *b, Site *c, Site *d);
+	void Delaunay_Recurse( Delaunay *delaunay, int sl, int sh, QuadEdgeRef *le, QuadEdgeRef *re );
+	void Delaunay_FindHull( Delaunay *delaunay );
+	void Delaunay_BuildTriangleIndices( Delaunay *delaunay );
+	void Delaunay_BuildVoronoiVertices( Delaunay *delaunay );
+	void Delaunay_FindNeighbours( Delaunay *delaunay );
+	void Delaunay_FindMinMax( Site *sites, int count, float *minX, float *minY, float *maxX, float *maxY );
+	
+#endif /* __Domain_Geometry_Delaunay_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Delaunay.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Delaunay.meta	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">Delaunay</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense</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">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Dimension.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Dimension.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,66 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Dimension.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "units.h"
+#include "types.h"
+#include "Dimension.h"
+
+void Dimension_3DTo1D_3_Func( Index dim0, Index dim1, Index dim2, 
+		Index dim0Size, Index dim1Size, Index dim2Size, 
+		Index* outputIndexPtr )
+{		
+	Index dimSizes[3];
+	dimSizes[0] = (dim0Size) ? (dim0Size) : 1;
+	dimSizes[1] = (dim1Size) ? (dim1Size) : 1;
+	dimSizes[2] = (dim2Size) ? (dim2Size) : 1;
+	
+	#if DEBUG 
+	{
+		Stream* dimensionError = Journal_Register( Error_Type, "DimensionMacros" );
+		Journal_Firewall( (dim0 < dimSizes[0]), dimensionError, "Error: Given coordinate[0] value %d >= "
+			"regionSize[0] %d\n", dim0, dimSizes[0] );
+		Journal_Firewall( (dim1 < dimSizes[1]), dimensionError, "Error: Given coordinate[1] value %d >= "
+			"regionSize[1] %d\n", dim1, dimSizes[1] );
+		Journal_Firewall( (dim2 < dimSizes[2]), dimensionError, "Error: Given coordinate[2] value %d >= "
+			"regionSize[2] %d\n", dim2, dimSizes[2] );
+	}	
+	#endif
+	
+	Dimension_3DTo1D_3_Macro( dim0, dim1, dim2, dim0Size, dim1Size, dim2Size, outputIndexPtr );
+}	
+
+void Dimension_1DTo3D_3_Func( Index index, Index dim0Size, Index dim1Size, Index dim2Size,
+		Index* dim0Ptr, Index* dim1Ptr, Index* dim2Ptr ) 
+{
+	Dimension_1DTo3D_3_Macro( index, dim0Size, dim1Size, dim2Size, dim0Ptr, dim1Ptr, dim2Ptr );
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Dimension.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Dimension.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,99 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+** Role:
+**	Functions for converting from 1D indices to 3D co-ordinate numbers,
+**	and back again.
+**
+** Assumptions:
+**
+** Comments:
+**	These macros should be used anywhere where IJK-style conversions are 
+**	required. It was created since the FeEquationNumber needed to use 
+**	new co-ordinate systems.
+**
+** $Id: Dimension.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Dimension_h__
+#define __Domain_Geometry_Dimension_h__
+
+	/** Converts 3 3d coordinates into the sequential number for a given sized region. */ 
+	#define Dimension_3DTo1D_3_Macro( dim0, dim1, dim2, dim0Size, dim1Size, dim2Size, indexPtr ) \
+	do { \
+		Index dimSizes[3]; \
+		dimSizes[0] = (dim0Size) ? (dim0Size) : 1; \
+		dimSizes[1] = (dim1Size) ? (dim1Size) : 1; \
+		dimSizes[2] = (dim2Size) ? (dim2Size) : 1; \
+		\
+		*(indexPtr) = ( ((dim2)*dimSizes[0]*dimSizes[1]) + ((dim1)*dimSizes[0]) + (dim0) ); \
+	} while (0) 
+	
+	void Dimension_3DTo1D_3_Func( Index dim0, Index dim1, Index dim2, 
+		Index dim0Size, Index dim1Size, Index dim2Size, 
+		Index* outputIndexPtr );
+
+	#ifdef MACRO_AS_FUNC
+		#define Dimension_3DTo1D_3 Dimension_3DTo1D_3_Func
+	#else	
+		#define Dimension_3DTo1D_3 Dimension_3DTo1D_3_Macro
+	#endif	
+
+
+	/** Converts a 3d coordinate into the sequential number for a given sized region. */ 
+	#define Dimension_3DTo1D( coord, regionSizes, indexPtr ) \
+		Dimension_3DTo1D_3( (coord)[0], (coord)[1], (coord)[2], (regionSizes)[0], (regionSizes)[1], (regionSizes)[2], indexPtr )
+
+	/** Converts a sequential number into the 3d co-ordinates for a given region, returned separately */ 
+	#define Dimension_1DTo3D_3_Macro( index, dim0Size, dim1Size, dim2Size, dim0Ptr, dim1Ptr, dim2Ptr ) \
+	do { \
+		Index dimSizes[3]; \
+		dimSizes[0] = (dim0Size) ? (dim0Size) : 1; \
+		dimSizes[1] = (dim1Size) ? (dim1Size) : 1; \
+		dimSizes[2] = (dim2Size) ? (dim2Size) : 1; \
+		\
+		*(dim0Ptr) = (index) % (dimSizes[0]); \
+		*(dim1Ptr) = ((index)/(dimSizes[0])) % (dimSizes[1]); \
+		*(dim2Ptr) = ((index)/((dimSizes[0])*(dimSizes[1]))) % (dimSizes[2]); \
+	} while (0) 
+
+	void Dimension_1DTo3D_3_Func( Index index, Index dim0Size, Index dim1Size, Index dim2Size,
+		Index* dim0Ptr, Index* dim1Ptr, Index* dim2Ptr );
+	#ifdef MACRO_AS_FUNC
+		#define Dimension_1DTo3D_3 Dimension_1DTo3D_3_Func
+	#else
+		#define Dimension_1DTo3D_3 Dimension_1DTo3D_3_Macro
+	#endif
+
+		
+	/** Converts a sequential number into the 3d co-ordinates for a given region, returned as one */ 
+	#define Dimension_1DTo3D( index, regionSizes, coord ) \
+		Dimension_1DTo3D_3( index, (regionSizes)[0], (regionSizes)[1], (regionSizes)[2], &(coord)[0], &(coord)[1], &(coord)[2] )
+
+#endif
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Edge.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Edge.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,97 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Edge.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "Edge.h"
+
+#include <stdlib.h>
+#include <assert.h>
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Macros
+*/
+
+#define Edge_TriMax( triCount )		\
+	(2 * triCount + 1)
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Functions
+*/
+
+Edge_Index Edge_BuildList_FromTriangles(
+		Triangle_List		triTbl, 
+		Triangle_Index		triCount, 
+		Edge_List*		edgeTbl, 
+		EdgeFaces_List*		edgeFacesTbl )
+{
+	Edge_Index	cnt = 0;
+	Triangle_Index	tri_I;
+	
+	*edgeTbl = Memory_Alloc_Array( Edge, Edge_TriMax(triCount), "Edge->edgeTbl" );
+	*edgeFacesTbl = Memory_Alloc_Array( EdgeFaces, Edge_TriMax(triCount), "Edge->edgeFacesTbl" );
+	
+	for( tri_I = 0; tri_I < triCount; tri_I++ )
+	{
+		Index		i;
+		
+		for( i = 0; i < 3; i++ )
+		{
+			Coord_Index	p1 = triTbl[tri_I][i];
+			Coord_Index	p2 = triTbl[tri_I][(i + 1) % 3];
+			Edge_Index	edge_I;
+			
+			for( edge_I = 0; edge_I < cnt; edge_I++ )
+				if( (p1 == (*edgeTbl)[edge_I][0] && p2 == (*edgeTbl)[edge_I][1]) ||
+				    (p1 == (*edgeTbl)[edge_I][1] && p2 == (*edgeTbl)[edge_I][0]) ) break;
+			if (edge_I < cnt)
+			{
+				(*edgeFacesTbl)[edge_I][1] = tri_I;
+				continue;
+			}
+			
+			(*edgeTbl)[cnt][0] = p1;
+			(*edgeTbl)[cnt][1] = p2;
+			(*edgeFacesTbl)[cnt][0] = tri_I;
+			(*edgeFacesTbl)[cnt++][1] = triCount;
+		}
+	}
+	
+	*edgeTbl = Memory_Realloc_Array( *edgeTbl, Edge, cnt );
+	*edgeFacesTbl = Memory_Realloc_Array( *edgeFacesTbl, EdgeFaces, cnt );
+
+	return cnt;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Edge.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Edge.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,59 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    Provides basic edge routines.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Edge.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Edge_h__
+#define __Domain_Geometry_Edge_h__
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Macros
+	*/
+
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Functions
+	*/
+	
+	/* constructs a list of edges and a list of faces touching each edge from a list of triangles */
+	Edge_Index Edge_BuildList_FromTriangles(
+			Triangle_List		triTbl, 
+			Triangle_Index		triCount, 
+			Edge_List*		edgeTbl, 
+			EdgeFaces_List*		edgeFacesTbl );
+
+	
+#endif /* __Domain_Geometry_Edge_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Finalise.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Finalise.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,45 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Finalise.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "Finalise.h"
+
+#include <stdio.h>
+
+Bool StgDomainGeometry_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	
+	return True;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Finalise.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Finalise.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,46 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Finalise.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Finalise_h__
+#define __Domain_Geometry_Finalise_h__
+	
+	Bool StgDomainGeometry_Finalise( void );
+	
+#endif /* __Domain_Geometry_Finalise_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/FullTensorMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/FullTensorMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,495 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: FullTensorMath.c  $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "units.h"
+#include "types.h"
+#include "TensorMath.h"
+#include "VectorMath.h"
+#include "FullTensorMath.h"
+#include "ComplexVectorMath.h"
+#include "ComplexMath.h"
+#include "stg_lapack.h"
+
+#include <math.h>
+#include <string.h>
+
+#define STG_TENSOR_ERROR 1.0e-05;
+
+
+
+
+/** This function converts TensorArray's to ComplexTensorArray's */
+void TensorArray_ToComplexTensorArray(TensorArray tensorArray, ComplexTensorArray complexTensorArray, Dimension_Index dim) {
+	Dimension_Index index_I;
+
+	if (dim !=2 ) {
+		if (dim != 3) {
+			Journal_Firewall( False, Journal_Register( Error_Type, "FullTensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}	
+			
+	for (index_I = 0; index_I < dim * dim; index_I++) {
+		complexTensorArray[index_I][REAL_PART] = tensorArray[index_I];
+		complexTensorArray[index_I][IMAG_PART] = 0.0;
+	}
+	return;			
+}
+/** This function converts ComplexTensorArrays back into TensorArrays.
+If there are any non-zero entries for complex components,
+this function will JournalFirewall and exit */
+void ComplexTensorArray_ToTensorArray(ComplexTensorArray complexTensorArray, TensorArray tensorArray, Dimension_Index dim) {
+	Dimension_Index index_I;
+	Stream* error = Journal_Register( ErrorStream_Type, "FullTensorMath" );
+
+	if (dim !=2 ) {
+		if (dim != 3) {
+			Journal_Firewall( False, Journal_Register( Error_Type, "FullTensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+		
+	for (index_I = 0; index_I < dim * dim; index_I++) {
+		if (complexTensorArray[index_I][IMAG_PART] == 0) {
+			
+			tensorArray[index_I] = complexTensorArray[index_I][REAL_PART];
+		}
+	
+		else {
+			Journal_Printf(error, "Cannot convert to real matrix:\n");			
+			Journal_Printf(error, "Indicee %d in complexTensorArray is complex value.\n", index_I);
+			Journal_PrintComplexTensorArray(error, complexTensorArray, dim);
+			Journal_Firewall( False, error, "In func '%s'. Cannot convert ComplexTensor to Real Tensor \n", __func__ );
+		}
+	}
+	
+	return;		
+}
+/** This function converts ComplexTensorArrays to Complex Square Matrices */
+void ComplexTensorArray_ToComplexMatrix(ComplexTensorArray complexTensor, Dimension_Index dim, Cmplx** complexMatrix ) {
+	if (dim == 2) {
+		Cmplx_Copy(complexTensor[FT2D_00], complexMatrix[0][0]); 			
+		Cmplx_Copy(complexTensor[FT2D_01], complexMatrix[0][1]);	
+		Cmplx_Copy(complexTensor[FT2D_10], complexMatrix[1][0]);		
+		Cmplx_Copy(complexTensor[FT2D_11], complexMatrix[1][1]);	
+	}
+	else if (dim == 3) {
+		Cmplx_Copy(complexTensor[FT3D_00], complexMatrix[0][0]);	
+		Cmplx_Copy(complexTensor[FT3D_01], complexMatrix[0][1]);	
+		Cmplx_Copy(complexTensor[FT3D_02], complexMatrix[0][2]);
+		
+		Cmplx_Copy(complexTensor[FT3D_10], complexMatrix[1][0]);		
+		Cmplx_Copy(complexTensor[FT3D_11], complexMatrix[1][1]);	
+		Cmplx_Copy(complexTensor[FT3D_12], complexMatrix[1][2]);
+		
+		Cmplx_Copy(complexTensor[FT3D_20], complexMatrix[2][0]);	
+		Cmplx_Copy(complexTensor[FT3D_21], complexMatrix[2][1]);			
+		Cmplx_Copy(complexTensor[FT3D_22], complexMatrix[2][2]);	
+	}
+	else {
+		Journal_Firewall( False, Journal_Register( Error_Type, "FullTensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+	}
+}
+
+/** This function calculates only the eigenvalues of a given TensorArray */
+void TensorArray_CalcAllEigenvalues( TensorArray tensor, Dimension_Index dim, ComplexEigenvector* eigenvectorList ) {
+	/* False flag means Eigenvectors are not written to eigenvectorList */
+	TensorArray_CalcAllEigenFunctions(tensor, dim, False, eigenvectorList);
+	
+}
+
+/** This function calculates only the eigenvalues of a given 2D TensorArray */
+void TensorArray_CalcAllEigenvalues2D( TensorArray tensor, ComplexEigenvector* eigenvectorList ) {
+	/* False flag means Eigenvectors are not written to eigenvectorList */
+	TensorArray_CalcAllEigenFunctions(tensor, 2, False, eigenvectorList);
+	
+}
+
+/** This function calculates only the eigenvalues of a given 3D TensorArray */
+void TensorArray_CalcAllEigenvalues3D( TensorArray tensor, ComplexEigenvector* eigenvectorList ) {
+	/* False flag means Eigenvectors are not written to eigenvectorList */
+	TensorArray_CalcAllEigenFunctions(tensor, 3, False, eigenvectorList);
+	
+}
+
+/** This function is a wrapper to calculate all eigenvalues and vectors for 2 or 3D TensorArray's */
+void TensorArray_CalcAllEigenvectors(TensorArray tensor, Dimension_Index dim, ComplexEigenvector* eigenvectorList){
+	/* True flag means eigenvalues and vectors are calculated */
+	TensorArray_CalcAllEigenFunctions(tensor, dim, True, eigenvectorList);
+
+	ComplexEigenvectorList_Sort( eigenvectorList, dim );
+}
+
+/** This function is a wrapper to calculate all eigenvalues and vectors for 2D TensorArray's */
+void TensorArray_CalcAllEigenvectors2D( TensorArray tensor, ComplexEigenvector* eigenvectorList ) {
+	
+	/* True flag means eigenvalues and vectors are calculated */
+
+	TensorArray_CalcAllEigenFunctions(tensor, 2, True, eigenvectorList);
+
+	ComplexEigenvectorList_Sort( eigenvectorList, 2 );
+	
+
+}
+/** This function is a wrapper to calculate all eigenvalues and vectors for 3D TensorArray's */
+void TensorArray_CalcAllEigenvectors3D( TensorArray tensor, ComplexEigenvector* eigenvectorList ) {
+	
+	/* True flag means eigenvalues and vectors are calculated */
+
+	TensorArray_CalcAllEigenFunctions(tensor, 3, True, eigenvectorList);
+
+	ComplexEigenvectorList_Sort( eigenvectorList, 3 );
+	
+
+}
+
+/** This function will call the blas-lapack library and calculate the eigenvalues and eigenvectors
+For a given tensorArray and return the answers in a ComplexEigenvector structure.*/
+void TensorArray_CalcAllEigenFunctions(TensorArray tensor, Dimension_Index dim, Bool eigenFlag, ComplexEigenvector* eigenvectorList) {
+/**This function will call the blas-lapack library and calculate the eigenvalues and eigenvectors */
+	/* Define functions needed to pass to blaslapack library function */
+	char jobVecLeft='V';
+	char jobVecRight='N';
+	
+	double* arrayA;
+	int	leadDimVL, leadDimVR, dimWorkSpace, INFO;
+	double errorValue;
+    double* workSpace;
+    double* outputReal;
+    double* outputImag;
+    double* leftEigenVec;
+    double* rightEigenVec;
+	
+	int row_I, col_I; 
+	/*char* 	errorStringValues; */
+	Stream* errorStream = Journal_Register( ErrorStream_Type, "FullTensorMath" );
+	
+	/* Set size of workspace to pass to function */
+	dimWorkSpace = 10*dim;
+
+	/* define array size */
+	arrayA = Memory_Alloc_Array( double, dim * dim, "ArrayA" );				
+
+	/* define output eigenvalue matrices */
+	outputReal = Memory_Alloc_Array( double, dim, "OutputReal" );				
+	outputImag = Memory_Alloc_Array( double, dim, "OutputImag" );
+	for (row_I = 0; row_I < dim; row_I++) {
+		outputReal[row_I] = 0;
+		outputImag[row_I] = 0;
+	}
+	/* Define workspace */
+	workSpace = Memory_Alloc_Array( double, dimWorkSpace, "DimWorkSpace" );
+	
+	/* Transpose array so that it is in Fortran-style indexing */
+	for( row_I = 0 ; row_I < dim ; row_I++ ) {
+		 for( col_I = 0 ; col_I < dim ; col_I++ ) {
+			arrayA[ ( row_I * dim ) + col_I ] = tensor[TensorArray_TensorMap(row_I, col_I, dim)];
+		 }
+	}
+	 /* Turn off eigenvector calculations if eigenvector flag is not set */
+	if (eigenFlag == False) {
+		 jobVecLeft = 'N';
+	}
+	/* Set sizes for eigenvectors */
+	if (jobVecLeft=='V') {
+		/* times size by 2 to account for complex eigenvectors */
+		leadDimVL = 2*dim;
+	}
+	else {
+		leadDimVL = 1;
+	}
+	/* Set sizes for alternate eigenvectors
+	This is currently always turned off since calculating right eigenvectors
+	as well is redundant */
+	if (jobVecRight=='V') {
+		/* times 2 to account for complex eigenvectors */
+		leadDimVR = 2*dim;
+	}
+	else {
+		leadDimVR = 1;
+	}
+	
+	/* set size of eigenvector arrays */
+	leftEigenVec = Memory_Alloc_Array( double, leadDimVL * dim, "LeftEigenVec" );				
+	rightEigenVec = Memory_Alloc_Array( double, leadDimVR * dim, "RightEigenVec" );
+	for (row_I = 0; row_I < leadDimVL * dim; row_I++) {
+		leftEigenVec[row_I] = 0;
+	}
+	for (row_I = 0; row_I < leadDimVR * dim; row_I++) {
+		rightEigenVec[row_I] = 0;
+	}
+	
+	/* Definitions of lapack call inputs (from dgeev man page):
+
+		JOBVL   (input) CHARACTER*1
+				  = 'N': left eigenvectors of A are not computed;
+				  = 'V': left eigenvectors of A are computed.
+		JOBVR   (input) CHARACTER*1
+				 = 'N': right eigenvectors of A are not computed;
+				 = 'V': right eigenvectors of A are computed
+		N       (input) INTEGER
+				 The order of the matrix A. N >= 0.
+		A       (input/output) DOUBLE PRECISION array, dimension (LDA,N)
+				 On entry, the N-by-N matrix A.
+				 On exit, A has been overwritten.
+		LDA     (input) INTEGER
+				 The leading dimension of the array A.  LDA >= max(1,N).
+		WR      (output) DOUBLE PRECISION array, dimension (N)
+		WI      (output) DOUBLE PRECISION array, dimension (N)
+				 WR and WI contain the real and imaginary parts,
+				 respectively, of the computed eigenvalues.  Complex
+				 conjugate pairs of eigenvalues appear consecutively
+				 with the eigenvalue having the positive imaginary part
+				 first.
+		VL      (output) DOUBLE PRECISION array, dimension (LDVL,N)
+				 If JOBVL = 'V', the left eigenvectors u(j) are stored one
+				 after another in the columns of VL, in the same order
+				 as their eigenvalues.
+				 If JOBVL = 'N', VL is not referenced.
+				 If the j-th eigenvalue is real, then u(j) = VL(:,j),
+				 the j-th column of VL.
+				 If the j-th and (j+1)-st eigenvalues form a complex
+				 conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and
+				 u(j+1) = VL(:,j) - i*VL(:,j+1).
+		LDVL    (input) INTEGER
+				 The leading dimension of the array VL.  LDVL >= 1; if
+				 JOBVL = 'V', LDVL >= N.
+		VR      (output) DOUBLE PRECISION array, dimension (LDVR,N)
+				 If JOBVR = 'V', the right eigenvectors v(j) are stored one
+				 after another in the columns of VR, in the same order
+				 as their eigenvalues.
+				 If JOBVR = 'N', VR is not referenced.
+				 If the j-th eigenvalue is real, then v(j) = VR(:,j),
+				 the j-th column of VR.
+				 If the j-th and (j+1)-st eigenvalues form a complex
+				 conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and
+				 v(j+1) = VR(:,j) - i*VR(:,j+1).
+		LDVR    (input) INTEGER
+				 The leading dimension of the array VR.  LDVR >= 1; if
+				 JOBVR = 'V', LDVR >= N.
+		WORK    (workspace/output) DOUBLE PRECISION array, dimension (LWORK)
+				 On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
+		
+		LWORK   (input) INTEGER
+				 The dimension of the array WORK.  LWORK >= max(1,3*N), and
+				 if JOBVL = 'V' or JOBVR = 'V', LWORK >= 4*N.  For good
+				 performance, LWORK must generally be larger.
+				 If LWORK = -1, a workspace query is assumed.  The optimal
+				 size for the WORK array is calculated and stored in WORK(1),
+				 and no other work except argument checking is performed.
+		INFO    (output) INTEGER
+				 = 0:  successful exit
+				 < 0:  if INFO = -i, the i-th argument had an illegal value.
+				 > 0:  if INFO = i, the QR algorithm failed to compute all the
+					   eigenvalues, and no eigenvectors have been computed;
+					   elements i+1:N of WR and WI contain eigenvalues which
+					   have converged.	 
+	*/	 
+
+
+	/** Passes into blaslapack function dgeev:
+		 From Man page:
+		 	1.  JOBVL			2.	JOBVR 			3.	N 
+			4.	A 				5.	LDA 			6.	WR 
+			7.	WI	 			8. 	VL	 			9. 	LDVL 
+			10.	VR 				11.	LDVR 			12.	WORK 
+			13.	LWORK 			14. INFO 
+		 
+		 In this code:
+		 	1.  &jobVecLeft		2.  &jobVecRight 	3. &dimOrderN 
+		 	4.  arrayA 			5.  &dim 	 		6. outputReal
+			7.  outputImag		8.  leftEigenVec 	9. &dimOrderN
+			10. rightEigenVec	11. &dimOrderN		12. workSpace
+			13. &dimWorkSpace	14. &INFO		 
+		 */
+		 
+	/** Calls blas-lapack function, dgeev through stg_lapack header file substitution
+	to take account of different Fortran compilers	*/	 
+	stg_dgeev( &jobVecLeft, &jobVecRight, &dim, arrayA, &dim, 
+	 		outputReal, outputImag, leftEigenVec, &leadDimVL, 
+	 		rightEigenVec, &leadDimVR, workSpace, &dimWorkSpace, &INFO );
+
+
+	/* Check flag for succesful calculation */
+
+	if (INFO < 0) {
+		Journal_Printf( errorStream, "Error in %s, Blas-Lapack failed at %f-th argument for tensor:", 
+		__func__, fabs(INFO));
+		Journal_PrintTensorArray( errorStream, tensor, dim );
+		Journal_Firewall(INFO , errorStream, "Error.\n" );
+
+	}
+	else if (INFO > 0) {
+		Journal_Printf( errorStream, "Error in %s, Blas-Lapack function failed for tensor:", __func__ );
+		Journal_PrintTensorArray( errorStream, tensor, dim );
+		Journal_Firewall(INFO, errorStream, "Error.\n" );		
+	}
+	
+
+/*Pass values back */
+	errorValue = STG_TENSOR_ERROR;	
+	/* Assign eigenvalues */
+	for (col_I=0; col_I < dim; col_I++) {
+		
+		eigenvectorList[col_I].eigenvalue[REAL_PART] = outputReal[col_I];
+		eigenvectorList[col_I].eigenvalue[IMAG_PART] = outputImag[col_I];
+		if (fabs(eigenvectorList[col_I].eigenvalue[REAL_PART]) < errorValue) {
+			eigenvectorList[col_I].eigenvalue[REAL_PART] = 0;
+		}
+		if (fabs(eigenvectorList[col_I].eigenvalue[IMAG_PART]) < errorValue) {
+			eigenvectorList[col_I].eigenvalue[IMAG_PART] = 0;
+		}	
+	}
+	
+	/* If eigenvectors have been calculated */
+	if (eigenFlag == True ) {
+		int index_K;
+		int numSign;
+		
+		/* Assign eigenvectors - see format for VL in comments for lapack pass above*/
+		for (col_I=0; col_I < dim; col_I++) {
+			
+			if (outputImag[col_I] == 0.0) {
+				for (row_I = 0; row_I < dim; row_I++) {
+					eigenvectorList[col_I].vector[row_I][REAL_PART] = leftEigenVec[col_I * leadDimVL + row_I];
+					eigenvectorList[col_I].vector[row_I][IMAG_PART] = 0;
+				}
+			}
+			else {
+				for (index_K = col_I; index_K <= col_I + 1; index_K++) {
+					
+					/* set sign of complex vector components */
+					if (index_K == col_I) {
+						numSign = -1;
+					}
+					else {
+						numSign = 1;
+					}	
+					for (row_I = 0; row_I < dim; row_I++) {
+					
+						/* u(col, row) = v(row, col) 
+											     \+- i * v(row, col + 1) */
+						eigenvectorList[index_K].vector[row_I][REAL_PART] = 
+							leftEigenVec[col_I * leadDimVL + row_I];
+			
+						eigenvectorList[index_K].vector[row_I][IMAG_PART] = 
+							numSign * leftEigenVec[(col_I + 1) * leadDimVL + row_I];
+					
+
+					}
+				}
+				col_I++;
+			}
+		}
+	}
+	/* Round up values that are less than the error bar */
+	for (row_I = 0; row_I < dim; row_I++) {
+		for (col_I = 0; col_I <dim; col_I++) {
+			
+			if (fabs(eigenvectorList[row_I].vector[col_I][REAL_PART]) < errorValue) {
+						eigenvectorList[row_I].vector[col_I][REAL_PART] = 0.0;
+				}
+			if (fabs(eigenvectorList[row_I].vector[col_I][IMAG_PART]) < errorValue) {
+						eigenvectorList[row_I].vector[col_I][IMAG_PART] = 0.0;
+				} 	
+		}
+	}
+	
+	
+				
+	/* Free memory and exit function */
+	Memory_Free( arrayA );
+	Memory_Free( outputReal );
+	Memory_Free( outputImag );
+	Memory_Free( leftEigenVec );
+	Memory_Free( rightEigenVec );
+	Memory_Free( workSpace );	
+}
+/** This function checks eigenvalues to find which of
+the two has the biggest modulus*/
+int _QsortComplexEigenvalue( const void* _a, const void* _b ) {
+	ComplexEigenvector* a = (ComplexEigenvector*) _a;
+	ComplexEigenvector* b = (ComplexEigenvector*) _b;
+	double tmp_a, tmp_b;
+	tmp_a = Cmplx_Modulus(a->eigenvalue);
+	tmp_b = Cmplx_Modulus(b->eigenvalue);
+	if ( tmp_a > tmp_b )
+		return 1;
+	else
+		return -1;
+}
+
+/** Sorts the eigenvectors and eigenvalues according to the value of the modulus of the 
+eigenvalue - from smallest to greatest */
+void ComplexEigenvectorList_Sort( ComplexEigenvector* eigenvectorList, Index count ) {
+	qsort( eigenvectorList, count, sizeof( ComplexEigenvector ), _QsortComplexEigenvalue );
+
+}
+/** This function prints a ComplexTensorArray 
+At present, it only shows %7.5g as the format.
+TODO: It would be nice in future to make this variable.*/
+void Journal_PrintComplexTensorArray_Unnamed( Stream* stream, ComplexTensorArray tensor, Dimension_Index dim ) {
+	Dimension_Index row_I, col_I;
+
+	/* For efficency - Check if stream is enabled */
+	if (!Stream_IsEnable(stream)) return;
+
+	for ( row_I = 0 ; row_I < dim ; row_I++ ) {
+		for ( col_I = 0 ; col_I < dim ; col_I++ ) {
+			Journal_Printf( stream, "%7.5g + %7.5g i", 
+				tensor[ MAP_TENSOR( row_I, col_I, dim ) ][REAL_PART], 
+				tensor[ MAP_TENSOR( row_I, col_I, dim ) ][IMAG_PART]);
+		}
+		Journal_Printf( stream, "\n" );
+	}
+}
+
+/** This function prints a Complex Square matrix */
+void Journal_PrintComplexMatrix_Unnamed( Stream* stream, Cmplx** complexMatrix, Dimension_Index dim ) {
+	Dimension_Index row_I, col_I;
+
+	/* For efficency - Check if stream is enabled */
+	if (!Stream_IsEnable(stream)) return;
+
+	for ( row_I = 0 ; row_I < dim ; row_I++ ) {
+		for ( col_I = 0 ; col_I < dim ; col_I++ ) {
+			Journal_Printf( stream, "%7.5g + %7.5g i", 
+				complexMatrix[row_I][col_I][REAL_PART], 
+				complexMatrix[row_I][col_I][IMAG_PART]);
+		}
+		Journal_Printf( stream, "\n" );
+	}
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/FullTensorMath.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/FullTensorMath.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,135 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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
+**
+** Role:
+**    Provides basic full tensor operations and conversions.
+**
+** Assumptions:
+** Comments:
+**
+** $Id: FullTensorMath.h  $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_FullTensorMath_h__
+#define __Domain_Geometry_FullTensorMath_h__
+
+#include "ComplexMath.h"
+#include "ComplexVectorMath.h"
+#include "TensorMath.h"
+
+
+/** Create complex eigenvalue and vector:
+	This creates a Cmplx tuple to represent the vector
+	And a Complex value to represent the eigenvalue.
+	These can be referenced by:
+	{eigenvectorName}.vector[{indexNumber}], or {eigenvectorName}.eigenvalue
+	*/
+typedef struct {
+	XYZC    vector;
+	Cmplx eigenvalue;
+} ComplexEigenvector;
+
+/** TensorArray - Tensor (t_{ij}) here is defined in 2D as
+	 * t_{00} = tensor[0] t_{01} = tensor[1]
+	 * t_{10} = tensor[2] t_{11} = tensor[3] 
+	 *
+	 * and in 3D as
+	 * t_{00} = tensor[0] t_{01} = tensor[1] t_{02} = tensor[2]
+	 * t_{10} = tensor[3] t_{11} = tensor[4] t_{12} = tensor[5]
+	 * t_{20} = tensor[6] t_{21} = tensor[7] t_{22} = tensor[8]
+	 *
+	 * */
+
+	/** SymmetricTensor - stores only unique components 
+	 * in 2D
+	 * tensor[0] = u_{00}
+	 * tensor[1] = u_{11}
+	 * tensor[2] = u_{12} = u_{21}
+	 *
+	 * in 3D
+	 * tensor[0] = u_{00}
+	 * tensor[1] = u_{11}
+	 * tensor[2] = u_{22}
+	 * tensor[3] = u_{01} = u_{10}
+	 * tensor[4] = u_{02} = u_{20}
+	 * tensor[5] = u_{12} = u_{21}
+	 */
+
+
+/* Define ComplexTensor conversion function */ 	
+void TensorArray_ToComplexTensorArray(TensorArray tensorArray, ComplexTensorArray complexTensorArray, Dimension_Index dim);
+
+void ComplexTensorArray_ToTensorArray(ComplexTensorArray complexTensorArray, TensorArray tensorArray, Dimension_Index dim);
+
+void ComplexTensorArray_ToComplexMatrix(ComplexTensorArray complexTensor, Dimension_Index dim, Cmplx** complexMatrix ) ;
+
+
+/* Define all Eigenvalue and Eigenvector functions for TensorArray's */
+
+void TensorArray_CalcAllEigenvalues( TensorArray tensor, Dimension_Index dim, ComplexEigenvector* eigenvectorList ) ;
+
+void TensorArray_CalcAllEigenvalues2D( TensorArray tensor, ComplexEigenvector* eigenvectorList ) ;
+void TensorArray_CalcAllEigenvalues3D( TensorArray tensor, ComplexEigenvector* eigenvectorList ) ;
+
+
+void TensorArray_CalcAllEigenvectors( TensorArray tensor, Dimension_Index dim, ComplexEigenvector* eigenvectorList );
+
+void TensorArray_CalcAllEigenvectors2D( TensorArray tensor, ComplexEigenvector* eigenvectorList ) ;
+void TensorArray_CalcAllEigenvectors3D( TensorArray tensor, ComplexEigenvector* eigenvectorList ) ;
+
+void TensorArray_CalcAllEigenFunctions(TensorArray tensor, Dimension_Index dim, Bool EigenFlag, ComplexEigenvector* eigenvectorList);
+
+/* Sorts the eigenvectors according to the value of the eigenvalue - from smallest to greatest */
+
+void ComplexEigenvectorList_Sort( ComplexEigenvector* eigenvectorList, Index count );
+
+
+/* Define print statements */
+
+/** Print a named ComplexTensorArray */
+#define Journal_PrintComplexTensorArray(stream, tensor, dim) \
+	do {	\
+		Journal_Printf( stream, #tensor " - \n" ); \
+		Journal_PrintComplexTensorArray_Unnamed( stream, tensor, dim ); \
+	} while(0) 
+
+void Journal_PrintComplexTensorArray_Unnamed( Stream* stream, ComplexTensorArray tensor, Dimension_Index dim ); 
+
+	/** Print a named ComplexMatrix */
+#define Journal_PrintComplexMatrix(stream, matrix, dim) \
+	do {	\
+		Journal_Printf( stream, #matrix " - \n" ); \
+		Journal_PrintComplexMatrix_Unnamed( stream, matrix, dim ); \
+	} while(0) 
+	
+void Journal_PrintComplexMatrix_Unnamed( Stream* stream, Cmplx** complexMatrix, Dimension_Index dim ) ;
+
+	
+	
+#endif /* __Domain_Geometry_FullTensorMath_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Geometry.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Geometry.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,79 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	External header file to this library.
+**
+** Assumptions:
+**	None so far.
+**
+** Comments:
+**	None so far.
+**
+** $Id: Geometry.h 4081 2007-04-27 06:20:07Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_h__
+#define __Domain_Geometry_h__
+	
+	#include "units.h"
+	#include "types.h"
+	#include "isinf.h"
+	#include "Dimension.h"
+	#include "VectorMath.h"
+	#include "TensorMath.h"
+	#include "TrigMath.h"
+	#include "ComplexMath.h"
+	#include "Plane.h"
+	#include "Edge.h"
+	#include "Line.h"
+	#include "RMatrix.h"
+	#include "Topology.h"
+	#include "IJKTopology.h"
+	#include "IJK6Topology.h"
+	#include "IJK26Topology.h"
+	#include "IrregTopology.h"
+	#include "GeometryClass.h"
+	#include "BlockGeometry.h"
+	#include "RefinedRegionsGeometry.h"
+	#include "ShellGeometry.h"
+	#include "IrregGeometry.h"
+	#include "QuadEdge.h"
+	#include "Delaunay.h"
+	#include "ParallelDelaunay.h"
+	#include "ComplexVectorMath.h"
+	#include "stg_lapack.h"
+	#include "FullTensorMath.h"
+	#include "TensorMultMath.h"
+	#include "Simplex.h"
+	#include "Hex.h"
+	#include "Init.h"
+	#include "Finalise.h"
+
+#endif /* __Domain_Geometry_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/GeometryClass.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/GeometryClass.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,157 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 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: GeometryClass.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "GeometryClass.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+
+/* Textual name of this class */
+const Type Geometry_Type = "Geometry";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+Geometry* _Geometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary )
+{
+	Geometry* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(Geometry) );
+	self = (Geometry*)_Stg_Component_New( _sizeOfSelf, type, _delete, _print, _copy, _defaultConstructor, _construct, _build, 
+			_initialise, _execute, _destroy, name, NON_GLOBAL );
+	
+	/* General info */
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	self->buildPoints = buildPoints;
+	self->pointAt = pointAt;
+	
+	/* Geometry info */
+	if( initFlag ){
+		_Geometry_Init( self );
+	}
+	
+	return self;
+}
+
+void _Geometry_Init(
+		Geometry*					self )
+{
+	/* General and Virtual info should already be set */
+	
+	/* Geometry info */
+	self->isConstructed = True;
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _Geometry_Delete( void* geometry ) {
+	Geometry* self = (Geometry*)geometry;
+	
+	/* Stg_Class_Delete parent */
+	_Stg_Class_Delete( self );
+}
+
+
+void _Geometry_Print( void* geometry, Stream* stream ) {
+	Geometry* self = (Geometry*)geometry;
+	
+	/* Set the Journal for printing informations */
+	Stream* geometryStream;
+	geometryStream = Journal_Register( InfoStream_Type, "GeometryStream" );
+
+	/* Print parent */
+	_Stg_Class_Print( self, stream );
+	
+	/* General info */
+	Journal_Printf( stream, "Geometry (ptr): (%p)\n", self );
+	
+	/* Virtual info */
+	
+	/* Geometry info */
+}
+
+
+void* _Geometry_Copy( void* geometry, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	Geometry*	self = (Geometry*)geometry;
+	Geometry*	newGeometry;
+	
+	newGeometry = (Geometry*)_Stg_Class_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	/* Virtual methods */
+	newGeometry->buildPoints = self->buildPoints;
+	newGeometry->pointAt = self->pointAt;
+	
+	newGeometry->pointCount = self->pointCount;
+	
+	return (void*)newGeometry;
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/GeometryClass.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/GeometryClass.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,122 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: GeometryClass.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_GeometryClass_h__
+#define __Domain_Geometry_GeometryClass_h__
+
+	/* Virtual function types */
+	typedef void	(Geometry_BuildPointsFunction)	( void* geometry, Coord_List points );
+	typedef void	(Geometry_PointAtFunction)	( void* geometry, Index index, Coord point );
+	
+	/* Textual name of this class */
+	extern const Type Geometry_Type;
+
+	/* Geometry information */
+	#define __Geometry \
+		/* General info */ \
+		__Stg_Component \
+		Dictionary*				dictionary; \
+		\
+		/* Virtual info */ \
+		Geometry_BuildPointsFunction*		buildPoints; \
+		Geometry_PointAtFunction*		pointAt; \
+		\
+		/* Geometry info ... */ \
+		Index					pointCount;
+	struct Geometry { __Geometry };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/* Creation implementation */
+	Geometry* _Geometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary );
+	
+	/* Initialisation implementation functions */
+	void _Geometry_Init(
+		Geometry*					self );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions ) {
+	IrregTopology* self = (IrregTopology*)ir
+	*/
+	
+	/* Stg_Class_Delete Geometry implementation */
+	void _Geometry_Delete( void* geometry );
+	
+	/* Print Geometry implementation */
+	void _Geometry_Print( void* geometry, Stream* stream );
+	
+	/* Copy */
+	#define Geometry_Copy( self ) \
+		(Geometry*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define Geometry_DeepCopy( self ) \
+		(Geometry*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	
+	void* _Geometry_Copy( void* geometry, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	
+	
+#endif /* __Domain_Geometry_GeometryClass_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/GeometryClass.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/GeometryClass.meta	Wed Oct 10 07:21:38 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">Geometry</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</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">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Hex.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Hex.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,64 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Simplex.c 3584 2006-05-16 11:11:07Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <mpi.h>
+
+#include "StGermain/StGermain.h"
+#include "Geometry.h"
+
+
+double Hex_Volume( double** verts, unsigned* inc, unsigned* inds ) {
+	static const unsigned	nTets = 5;
+	static const unsigned	tets[5][4] = {{0, 1, 2, 4}, 
+					      {1, 2, 3, 7}, 
+					      {1, 4, 5, 7}, 
+					      {2, 4, 6, 7}, 
+					      {1, 2, 4, 7}};
+	unsigned		curTet[4];
+	double			vol;
+	unsigned		tet_i, ind_i;
+
+	assert( verts );
+	assert( inc );
+	assert( inds );
+
+	vol = 0.0;
+	for( tet_i = 0; tet_i < nTets; tet_i++ ) {
+		for( ind_i = 0; ind_i < 4; ind_i++ )
+			curTet[ind_i] = inds[tets[tet_i][ind_i]];
+		vol += Simplex_Volume( verts, inc, curTet );
+	}
+
+	return vol;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Hex.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Hex.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,46 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Invariants:
+**
+** Comments:
+**
+** $Id: Hex.h 3584 2006-05-16 11:11:07Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Hex_h__
+#define __Domain_Geometry_Hex_h__
+
+	double Hex_Volume( double** verts, unsigned* inc, unsigned* inds );
+
+#endif /* __Domain_Geometry_Hex_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IJK26Topology.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IJK26Topology.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,535 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: IJK26Topology.c 3882 2006-10-26 04:41:18Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "Topology.h"
+#include "IJKTopology.h"
+#include "IJK26Topology.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <assert.h>
+
+
+/* Textual name of this class */
+const Type IJK26Topology_Type = "IJK26Topology";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+IJK26Topology* IJK26Topology_DefaultNew( Name name )
+{
+	return (IJK26Topology*)_IJKTopology_New( 
+		sizeof(IJK26Topology), 
+		IJK26Topology_Type, 
+		_IJK26Topology_Delete, 
+		_IJK26Topology_Print,
+		_IJKTopology_Copy,
+		(Stg_Component_DefaultConstructorFunction*)IJK26Topology_DefaultNew,
+		_IJK26Topology_Construct,
+		_IJK26Topology_Build,
+		_IJK26Topology_Initialise,
+		_IJK26Topology_Execute,
+		_IJK26Topology_Destroy,
+		name,
+		False,
+		_IJK26Topology_NeighbourCount,
+		_IJK26Topology_BuildNeighbours,
+		NULL,
+		NULL,
+		NULL );
+}
+
+IJK26Topology* IJK26Topology_New_All(
+		Name						name,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] )
+{
+	return _IJK26Topology_New( 
+		sizeof(IJK26Topology), 
+		IJK26Topology_Type, 
+		_IJK26Topology_Delete, 
+		_IJK26Topology_Print,
+		_IJKTopology_Copy,
+		(Stg_Component_DefaultConstructorFunction*)IJK26Topology_DefaultNew,
+		_IJK26Topology_Construct,
+		_IJK26Topology_Build,
+		_IJK26Topology_Initialise,
+		_IJK26Topology_Execute,
+		_IJK26Topology_Destroy,
+		name,
+		True,
+		_IJK26Topology_NeighbourCount,
+		_IJK26Topology_BuildNeighbours,
+		dictionary,
+		size,
+		isPeriodic );
+}
+
+
+void IJK26Topology_Init(
+		IJK26Topology*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] )
+{
+	/* General info */
+	self->type = IJK26Topology_Type;
+	self->_sizeOfSelf = sizeof(IJK26Topology);
+	self->_deleteSelf = False;
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	self->_delete = _IJK26Topology_Delete;
+	self->_print = _IJK26Topology_Print;
+	self->_copy = _IJKTopology_Copy;
+	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)IJK26Topology_DefaultNew;
+	self->_construct = _IJK26Topology_Construct;
+	self->_build = _IJK26Topology_Build;
+	self->_initialise = _IJK26Topology_Initialise;
+	self->_execute = _IJK26Topology_Execute;
+	self->_destroy = _IJK26Topology_Destroy;
+	self->neighbourCount = _IJK26Topology_NeighbourCount;
+	self->buildNeighbours = _IJK26Topology_BuildNeighbours;
+	
+	_Stg_Class_Init( (Stg_Class*)self );
+	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+	_Stg_Component_Init( (Stg_Component*)self );
+
+	/* IJK26Topology info */
+	_Topology_Init( (Topology*)self );
+	_IJKTopology_Init( (IJKTopology*)self, size, isPeriodic, False );
+	_IJK26Topology_Init( self, True );
+}
+
+
+IJK26Topology* _IJK26Topology_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,
+		Topology_NeighbourCountFunction*		neighbourCount,
+		Topology_BuildNeighboursFunction*		buildNeighbours,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] )
+{
+	IJK26Topology* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(IJK26Topology) );
+	self = (IJK26Topology*)_IJKTopology_New( _sizeOfSelf, type, _delete, _print, _copy, _defaultConstructor,
+			_construct, _build, _initialise, _execute, _destroy, name, initFlag, neighbourCount, buildNeighbours,
+			dictionary, size, isPeriodic );
+	
+	/* General info */
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	
+	/* IJK26Topology info */
+	if( initFlag ){
+		_IJK26Topology_Init( self, True );
+	}
+	
+	return self;
+}
+
+
+void _IJK26Topology_Init( IJK26Topology* self, Bool shiftNegOne )
+{
+	Index i;
+
+	if (self->dictionary) {
+		self->isConstructed = True;
+
+		/* Since the default is for elements, do a slight adjustment */
+		for (i=I_AXIS; i < 3; i++ ) {
+			if (shiftNegOne)
+				self->size[i] -= 1;
+
+			if ( self->size[i] == 0 )
+				self->size[i] = 1;
+		}
+		
+		self->indexCount = self->size[I_AXIS] * self->size[J_AXIS] * self->size[K_AXIS];
+		assert( self->indexCount );
+	}
+
+	return;
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _IJK26Topology_Delete( void* ijk26Topology ) {
+	IJK26Topology* self = (IJK26Topology*)ijk26Topology;
+	
+	/* Stg_Class_Delete parent */
+	_IJKTopology_Delete( self );
+}
+
+
+void _IJK26Topology_Print( void* ijk26Topology, Stream* stream ) {
+	IJK26Topology* self = (IJK26Topology*)ijk26Topology;
+	
+	/* Set the Journal for printing informations */
+	Stream* ijk26TopologyStream = Journal_Register( InfoStream_Type, "IJK26TopologyStream" );
+
+	/* Print parent */
+	_Topology_Print( self, stream );
+	
+	/* General info */
+	Journal_Printf( ijk26TopologyStream, "IJK26Topology (ptr): (%p)\n", self );
+	
+	/* Virtual info */
+	
+	/* IJK26Topology info */
+}
+
+void _IJK26Topology_Construct( void* ijk26Topology, Stg_ComponentFactory* cf, void* data ){
+	IJK26Topology *self = (IJK26Topology*)ijk26Topology;
+
+	_IJKTopology_Construct( self, cf, data );
+
+	/* No shifting sizes of topology because no assumption is made about elements */
+	_IJK26Topology_Init( self, False );
+}
+
+void _IJK26Topology_Build( void* ijk26Topology, void* data ){
+	
+}
+	
+void _IJK26Topology_Initialise( void* ijk26Topology, void* data ){
+	
+}
+	
+void _IJK26Topology_Execute( void* ijk26Topology, void* data ){
+	
+}
+	
+void _IJK26Topology_Destroy( void* ijk26Topology, void* data ){
+	
+}
+
+/* See header file for docs */
+NeighbourIndex _IJK26Topology_NeighbourCount( void* ijk26Topology, Index index ) {
+	IJK26Topology*  self = (IJK26Topology*)ijk26Topology;
+	IJK		max;		/* init later */
+	IJK		nbrPerDim = { 3, 3, 3 };
+	IJK		refObject;
+	Index	i;
+	
+	max[0] = self->size[I_AXIS] - 1;
+	max[1] = self->size[J_AXIS] - 1;
+	max[2] = self->size[K_AXIS] - 1;
+	 
+	IJK_1DTo3D( self, index, refObject );
+	
+	for( i=I_AXIS; i < 3; i++ ) {
+
+		if( 0 == max[i] )
+			nbrPerDim[i] = 1;
+
+		/* Ok given there is actually more than one item in this dim:
+		only if we are using "dynamic sizes" ie just want the good values to
+		be returned from BuildNeighbours and don't want entries in the array with
+		an INVALID tag, do we need to see if the size should be reduced */
+		else if( self->dynamicSizes ) {
+			if ( ( False == self->isPeriodic[i] )
+				&& (refObject[i] == 0 || refObject[i] == max[i]) )
+			{
+				nbrPerDim[i]--;
+			}	
+		}	
+	}	
+	
+	return nbrPerDim[I_AXIS] * nbrPerDim[J_AXIS] * nbrPerDim[K_AXIS] - 1;
+}
+
+
+void _IJK26Topology_BuildNeighbours( void* ijk26Topology, Index index, NeighbourIndex* neighbours )
+{
+	IJK26Topology*	self = (IJK26Topology*)ijk26Topology;
+	IJK		max; 		/* init later */
+	IJK		refObject;
+	Index		pos = 0;
+	int		nbrRelative[3];
+	Index	dim_I;
+	Bool	nbrExists = True;
+
+	max[0] = self->size[0] - 1;
+	max[1] = self->size[1] - 1;
+	max[2] = self->size[2] - 1;
+
+	IJK_1DTo3D( self, index, refObject );
+
+	/* For each neighbour position relative to the reference object */
+	for ( nbrRelative[K_AXIS] = -1; nbrRelative[K_AXIS] <= 1; nbrRelative[K_AXIS] ++ ) {
+		if ( (0 == max[K_AXIS]) && (nbrRelative[K_AXIS] != 0) ) continue; 
+		
+		for ( nbrRelative[J_AXIS] = -1; nbrRelative[J_AXIS] <= 1; nbrRelative[J_AXIS]++ ) {
+			if ( (0 == max[J_AXIS]) && (nbrRelative[J_AXIS] != 0) ) continue; 
+		
+			for ( nbrRelative[I_AXIS] = -1; nbrRelative[I_AXIS] <= 1; nbrRelative[I_AXIS]++ ) {
+				if ( (0 == max[I_AXIS]) && (nbrRelative[I_AXIS] != 0) ) continue; 
+
+				if ( ( 0 == nbrRelative[I_AXIS] ) && ( 0 == nbrRelative[J_AXIS] ) && ( 0 == nbrRelative[K_AXIS] )  ) {
+					continue;
+				}
+				
+				nbrExists = True;
+				/* Test if the neigbour exists or not, and modify the index appropriately */
+				for ( dim_I=0; dim_I < 3; dim_I++ ) {
+					if ( (False == self->isPeriodic[dim_I] ) &&
+						( (( refObject[dim_I] == 0 ) && (-1 == nbrRelative[dim_I] )) ||
+						(( refObject[dim_I] == max[dim_I] ) && (1 == nbrRelative[dim_I] )) ) )
+					{
+						nbrExists = False;
+						break;
+					}
+				}	
+				if (nbrExists) {
+					IJK     nbrPos;
+					Dimension_Index	innerDim_I;
+				
+					/* Find out the object's number */
+
+					for ( innerDim_I=0; innerDim_I < 3; innerDim_I++ ) {
+						if ( self->isPeriodic[innerDim_I] && (refObject[innerDim_I] == 0)
+							&& (-1 == nbrRelative[innerDim_I] ) )
+						{
+							nbrPos[innerDim_I] = max[innerDim_I];
+						}
+						else if ( self->isPeriodic[innerDim_I]
+							&& (refObject[innerDim_I] == max[innerDim_I] )
+							&& (1 == nbrRelative[innerDim_I] ) )
+						{
+							nbrPos[innerDim_I] = 0;
+						}
+						else {
+							nbrPos[innerDim_I] = refObject[innerDim_I] + nbrRelative[innerDim_I];
+						}
+					}	
+					
+					IJK_3DTo1D_3( self, 
+						nbrPos[I_AXIS],
+						nbrPos[J_AXIS],
+						nbrPos[K_AXIS],
+						&neighbours[pos] );
+					pos++;
+				}
+				else {
+					if( False == self->dynamicSizes ) {
+						/* Set the object to invalid if using dynamic sizes */
+						neighbours[pos] = Topology_Invalid( self );
+						pos++;
+					}	
+				}
+			}	
+		}	
+	}
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+void IJK26Topology_PrintNeighboursOfIndex( IJK26Topology* self, Index refIndex, Stream* stream ) {
+	NeighbourIndex nbrCount;
+	NeighbourIndex* neighbours;
+
+	nbrCount = Topology_NeighbourCount( self, refIndex );
+	neighbours = Memory_Alloc_Array( NeighbourIndex, nbrCount, "neighbours" );
+	Topology_BuildNeighbours( self, refIndex, neighbours );
+	
+	IJK26Topology_PrintNeighbourOfIndexFromArray( self, refIndex, neighbours, nbrCount, stream );
+	Memory_Free( neighbours );
+}
+
+
+void IJK26Topology_PrintNeighbourOfIndexFromArray(
+		IJK26Topology* self,
+		Index refIndex,
+		NeighbourIndex* neighbours,
+		NeighbourIndex nbrCount,
+		Stream* stream )
+{		
+	if ( True == self->dynamicSizes )
+	{
+		Index nbr_I;
+
+		Journal_Printf( stream, "[%d] = {", nbrCount );
+		for ( nbr_I=0; nbr_I < nbrCount; nbr_I++ ) {
+			Journal_Printf( stream, "%d", neighbours[nbr_I] );
+			if ( neighbours[nbr_I] == Topology_Invalid( self ) ) {
+				Journal_Printf( stream, "(Inv)");
+			}
+			Journal_Printf( stream, ", ");
+		}
+		Journal_Printf( stream, "}\n" );
+	} 
+	else {
+		Dimension_Index  dimension = 0;
+		Dimension_Index  dim_I=0;
+
+		for ( dim_I=0; dim_I < 3; dim_I++ ) {
+			if (self->size[dim_I] > 1) {
+				dimension++;
+			}
+		}
+		if ( 0 == dimension ) {
+			Journal_Printf( stream, "|" );
+			Journal_Printf( stream, "(%3d  )", refIndex );
+			Journal_Printf( stream, "|" );
+			Journal_Printf( stream, "\n" );
+		}
+		else if ( 1 == dimension ) {
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintMiddleRow( self, neighbours, 0, refIndex, 1, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+		}
+		else if ( 2 == dimension ) {
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 5, 6, 7, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintMiddleRow( self, neighbours, 3, refIndex, 4, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 0, 1, 2, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+		}
+		else {
+			/* 3D: do it in 3 separate goes: */
+			Journal_Printf( stream, "-1 in 3rd dim plane\n" );
+			Stream_Indent( stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 6, 7, 8, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 3, 4, 5, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 0, 1, 2, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			Stream_UnIndent( stream );
+			Journal_Printf( stream, "ref item's plane in 3rd dim\n" );
+			Stream_Indent( stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 14, 15, 16, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintMiddleRow( self, neighbours, 12, refIndex, 13, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 9, 10, 11, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			Stream_UnIndent( stream );
+			Journal_Printf( stream, "+1 3rd dim\n" );
+			Stream_Indent( stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 23, 24, 25, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 20, 21, 22, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			IJK26Topology_PrintNormalRow( self, neighbours, 17, 18, 19, stream );
+			IJK26Topology_PrintRowSeparator( self, stream );
+			Stream_UnIndent( stream );
+		}
+	}
+}	
+
+
+void IJK26Topology_PrintRowSeparator( IJK26Topology* self, Stream* stream ) {  	
+	Journal_Printf( stream, "-------------------------\n" );
+}
+
+
+void IJK26Topology_PrintNeighbour( IJK26Topology* topology, Index itemIndex, Stream* stream ) {  	
+	if ( itemIndex == Topology_Invalid( topology ) ) {
+		Journal_Printf( stream, "   X   ", itemIndex );
+	}
+	else {	
+		Journal_Printf( stream, "%4d   ", itemIndex );
+	}
+}	
+
+
+void IJK26Topology_PrintNormalRow( IJK26Topology* topology, NeighbourIndex* neighbours,
+		Index nbr1, Index nbr2, Index nbr3, Stream* stream )
+{
+	/* Do middle row */
+	Journal_Printf( stream, "|" );
+	IJK26Topology_PrintNeighbour( topology, neighbours[nbr1], stream );
+	Journal_Printf( stream, "|" );
+	IJK26Topology_PrintNeighbour( topology, neighbours[nbr2], stream );
+	Journal_Printf( stream, "|" );
+	IJK26Topology_PrintNeighbour( topology, neighbours[nbr3], stream );
+	Journal_Printf( stream, "|" );
+	Journal_Printf( stream, "\n" );
+}
+
+
+void IJK26Topology_PrintMiddleRow( IJK26Topology* topology, NeighbourIndex* neighbours,
+		Index leftNbr, Index refPos, Index rightNbr, Stream* stream )
+{
+	/* Do middle row */
+	Journal_Printf( stream, "|" );
+	IJK26Topology_PrintNeighbour( topology, neighbours[leftNbr], stream );
+	Journal_Printf( stream, "|" );
+	/* represents the current one */
+	Journal_Printf( stream, "(%3d  )", refPos );
+	Journal_Printf( stream, "|" );
+	IJK26Topology_PrintNeighbour( topology, neighbours[rightNbr], stream );
+	Journal_Printf( stream, "|" );
+	Journal_Printf( stream, "\n" );
+}
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IJK26Topology.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IJK26Topology.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,166 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	Concrete IJKTopology class for elements or nodes with 26 neighbours
+**	(all directions, including diagonals).
+**
+** Assumptions:
+**
+** Comments:
+** Refactored by PatrickSunter on 7th July 2004 for easier readability.
+**
+** $Id: IJK26Topology.h 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_IJK26Topology_h__
+#define __Domain_Geometry_IJK26Topology_h__
+
+	/* Virtual function types */
+	
+	/** Textual name of this class */
+	extern const Type IJK26Topology_Type;
+
+	/** IJK26Topology class contents (see IJK26Topology) */
+	#define __IJK26Topology \
+		/* General info */ \
+		__IJKTopology \
+		\
+	
+	/**	Handles the 3D topology for an element/node, with 26 neighbours - see IJK26Topology.h.
+	That file has full information on the class and its member functions. */
+	struct IJK26Topology { __IJK26Topology };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/** Create a IJK26Topology, using the sizes in the dictionary */
+	#define IJK26Topology_New( name, dictionary ) \
+		IJK26Topology_New_All( name, dictionary, NULL, NULL )
+	
+	/** Create a IJK26Topology */
+	IJK26Topology* IJK26Topology_DefaultNew( Name name );
+	
+	IJK26Topology* IJK26Topology_New_All(
+		Name						name,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] );
+	
+	/** Initialise a IJK26Topology */
+	void IJK26Topology_Init(
+		IJK26Topology*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] );
+	
+	/** Creation implementation */
+	IJK26Topology* _IJK26Topology_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,
+		Topology_NeighbourCountFunction*		neighbourCount,
+		Topology_BuildNeighboursFunction*		buildNeighbours,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] );
+	
+	/** Initialises members. Uses IJKTopology_Init(), but behaviour is different
+	if the mesh sizes are read from the dictionary: for the IJK26 system we assume
+	the topology relates to elements, and thus 1 is subtracted from each of the
+	total node numbers per dimension read from the dictionary. */
+	void _IJK26Topology_Init( IJK26Topology* self, Bool shiftNegOne );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/** Stg_Class_Delete() implementation */
+	void _IJK26Topology_Delete( void* ijk26Topology );
+	
+	/** Stg_Class_Print() implementation */
+	void _IJK26Topology_Print( void* ijk26Topology, Stream* stream );
+	
+	void _IJK26Topology_Construct( void* ijk26Topology, Stg_ComponentFactory* cf, void* data );
+	
+	void _IJK26Topology_Build( void* ijk26Topology, void* data );
+	
+	void _IJK26Topology_Initialise( void* ijk26Topology, void* data );
+	
+	void _IJK26Topology_Execute( void* ijk26Topology, void* data );
+	
+	void _IJK26Topology_Destroy( void* ijk26Topology, void* data );
+	
+	/** Topology_NeighbourCount() implementation. */
+	NeighbourIndex _IJK26Topology_NeighbourCount( void* ijk26Topology, Index index );
+	
+	/** Topology_BuildNeighbours() implementation. */
+	void _IJK26Topology_BuildNeighbours( void* ijk26Topology, Index index, NeighbourIndex* neighbours );
+	
+	/* ******************** Public Functions ********************* */
+
+	/** Handy little function to print the neighbours of an item in an easy to read manner using
+		high-tech ASCII art techniques ;) */
+	void IJK26Topology_PrintNeighboursOfIndex( IJK26Topology* topology, Index index, Stream* stream );
+
+	/** Version of IJKTopology_PrintNeighboursOfIndex() for when you already have generated the nbr array */
+	void IJK26Topology_PrintNeighbourOfIndexFromArray( IJK26Topology* topology, Index index,
+		NeighbourIndex* neighbours, NeighbourIndex neighbourCount, Stream* stream );
+	
+	/* TODO: it would be cool to have a little ASCII art function to print the whole topology layout too
+		for 2D topologies, including some special symbols for periodicity too. */
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	
+	/* Some little utility functions for printing the nbr info */
+	
+	void IJK26Topology_PrintRowSeparator( IJK26Topology* self, Stream* stream );
+	void IJK26Topology_PrintNeighbour( IJK26Topology* topology, Index itemIndex, Stream* stream );
+	void IJK26Topology_PrintNormalRow( IJK26Topology* topology, NeighbourIndex* neighbours,
+		Index nbr1, Index nbr2, Index nbr3, Stream* stream );
+	void IJK26Topology_PrintMiddleRow( IJK26Topology* topology, NeighbourIndex* neighbours,
+		Index leftNbr, Index refPos, Index rightNbr, Stream* stream );	
+	
+#endif /* __Domain_Geometry_IJK26Topology_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IJK26Topology.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IJK26Topology.meta	Wed Oct 10 07:21:38 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">IJK26Topology</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">IJKTopology</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 9f22ec4f42ee -r 5667007f4799 Geometry/src/IJK6Topology.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IJK6Topology.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,345 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: IJK6Topology.c 3882 2006-10-26 04:41:18Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "Topology.h"
+#include "IJKTopology.h"
+#include "IJK6Topology.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+
+
+/* Textual name of this class */
+const Type IJK6Topology_Type = "IJK6Topology";
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+IJK6Topology* IJK6Topology_DefaultNew( Name name )
+{
+	return _IJK6Topology_New( 
+		sizeof(IJK6Topology), 
+		IJK6Topology_Type, 
+		_IJK6Topology_Delete, 
+		_IJK6Topology_Print,
+		_IJKTopology_Copy,
+                (Stg_Component_DefaultConstructorFunction*)IJK6Topology_DefaultNew,
+		_IJK6Topology_Construct,
+		_IJK6Topology_Build,
+		_IJK6Topology_Initialise,
+		_IJK6Topology_Execute,
+		_IJK6Topology_Destroy,
+		name,
+		False,
+		_IJK6Topology_NeighbourCount,
+		_IJK6Topology_BuildNeighbours,
+		NULL,
+		NULL,
+		NULL );
+}
+
+IJK6Topology* IJK6Topology_New_All(
+		Name						name,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] )
+{
+	return _IJK6Topology_New( 
+		sizeof(IJK6Topology), 
+		IJK6Topology_Type, 
+		_IJK6Topology_Delete, 
+		_IJK6Topology_Print,
+		_IJKTopology_Copy,
+		(Stg_Component_DefaultConstructorFunction*)IJK6Topology_DefaultNew,
+		_IJK6Topology_Construct,
+		_IJK6Topology_Build,
+		_IJK6Topology_Initialise,
+		_IJK6Topology_Execute,
+		_IJK6Topology_Destroy,
+		name,
+		True,
+		_IJK6Topology_NeighbourCount,
+		_IJK6Topology_BuildNeighbours,
+		dictionary,
+		size,
+		isPeriodic );
+}
+
+void IJK6Topology_Init(
+		IJK6Topology*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] )
+{
+	/* General info */
+	self->type = IJK6Topology_Type;
+	self->_sizeOfSelf = sizeof(IJK6Topology);
+	self->_deleteSelf = False;
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	self->_delete = _IJK6Topology_Delete;
+	self->_print = _IJK6Topology_Print;
+	self->_copy = _IJKTopology_Copy;
+	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)IJK6Topology_DefaultNew;
+	self->_construct = _IJK6Topology_Construct;
+	self->_build = _IJK6Topology_Build,
+	self->_initialise = _IJK6Topology_Initialise;
+	self->_execute = _IJK6Topology_Execute;
+	self->_destroy = _IJK6Topology_Destroy;
+	self->neighbourCount = _IJK6Topology_NeighbourCount;
+	self->buildNeighbours = _IJK6Topology_BuildNeighbours;
+
+	_Stg_Class_Init( (Stg_Class*)self );
+	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+	_Stg_Component_Init( (Stg_Component*)self );
+	
+	/* IJK6Topology info */
+	_Topology_Init( (Topology*)self );
+	_IJKTopology_Init( (IJKTopology*)self, size, isPeriodic, False );
+	_IJK6Topology_Init( self );
+}
+
+
+IJK6Topology* _IJK6Topology_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,
+		Topology_NeighbourCountFunction*		neighbourCount,
+		Topology_BuildNeighboursFunction*		buildNeighbours,
+		Dictionary*					dictionary,
+		IJK					size,
+		Bool					isPeriodic[3] )
+{
+	IJK6Topology* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(IJK6Topology) );
+	self = (IJK6Topology*)_IJKTopology_New( _sizeOfSelf, type, _delete, _print, _copy, _defaultConstructor,
+			_construct, _build, _initialise, _execute, _destroy, name, initFlag, neighbourCount, buildNeighbours,
+			dictionary, size, isPeriodic );
+
+	/* General info */
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	
+	/* IJK6Topology info */
+	if( initFlag ){
+		_IJK6Topology_Init( self );
+	}
+	
+	return self;
+}
+
+void _IJK6Topology_Init(
+		IJK6Topology*					self )
+{
+	self->isConstructed = True;
+	return;
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _IJK6Topology_Delete( void* ijk6Topology ) {
+	IJK6Topology* self = (IJK6Topology*)ijk6Topology;
+	
+	/* Stg_Class_Delete parent */
+	_Topology_Delete( self );
+}
+
+
+void _IJK6Topology_Print( void* ijk6Topology, Stream* stream ) {
+	IJK6Topology* self = (IJK6Topology*)ijk6Topology;
+	
+	/* Set the Journal for printing informations */
+	Stream* ijk6TopologyStream = Journal_Register( InfoStream_Type, "IJK6TopologyStream" );
+
+	/* Print parent */
+	_Topology_Print( self, stream );
+	
+	/* General info */
+	Journal_Printf( ijk6TopologyStream, "IJK6Topology (ptr): (%p)\n", self );
+	
+	/* Virtual info */
+	
+	/* IJK6Topology info */
+}
+
+void _IJK6Topology_Construct( void* ijk6Topology, Stg_ComponentFactory* cf, void* data ){
+	IJK6Topology *self = (IJK6Topology*)ijk6Topology;
+
+	_IJKTopology_Construct( self, cf, data );
+	_IJK6Topology_Init( self );
+}
+
+void _IJK6Topology_Build( void* ijk6Topology, void* data ){
+	
+}
+	
+void _IJK6Topology_Initialise( void* ijk6Topology, void* data ){
+	
+}
+	
+void _IJK6Topology_Execute( void* ijk6Topology, void* data ){
+	
+}
+	
+void _IJK6Topology_Destroy( void* ijk6Topology, void* data ){
+	
+}
+
+NeighbourIndex _IJK6Topology_NeighbourCount( void* ijk6Topology, Index index ) {
+	IJK6Topology*   self = (IJK6Topology*)ijk6Topology;
+	IJK		max;			/* init later */
+	Index		nbrCnt = 6;
+	Index		dim_I;
+	IJK		refObject;
+	int		nbrRelative[3];
+	int		sign;
+	
+	max[0] = self->size[0]-1;
+	max[1] = self->size[1]-1;
+	max[2] = self->size[2]-1;
+	 
+	IJK_1DTo3D( self, index, refObject );
+
+	for ( sign = 1; sign >= -1; sign -= 2 ) {
+		for (dim_I=I_AXIS; dim_I < 3; dim_I++) {
+			if( self->size[dim_I] == 1 ) {
+				nbrCnt--;
+				continue;
+			}	
+
+			if( True == self->dynamicSizes ) {
+				nbrRelative[I_AXIS] = nbrRelative[J_AXIS] = nbrRelative[K_AXIS] = 0;
+				nbrRelative[dim_I] = sign;
+
+				if ( ( False == self->isPeriodic[dim_I] ) &&
+					( (( refObject[dim_I] == 0 ) && (-1 == nbrRelative[dim_I] ) ) ||
+					(( refObject[dim_I] == max[dim_I] ) && (1 == nbrRelative[dim_I] )) ) )
+				{
+					nbrCnt--;
+				}
+			}	
+		}
+	}	
+	
+	return nbrCnt;
+}
+
+
+void _IJK6Topology_BuildNeighbours( void* ijk6Topology, Index index, NeighbourIndex* neighbours )
+{
+	IJK6Topology*	self = (IJK6Topology*)ijk6Topology;
+	IJK		max;			/* init later */
+	int		sign;
+	Index	dim_I;
+	IJK		refObject;
+	int		nbrRelative[3];
+	Index	pos = 0;
+	
+	max[0] = self->size[0]-1;
+	max[1] = self->size[1]-1;
+	max[2] = self->size[2]-1;
+ 
+	IJK_1DTo3D( self, index, refObject );
+
+	for ( sign = 1; sign >= -1; sign -= 2 ) {
+		for ( dim_I = I_AXIS; dim_I < 3; dim_I++ ) {
+			if ( 0 == max[dim_I] ) continue;
+		
+			nbrRelative[I_AXIS] = nbrRelative[J_AXIS] = nbrRelative[K_AXIS] = 0;
+			nbrRelative[dim_I] = sign;
+
+			if ( ( False == self->isPeriodic[dim_I] ) &&
+				( ( ( refObject[dim_I] == 0 ) && (-1 == nbrRelative[dim_I] ) ) ||
+				( ( refObject[dim_I] == max[dim_I] ) && (1 == nbrRelative[dim_I] ) ) ) )
+			{
+				if( False == self->dynamicSizes ) {
+					/* Set the object to invalid if using dynamic sizes */
+					neighbours[pos] = Topology_Invalid( self );
+					pos++;
+				}	
+			}
+			else {
+				IJK nbrPos;
+				Dimension_Index	innerDim_I;
+
+				for ( innerDim_I=0; innerDim_I < 3; innerDim_I++ ) {
+					if ( self->isPeriodic[innerDim_I] && (refObject[innerDim_I] == 0)
+						&& (-1 == nbrRelative[innerDim_I] ) )
+					{
+						nbrPos[innerDim_I] = max[innerDim_I];
+					}
+					else if ( self->isPeriodic[innerDim_I] && (refObject[innerDim_I] == max[innerDim_I] )
+						&& (1 == nbrRelative[innerDim_I] ) )
+					{
+						nbrPos[innerDim_I] = 0;
+					}
+					else {
+						nbrPos[innerDim_I] = refObject[innerDim_I] + nbrRelative[innerDim_I];
+					}
+				}	
+
+				IJK_3DTo1D_3( self, 
+					nbrPos[I_AXIS],
+					nbrPos[J_AXIS],
+					nbrPos[K_AXIS],
+					&neighbours[pos] );
+				pos++;
+			}
+		}
+	}	
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IJK6Topology.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IJK6Topology.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,158 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	Concrete IJKTopology class for element or node with 6 neighbours
+**	(only fully adjoining directions, no diagonals).
+**
+** Assumptions:
+**
+** Comments:
+**	In this topology, the ordering goes:
+**	---In 3D---
+**	0:+ve I, 1:+ve J, 2:+ve K, 3:-ve I, 4:-ve J, 5:-ve K
+**
+**  ---In 2D---
+**  In 2D, the same convention applies, except the missing dimension is
+**	skipped. Eg if there was no K dimension:
+**	0:+ve I, 1:+ve J, 2: -ve I, 3: -ve J
+**
+**	TODO: Add a link to a TWiki page with a diagram.
+**
+** $Id: IJK6Topology.h 3851 2006-10-12 08:57:22Z SteveQuenette $
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_IJK6Topology_h__
+#define __Domain_Geometry_IJK6Topology_h__
+
+	/* Virtual function types */
+	
+	/* Textual name of this class */
+	extern const Type IJK6Topology_Type;
+
+	/** IJK6Topology class contents */
+	#define __IJK6Topology \
+		/* General info */ \
+		__IJKTopology \
+
+	/**	Concrete IJKTopology class for element or node with 6 neighbours
+	- see IJK6Topology.h for member functions. */
+	struct IJK6Topology { __IJK6Topology };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/** Create an IJK6Topology, using the dictonary */
+	#define IJK6Topology_New( name, dictionary ) \
+		IJK6Topology_New_All( name, dictionary, NULL, NULL )
+	
+	/** Create an IJK6Topology */
+	
+	IJK6Topology* IJK6Topology_DefaultNew( Name name );
+	
+	IJK6Topology* IJK6Topology_New_All(
+		Name						name,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] );
+
+	/** Initialise an IJK6Topology */
+	void IJK6Topology_Init(
+		IJK6Topology*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] );
+
+	
+	/** Creation implementation */
+	IJK6Topology* _IJK6Topology_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,
+		Topology_NeighbourCountFunction*		neighbourCount,
+		Topology_BuildNeighboursFunction*		buildNeighbours,
+		Dictionary*					dictionary,
+		IJK					size,
+		Bool						isPeriodic[3] );
+
+	/** Initialisation implementation */
+	void _IJK6Topology_Init(
+		IJK6Topology*					self );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/** Stg_Class_Delete() implementation */
+	void _IJK6Topology_Delete( void* ijk6Topology );
+	
+	/** Stg_Class_Print() implementation */
+	void _IJK6Topology_Print( void* ijk6Topology, Stream* stream );
+	
+	void _IJK6Topology_Construct( void* ijk6Topology, Stg_ComponentFactory* cf, void* data );
+	
+	void _IJK6Topology_Build( void* ijk6Topology, void* data );
+	
+	void _IJK6Topology_Initialise( void* ijk6Topology, void* data );
+	
+	void _IJK6Topology_Execute( void* ijk6Topology, void* data );
+	
+	void _IJK6Topology_Destroy( void* ijk6Topology, void* data );
+	
+	/** Topology_NeighbourCount() implementation. */
+	NeighbourIndex _IJK6Topology_NeighbourCount( void* ijk6Topology, Index index );
+	
+	/** Topology_BuildNeighbours() implementation. */
+	void _IJK6Topology_BuildNeighbours( void* ijk6Topology, Index index, NeighbourIndex* neighbours );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	
+	
+#endif /* __Domain_Geometry_IJK6Topology_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IJK6Topology.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IJK6Topology.meta	Wed Oct 10 07:21:38 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">IJK6Topology</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">IJKTopology</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 9f22ec4f42ee -r 5667007f4799 Geometry/src/IJKTopology.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IJKTopology.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,249 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: IJKTopology.c 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "Topology.h"
+#include "IJKTopology.h"
+
+#include "Geometry.h"
+#include "BlockGeometry.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <assert.h>
+
+
+/* Textual name of this class */
+const Type IJKTopology_Type = "IJKTopology";
+
+const char IJKTopology_DimNumToDimLetter[3] = { 'I', 'J', 'K' };
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+IJKTopology* _IJKTopology_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,
+		Topology_NeighbourCountFunction*		neighbourCount,
+		Topology_BuildNeighboursFunction*		buildNeighbours,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool						isPeriodic[3] )
+{
+	IJKTopology* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(IJKTopology) );
+	self = (IJKTopology*)_Topology_New( _sizeOfSelf, type, _delete, _print, _copy, _defaultConstructor,
+			_construct, _build, _initialise, _execute, _destroy, name, initFlag, neighbourCount, buildNeighbours );
+	
+	/* General info */
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	
+	/* IJKTopology info */
+	if( initFlag ){
+		_IJKTopology_Init( self, size, isPeriodic, False );
+	}
+	
+	return self;
+}
+
+void _IJKTopology_Construct( void* ijkTopology, Stg_ComponentFactory* cf, void* data ){
+	IJKTopology*    self   = (IJKTopology*)ijkTopology;
+	IJK             size;
+	int             shift;
+	Dimension_Index dim;
+	Dimension_Index dim_I;
+	Bool		isPeriodic[3];
+	Bool		dynamic;
+
+	self->dictionary = cf->rootDict;
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+	
+	/* TODO _Topology_Construct( self, cf ); */
+	_Topology_Init( (Topology*)self );
+
+	size[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "sizeI", 1 );  
+	size[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "sizeJ", 1 );  
+	size[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "sizeK", 1 );  
+	if ( dim == 2 )
+		size[ K_AXIS ] = 1;
+
+	isPeriodic[ I_AXIS ] = Stg_ComponentFactory_GetRootDictBool( cf, "isPeriodicI", False );  
+	isPeriodic[ J_AXIS ] = Stg_ComponentFactory_GetRootDictBool( cf, "isPeriodicJ", False );  
+	isPeriodic[ K_AXIS ] = Stg_ComponentFactory_GetRootDictBool( cf, "isPeriodicK", False );  
+
+	dynamic = Stg_ComponentFactory_GetBool( cf, self->name, "dynamic", False );
+	
+	/* Shift the topology if nessesary */
+	shift = Stg_ComponentFactory_GetInt( cf, self->name, "sizeShift", 0 );
+	for ( dim_I = I_AXIS ; dim_I < dim ; dim_I++ )
+		size[ dim_I ] += shift;
+
+	_IJKTopology_Init( self, size, isPeriodic, dynamic );
+}
+
+
+void _IJKTopology_Init(
+		IJKTopology*					self,
+		IJK						size,
+		Bool						isPeriodic[3], 
+		Bool						dynamic )
+{
+	Index i = I_AXIS;
+
+	/* General and Virtual info should already be set */
+	
+	/* IJKTopology info */
+	self->isConstructed = True;
+	if ( size ) {
+		for (i=I_AXIS; i < 3; i++ ) {
+			self->size[i] = size[i];
+		}
+	}
+	else if( self->dictionary ) {
+		char* keyBase = "meshSize";
+		char* key = Memory_Alloc_Array_Unnamed( char, (strlen( keyBase ) + 2 ) );
+
+		for (i=I_AXIS; i < 3; i++ ) {
+			sprintf ( key, "%s%c", keyBase, IJKTopology_DimNumToDimLetter[i] );
+			self->size[i] = Dictionary_Entry_Value_AsUnsignedInt( Dictionary_GetDefault(
+				self->dictionary, key, Dictionary_Entry_Value_FromUnsignedInt( 1 ) ) );
+		}
+		Memory_Free( key );
+	}
+	else {
+		fprintf( stderr, "Error - %s: either a valid Dictionary or size input parameter must be given.\n",
+			__func__ );
+		exit( EXIT_FAILURE );	
+	}
+	
+	if ( isPeriodic ) {
+		for (i=I_AXIS; i < 3; i++ ) {
+			self->isPeriodic[i] = isPeriodic[i];
+		}
+	}
+	else if( self->dictionary ) {
+		self->isPeriodic[I_AXIS] = Dictionary_GetBool_WithDefault( self->dictionary, "isPeriodicI", False );
+		self->isPeriodic[J_AXIS] = Dictionary_GetBool_WithDefault( self->dictionary, "isPeriodicJ", False );
+		self->isPeriodic[K_AXIS] = Dictionary_GetBool_WithDefault( self->dictionary, "isPeriodicK", False );
+	}
+	else {
+		fprintf( stderr, "Error - %s: either a valid Dictionary or \"isPeriodic\" input parameter must be given.\n",
+			__func__ );
+		exit( EXIT_FAILURE );	
+	}	
+
+	for (i=I_AXIS; i < 3; i++ ) {
+		if ( self->size[i] == 0 ) self->size[i] = 1;
+	}
+	
+	self->indexCount = self->size[I_AXIS] * self->size[J_AXIS] * self->size[K_AXIS];
+	assert( self->indexCount );
+	
+	self->dynamicSizes = dynamic;
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _IJKTopology_Delete( void* ijk26Topology ) {
+	IJKTopology* self = (IJKTopology*)ijk26Topology;
+	
+	/* Stg_Class_Delete parent */
+	_Topology_Delete( self );
+}
+
+
+void _IJKTopology_Print( void* ijk26Topology, Stream* stream ) {
+	IJKTopology* self = (IJKTopology*)ijk26Topology;
+	
+	/* Print parent */
+	_Topology_Print( self, stream );
+	
+	 IJKTopology_PrintConcise( self, stream );
+}
+
+
+void IJKTopology_PrintConcise( IJKTopology* self, Stream* stream ) {
+	/* General info */
+	Journal_Printf( stream, "IJKTopology (ptr): (%p)\n", self );
+	
+	/* IJKTopology info */
+	Stream_Indent( stream );
+	Journal_Printf( stream, "size : (%u,%u,%u)\n", self->size[0], self->size[1], self->size[2] );
+	Journal_Printf( stream, "isPeriodic : (%s,%s,%s)\n",
+		StG_BoolToStringMap[self->isPeriodic[I_AXIS]],
+		StG_BoolToStringMap[self->isPeriodic[J_AXIS]],
+		StG_BoolToStringMap[self->isPeriodic[K_AXIS]] );
+	Journal_Printf( stream, "dynamicSizes : %s\n", StG_BoolToStringMap[self->dynamicSizes] );
+	Stream_UnIndent( stream );
+}
+
+
+void* _IJKTopology_Copy( void* ijkTopology, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	IJKTopology*	self = (IJKTopology*)ijkTopology;
+	IJKTopology*	newIJKTopology;
+	Dimension_Index	dim_I=0;
+	
+	newIJKTopology = (IJKTopology*)_Topology_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	newIJKTopology->dictionary = self->dictionary;
+	for ( dim_I = 0; dim_I < 3; dim_I++ ) {
+		newIJKTopology->size[dim_I] = self->size[dim_I];
+		newIJKTopology->isPeriodic[dim_I] = self->isPeriodic[dim_I];
+	}	
+	newIJKTopology->dynamicSizes = self->dynamicSizes;
+	
+	return (void*)newIJKTopology;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IJKTopology.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IJKTopology.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,162 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	Abstract class inheriting from Topology, which handles the 3D topology for
+**	an element or node, in an IJK co-ordinate system.
+**
+** Assumptions:
+**
+** Comments:
+** This class was abstracted from the common code in IJK6Topology.h and
+**	IJK26Topology.h on 8 July 2004.
+**
+** $Id: IJKTopology.h 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include "Dimension.h"
+
+#ifndef __Domain_Geometry_IJKTopology_h__
+#define __Domain_Geometry_IJKTopology_h__
+
+	/* Virtual function types */
+	
+	/** Textual name of this class */
+	extern const Type IJKTopology_Type;
+
+	/** Mapping from integer dimension to letter */
+	extern const char IJKTopology_DimNumToDimLetter[3];
+
+	/** IJKTopology class contents (see IJKTopology) */
+	#define __IJKTopology \
+		/* General info */ \
+		/** Parent class - Topology */ \
+		__Topology \
+		Dictionary*			dictionary; \
+		\
+		/* Virtual info */ \
+		\
+		/* IJKTopology info ... */ \
+		/** The total number of elements/nodes in the I,J, and K directions for the entire mesh. */ \
+		IJK				size; \
+		/** Determines, for each dimension, whether the topology is periodic */ \
+		Bool                            isPeriodic[3];	\
+		/** Determines whether objects outside the mesh should be counted - see Topology_NeighbourCount() and Topology_BuildNeighbours(). */ \
+		Bool				dynamicSizes;
+
+	/**	Abstract class inheriting from Topology, which handles the topology for
+	**	an element/node, in an IJK co-ordinate system - see IJKTopology.h for functions etc.
+	*/
+	struct IJKTopology { __IJKTopology };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/** Creation implementation */
+	IJKTopology* _IJKTopology_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,
+		Topology_NeighbourCountFunction*		neighbourCount,
+		Topology_BuildNeighboursFunction*		buildNeighbours,
+		Dictionary*					dictionary,
+		IJK						size,
+		Bool                                            isPeriodic[3] );
+	
+	/** Initialises members. If a valid dictionary has been passed in, the mesh sizes
+	in the dictionary are used to determine the number of elements. Otherwise, the
+	values in the "size" input parameter are used. */
+	void _IJKTopology_Init(
+		IJKTopology*		self,
+		IJK			size,
+		Bool			isPeriodic[3], 
+		Bool			dynamic );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/** Stg_Class_Delete() IJKTopology implementation */
+	void _IJKTopology_Delete( void* ijk26Topology );
+	
+	/** Stg_Class_Print() IJKTopology implementation */
+	void _IJKTopology_Print( void* ijk26Topology, Stream* stream );
+	
+	/** Prints core info without all the Class overhead */
+	void IJKTopology_PrintConcise( IJKTopology* self, Stream* stream );
+
+	/* Copy */
+	#define IJKTopology_Copy( self ) \
+		(IJKTopology*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define IJKTopology_DeepCopy( self ) \
+		(IJKTopology*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	
+	void* _IJKTopology_Copy( void* ijkTopology, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	
+	void _IJKTopology_Construct( void* ijkTopology, Stg_ComponentFactory* cf, void* data );
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public functions/macros
+	*/
+	
+	/** Converts i,j,k coordinates into the exact element number for this topology type. */ 
+	#define IJK_3DTo1D( self, ijk, indexPtr ) \
+		Dimension_3DTo1D( (ijk), (self)->size, indexPtr )
+
+	/** Converts i,j,k coordinates into the exact element number for this topology type. */ 
+	#define IJK_3DTo1D_3( self, i, j, k, indexPtr ) \
+		Dimension_3DTo1D_3( (i), (j), (k), (self)->size[I_AXIS], (self)->size[J_AXIS], (self)->size[K_AXIS], indexPtr )
+
+	/** Converts an element number in the mesh into i,j,k co-ordinates, returned separately */
+	#define IJK_1DTo3D_3( self, index, iPtr, jPtr, kPtr ) \
+		Dimension_1DTo3D_3( (index), (self)->size[I_AXIS], (self)->size[J_AXIS], (self)->size[K_AXIS], (iPtr), (jPtr), (kPtr) )
+		
+	/** Converts an element number in to mesh into i,j,k co-ordinates, returned in an ijk array */
+	#define IJK_1DTo3D(self, index, ijk) \
+		IJK_1DTo3D_3(self, index, &(ijk)[I_AXIS], &(ijk)[J_AXIS], &(ijk)[K_AXIS])
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	
+	
+#endif /* __Domain_Geometry_IJKTopology_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IJKTopology.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IJKTopology.meta	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">IJKTopology</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">Topology</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">sizeI</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">1</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">sizeJ</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">1</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">sizeK</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">1</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">isPeriodicI</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">isPeriodicJ</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">isPeriodicK</param>
+		<param name="Type">Bool</param>
+		<param name="Default">False</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">sizeShift</param>
+		<param name="Type">Int</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 9f22ec4f42ee -r 5667007f4799 Geometry/src/Init.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Init.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,82 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Init.c 3882 2006-10-26 04:41:18Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "Init.h"
+#include "Topology.h"
+#include "IJKTopology.h"
+#include "IJK6Topology.h"
+#include "IJK26Topology.h"
+#include "IrregTopology.h"
+#include "GeometryClass.h"
+#include "BlockGeometry.h"
+#include "RefinedRegionsGeometry.h"
+#include "ShellGeometry.h"
+#include "IrregGeometry.h"
+#include "Delaunay.h"
+#include "ParallelDelaunay.h"
+
+#include <stdio.h>
+
+Bool StgDomainGeometry_Init( int* argc, char** argv[] ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+
+		
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), IJK6Topology_Type, "0", (Stg_Component_DefaultConstructorFunction*)IJK6Topology_DefaultNew );
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), IJK26Topology_Type, "0", (Stg_Component_DefaultConstructorFunction*)IJK26Topology_DefaultNew );
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), IrregTopology_Type, "0", (Stg_Component_DefaultConstructorFunction*)IrregTopology_DefaultNew );
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), BlockGeometry_Type, "0", (Stg_Component_DefaultConstructorFunction*)BlockGeometry_DefaultNew );
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), RefinedRegionsGeometry_Type, "0", RefinedRegionsGeometry_DefaultNew );
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), ShellGeometry_Type, "0", (Stg_Component_DefaultConstructorFunction*)ShellGeometry_DefaultNew );
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), IrregGeometry_Type, "0", (Stg_Component_DefaultConstructorFunction*)IrregGeometry_DefaultNew );
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), Delaunay_Type, "0", (Stg_Component_DefaultConstructorFunction*)Delaunay_DefaultNew );
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), ParallelDelaunay_Type, "0", (Stg_Component_DefaultConstructorFunction*)ParallelDelaunay_DefaultNew );
+
+	RegisterParent( Delaunay_Type,               Stg_Component_Type );
+	RegisterParent( ParallelDelaunay_Type,       Delaunay_Type );
+	RegisterParent( Geometry_Type,               Stg_Component_Type );
+	RegisterParent( BlockGeometry_Type,          Geometry_Type );
+	RegisterParent( RefinedRegionsGeometry_Type, Geometry_Type );
+	RegisterParent( IrregGeometry_Type,          Geometry_Type );
+	RegisterParent( ShellGeometry_Type,          Geometry_Type );
+	
+	RegisterParent( Topology_Type,      Stg_Component_Type );
+	RegisterParent( IJKTopology_Type,   Topology_Type );
+	RegisterParent( IrregTopology_Type, Topology_Type );
+	RegisterParent( IJK26Topology_Type, IJKTopology_Type );
+	RegisterParent( IJK6Topology_Type,  IJKTopology_Type );
+	
+	return True;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Init.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Init.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,47 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	performs and pre-running initialisation necessary in this directory.
+**
+** Assumptions:
+**	
+**
+** Comments:
+**	None as yet.
+**
+** $Id: Init.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Init_h__
+#define __Domain_Geometry_Init_h__
+	
+	Bool StgDomainGeometry_Init( int* argc, char** argv[] );
+	
+#endif /* __Domain_Geometry_Init_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IrregGeometry.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IrregGeometry.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,318 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: IrregGeometry.c 3882 2006-10-26 04:41:18Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "GeometryClass.h"
+#include "IrregGeometry.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+/* Textual name of this class */
+const Type IrregGeometry_Type = "IrregGeometry";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+IrregGeometry* IrregGeometry_DefaultNew( Name name )
+{
+	return (IrregGeometry*)_IrregGeometry_New(
+		sizeof(IrregGeometry), 
+		IrregGeometry_Type, 
+		_IrregGeometry_Delete, 
+		_IrregGeometry_Print,
+		NULL,
+		(Stg_Component_DefaultConstructorFunction*)IrregGeometry_DefaultNew,
+		_IrregGeometry_Construct,
+		_IrregGeometry_Build,
+		_IrregGeometry_Initialise,
+		_IrregGeometry_Execute,
+		_IrregGeometry_Destroy,
+		name,
+		False,
+		_IrregGeometry_BuildPoints,
+		_IrregGeometry_PointAt,
+		NULL, 
+		NULL );
+}
+
+IrregGeometry* IrregGeometry_New(
+		Name						name,
+		Dictionary*					dictionary,
+		Name						listKey )
+{
+	return _IrregGeometry_New( 
+		sizeof(IrregGeometry), 
+		IrregGeometry_Type, 
+		_IrregGeometry_Delete, 
+		_IrregGeometry_Print,
+		NULL,
+		(Stg_Component_DefaultConstructorFunction*)IrregGeometry_DefaultNew,
+		_IrregGeometry_Construct,
+		_IrregGeometry_Build,
+		_IrregGeometry_Initialise,
+		_IrregGeometry_Execute,
+		_IrregGeometry_Destroy,
+		name,
+		True,
+		_IrregGeometry_BuildPoints,
+		_IrregGeometry_PointAt,
+		dictionary,
+		listKey );
+}
+
+
+void IrregGeometry_Init(
+		IrregGeometry*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		Name						listKey )
+{
+	/* General info */
+	self->type = IrregGeometry_Type;
+	self->_sizeOfSelf = sizeof(IrregGeometry);
+	self->_deleteSelf = False;
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	self->_delete = _IrregGeometry_Delete;
+	self->_print = _IrregGeometry_Print;
+	self->_copy = NULL;
+	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)IrregGeometry_DefaultNew;
+	self->_construct = _IrregGeometry_Construct;
+	self->_build = _IrregGeometry_Build;
+	self->_initialise = _IrregGeometry_Initialise;
+	self->_execute = _IrregGeometry_Execute;
+	self->_destroy = _IrregGeometry_Destroy;
+	self->buildPoints = _IrregGeometry_BuildPoints;
+	self->pointAt = _IrregGeometry_PointAt;
+	
+	_Stg_Class_Init( (Stg_Class*)self );
+	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+	_Stg_Component_Init( (Stg_Component*)self );
+	
+	_Geometry_Init( (Geometry*)self );
+	
+	/* IrregGeometry info */
+	_IrregGeometry_Init( self, listKey );
+}
+
+
+IrregGeometry* _IrregGeometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary,
+		Name						listKey )
+{
+	IrregGeometry* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(IrregGeometry) );
+	self = (IrregGeometry*)_Geometry_New(
+		_sizeOfSelf,
+		type,
+		_delete,
+		_print,
+		_copy, 
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,
+		name,
+		initFlag,
+		buildPoints,
+		pointAt,
+		dictionary );
+	
+	/* General info */
+	
+	/* Virtual info */
+	
+	/* IrregGeometry info */
+	if( initFlag ){
+		_IrregGeometry_Init( self, listKey );
+	}
+	
+	return self;
+}
+
+void _IrregGeometry_Init(
+		IrregGeometry*					self,
+		Name						listKey )
+{
+	/* General and Virtual info should already be set */
+	
+	/* IrregGeometry info */
+	Dictionary_Entry_Value*		list;
+	Dictionary_Entry_Value*		point;
+	Index				i;
+	
+	self->isConstructed = True;
+	list = Dictionary_Get( self->dictionary, listKey );
+	self->pointCount = Dictionary_Entry_Value_GetCount( list );
+	self->pointTbl = Memory_Alloc_Array( Coord, self->pointCount, "IrregGeometry->pointTbl" );
+	point = Dictionary_Entry_Value_GetFirstElement( list );
+	
+	for( i = 0; i < self->pointCount; i++ ) {
+		self->pointTbl[i][0] = Dictionary_Entry_Value_AsDouble( Dictionary_Entry_Value_GetMember( point, "x") );
+		self->pointTbl[i][1] = Dictionary_Entry_Value_AsDouble( Dictionary_Entry_Value_GetMember( point, "y") );
+		self->pointTbl[i][2] = Dictionary_Entry_Value_AsDouble( Dictionary_Entry_Value_GetMember( point, "z") );
+		point = point->next;
+	}
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _IrregGeometry_Delete( void* irregGeometry ) {
+	IrregGeometry* self = (IrregGeometry*)irregGeometry;
+	
+	/* Stg_Class_Delete parent */
+	_Geometry_Delete( self );
+}
+
+
+void _IrregGeometry_Print( void* irregGeometry, Stream* stream ) {
+	IrregGeometry* self = (IrregGeometry*)irregGeometry;
+	
+	/* Set the Journal for printing informations */
+	Stream* irregGeometryStream;
+	irregGeometryStream = Journal_Register( InfoStream_Type, "IrregGeometryStream" );
+
+	/* Print parent */
+	_Geometry_Print( self, stream );
+	
+	/* General info */
+	Journal_Printf( stream, "IrregGeometry (ptr): (%p)\n", self );
+	
+	/* Virtual info */
+	
+	/* IrregGeometry info */
+}
+
+void _IrregGeometry_Construct( void* irregGeometry, Stg_ComponentFactory *cf, void* data ){
+	IrregGeometry *self = (IrregGeometry*)irregGeometry;
+	Dictionary *componentDict = NULL;
+	Dictionary *thisComponentDict = NULL;
+	Name listName = NULL;
+
+	self->dictionary = cf->rootDict;
+	componentDict = cf->componentDict;
+	assert( componentDict );
+	thisComponentDict = Dictionary_GetDictionary( componentDict, self->name );
+	assert( thisComponentDict );
+	
+	listName = Dictionary_GetString( thisComponentDict, "ListName" );
+
+	_Geometry_Init( (Geometry*)self );
+	_IrregGeometry_Init( self, listName );
+}
+	
+void _IrregGeometry_Build( void* irregGeometry, void *data ){
+	
+}
+	
+void _IrregGeometry_Initialise( void* irregGeometry, void *data ){
+	
+}
+	
+void _IrregGeometry_Execute( void* irregGeometry, void *data ){
+	
+}
+
+void _IrregGeometry_Destroy( void* irregGeometry, void *data ){
+	
+}
+
+void _IrregGeometry_BuildPoints( void* irregGeometry, Coord_List points )
+{
+	IrregGeometry*  self = (IrregGeometry*)irregGeometry;
+	Index		i;
+	
+	for( i = 0; i < self->pointCount; i++ ) {
+		points[i][0] = self->pointTbl[i][0];
+		points[i][1] = self->pointTbl[i][1];
+		points[i][2] = self->pointTbl[i][2];
+	}
+}
+
+
+void _IrregGeometry_PointAt( void* irregGeometry, Index index, Coord point )
+{
+	IrregGeometry* self = (IrregGeometry*)irregGeometry;
+	
+	if( index < self->pointCount ) {
+		point[0] = self->pointTbl[index][0];
+		point[1] = self->pointTbl[index][1];
+		point[2] = self->pointTbl[index][2];
+	}
+	else {
+		point[0] = HUGE_VAL;
+		point[1] = HUGE_VAL;
+		point[2] = HUGE_VAL;
+	}
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IrregGeometry.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IrregGeometry.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,139 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: IrregGeometry.h 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_IrregGeometry_h__
+#define __Domain_Geometry_IrregGeometry_h__
+
+	/* Virtual function types */
+	
+	/* Textual name of this class */
+	extern const Type IrregGeometry_Type;
+
+	/* IrregGeometry information */
+	#define __IrregGeometry \
+		/* General info */ \
+		__Geometry \
+		\
+		/* Virtual info */ \
+		\
+		/* IrregGeometry info ... */ \
+		Coord_List			pointTbl;
+	struct IrregGeometry { __IrregGeometry };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/* Create a IrregGeometry */
+	IrregGeometry* IrregGeometry_DefaultNew( );
+
+	IrregGeometry* IrregGeometry_New(
+		Name						name,
+		Dictionary*					dictionary,
+		Name						listKey );
+	
+	/* Initialise a IrregGeometry */
+	void IrregGeometry_Init(
+		IrregGeometry*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		Name						listKey );
+	
+	/* Creation implementation */
+	IrregGeometry* _IrregGeometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary,
+		Name						listKey );
+	
+	/* Initialisation implementation functions */
+	void _IrregGeometry_Init(
+		IrregGeometry*					self,
+		Name						listKey );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/* Stg_Class_Delete IrregGeometry implementation */
+	void _IrregGeometry_Delete( void* irregGeometry );
+	
+	/* Print IrregGeometry implementation */
+	void _IrregGeometry_Print( void* irregGeometry, Stream* stream );
+	
+	void _IrregGeometry_Construct( void* irregGeometry, Stg_ComponentFactory *cf, void* data );
+	
+	void _IrregGeometry_Build( void* irregGeometry, void *data );
+	
+	void _IrregGeometry_Initialise( void* irregGeometry, void *data );
+	
+	void _IrregGeometry_Execute( void* irregGeometry, void *data );
+
+	void _IrregGeometry_Destroy( void* irregGeometry, void *data );
+	
+	void _IrregGeometry_BuildPoints( void* irregGeometry, Coord_List points );
+	
+	void _IrregGeometry_PointAt( void* irregGeometry, Index index, Coord point );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	
+	
+#endif /* __Domain_Geometry_IrregGeometry_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IrregGeometry.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IrregGeometry.meta	Wed Oct 10 07:21:38 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">IrregGeometry</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">Geometry</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+<!-- This component calls in another directory so the info above/below may not be complete-->
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IrregTopology.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IrregTopology.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,313 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: IrregTopology.c 3882 2006-10-26 04:41:18Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "Topology.h"
+#include "IrregTopology.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+
+/* Textual name of this class */
+const Type IrregTopology_Type = "IrregTopology";
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+IrregTopology* IrregTopology_DefaultNew( Name name )
+{
+	return (IrregTopology*)_IrregTopology_New( 
+		sizeof(IrregTopology), 
+		IrregTopology_Type, 
+		_IrregTopology_Delete, 
+		_IrregTopology_Print,
+		NULL,
+		(Stg_Component_DefaultConstructorFunction*)IrregTopology_DefaultNew,
+		_IrregTopology_Construct,
+		_IrregTopology_Build,
+		_IrregTopology_Initialise,
+		_IrregTopology_Execute,
+		_IrregTopology_Destroy,
+		name,
+		False,
+		_IrregTopology_NeighbourCount,
+		_IrregTopology_BuildNeighbours,
+		NULL,
+		NULL );
+}
+
+IrregTopology* IrregTopology_New(
+		Name						name,
+		Dictionary*					dictionary,
+		Name						listKey )
+{
+	return _IrregTopology_New( 
+		sizeof(IrregTopology), 
+		IrregTopology_Type, 
+		_IrregTopology_Delete, 
+		_IrregTopology_Print,
+		NULL,
+		(Stg_Component_DefaultConstructorFunction*)IrregTopology_DefaultNew,
+		_IrregTopology_Construct,
+		_IrregTopology_Build,
+		_IrregTopology_Initialise,
+		_IrregTopology_Execute,
+		_IrregTopology_Destroy,
+		name,
+		True,
+		_IrregTopology_NeighbourCount,
+		_IrregTopology_BuildNeighbours,
+		dictionary,
+		listKey );
+}
+
+
+void IrregTopology_Init(
+		IrregTopology*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		Name						listKey )
+{
+	/* General info */
+	self->type = IrregTopology_Type;
+	self->_sizeOfSelf = sizeof(IrregTopology);
+	self->_deleteSelf = False;
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	self->_delete = _IrregTopology_Delete;
+	self->_print = _IrregTopology_Print;
+	self->_copy = NULL;
+	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)IrregTopology_DefaultNew;
+	self->_construct = _IrregTopology_Construct;
+	self->_build = _IrregTopology_Build;
+	self->_initialise = _IrregTopology_Initialise;
+	self->_execute = _IrregTopology_Execute;
+	self->_destroy = _IrregTopology_Destroy;
+	self->neighbourCount = _IrregTopology_NeighbourCount;
+	self->buildNeighbours = _IrregTopology_BuildNeighbours;
+	
+	_Stg_Class_Init( (Stg_Class*)self );
+	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+	_Stg_Component_Init( (Stg_Component*)self );
+	
+	/* IrregTopology info */
+	_IrregTopology_Init( self, listKey );
+}
+
+
+IrregTopology* _IrregTopology_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,
+		Topology_NeighbourCountFunction*		neighbourCount,
+		Topology_BuildNeighboursFunction*		buildNeighbours,
+		Dictionary*					dictionary,
+		Name						listKey )
+{
+	IrregTopology* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(IrregTopology) );
+	self = (IrregTopology*)_Topology_New( _sizeOfSelf, type, _delete, _print, _copy, _defaultConstructor,
+			_construct, _build, _initialise, _execute, _destroy, name, initFlag, neighbourCount, buildNeighbours );
+	
+	/* General info */
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	
+	/* IrregTopology info */
+	if( initFlag ){
+		_IrregTopology_Init( self, listKey );
+	}
+	
+	return self;
+}
+
+void _IrregTopology_Init(
+		IrregTopology*					self,
+		Name						listKey )
+{
+	/* General and Virtual info should already be set */
+	
+	/* IrregTopology info */
+	Dictionary_Entry_Value*		list;
+	Dictionary_Entry_Value*		index;
+	Dictionary_Entry_Value*		nbr;
+	Index				i;
+	
+	self->isConstructed = True;
+	list = Dictionary_Get( self->dictionary, listKey );
+	self->indexCount = Dictionary_Entry_Value_GetCount( list );
+	self->neighbourCountTbl = Memory_Alloc_Array( Index, self->indexCount, "IrregTopology->neighbourCountTbl" );
+	self->neighbourTbl = Memory_Alloc_Array( Index*, self->indexCount, "IrregTopology->neighbourCountTbl" );
+	index = Dictionary_Entry_Value_GetFirstElement( list );
+	
+	for( i = 0; i < self->indexCount; i++ ) {
+		Index n_I;
+		
+		self->neighbourCountTbl[i] = Dictionary_Entry_Value_GetCount( index );
+		nbr = Dictionary_Entry_Value_GetFirstElement( index );
+		self->neighbourTbl[i] = Memory_Alloc_Array( Index, self->neighbourCountTbl[i], "IrregTopology->neighbourTbl[]" );
+		
+		for( n_I = 0; n_I < self->neighbourCountTbl[i]; n_I++ ) {
+			self->neighbourTbl[i][n_I] = Dictionary_Entry_Value_AsUnsignedInt( nbr );
+			nbr = nbr->next;
+		}
+		
+		index = index->next;
+	}
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _IrregTopology_Delete( void* irregTopology ) {
+	IrregTopology*  self = (IrregTopology*)irregTopology;
+	Index		i;
+	
+	for( i = 0; i < self->indexCount; i++ )
+		if( self->neighbourTbl[i] )
+			Memory_Free( self->neighbourTbl[i] );
+	if( self->neighbourTbl ) {
+		Memory_Free( self->neighbourTbl );
+		self->neighbourTbl = NULL;
+	}
+	
+	if( self->neighbourCountTbl ) {
+		Memory_Free( self->neighbourCountTbl );
+		self->neighbourCountTbl = NULL;
+	}
+	
+	/* Stg_Class_Delete parent */
+	_Topology_Delete( self );
+}
+
+
+void _IrregTopology_Print( void* irregTopology, Stream* stream ) {
+	IrregTopology* self = (IrregTopology*)irregTopology;
+	
+	/* Set the Journal for printing informations */
+	Stream* irregTopologyStream;
+	irregTopologyStream = Journal_Register( InfoStream_Type, "IrregTopologyStream" );
+
+	/* Print parent */
+	_Topology_Print( self, stream );
+	
+	/* General info */
+	Journal_Printf( stream, "IrregTopology (ptr): (%p)\n", self );
+	
+	/* Virtual info */
+	
+	/* IrregTopology info */
+}
+
+void _IrregTopology_Construct( void* irregTopology, Stg_ComponentFactory *cf, void* data ){
+	IrregTopology *self = (IrregTopology*)irregTopology;
+	Dictionary *componentDict = NULL;
+	Dictionary *thisComponentDict = NULL;
+	Name listName = NULL;
+
+	self->dictionary = cf->rootDict;
+	componentDict = cf->componentDict;
+	assert( componentDict );
+	thisComponentDict = Dictionary_GetDictionary( componentDict, self->name );
+	assert( thisComponentDict );
+	
+	listName = Dictionary_GetString( thisComponentDict, "ListName" );
+
+	_Topology_Init( (Topology*)self );
+	_IrregTopology_Init( self, listName );
+}
+
+void _IrregTopology_Build( void* irregTopology, void* data ){
+	
+}
+	
+void _IrregTopology_Initialise( void* irregTopology, void* data ){
+	
+}
+	
+void _IrregTopology_Execute( void* irregTopology, void* data ){
+	
+}
+	
+void _IrregTopology_Destroy( void* irregTopology, void* data ){
+	
+}
+
+
+NeighbourIndex _IrregTopology_NeighbourCount( void* irregTopology, Index index ) {
+	IrregTopology* self = (IrregTopology*)irregTopology;
+
+	return self->neighbourCountTbl[index];
+}
+
+
+void _IrregTopology_BuildNeighbours( void* irregTopology, Index index, NeighbourIndex* neighbours ) {
+	IrregTopology*  self = (IrregTopology*)irregTopology;
+	NeighbourIndex  n_I;
+	
+	for( n_I = 0; n_I < self->neighbourCountTbl[index]; n_I++ )
+		neighbours[n_I] = self->neighbourTbl[index][n_I];
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IrregTopology.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IrregTopology.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,141 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: IrregTopology.h 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_IrregTopology_h__
+#define __Domain_Geometry_IrregTopology_h__
+
+	/* Virtual function types */
+	
+	/* Textual name of this class */
+	extern const Type IrregTopology_Type;
+
+	/* IrregTopology information */
+	#define __IrregTopology \
+		/* General info */ \
+		__Topology \
+		Dictionary*			dictionary; \
+		\
+		/* Virtual info */ \
+		\
+		/* IrregTopology info ... */ \
+		Index*				neighbourCountTbl; \
+		Index**				neighbourTbl;
+	struct IrregTopology { __IrregTopology };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/* Create a IrregTopology */
+	IrregTopology* IrregTopology_DefaultNew( Name name );
+
+	IrregTopology* IrregTopology_New(
+		Name						name,
+		Dictionary*					dictionary,
+		Name						listKey );
+	
+	/* Initialise a IrregTopology */
+	void IrregTopology_Init(
+		IrregTopology*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		Name						listKey );
+	
+	/* Creation implementation */
+	IrregTopology* _IrregTopology_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,
+		Topology_NeighbourCountFunction*		neighbourCount,
+		Topology_BuildNeighboursFunction*		buildNeighbours,
+		Dictionary*					dictionary,
+		Name						listKey );
+	
+	/* Initialisation implementation functions */
+	void _IrregTopology_Init(
+		IrregTopology*					self,
+		Name						listKey );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/* Stg_Class_Delete IrregTopology implementation */
+	void _IrregTopology_Delete( void* irregTopology );
+	
+	/* Print IrregTopology implementation */
+	void _IrregTopology_Print( void* irregTopology, Stream* stream );
+
+	void _IrregTopology_Construct( void* irregTopology, Stg_ComponentFactory *cf, void* data );
+
+	void _IrregTopology_Build( void* irregTopology, void* data );
+	
+	void _IrregTopology_Initialise( void* irregTopology, void* data );
+	
+	void _IrregTopology_Execute( void* irregTopology, void* data );
+	
+	void _IrregTopology_Destroy( void* irregTopology, void* data );
+	
+	NeighbourIndex _IrregTopology_NeighbourCount( void* irregTopology, Index index );
+	
+	void _IrregTopology_BuildNeighbours( void* irregTopology, Index index, NeighbourIndex* neighbours );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	
+	
+#endif /* __Domain_Geometry_IrregTopology_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/IrregTopology.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/IrregTopology.meta	Wed Oct 10 07:21:38 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">IrregTopology</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">Topology</param>
+<param name="Reference">...</param>
+<param name="Summary">...</param>
+<param name="Description">...</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+
+</list>
+
+<list name="Dependencies">
+<!-- This component calls in another directory so the info above/below may not be complete-->
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Line.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Line.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,52 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Line.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "VectorMath.h"
+#include "Line.h"
+
+#include <stdlib.h>
+#include <assert.h>
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Macros
+*/
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Functions
+*/
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Line.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Line.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,62 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    Provides basic edge routines.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Line.h 4081 2007-04-27 06:20:07Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Line_h__
+#define __Domain_Geometry_Line_h__
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Macros
+	*/
+	
+	#define Stg_Line_CalcFromPoints( line, a, b ) \
+		(line)[0] = (a)[1] - (b)[1]; \
+		(line)[1] = (b)[0] - (a)[0]; \
+		(line)[2] = 0.0; \
+		Vec_Norm3D( line, line ); \
+		(line)[3] = Vec_Dot3D( line, a )
+	
+	#define Stg_Line_PointIsInside( line, point ) \
+		((Vec_Dot3D( line, point) >= line[3]) ? True : False)
+
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Functions
+	*/
+
+	
+#endif /* __Domain_Geometry_Line_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/ParallelDelaunay.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ParallelDelaunay.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,1429 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+** The ParallelDelaunay class computes the constrained delaunay triangulation of a set of points
+** in 2 Dimensions along with the voronoi diagram of the point-set.
+** Assumptions:
+**
+** Comments:
+**
+** The recursive divide and conquer algorithm has been implemented from the pseudo-code
+** given in "Primitives for the manipulation of general subdivisions and the computation
+** of voronoi diagrams" by Leonidas Guibas and Jorge Stolfi.
+** ACM transtactions on graphics, Vol. 4, No. 2, April 1985, Pages 74-123
+**
+**
+** $Id: ParallelDelaunay.c 3462 2006-02-19 06:53:24Z RaquibulHassan $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "QuadEdge.h"
+#include "Delaunay.h"
+#include "ParallelDelaunay.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+const Type ParallelDelaunay_Type="ParallelDelaunay";
+#define PI 3.1415926535897932384626
+#define MERGE_FACTOR 1
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+/** Create a ParallelDelaunay */
+ParallelDelaunay* ParallelDelaunay_DefaultNew( Name name )
+{
+	ParallelDelaunay *d = _ParallelDelaunay_New(
+			sizeof( ParallelDelaunay ),
+			ParallelDelaunay_Type,
+			_ParallelDelaunay_Delete,
+			_ParallelDelaunay_Print,
+			_ParallelDelaunay_Copy,
+			(Stg_Component_DefaultConstructorFunction*)ParallelDelaunay_DefaultNew,
+			_ParallelDelaunay_Construct,
+			_ParallelDelaunay_Build,
+			_ParallelDelaunay_Initialise,
+			_ParallelDelaunay_Execute,
+			_ParallelDelaunay_Destroy,
+			name,
+			False,
+			NULL,
+			NULL,
+			0,
+			0,
+			0,
+			NULL,
+			NULL );
+
+	return d;
+}
+	
+ParallelDelaunay* ParallelDelaunay_New(
+	Name						name,
+	Dictionary*					dictionary,
+	CoordF						*sites,
+	int							numSites,
+	int							rank,
+	int							numProcs,
+	MPI_Comm					*comm,
+	DelaunayAttributes			*attr )
+{
+	ParallelDelaunay *d = _ParallelDelaunay_New(
+			sizeof( ParallelDelaunay ),
+			ParallelDelaunay_Type,
+			_ParallelDelaunay_Delete,
+			_ParallelDelaunay_Print,
+			_ParallelDelaunay_Copy,
+			(Stg_Component_DefaultConstructorFunction*)ParallelDelaunay_DefaultNew,
+			_ParallelDelaunay_Construct,
+			_ParallelDelaunay_Build,
+			_ParallelDelaunay_Initialise,
+			_ParallelDelaunay_Execute,
+			_ParallelDelaunay_Destroy,
+			name,
+			True,
+			dictionary,
+			sites,
+			numSites,
+			rank,
+			numProcs,
+			comm,
+			attr );
+	
+	return d;
+}
+
+#define MASTER_PROC 0
+
+	/** Initialise a ParallelDelaunay */
+void ParallelDelaunay_Init(
+	ParallelDelaunay*					self,
+	Name						name,
+	Dictionary*					dictionary,
+	CoordF						*sites,
+	int							numSites,
+	int							rank,
+	int							numProcs,
+	MPI_Comm					*comm,
+	DelaunayAttributes			*attr )
+{
+	self->type = ParallelDelaunay_Type;
+	self->_sizeOfSelf = sizeof( ParallelDelaunay );
+	self->_deleteSelf = False;
+	self->dictionary = dictionary;
+
+	self->_delete = _ParallelDelaunay_Delete;
+	self->_print = _ParallelDelaunay_Print;
+	self->_copy = _ParallelDelaunay_Copy;
+	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)ParallelDelaunay_DefaultNew;
+	self->_construct = _ParallelDelaunay_Construct;
+	self->_build = _ParallelDelaunay_Build;
+	self->_initialise = _ParallelDelaunay_Initialise;
+	self->_execute = _ParallelDelaunay_Execute;
+	self->_destroy = _ParallelDelaunay_Destroy;
+
+	self->attributes = Memory_Alloc_Unnamed( DelaunayAttributes );
+	memcpy( self->attributes, attr, sizeof( DelaunayAttributes ) );
+	self->attributes->BuildBoundingTriangle = 0;
+	
+	self->dictionary = dictionary;
+	self->numSites = numSites;
+	self->numInputSites = numSites;
+	self->points = sites;
+	self->leftProc = 0;
+	self->rightProc = 0;
+	self->haloSites[0] = NULL;
+	self->haloSites[1] = NULL;
+	self->localTriangulation = NULL;
+	self->rank = rank;
+	self->numProcs = numProcs;
+	self->comm = comm;
+	
+	_Stg_Class_Init( (Stg_Class*)self );
+	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+	_Stg_Component_Init( (Stg_Component*)self );
+	_ParallelDelaunay_Init( self );
+}
+
+/** Creation implementation */
+ParallelDelaunay* _ParallelDelaunay_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,
+	Dictionary					*dictionary,
+	CoordF						*sites,
+	int							numSites,
+	int							rank,
+	int							numProcs,
+	MPI_Comm					*comm,
+	DelaunayAttributes			*attr )
+{
+	ParallelDelaunay *self = NULL;
+	DelaunayAttributes *myAttr = NULL;
+	
+	myAttr = Memory_Alloc_Unnamed( DelaunayAttributes );
+	memcpy( myAttr, attr, sizeof( DelaunayAttributes ) );
+	myAttr->BuildBoundingTriangle = 0;
+	
+	assert( _sizeOfSelf >= sizeof(ParallelDelaunay) );
+	self = (ParallelDelaunay*)_Delaunay_New( _sizeOfSelf, type, _delete, _print, _copy, _defaultConstructor,
+			_construct, _build, _initialise, _execute, _destroy, name, True, dictionary, sites, numSites, 0, myAttr );
+	
+	self->points = sites;
+	self->leftProc = 0;
+	self->rightProc = 0;
+	self->haloSites[0] = NULL;
+	self->haloSites[1] = NULL;
+	self->localTriangulation = NULL;
+	self->rank = rank;
+	self->numProcs = numProcs;
+	self->comm = comm;
+	
+	if( initFlag ){
+		_ParallelDelaunay_Init( self );
+	}
+
+	return self;
+}
+
+int ParallelDelaunayBtreeCompareFunction( void *a, void *b )
+{
+	Site *s1, *s2;
+
+	s1 = (Site*)a;
+	s2 = (Site*)b;
+
+	if( (*(s1->coord))[0] > (*(s2->coord))[0] ){
+		return 1;
+	}
+	else if( (*(s1->coord))[0] == (*(s2->coord))[0] ){
+		if( (*(s1->coord))[1] > (*(s2->coord))[1] ){
+			return 1;
+		}
+		else if( (*(s1->coord))[1] < (*(s2->coord))[1] ){
+			return -1;
+		}
+		else{
+			return 0;
+		}
+	}
+	else{
+		return -1;
+	}
+}
+
+#define epsilon 0.0001
+#define LOAD_TAG 1
+#define DATA_TAG 1<<1
+#define NEW_SITE_FACTOR 100
+void _ParallelDelaunay_Init( ParallelDelaunay* self )
+{
+	assert( self );
+
+	self->numHaloSites[0] = 0;
+	self->numHaloSites[1] = 0;
+	self->sitePool = MemoryPool_New( Site, NEW_SITE_FACTOR, NEW_SITE_FACTOR );
+	self->coordPool = MemoryPool_New( CoordF, NEW_SITE_FACTOR, NEW_SITE_FACTOR );
+}
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+
+/** Stg_Class_Delete() implementation */
+void _ParallelDelaunay_Delete( void* pd )
+{
+	ParallelDelaunay *self = (ParallelDelaunay*)pd;
+	
+	assert( self );
+
+	Memory_Free( self->localPoints );
+	if( self->mappingTable[0] ) Memory_Free( self->mappingTable[0] );
+	if( self->mappingTable[1] ) Memory_Free( self->mappingTable[1] );
+	Memory_Free( self->mapGlobalToLocal );
+	if( self->processor ) Memory_Free( self->processor );
+	if( self->initialOrder ) Memory_Free( self->initialOrder );
+	Memory_Free( self->processorLoad );
+	Memory_Free( self->attributes );
+
+	Stg_Class_Delete( self->localTriangulation );
+	Stg_Class_Delete( self->sitePool );
+	Stg_Class_Delete( self->coordPool );
+	_Delaunay_Delete( self );
+}
+
+/** Stg_Class_Print() implementation */
+void _ParallelDelaunay_Print( void* pd, Stream* stream )
+{
+	ParallelDelaunay *self = ( ParallelDelaunay* )pd;
+	
+	assert( self );
+	assert( stream );
+
+	_Delaunay_Print( (Delaunay*)self, stream );
+	Journal_Printf( stream, "ParallelDelaunay (ptr): (%p)\n", self );
+}
+
+void *_ParallelDelaunay_Copy( void* pd, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap )
+{
+	return NULL;
+}
+
+void _ParallelDelaunay_Construct( void* pd, Stg_ComponentFactory* cf, void* data )
+{
+	
+}
+
+void _ParallelDelaunay_Build( void* pd, void* data )
+{
+	float _minX, _maxX;
+	float _minY, _maxY;
+	int numProcs, numSites, i, j, count;
+	float stride, start;
+	int *alloced = NULL;
+	int offset;
+	ParallelDelaunay *self = (ParallelDelaunay*)pd;
+	DelaunayAttributes attr;
+
+	assert( self );
+	
+	numProcs = self->numProcs;
+	numSites = self->numSites;
+
+	if( numProcs == 1 ){
+		self->leftProc = numProcs;
+		self->rightProc = numProcs;
+	}
+	else{
+		if( self->rank == MASTER_PROC ){
+			self->leftProc = numProcs;
+			self->rightProc = self->rank + 1;
+		}
+		else if( self->rank == (numProcs-1) ){
+			self->leftProc = self->rank - 1;
+			self->rightProc = numProcs;
+		}
+		else{
+			self->leftProc = self->rank - 1;
+			self->rightProc = self->rank + 1;
+		}
+	}
+	
+	self->mapGlobalToLocal = Memory_Alloc_Array_Unnamed( int, numSites );
+	self->processorLoad = Memory_Alloc_Array_Unnamed( int, numProcs );
+	memset( self->processorLoad, 0, sizeof( int )*numProcs );
+
+	if( self->rank == MASTER_PROC ){
+		self->processor = Memory_Alloc_Array_Unnamed( int, numSites );
+
+		alloced = Memory_Alloc_Array_Unnamed( int, numSites );
+		memset( alloced, 0, sizeof( int )*numSites );
+	
+		self->initialOrder = Memory_Alloc_Array_Unnamed( int, numSites );
+		memset( self->initialOrder, 0, sizeof( int )*numSites );
+		
+		Delaunay_FindMinMax( self->sites, self->numSites, &_minX, &_minY, &_maxX, &_maxY );
+		Delaunay_SortSites( self->sites, self->numSites );
+
+		for( i=0; i<numSites; i++ ){
+			self->initialOrder[i] = self->sites[i].id;
+		}
+		
+		stride = (_maxX - _minX)/((float)numProcs);
+
+		start = _minX;
+		for( i=0; i<numProcs; i++ ){
+			for( j=0; j<numSites; j++ ){
+				if( ((*(self->sites[j].coord))[0] >= start-epsilon) &&
+						((*(self->sites[j].coord))[0] <= (start+stride+epsilon)) &&
+						(!alloced[j]) ){
+					
+					alloced[j] = 1;
+					self->processorLoad[i]++;
+					self->processor[j] = i;
+				}
+			}
+			start+=stride;
+		}
+		
+		/*for( i=0; i<numProcs; i++ ){
+			printf( "processorLoad[%d] = %d\n", i, self->processorLoad[i] );
+		}*/
+		
+		for( i=MASTER_PROC+1; i<numProcs; i++ ){
+			MPI_Send( &(self->processorLoad[i]), 1, MPI_INT, i, LOAD_TAG, *self->comm );
+		}
+
+		self->numLocalSites = self->processorLoad[MASTER_PROC];
+		self->localPoints = Memory_Alloc_Array_Unnamed( CoordF, self->numLocalSites );
+		
+		{
+			CoordF **procCoords = NULL;
+			int *procCoordCounter = NULL;
+
+			procCoordCounter = malloc( sizeof(int)*numProcs );
+			memset( procCoordCounter, 0, sizeof(int)*numProcs );
+
+			procCoords = malloc( sizeof( CoordF* ) * numProcs );
+			for( i=MASTER_PROC+1; i<numProcs; i++ ){
+				procCoords[i] = malloc( sizeof(CoordF) * self->processorLoad[i] );
+				memset( procCoords[i], 0, sizeof( CoordF ) * self->processorLoad[i] );
+			}
+
+			count = 0;
+			for( i=0; i<numSites; i++ ){
+				if( self->processor[i] == MASTER_PROC ){
+					memcpy( &(self->localPoints[count++]), self->sites[i].coord, sizeof(CoordF) );
+				}
+				else{
+					memcpy( &(procCoords[self->processor[i]][procCoordCounter[self->processor[i]]++]), self->sites[i].coord,  sizeof(CoordF) );
+				}			
+			}
+			
+			for( i=MASTER_PROC+1; i<numProcs; i++ ){
+				MPI_Send( procCoords[i], sizeof( CoordF )*self->processorLoad[i], MPI_BYTE, i, DATA_TAG, *self->comm );
+			}
+
+			free( procCoordCounter );
+			for( i=MASTER_PROC+1; i<numProcs; i++ ){
+				free( procCoords[i] );
+			}
+			free( procCoords );
+		}
+
+		Memory_Free( alloced );
+	}
+	else{
+		MPI_Status status;
+		
+		MPI_Recv( &self->numLocalSites, 1, MPI_INT, MASTER_PROC, LOAD_TAG, *self->comm, &status );
+
+		self->localPoints = Memory_Alloc_Array_Unnamed( CoordF, self->numLocalSites );
+
+		MPI_Recv( self->localPoints, sizeof(CoordF)*self->numLocalSites, MPI_BYTE, MASTER_PROC, DATA_TAG, *self->comm, &status );
+	}
+
+	MPI_Bcast( self->processorLoad, numProcs, MPI_INT, MASTER_PROC, *self->comm );
+	self->numTotalLocalSites = self->numLocalSites;
+
+	offset = 0;
+	for( i=0; i<self->rank; i++ ){
+		offset += self->processorLoad[i];
+	}
+	
+	self->localTriangulation = Delaunay_New( "delaunay", self->dictionary, self->localPoints, self->numLocalSites, offset, self->attributes );
+	self->localTriangulation->qp = MemoryPool_New( QuadEdge, self->localTriangulation->numSites * (3 + MERGE_FACTOR), 10 );
+	Delaunay_SortSites(self->localTriangulation->sites, self->localTriangulation->numSites);
+    Delaunay_Recurse(self->localTriangulation, 0, self->localTriangulation->numSites,
+			&self->localTriangulation->leftMost, &self->localTriangulation->rightMost);
+
+	for( i=0; i<numSites; i++ ){
+		self->mapGlobalToLocal[i] = numSites;
+	}
+	
+	for( i=0; i<self->numLocalSites; i++ ){
+		self->mapGlobalToLocal[self->localTriangulation->sites[i].id] = self->localTriangulation->sites[i].id;
+	}
+	
+	if( self->leftProc != self->numProcs ){
+		ParallelDelaunayMerge( self, self->comm, self->leftProc );
+	}
+		
+	if( self->rightProc != self->numProcs ){
+		ParallelDelaunayMerge( self, self->comm, self->rightProc );
+	}
+}
+
+void _ParallelDelaunay_Initialise( void* pd, void* data )
+{
+	
+}
+
+void _ParallelDelaunay_Execute( void* pd, void* data )
+{
+	DelaunayAttributes attr;
+	ParallelDelaunay *self = (ParallelDelaunay*)pd;
+	int offset, i;
+	
+	offset = 0;
+	for( i=0; i<self->rank; i++ ){
+		offset += self->processorLoad[i];
+	}
+
+	if( self->leftProc != self->numProcs ){
+		ParallelDelaunay_RetriangulateAfterMerge( self, LEFT );
+	}
+
+	if( self->rightProc != self->numProcs ){
+		ParallelDelaunay_RetriangulateAfterMerge( self, RIGHT );
+	}
+
+	Stg_Class_Delete( self->localTriangulation );
+	
+	memcpy( &attr, self->attributes, sizeof( DelaunayAttributes ) );
+	attr.BuildTriangleIndices = 0;
+	self->localTriangulation = Delaunay_New( "delaunay", self->dictionary, self->localPoints, self->numTotalLocalSites, offset, &attr );
+	Stg_Component_Build( self->localTriangulation, NULL, True );
+	
+	if( self->attributes->BuildTriangleIndices ){
+		ParallelDelaunay_BuildTriangleIndices( self );
+	}	
+}
+
+void _ParallelDelaunay_Destroy( void* pd, void* data )
+{
+	
+}
+
+#define onCurrentProc( pd, id ) ( id < (pd->processorLoad[pd->rank]+pd->localTriangulation->idOffset) )
+#define onLeftProc( pd, id ) ( ( pd->numHaloSites[0]>0 ) && ( id >= (pd->processorLoad[pd->rank]+pd->localTriangulation->idOffset) ) && \
+				( id < (pd->processorLoad[pd->rank]+pd->numHaloSites[0]+pd->localTriangulation->idOffset) ) )
+#define onRightProc( pd, id ) ( ( pd->numHaloSites[1]>0 ) && ( id >= (pd->processorLoad[pd->rank]+pd->localTriangulation->idOffset+pd->numHaloSites[0]) ) && \
+				( id < (pd->numTotalLocalSites+pd->localTriangulation->idOffset) ) )
+
+void ParallelDelaunay_RetriangulateAfterMerge( ParallelDelaunay *pd, Direction d )
+{
+		BTreeIterator *iter = NULL;
+		Site *result = NULL;
+		ParallelDelaunay *self = pd;
+		int i = 0;
+		int numProcs;
+		int numSites;
+		int count;
+		int offset;
+
+		numProcs = self->numProcs;
+		numSites = self->numSites;
+		offset = 0;
+		for( i=0; i<self->rank; i++ ){
+			offset += self->processorLoad[i];
+		}
+		
+		self->haloSites[d] = BTree_New( ParallelDelaunayBtreeCompareFunction, NULL, NULL, NULL, BTREE_NO_DUPLICATES );
+		
+		for( i=0; i<self->localTriangulation->qp->numElements; i++ ){
+			if( IS_FREE((QuadEdgeRef)&(self->localTriangulation->qp->chunks[0].memory[i*sizeof(QuadEdge)])) ) continue;
+	
+			if( self->mapGlobalToLocal[((Site*)((QuadEdge*)&(self->localTriangulation->qp->chunks[0].memory[i*sizeof(QuadEdge)]))->data[0])->id] == numSites )
+				BTree_InsertNode( self->haloSites[d], ((Site*)((QuadEdge*)&(self->localTriangulation->qp->chunks[0].memory[i*sizeof(QuadEdge)]))->data[0]), sizeof( Site* ) );
+			
+			if( self->mapGlobalToLocal[((Site*)((QuadEdge*)&(self->localTriangulation->qp->chunks[0].memory[i*sizeof(QuadEdge)]))->data[2])->id] == numSites )
+				BTree_InsertNode( self->haloSites[d], ((Site*)((QuadEdge*)&(self->localTriangulation->qp->chunks[0].memory[i*sizeof(QuadEdge)]))->data[2]), sizeof( Site* ) );
+		}
+
+		self->localPoints = Memory_Realloc_Array
+			( self->localPoints, CoordF, sizeof(CoordF) * (self->numTotalLocalSites + self->haloSites[d]->nodeCount) );
+		
+		self->mappingTable[d] = Memory_Alloc_Array_Unnamed( int, self->haloSites[d]->nodeCount );
+		memset( self->mappingTable[d], 0, sizeof( int ) * self->haloSites[d]->nodeCount );
+		
+		count=0;
+		i = self->numTotalLocalSites;
+		iter = BTreeIterator_New( self->haloSites[d] );
+		for( result=(Site*)BTreeIterator_First(iter);
+				result;
+				result=(Site*)BTreeIterator_Next(iter)){
+			
+			self->mappingTable[d][count++] = result->id;
+			memcpy( &(self->localPoints[i++]), result->coord, sizeof( CoordF ) );
+		}
+		Stg_Class_Delete( self->localTriangulation );
+
+		self->localTriangulation = Delaunay_New( "delaunay", self->dictionary, self->localPoints, self->numLocalSites, offset, self->attributes );
+		self->localTriangulation->qp = MemoryPool_New( QuadEdge, self->localTriangulation->numSites * 4, 10 );
+		Delaunay_SortSites(self->localTriangulation->sites, self->localTriangulation->numSites);
+    	Delaunay_Recurse(self->localTriangulation, 0, self->localTriangulation->numSites,
+				&self->localTriangulation->leftMost, &self->localTriangulation->rightMost);
+
+		self->numHaloSites[d] = self->haloSites[d]->nodeCount;
+		self->numTotalLocalSites += self->haloSites[d]->nodeCount;
+		
+		Stg_Class_Delete( self->haloSites[d] );
+		Stg_Class_Delete( iter );
+}
+
+void ParallelDelaunay_BuildTriangleIndices( ParallelDelaunay *pd )
+{
+	int i = 0, triCount;
+	QuadEdgeRef e = 0, eStart = 0, eOnext = 0, eLnext = 0;
+	QuadEdge *edges = NULL;
+	Site *sites = NULL;
+	int maxEdges = 0;
+	int rank = 0;
+	int pass = 0;
+	unsigned int **triIndices = NULL;
+	Delaunay *delaunay = NULL;
+
+	delaunay = pd->localTriangulation;
+
+	assert( delaunay );
+
+	delaunay->triangleIndices = Memory_Alloc_Array_Unnamed( unsigned int*, delaunay->numFaces );
+	delaunay->triangleIndices[0] = Memory_Alloc_Array_Unnamed( unsigned int, delaunay->numFaces * 3 );
+	memset( delaunay->triangleIndices[0] , 0, sizeof(unsigned int) * delaunay->numFaces * 3 );
+
+	for( i=0; i<delaunay->numFaces; i++ ){
+		delaunay->triangleIndices[i] = delaunay->triangleIndices[0]+i*3;
+	}
+	
+	triIndices = delaunay->triangleIndices;
+	
+	edges = (QuadEdge*)delaunay->qp->chunks[0].memory;
+	sites = delaunay->sites;
+	rank = pd->rank;
+	maxEdges = delaunay->qp->numElements;
+		
+	for (i = 0; i < maxEdges; i++) {
+		edges[i].count = 0;
+	}
+
+	triCount = 0;
+	for (i = 0; i < maxEdges; i++) {
+		
+		e = eStart = (QuadEdgeRef)((void*)&(edges[i]));
+		
+		if( IS_FREE(e) )continue;
+		
+		do{
+			eOnext = ONEXT(e);
+			eLnext = LNEXT(e);
+			
+			if( (COUNT(e)<2) && (COUNT(LNEXT(e))<2) && (COUNT(eOnext)<2) ){
+				if( ((((Site*)ORG(eLnext)) == ((Site*)DEST(e)))) &&
+				 ((((Site*)DEST(eLnext)) == ((Site*)DEST(eOnext)))) ){
+		
+					if( onCurrentProc( pd, ((Site*)ORG(e))->id ) ||
+						onCurrentProc( pd, ((Site*)DEST(e))->id ) ||
+						onCurrentProc( pd, ((Site*)DEST(eOnext))->id ) ){
+						
+						pass = 0;
+						if( !onCurrentProc( pd, ((Site*)ORG(e))->id ) ){
+							if( !onRightProc( pd, ((Site*)ORG(e))->id ) ) pass = 1;
+						}
+						
+						if( !onCurrentProc( pd, ((Site*)DEST(e))->id ) ){
+							if( !onRightProc( pd, ((Site*)DEST(e))->id ) ) pass = 1;
+						}
+						
+						if( !onCurrentProc( pd, ((Site*)DEST(eOnext))->id ) ){
+							if( !onRightProc( pd, ((Site*)DEST(eOnext))->id ) ) pass = 1;
+						}
+						
+						if( !pass ){
+							triIndices[triCount][0] = ParallelDelaunay_TranslateLocalToGlobal(pd, ((Site*)ORG(e))->id);
+							triIndices[triCount][1] = ParallelDelaunay_TranslateLocalToGlobal(pd, ((Site*)DEST(e))->id);
+							triIndices[triCount][2] = ParallelDelaunay_TranslateLocalToGlobal(pd, ((Site*)DEST(eOnext))->id);
+
+							triCount++;
+						}
+					}
+
+					COUNT(e)++;
+					COUNT(LNEXT(e))++;
+					COUNT(eOnext)++;
+				}
+			}
+			e = eOnext;
+		}while( e != eStart );
+	}
+	
+	delaunay->numTriangles = triCount;
+}
+
+#define NEIGHBOURS_TAG 1<<4
+#define VORONOI_SIDES_TAG 1<<5
+#define VORONOI_AREA_TAG 1<<6
+#define NUM_NEIGHBOUR_TAG 1<<7
+#define MAX_NEIGHBOURS 100
+
+void ParallelDelaunay_GatherTriangulation( ParallelDelaunay *pd )
+{
+	int i, j, k, l, count, count1;
+	MPI_Status st;
+	int numNeighboursSum = 0;
+	int stride = 0;
+	
+	assert( pd );
+
+	if( pd->rank == MASTER_PROC ){
+		
+		if( pd->attributes->CalculateVoronoiSurfaceArea ){
+			pd->voronoiArea = Memory_Alloc_Array_Unnamed( float, pd->numInputSites );
+		}
+
+		if( pd->attributes->FindNeighbours ){
+			pd->numNeighbours = Memory_Alloc_Array_Unnamed( unsigned int, pd->numInputSites );
+		}
+		
+		count = 0;
+		count1 = 0;
+		numNeighboursSum = 0;
+
+		{
+			float **procVoronoi = NULL;
+			int **procNumNeighbours = NULL;
+			int *procVoronoiCounter = NULL;
+			int *procNumNeighboursCounter = NULL;
+
+			procVoronoiCounter = malloc( sizeof( int ) * pd->numProcs );
+			memset( procVoronoiCounter, 0, sizeof( int ) * pd->numProcs );
+			
+			procNumNeighboursCounter = malloc( sizeof( int ) * pd->numProcs );
+			memset( procNumNeighboursCounter, 0, sizeof( int ) * pd->numProcs );
+
+			procVoronoi = malloc( sizeof( float* ) * pd->numProcs ); memset( procVoronoi, 0, sizeof(float*)*pd->numProcs );
+			procNumNeighbours = malloc( sizeof( int* ) * pd->numProcs ); memset( procNumNeighbours, 0, sizeof(int*)*pd->numProcs );
+
+			for( i=MASTER_PROC+1; i<pd->numProcs; i++ ){
+
+				if( pd->attributes->CalculateVoronoiSurfaceArea ){
+					procVoronoi[i] = malloc( sizeof(float)*pd->processorLoad[i] );
+					memset( procVoronoi[i], 0, sizeof( float ) * pd->processorLoad[i] );
+					MPI_Recv( procVoronoi[i], pd->processorLoad[i], MPI_FLOAT, i, VORONOI_AREA_TAG, (*pd->comm), &st );
+				}
+
+				if( pd->attributes->FindNeighbours ){
+					procNumNeighbours[i] = malloc( sizeof(int)*pd->processorLoad[i] );
+					memset( procNumNeighbours[i], 0, sizeof(int) * pd->processorLoad[i] );
+					MPI_Recv( procNumNeighbours[i], pd->processorLoad[i], MPI_INT, i, NUM_NEIGHBOUR_TAG, (*pd->comm), &st );
+				}
+			}
+
+			for( i=0; i<pd->numInputSites; i++ ){
+				int proc, order;
+				proc = pd->processor[i];
+				order = pd->initialOrder[i];
+
+				if( pd->attributes->CalculateVoronoiSurfaceArea ){
+					if( pd->processor[i] == MASTER_PROC ){
+						memcpy( &(pd->voronoiArea[pd->initialOrder[i]]), &(pd->localTriangulation->voronoiArea[count++]), sizeof( float ) );
+					}
+					else{
+						memcpy( &(pd->voronoiArea[order]), &(procVoronoi[proc][procVoronoiCounter[proc]++]), sizeof(float) );
+					}
+				}
+			
+				if( pd->attributes->FindNeighbours ){
+					if( pd->processor[i] == MASTER_PROC ){
+						memcpy( &(pd->numNeighbours[pd->initialOrder[i]]), &(pd->localTriangulation->numNeighbours[count1++]), sizeof( int ) );
+					}
+					else{
+						memcpy( &(pd->numNeighbours[pd->initialOrder[i]]), &(procNumNeighbours[proc][procNumNeighboursCounter[proc]++]), sizeof( int ) );
+					}
+					numNeighboursSum += pd->numNeighbours[pd->initialOrder[i]];
+				}
+			}
+			
+			for( i=MASTER_PROC+1; i<pd->numProcs; i++ ){
+				if( procVoronoi[i] ) free( procVoronoi[i] );
+				if( procNumNeighbours[i] ) free( procNumNeighbours[i] );
+			}
+			free( procVoronoi );
+			free( procNumNeighbours );
+			free( procVoronoiCounter );
+			free( procNumNeighboursCounter );
+		}
+
+		if( pd->attributes->FindNeighbours ){
+			pd->neighbours = Memory_Alloc_Array_Unnamed( unsigned int*, pd->numInputSites );
+			pd->neighbours[0] = Memory_Alloc_Array_Unnamed( unsigned int, numNeighboursSum );
+		}
+	
+		if( pd->attributes->CalculateVoronoiSides ){
+			pd->voronoiSides = Memory_Alloc_Array_Unnamed( float*, pd->numInputSites );
+			pd->voronoiSides[0] = Memory_Alloc_Array_Unnamed( float, numNeighboursSum );
+		}
+		
+		stride = 0;
+		for( j=0; j<pd->numInputSites; j++ ){
+			if( pd->attributes->FindNeighbours ){
+				pd->neighbours[j] = pd->neighbours[0]+stride;
+			}
+			
+			if( pd->attributes->CalculateVoronoiSides ){
+				pd->voronoiSides[j] = pd->voronoiSides[0]+stride;
+			}
+
+			if( pd->attributes->FindNeighbours ){
+				stride += pd->numNeighbours[j];
+			}
+		}
+		
+		{
+			float **procVoronoiSides = NULL;
+			float **procNeighbours = NULL;
+			int *procVoronoiSidesCounter = NULL;
+			int *procNeighboursCounter = NULL;
+			int *procNumNeighboursCount = NULL;
+
+			procVoronoiSidesCounter = malloc( sizeof( int ) * pd->numProcs );
+			memset( procVoronoiSidesCounter, 0, sizeof( int ) * pd->numProcs );
+			
+			procNeighboursCounter = malloc( sizeof( int ) * pd->numProcs );
+			memset( procNeighboursCounter, 0, sizeof( int ) * pd->numProcs );
+			
+			procNumNeighboursCount = malloc( sizeof( int ) * pd->numProcs );
+			memset( procNumNeighboursCount, 0, sizeof( int ) * pd->numProcs );
+
+			procVoronoiSides = malloc( sizeof( float* ) * pd->numProcs ); memset( procVoronoiSides, 0, sizeof(float*)*pd->numProcs );
+			procNeighbours = malloc( sizeof( unsigned int* ) * pd->numProcs ); memset( procNeighbours, 0, sizeof(unsigned int*)*pd->numProcs );
+
+			for( i=0; i<pd->numInputSites; i++ ){
+				procNumNeighboursCount[pd->processor[i]]+=pd->numNeighbours[pd->initialOrder[i]];
+			}
+
+			for( i=MASTER_PROC+1; i<pd->numProcs; i++ ){
+				if( pd->attributes->CalculateVoronoiSides ){
+					procVoronoiSides[i] = malloc( sizeof(float)*procNumNeighboursCount[i] );
+					memset( procVoronoiSides[i], 0, sizeof( float ) * procNumNeighboursCount[i] );
+					MPI_Recv( procVoronoiSides[i], procNumNeighboursCount[i], MPI_FLOAT, i, VORONOI_SIDES_TAG, (*pd->comm), &st );
+				}
+
+				if( pd->attributes->FindNeighbours ){
+					procNeighbours[i] = malloc( sizeof(unsigned int)*procNumNeighboursCount[i] );
+					memset( procNeighbours[i], 0, sizeof(unsigned int) * procNumNeighboursCount[i] );
+					MPI_Recv( procNeighbours[i], procNumNeighboursCount[i], MPI_INT, i, NEIGHBOURS_TAG, (*pd->comm), &st );
+				}
+			}
+
+			count = 0;
+			for(j=0; j<pd->numInputSites; j++){
+				int proc, order;
+				proc = pd->processor[j];
+				order = pd->initialOrder[j];
+				
+				if( pd->processor[j] == MASTER_PROC ){
+					if( pd->attributes->CalculateVoronoiSides ){
+						memcpy( (pd->voronoiSides[pd->initialOrder[j]]), (pd->localTriangulation->voronoiSides[count]),
+								sizeof(float)*pd->localTriangulation->numNeighbours[count] );
+					}
+					if( pd->attributes->FindNeighbours ){
+						memcpy( (pd->neighbours[pd->initialOrder[j]]), (pd->localTriangulation->neighbours[count]),
+								sizeof(int)*pd->localTriangulation->numNeighbours[count] );
+						for( i=0; i<pd->numNeighbours[pd->initialOrder[j]]; i++ ){
+							pd->neighbours[pd->initialOrder[j]][i] = 
+								pd->initialOrder[ParallelDelaunay_TranslateLocalToGlobal(pd, pd->neighbours[pd->initialOrder[j]][i])];
+						}
+					}
+					count++;
+				}
+				else{
+					if( pd->attributes->CalculateVoronoiSides ){
+						memcpy( (pd->voronoiSides[pd->initialOrder[j]]),
+								&(procVoronoiSides[proc][procVoronoiSidesCounter[proc]]),
+								sizeof(float)*pd->numNeighbours[order] );
+						procVoronoiSidesCounter[proc]+=pd->numNeighbours[order];
+					}
+					if( pd->attributes->FindNeighbours ){
+						memcpy( (pd->neighbours[pd->initialOrder[j]]),
+								&(procNeighbours[proc][procNeighboursCounter[proc]]),
+								sizeof(int)*pd->numNeighbours[order] );
+						procNeighboursCounter[proc]+=pd->numNeighbours[order];
+
+						for( i=0; i<pd->numNeighbours[pd->initialOrder[j]]; i++ ){
+							pd->neighbours[pd->initialOrder[j]][i] = pd->initialOrder[pd->neighbours[pd->initialOrder[j]][i]];
+						}
+					}
+				}
+			}
+
+			for( i=MASTER_PROC+1; i<pd->numProcs; i++ ){
+				if( procVoronoiSides[i] ) free( procVoronoiSides[i] );
+				if( procNeighbours[i] ) free( procNeighbours[i] );
+			}
+			free( procVoronoiSides );
+			free( procNeighbours );
+			free( procVoronoiSidesCounter );
+			free( procNeighboursCounter );			
+			free( procNumNeighboursCount );			
+		}
+	}
+	else{
+		if( pd->attributes->CalculateVoronoiSurfaceArea ){
+			MPI_Send( (pd->localTriangulation->voronoiArea), pd->numLocalSites, MPI_FLOAT, MASTER_PROC, VORONOI_AREA_TAG, (*pd->comm) );
+		}
+			
+		if( pd->attributes->FindNeighbours ){
+			MPI_Send( (pd->localTriangulation->numNeighbours), pd->numLocalSites, MPI_INT, MASTER_PROC, NUM_NEIGHBOUR_TAG, (*pd->comm) );
+		}
+		
+		if( pd->attributes->CalculateVoronoiSides ){
+			int sum = 0;
+			for( i=0; i<pd->numLocalSites; i++ ){
+				sum+=pd->localTriangulation->numNeighbours[i];
+			}
+			MPI_Send( pd->localTriangulation->voronoiSides[0], sum, 
+					MPI_FLOAT, MASTER_PROC, VORONOI_SIDES_TAG, *(pd->comm));
+		}
+
+		if( pd->attributes->FindNeighbours ){
+			int sum = 0;
+			for( i=0; i<pd->numLocalSites; i++ ){
+				sum+=pd->localTriangulation->numNeighbours[i];
+				
+				for( j=0; j<pd->localTriangulation->numNeighbours[i]; j++ ){
+					pd->localTriangulation->neighbours[i][j] = ParallelDelaunay_TranslateLocalToGlobal( pd, pd->localTriangulation->neighbours[i][j] );
+				}
+			}
+			MPI_Send( pd->localTriangulation->neighbours[0], sum, MPI_INT, MASTER_PROC, NEIGHBOURS_TAG, *(pd->comm) );
+		}
+	}
+	
+	if( pd->attributes->BuildTriangleIndices ){
+		unsigned int **triIndices = NULL;
+		int globalNumTriangles = 0;
+		Delaunay *delaunay = NULL;
+		int *triCountArray = NULL;
+		int triCount = 0;
+		int rank = 0;
+
+		delaunay = pd->localTriangulation;
+
+		assert( delaunay );
+	
+		triIndices = delaunay->triangleIndices;
+		triCount = delaunay->numTriangles;
+
+		MPI_Allreduce( &triCount, &globalNumTriangles, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
+	
+		pd->numTriangles = globalNumTriangles;
+		
+		triCountArray = Memory_Alloc_Array_Unnamed( int, pd->numProcs );
+		rank = pd->rank;
+	
+		if( rank == MASTER_PROC ){
+
+			pd->triangleIndices = Memory_Alloc_Array_Unnamed( unsigned int*,  globalNumTriangles );
+			pd->triangleIndices[0] = Memory_Alloc_Array_Unnamed( unsigned int, globalNumTriangles*3 );
+
+			if ( pd->attributes->BuildTriangleNeighbours ){
+				pd->triangleNeighbours = Memory_Alloc_Array_Unnamed( unsigned int*,  globalNumTriangles );
+				pd->triangleNeighbours[0] = Memory_Alloc_Array_Unnamed( unsigned int, globalNumTriangles*3 );
+			}
+
+			triCountArray[0] = triCount;
+			for( i=MASTER_PROC+1; i<pd->numProcs; i++ ){
+				MPI_Recv( &(triCountArray[i]), 1, MPI_INT, i, DATA_TAG, MPI_COMM_WORLD, &st );					
+			}
+
+			for( i=0; i<globalNumTriangles; i++ ){
+				pd->triangleIndices[i] = pd->triangleIndices[0] + i*3;
+	
+				if ( pd->attributes->BuildTriangleNeighbours ){
+					pd->triangleNeighbours[i] = pd->triangleNeighbours[0] + i*3;
+
+					pd->triangleNeighbours[i][0] = pd->numTriangles;
+					pd->triangleNeighbours[i][1] = pd->numTriangles;
+					pd->triangleNeighbours[i][2] = pd->numTriangles;
+				}
+			}
+
+			for(j=0; j<triCountArray[0]; j++){
+				memcpy( pd->triangleIndices[j], triIndices[j], sizeof(int)*3 );
+			}
+		
+			stride = j;
+			for( i=MASTER_PROC+1; i<pd->numProcs; i++ ){
+				unsigned int *temp = malloc( sizeof(unsigned int)*triCountArray[i]*3 );
+					MPI_Recv( temp, triCountArray[i]*3, MPI_INT, i, DATA_TAG, MPI_COMM_WORLD, &st );					
+				for(j=0; j<triCountArray[i]*3; j+=3){
+					memcpy( pd->triangleIndices[stride++], &(temp[j]), sizeof(int)*3 );
+				}
+				free( temp );
+			}
+
+			for( i=0; i<pd->numTriangles; i++ ){
+				pd->triangleIndices[i][0] = pd->initialOrder[pd->triangleIndices[i][0]];
+				pd->triangleIndices[i][1] = pd->initialOrder[pd->triangleIndices[i][1]];
+				pd->triangleIndices[i][2] = pd->initialOrder[pd->triangleIndices[i][2]];
+			}
+
+			/*for( j=0; j<globalNumTriangles; j++ ){
+				printf( "indices[%d] = [%d, %d, %d]\n", j, pd->triangleIndices[j][0], pd->triangleIndices[j][1], pd->triangleIndices[j][2] );
+			}*/
+			
+			stride = 0;
+			if ( pd->attributes->BuildTriangleNeighbours ){
+				int **nodeToTriangle = NULL;
+				int *nodeToTriangleCount = NULL;
+				int *triangleNeighboursCount = NULL;
+				int triangles[2];
+				int counter = 0;
+				int found = 0;
+				int m = 0;
+
+				nodeToTriangle = Memory_Alloc_Array_Unnamed( int*, pd->numInputSites );
+				nodeToTriangle[0] = Memory_Alloc_Array_Unnamed( int, numNeighboursSum );
+
+				nodeToTriangleCount = Memory_Alloc_Array_Unnamed( int, pd->numInputSites );
+				memset( nodeToTriangleCount, 0, sizeof( int ) * pd->numInputSites );
+				
+				triangleNeighboursCount = Memory_Alloc_Array_Unnamed( int, pd->numTriangles );
+				memset( triangleNeighboursCount, 0, sizeof( int ) * pd->numTriangles );
+
+				for( i=0; i<pd->numSites; i++ ){
+					nodeToTriangle[i] = nodeToTriangle[0] + stride;
+
+					stride += pd->numNeighbours[i];
+				}
+
+				for( i=0; i<pd->numTriangles; i++ ){
+					nodeToTriangle[pd->triangleIndices[i][0]][nodeToTriangleCount[pd->triangleIndices[i][0]]++] = i;
+					nodeToTriangle[pd->triangleIndices[i][1]][nodeToTriangleCount[pd->triangleIndices[i][1]]++] = i;
+					nodeToTriangle[pd->triangleIndices[i][2]][nodeToTriangleCount[pd->triangleIndices[i][2]]++] = i;
+				}
+				
+				for( i=0; i<pd->numInputSites; i++ ){
+					for( j=0; j<pd->numNeighbours[i]; j++ ){
+						triangles[0] = -1;
+						triangles[1] = -1;
+						counter = 0;
+						for( k=0; k<nodeToTriangleCount[i]; k++ ){
+							for( l=0; l<3; l++ ){
+								if( pd->neighbours[i][j] == pd->triangleIndices[nodeToTriangle[i][k]][l] ){
+									triangles[counter++] = nodeToTriangle[i][k];
+								}
+							}
+						}
+						
+						if( (triangles[0] > -1) ){
+							
+							found = 0;
+							for( m=0; m<3; m++ ){
+								if( pd->triangleNeighbours[triangles[0]][m] == triangles[1] ) found = 1;
+							}
+							if( !found ){
+								pd->triangleNeighbours[triangles[0]][triangleNeighboursCount[triangles[0]]++] = triangles[1];
+							}
+						}
+						if( (triangles[1] > -1) ){
+						
+							found = 0;
+							for( m=0; m<3; m++ ){
+								if( pd->triangleNeighbours[triangles[1]][m] == triangles[0] ) found = 1;
+							}
+							if( !found ){
+								pd->triangleNeighbours[triangles[1]][triangleNeighboursCount[triangles[1]]++] = triangles[0];
+							}
+						}
+					}
+				}
+				
+				Memory_Free( nodeToTriangle[0] );
+				Memory_Free( nodeToTriangle );
+				Memory_Free( nodeToTriangleCount );
+				Memory_Free( triangleNeighboursCount );
+			}
+		}
+		else{
+			MPI_Send( &triCount, 1, MPI_INT, MASTER_PROC, DATA_TAG, MPI_COMM_WORLD );
+			MPI_Send( triIndices[0], 3*triCount, MPI_INT, MASTER_PROC, DATA_TAG, MPI_COMM_WORLD );
+		}
+
+		Memory_Free( triCountArray );
+	}	
+}
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+
+int ParallelDelaunay_TranslateLocalToGlobal( ParallelDelaunay *self, int id )
+{
+	if( id >= (self->localTriangulation->idOffset+self->numLocalSites) ){
+	
+		if( (self->leftProc != self->numProcs) && (id < (self->localTriangulation->idOffset+self->numLocalSites + self->numHaloSites[0])) ){
+			
+			id = self->mappingTable[0][(id -
+						(self->localTriangulation->idOffset+
+						 self->numLocalSites))];
+		}
+		else{
+
+			id = self->mappingTable[1][(id -
+						(self->localTriangulation->idOffset+
+						 self->numLocalSites+
+						 self->numHaloSites[0]))];
+		}
+		return id;
+	}
+	else{
+		return id;
+	}
+}
+
+#define EDGE_TAG 102
+#define BREAK_TAG 103
+typedef struct SitePacket_t{
+	int id;
+	float xyz[3];
+}SitePacket;
+void ParallelDelaunaySendEdge( QuadEdgeRef edge, int rank, MPI_Comm *comm, MPI_Request *req )
+{
+	SitePacket sp[2];
+	assert(edge);
+
+	memcpy( sp[0].xyz, ((Site*)ORG(edge))->coord, sizeof( CoordF ) );
+	sp[0].id = ((Site*)ORG(edge))->id;
+	
+	memcpy( sp[1].xyz, ((Site*)DEST(edge))->coord, sizeof( CoordF ) );
+	sp[1].id = ((Site*)DEST(edge))->id;
+	MPI_Isend( sp, sizeof(SitePacket)*2, MPI_BYTE, rank, EDGE_TAG, *comm, req );
+}
+
+QuadEdgeRef ParallelDelaunayRecvEdge( ParallelDelaunay *pd, int rank, MPI_Comm *comm )
+{
+	QuadEdgeRef edge = 0;
+	CoordF *c[2];
+	Site *s[2];
+	MPI_Status st;
+	SitePacket sp[2];
+	Delaunay *d = NULL;
+	
+	assert( pd );
+	d = pd->localTriangulation;
+	
+	edge = MakeQuadEdge( d->qp );
+	
+	assert(edge);
+
+	s[0] = MemoryPool_NewObject( Site, pd->sitePool );
+	s[1] = MemoryPool_NewObject( Site, pd->sitePool );
+	
+	c[0] = MemoryPool_NewObject( CoordF, pd->coordPool );
+	c[1] = MemoryPool_NewObject( CoordF, pd->coordPool );
+	
+	MPI_Recv( sp, sizeof(SitePacket)*2, MPI_BYTE, rank, EDGE_TAG, *comm, &st );
+
+	memcpy( (c[0]), sp[0].xyz, sizeof( CoordF ) );
+	memcpy( (c[1]), sp[1].xyz, sizeof( CoordF ) );
+
+	s[0]->id = sp[0].id;
+	s[0]->coord = (c[0]);
+	s[1]->id = sp[1].id;
+	s[1]->coord = (c[1]);
+	
+	ORG(edge)=(s[0]);
+	DEST(edge)=(s[1]);
+
+	return edge;
+}
+
+int ParallelDelaunayListCompareFunction( void *a, void *b )
+{
+	QuadEdgeRef e1, e2;
+
+	e1 = (QuadEdgeRef)a;
+	e2 = (QuadEdgeRef)b;
+
+	if( e1 > e2 ){
+		return 1;
+	}
+	else if( e1 < e2 ){
+		return -1;
+	}
+	else{
+		return 0;
+	}
+}
+
+void ParallelDelaunayListDeleteFunction( void *a )
+{
+
+}
+
+QuadEdgeRef ParallelDelaunayFindLowestQuadEdge( ParallelDelaunay *pd, MPI_Comm *comm, int rank )
+{
+	QuadEdgeRef ldi=0, rdi=0;
+	MPI_Request r;
+	MPI_Status s;
+	int globalBreak, localBreak;
+	LinkedList *list = NULL;
+	LinkedListIterator *iter;
+	QuadEdgeRef result = 0;
+	Delaunay *d = NULL;
+
+	assert( pd );
+	d = pd->localTriangulation;
+	
+	list = LinkedList_New( ParallelDelaunayListCompareFunction, NULL, NULL, ParallelDelaunayListDeleteFunction, LINKEDLIST_UNSORTED );
+	iter = LinkedListIterator_New( list );
+	
+	if( rank == pd->leftProc ){
+		rdi = d->leftMost;
+	}
+	else if( rank == pd->rightProc ){
+		ldi = d->rightMost;
+	}
+	else{
+		fprintf( stderr, "Failed to find lowest edge on rank %d..!\n Aborting..!\n", rank );
+	}
+
+	if( rank == pd->numProcs ) return 0;
+	
+	localBreak = 0;
+	globalBreak = 0;
+
+	while (1) 
+	{
+		localBreak = 0;
+		globalBreak = 0;
+
+		if( rank == pd->leftProc ){
+			ParallelDelaunaySendEdge( rdi, rank, comm, &r );
+			ldi = ParallelDelaunayRecvEdge( pd, rank, comm );
+			MPI_Wait( &r, &s );
+			LinkedList_InsertNode( list, (void*)ldi, sizeof( QuadEdgeRef* ) );
+			
+			if (RightOf(ORG(ldi), rdi)){
+				rdi = ONEXT(SYM(rdi));
+				localBreak = 1;
+			}
+			else{
+			}
+		}
+		
+		if( rank == pd->rightProc ){
+			ParallelDelaunaySendEdge( ldi, rank, comm, &r );
+			rdi = ParallelDelaunayRecvEdge( pd, rank, comm );
+			MPI_Wait( &r, &s );
+			LinkedList_InsertNode( list, (void*)rdi, sizeof( QuadEdgeRef* ) );
+			
+			if (LeftOf(ORG(rdi), ldi)){
+				ldi = LNEXT(ldi);
+				localBreak = 1;
+			}
+			else{
+			}
+		}
+
+		MPI_Isend( &localBreak, 1, MPI_INT, rank, BREAK_TAG, *comm, &r );
+		MPI_Recv( &(globalBreak), 1, MPI_INT, rank, BREAK_TAG, *comm, &s );
+		MPI_Wait( &r, &s );
+		globalBreak |= localBreak;
+		
+		if( globalBreak == 0 ){
+			break;
+		}
+	}
+
+	for( result=(QuadEdgeRef)((void*)LinkedListIterator_First(iter));
+			result != 0;
+			result=(QuadEdgeRef)((void*)LinkedListIterator_Next(iter)) ){
+
+		DeleteQuadEdge( d->qp, result );
+	}
+
+	Stg_Class_Delete( list );
+	Stg_Class_Delete( iter );
+	
+	if( rank == pd->leftProc ){
+		return rdi;
+	}
+	else if( rank == pd->rightProc ){
+		return ldi;
+	}
+	
+	return 0;
+}
+
+void ParallelDelaunayMerge( ParallelDelaunay *pd, MPI_Comm *comm, int rank )
+{
+	QuadEdgeRef lowest = 0, lcand = 0, rcand = 0, basel = 0, baselPrev;
+	MPI_Request r;
+	MPI_Status s;
+	int localBreak=0, globalBreak=0;
+	double result = 0.0f;
+	Delaunay *d = NULL;
+	
+	assert( pd );
+
+	d = pd->localTriangulation;
+
+	lowest = ParallelDelaunayFindLowestQuadEdge( pd, comm, rank );
+	
+	localBreak = 0;
+	globalBreak = 0;
+
+	if( rank == pd->numProcs ){
+		fprintf( stderr, "Failed to merge rank %d with rank %d..!\nAborting..!\n", pd->rank, rank );
+		assert( 0 );
+	}
+	
+	if( rank == pd->leftProc ){
+		rcand = lowest;
+		
+		ParallelDelaunaySendEdge( lowest, rank, comm, &r );
+		lcand = ParallelDelaunayRecvEdge( pd, rank, comm );
+		MPI_Wait( &r, &s );
+		
+		basel = MakeQuadEdge( d->qp );
+		ORG(basel) = DEST(SYM(rcand));
+		DEST(basel) = ORG(lcand);
+
+		DeleteQuadEdge( d->qp, lcand );
+		
+		CCW( ((Site*)DEST(rcand))->coord, ((Site*)DEST(basel))->coord, ((Site*)ORG(basel))->coord, &result);
+		if( result == 0.0f ){
+			rcand = OPREV(rcand);
+		}
+		
+		while(1){
+			localBreak = 0;
+			if (RightOf(DEST(rcand), basel)){
+				while (InCircle(DEST(basel), ORG(basel), DEST(rcand), DEST(OPREV(rcand)))){
+					QuadEdgeRef t = OPREV(rcand);
+
+					DeleteQuadEdge(d->qp, rcand);
+					rcand = t;
+				}
+			}
+			
+			if (!RightOf(DEST(rcand), basel)) localBreak = 1;
+
+			MPI_Isend( &localBreak, 1, MPI_INT, rank, BREAK_TAG, *comm, &r );
+			MPI_Recv( &(globalBreak), 1, MPI_INT, rank, BREAK_TAG, *comm, &s );
+			MPI_Wait( &r, &s );
+			globalBreak &= localBreak;
+
+			if( globalBreak ){
+				break;
+			}
+
+			ParallelDelaunaySendEdge( rcand, rank, comm, &r );
+			lcand = ParallelDelaunayRecvEdge( pd, rank, comm );
+			MPI_Wait( &r, &s );
+
+			if ( !RightOf(DEST(lcand), basel) ||
+				( RightOf(DEST(rcand), basel) && 
+				InCircle(DEST(lcand), ORG(lcand), ORG(rcand), DEST(rcand)))){
+			
+				baselPrev = basel;
+				basel = MakeQuadEdge(d->qp);
+				ORG(basel) = DEST(rcand);
+				DEST(basel) = ORG(SYM(baselPrev));
+				
+				rcand=LNEXT(rcand);
+				DeleteQuadEdge( d->qp, lcand );
+			}
+			else{
+				baselPrev = basel;
+				basel = MakeQuadEdge(d->qp);
+				ORG(basel) = DEST(SYM(baselPrev));
+				DEST(basel) = ORG(SYM(lcand));
+			}
+		}
+	}
+	else if( rank == pd->rightProc ){
+		lcand = lowest;
+		
+		ParallelDelaunaySendEdge( lowest, rank, comm, &r );
+		rcand = ParallelDelaunayRecvEdge( pd, rank, comm );
+		MPI_Wait( &r, &s );
+		
+		basel = MakeQuadEdge(d->qp);
+		ORG(basel) = DEST(SYM(rcand));
+		DEST(basel) = ORG(lcand);
+		
+		DeleteQuadEdge( d->qp, rcand );
+		
+		CCW( ((Site*)DEST(lcand))->coord, ((Site*)DEST(basel))->coord, ((Site*)ORG(basel))->coord, &result);
+		if( result == 0.0f ){
+			lcand = ONEXT(lcand);
+		}
+		
+		while(1){
+			localBreak = 0;
+			if (RightOf(DEST(lcand), basel)){
+				while (InCircle(DEST(basel), ORG(basel), DEST(lcand), DEST(ONEXT(lcand)))){
+					QuadEdgeRef t = ONEXT(lcand);
+					
+					DeleteQuadEdge(d->qp, lcand);
+					lcand = t;
+				}
+			}
+			
+			if (!RightOf(DEST(lcand), basel)) localBreak = 1;
+
+			MPI_Isend( &localBreak, 1, MPI_INT, rank, BREAK_TAG, *comm, &r );
+			MPI_Recv( &(globalBreak), 1, MPI_INT, rank, BREAK_TAG, *comm, &s );
+			MPI_Wait( &r, &s );
+			globalBreak &= localBreak;
+
+			if( globalBreak ){
+				break;
+			}
+			
+			ParallelDelaunaySendEdge( lcand, rank, comm, &r );
+			rcand = ParallelDelaunayRecvEdge( pd, rank, comm );
+			MPI_Wait( &r, &s );
+
+			if ( !RightOf(DEST(lcand), basel) ||
+				( RightOf(DEST(rcand), basel) && 
+				InCircle(DEST(lcand), ORG(lcand), ORG(rcand), DEST(rcand)))){
+				
+				baselPrev = basel;
+				basel = MakeQuadEdge(d->qp);
+				ORG(basel) = DEST(rcand);
+				DEST(basel) = ORG(SYM(baselPrev));
+			}
+			else{
+				baselPrev = basel;
+				basel = MakeQuadEdge(d->qp);
+				ORG(basel) = DEST(SYM(baselPrev));
+				DEST(basel) = ORG(SYM(lcand));
+				
+				lcand = RPREV(lcand);
+				DeleteQuadEdge( d->qp, rcand );
+			}
+		}
+	}
+}
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/ParallelDelaunay.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ParallelDelaunay.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,171 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	Calculates the ParallelDelaunay triangulation and the voronoi diangram of a set of points.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: ParallelDelaunay.h 3462 2006-02-19 06:53:24Z Raquibul Hassan$
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_ParallelDelaunay_h__
+#define __Domain_Geometry_ParallelDelaunay_h__
+
+	/* Virtual function types */
+	
+	/** Textual name of this class */
+	extern const Type ParallelDelaunay_Type;
+
+	/** ParallelDelaunay class contents (see Delaunay) */
+	#define __ParallelDelaunay \
+		__Delaunay \
+		CoordF		*localPoints; \
+		int			*initialOrder; \
+		int			leftProc; \
+		int			rightProc; \
+		int			numProcs; \
+		BTree		*haloSites[2]; \
+		int			numHaloSites[2]; \
+		Delaunay	*localTriangulation; \
+		int			*mappingTable[2]; \
+		int			*mapGlobalToLocal; \
+		int			*processor; \
+		int			*processorLoad; \
+		int			rank; \
+		int			numLocalSites; \
+		int			numTotalLocalSites; \
+		MemoryPool	*sitePool; \
+		MemoryPool	*coordPool; \
+		MPI_Comm	*comm;
+	struct ParallelDelaunay { __ParallelDelaunay };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/** Create a ParallelDelaunay */
+	ParallelDelaunay* ParallelDelaunay_DefaultNew( Name name );
+	
+	ParallelDelaunay* ParallelDelaunay_New(
+		Name						name,
+		Dictionary*					dictionary,
+		CoordF						*sites,
+		int							numSites,
+		int							rank,
+		int							numProcs,
+		MPI_Comm					*comm,
+		DelaunayAttributes	*attr );
+	
+	/** Initialise a ParallelDelaunay */
+	void ParallelDelaunay_Init(
+		ParallelDelaunay*					self,
+		Name						name,
+		Dictionary*					dictionary,
+		CoordF						*sites,
+		int							numSites,
+		int							rank,
+		int							numProcs,
+		MPI_Comm					*comm,
+		DelaunayAttributes			*attr );
+	
+	/** Creation implementation */
+	ParallelDelaunay* _ParallelDelaunay_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,
+		Dictionary					*dictionary,
+		CoordF						*sites,
+		int							numSites,
+		int							rank,
+		int							numProcs,
+		MPI_Comm					*comm,
+		DelaunayAttributes			*attr );
+	
+	void _ParallelDelaunay_Init( ParallelDelaunay* self );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/** Stg_Class_Delete() implementation */
+	void _ParallelDelaunay_Delete( void* pd );
+	
+	/** Stg_Class_Print() implementation */
+	void _ParallelDelaunay_Print( void* pd, Stream* stream );
+	
+	void *_ParallelDelaunay_Copy( void* pd, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void _ParallelDelaunay_Construct( void* pd, Stg_ComponentFactory* cf, void* data );
+	
+	void _ParallelDelaunay_Build( void* pd, void* data );
+	
+	void _ParallelDelaunay_Initialise( void* pd, void* data );
+	
+	void _ParallelDelaunay_Execute( void* pd, void* data );
+	
+	void _ParallelDelaunay_Destroy( void* pd, void* data );
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	typedef enum Direction_t{
+		LEFT,
+		RIGHT
+	}Direction;
+
+	void ParallelDelaunay_RetriangulateAfterMerge( ParallelDelaunay *pd, Direction d );
+	void ParallelDelaunay_BuildTriangleIndices( ParallelDelaunay *pd );
+	void ParallelDelaunaySendEdge( QuadEdgeRef edge, int rank, MPI_Comm *comm, MPI_Request *req );
+	QuadEdgeRef ParallelDelaunayRecvEdge( ParallelDelaunay *pd, int rank, MPI_Comm *comm );
+
+	QuadEdgeRef ParallelDelaunayFindLowestQuadEdge( ParallelDelaunay *pd, MPI_Comm *comm, int rank );
+	void ParallelDelaunayMerge( ParallelDelaunay *pd, MPI_Comm *comm, int rank );
+	int ParallelDelaunay_TranslateLocalToGlobal( ParallelDelaunay *self, int id );
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public Member functions
+	*/
+	
+	void ParallelDelaunay_GatherTriangulation( ParallelDelaunay *pd );
+	
+#endif /* __Domain_Geometry_ParallelDelaunay_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/ParallelDelaunay.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ParallelDelaunay.meta	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">ParallelDelaunay</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">https://csd.vpac.org/twiki/bin/view/Stgermain/SoftwareLicense</param>
+<param name="Parent">Delaunay</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>
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Plane.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Plane.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,61 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Plane.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "VectorMath.h"
+#include "Plane.h"
+
+#include <stdio.h>
+#include <assert.h>
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Macros
+*/
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Functions
+*/
+
+void Plane_LineIntersect( Plane plane, Line3 line, Coord point ) {
+	double		t = plane[3] - plane[0] * line[0][0] - plane[1] * line[0][1] - plane[2] * line[0][2];
+	
+	t /= plane[0] * line[1][0] + plane[1] * line[1][1] + plane[2] * line[1][2];
+	
+	point[0] = line[0][0] + line[1][0] * t;
+	point[1] = line[0][1] + line[1][1] * t;
+	point[2] = line[0][2] + line[1][2] * t;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Plane.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Plane.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,81 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    Provides operations for use on infinite planes.
+**
+** Assumptions:
+**    - Coord is an array of 3 doubles.
+**
+** Comments:
+**
+** $Id: Plane.h 4081 2007-04-27 06:20:07Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Plane_h__
+#define __Domain_Geometry_Plane_h__
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Macros
+	*/
+	
+	/* calculate a plane equation from two non-parallel vectors and a point */
+	#define Plane_CalcFromVec( dest, axisA, axisB, pointOnPlane )		\
+		Vec_Cross3D( dest, axisA, axisB );				\
+		Vec_Norm3D( dest, dest );					\
+		dest[3] = Vec_Dot3D( dest, pointOnPlane )
+		
+	
+	/* return the plane's normal in dest */
+	#define Plane_Normal( dest, plane )		\
+		Vec_Set3D( dest, plane )
+		
+	
+	/* calculate the shortest distance from plane to point */
+	#define Plane_DistanceToPoint( plane, point )		\
+		(Vec_Dot3D( plane, point ) - plane[3])
+	
+	
+	/* determines if point is in front of the plane based on the direction of the plane's normal */
+	#define Plane_PointIsInFront( plane, point )					\
+		(Plane_DistanceToPoint( plane, point ) > 0.0 ? True : False)
+	
+	
+	/* determines if the point is situated on the plane */
+	#define Plane_PointIsOnPlane( plane, point )				\
+		(Vec_Dot3D( plane, point ) == plane[3] ? True : False)
+		
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Functions
+	*/
+	
+	void Plane_LineIntersect( Plane plane, Line3 line, Coord point );
+
+	
+#endif /* __Domain_Geometry_Plane_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/QuadEdge.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/QuadEdge.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,129 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: QuadEdge.c 3462 2006-02-19 06:53:24Z Raquibul Hassan$
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "QuadEdge.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <assert.h>
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+
+QuadEdgeRef MakeQuadEdge( MemoryPool *qp )
+{
+	QuadEdge *qe = (QuadEdge*)NULL;
+	QuadEdgeRef e = 0;
+
+	qe = MemoryPool_NewObject( QuadEdge, qp );
+	memset( qe, 0, sizeof( QuadEdge ) );
+	e = (QuadEdgeRef) qe;
+	SET_IN_USE( (QuadEdgeRef)e );
+	
+	if( e == 0 ){
+		fprintf( stderr, "Out of memory..!\n Aborting..!\n" );
+		assert( 0 );
+	}
+	
+	ONEXT(e) = e;
+	SYMDNEXT(e) = SYM(e);
+	ROTRNEXT(e) = TOR(e);
+	TORLNEXT(e) = ROT(e);
+	COUNT(e) = 0;
+	
+	return e;
+}
+
+void DeleteQuadEdge( MemoryPool *qp, QuadEdgeRef e)
+{
+	QuadEdgeRef f = SYM(e);
+	
+	if (ONEXT(e) != e) SpliceQuadEdges(e, OPREV(e));
+	if (ONEXT(f) != f) SpliceQuadEdges(f, OPREV(f));  
+    
+	MemoryPool_DeleteObject( qp, (QuadEdge*) ((e) & WORD) );
+}
+
+void SpliceQuadEdges(QuadEdgeRef a, QuadEdgeRef b)
+{
+	QuadEdgeRef ta, tb;
+	QuadEdgeRef alpha = ROT(ONEXT(a));
+	QuadEdgeRef beta = ROT(ONEXT(b));
+
+	ta = ONEXT(a);
+	tb = ONEXT(b);
+	ONEXT(a) = tb;
+	ONEXT(b) = ta;
+	ta = ONEXT(alpha);
+	tb = ONEXT(beta);
+	ONEXT(alpha) = tb;
+	ONEXT(beta) = ta;    
+}
+
+QuadEdgeRef ConnectQuadEdges(MemoryPool *qp, QuadEdgeRef a, QuadEdgeRef b)
+{
+	QuadEdgeRef e;
+
+	e = MakeQuadEdge( qp );
+	ORG(e) = DEST(a);
+	DEST(e) = ORG(b);
+	
+	SpliceQuadEdges(e, LNEXT(a));
+	SpliceQuadEdges(SYM(e), b);
+	
+	return e;
+}
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/QuadEdge.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/QuadEdge.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,201 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: QuadEdge.h 3462 2006-02-19 06:53:24Z Raquibul Hassan$
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_QuadEdge_h__
+#define __Domain_Geometry_QuadEdge_h__
+
+	/* Virtual function types */
+	
+	/** Textual name of this class */
+	extern const Type QuadEdge_Type;
+
+	#define IN_USE 1
+	
+	typedef struct VoronoiVertex_t{
+		float point[2];
+	}VoronoiVertex;
+
+	/** QuadEdge class contents (see QuadEdge) */
+	#define __QuadEdge \
+		QuadEdgeRef 	next[4];\
+		void			*data[4];\
+		unsigned		count;\
+		unsigned		attributes;
+
+	struct QuadEdge { __QuadEdge };
+
+/* Defining WORD according to the architecture */
+#if defined(SYSTEM_SIZEOF_LONG) && SYSTEM_SIZEOF_LONG == 8
+	#define WORD 0xfffffffffffffffcu
+#else
+	#define WORD 0xfffffffcu
+#endif
+
+#define COUNT(e)  ((QuadEdge *)((e)&WORD))->count
+
+/* Defining macros for operating on bit flags */
+/*#define IS_IN_USE(e)	(((QuadEdge *)((e)&WORD))->attributes == IN_USE)
+#define IS_FREE(e)		(!(((QuadEdge *)((e)&WORD))->attributes == IN_USE))
+#define SET_IN_USE(e)	(((QuadEdge *)((e)&WORD))->attributes = IN_USE)
+#define SET_FREE(e)		(((QuadEdge *)((e)&WORD))->attributes = 0)*/
+
+#define IS_IN_USE(e)   (((QuadEdge *)((e)&WORD))->attributes & IN_USE)
+#define IS_FREE(e)             (!(((QuadEdge *)((e)&WORD))->attributes & IN_USE))
+#define SET_IN_USE(e)  (((QuadEdge *)((e)&WORD))->attributes |= IN_USE)
+#define SET_FREE(e)            (((QuadEdge *)((e)&WORD))->attributes &= ~IN_USE)
+
+/* Edge orientation operators: */
+
+#define ROT(e) (((e)&WORD)+(((e)+1)&3u))
+#define SYM(e) (((e)&WORD)+(((e)+2)&3u))
+#define TOR(e) (((e)&WORD)+(((e)+3)&3u))
+
+/* Vertex/face walking operators: */
+
+#define ONEXT(e) ((QuadEdge *)((e)&WORD))->next[(e)&3]
+#define ROTRNEXT(e) ((QuadEdge *)((e)&WORD))->next[((e)+1)&3]
+#define SYMDNEXT(e) ((QuadEdge *)((e)&WORD))->next[((e)+2)&3]
+#define TORLNEXT(e) ((QuadEdge *)((e)&WORD))->next[((e)+3)&3]
+
+#define RNEXT(e) (TOR(ROTRNEXT(e)))
+#define DNEXT(e) (SYM(SYMDNEXT(e)))
+#define LNEXT(e) (ROT(TORLNEXT(e)))
+
+#define OPREV(e) (ROT(ROTRNEXT(e)))
+#define DPREV(e) (TOR(TORLNEXT(e)))
+#define RPREV(e) (SYMDNEXT(e))
+#define LPREV(e) (SYM(ONEXT(e)))
+
+/* Data pointers: */
+
+#define ODATA(e) ((QuadEdge *)((e)&WORD))->data[(e)&3]
+#define RDATA(e) ((QuadEdge *)((e)&WORD))->data[((e)+1)&3]
+#define DDATA(e) ((QuadEdge *)((e)&WORD))->data[((e)+2)&3]
+#define LDATA(e) ((QuadEdge *)((e)&WORD))->data[((e)+3)&3]
+
+#define ORG(e) ODATA(e)
+#define DEST(e) DDATA(e)
+
+#define VORG(e) RDATA(e)
+#define VDEST(e) LDATA(e)
+
+/* Fast absolute floating point value */
+#define FABS(a)  ((a) >= 0.0 ? (a) : -(a))
+
+/* Macro for calculating the area of a triangle */
+#define CCW(a, b, c, result)\
+	do{\
+		double ax=0, ay=0, bx=0, by=0, cx=0, cy=0; \
+		ax = (*(a))[0]; ay = (*(a))[1];\
+		bx = (*(b))[0]; by = (*(b))[1];\
+		cx = (*(c))[0]; cy = (*(c))[1];\
+		*(result) = ((bx*cy-by*cx) - (ax*cy-ay*cx) + (ax*by-ay*bx));\
+	}while(0)
+
+/* Macro for calculating the cross product of 2 3D vectors */
+#define CROSS_PROD( result, a, b )\
+	do{\
+		result[0]=a[1]*b[2] - b[1]*a[2];\
+		result[1]=-1.0f*(a[0]*b[2] - b[0]*a[2]);\
+		result[2]=a[0]*b[1] - b[0]*a[1];\
+	}while(0)
+
+/* Macro for calculating the circumcircle of 3 points */
+#define CIRCUM_CIRCLE( a, b, c, result ) \
+do{\
+	double ab[3], ac[3], abMid[3], acMid[3], cp1[3], cp2[3], rhs[3], lhs[3], mod, temp, lambda; \
+	ab[0] = (*(b))[0] - (*(a))[0];\
+	ab[1] = (*(b))[1] - (*(a))[1];\
+	ab[2] = 0.0f;\
+	mod = sqrt(ab[0]*ab[0] + ab[1]*ab[1]);\
+	ab[0]/=mod;\
+	ab[1]/=mod;\
+	abMid[0] = ((*(b))[0] + (*(a))[0])*0.5;\
+	abMid[1] = ((*(b))[1] + (*(a))[1])*0.5;\
+\
+	ac[0] = (*(c))[0] - (*(a))[0];\
+	ac[1] = (*(c))[1] - (*(a))[1];\
+	ac[2] = 0.0f;\
+	mod = sqrt(ac[0]*ac[0] + ac[1]*ac[1]);\
+	ac[0]/=mod;\
+	ac[1]/=mod;\
+	acMid[0] = ((*(c))[0] + (*(a))[0])*0.5;\
+	acMid[1] = ((*(c))[1] + (*(a))[1])*0.5;\
+\
+	temp = ab[0];\
+	ab[0] = -ab[1];\
+	ab[1] = temp;\
+\
+	temp = ac[0];\
+	ac[0] = -ac[1];\
+	ac[1] = temp;\
+\
+	CROSS_PROD( cp1, abMid, ac );\
+	CROSS_PROD( cp2, acMid, ac );\
+\
+	rhs[0] = cp2[0]-cp1[0];\
+	rhs[1] = cp2[1]-cp1[1];\
+	rhs[2] = cp2[2]-cp1[2];\
+\
+	CROSS_PROD( lhs, ab, ac );\
+\
+	lambda = rhs[2]/lhs[2];\
+\
+	(*(result))->point[0] = abMid[0] + ab[0]*lambda;\
+	(*(result))->point[1] = abMid[1] + ab[1]*lambda;\
+}while(0)
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	
+	QuadEdgeRef MakeQuadEdge( MemoryPool *qp );
+	void DeleteQuadEdge( MemoryPool *qp, QuadEdgeRef e);
+	void SpliceQuadEdges(QuadEdgeRef a, QuadEdgeRef b);
+	QuadEdgeRef ConnectQuadEdges(MemoryPool *qp, QuadEdgeRef a, QuadEdgeRef b);
+	
+#endif /* __Domain_Geometry_QuadEdge_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/RMatrix.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/RMatrix.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,120 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: RMatrix.c 4081 2007-04-27 06:20:07Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "VectorMath.h"
+#include "RMatrix.h"
+#include "TrigMath.h"
+
+#include <math.h>
+#include <assert.h>
+#include <string.h>
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Functions
+*/
+
+void RMatrix_BuildOrientation( RMatrix dest, Coord zAxis, Coord xAxis ) {
+	Coord		nxa;
+	
+	RMatrix_LoadIdentity( dest );
+	RMatrix_ApplyRotationY( dest, ArcTan( zAxis[0], zAxis[2] ) );
+	RMatrix_ApplyRotationX( dest, asin( zAxis[1] / Vec_Mag3D( zAxis ) ) );
+	
+	RMatrix_VectorMult( nxa, dest, xAxis );
+	RMatrix_ApplyRotationZ( dest, asin( nxa[1] / Vec_Mag3D( nxa ) ) );
+}
+
+
+void RMatrix_ApplyRotationY( RMatrix dest, double angle ) {
+	RMatrix		tmp;
+	
+	tmp[0] = cos( angle );  tmp[1] = 0.0;   tmp[2] = -sin( angle );
+	tmp[3] = 0.0;		tmp[4] = 1.0;   tmp[5] = 0.0;
+	tmp[6] = sin( angle );  tmp[7] = 0.0;   tmp[8] = cos( angle );
+	
+	RMatrix_Mult( dest, dest, tmp );
+}
+
+
+void RMatrix_ApplyRotationZ( RMatrix dest, double angle ) {
+	RMatrix		tmp;
+	
+	tmp[0] = cos( angle );  tmp[1] = sin( angle );  tmp[2] = 0.0;
+	tmp[3] = -sin( angle);  tmp[4] = cos( angle );  tmp[5] = 0.0;
+	tmp[6] = 0.0;		tmp[7] = 0.0;		tmp[8] = 1.0;
+	
+	RMatrix_Mult( dest, dest, tmp );
+}
+
+
+void RMatrix_ApplyRotationX( RMatrix dest, double angle ) {
+	RMatrix		tmp;
+	
+	tmp[0] = 1.0;   tmp[1] = 0.0;		tmp[2] = 0.0;
+	tmp[3] = 0.0;   tmp[4] = cos( angle );  tmp[5] = sin( angle );
+	tmp[6] = 0.0;   tmp[7] = -sin( angle);  tmp[8] = cos( angle );
+	
+	RMatrix_Mult( dest, dest, tmp );
+}
+
+
+void RMatrix_Mult( RMatrix dest, RMatrix a, RMatrix b ) {
+	RMatrix		tmp;
+	
+	tmp[0] = a[0] * b[0] + a[1] * b[3] + a[2] * b[6];
+	tmp[1] = a[0] * b[1] + a[1] * b[4] + a[2] * b[7];
+	tmp[2] = a[0] * b[2] + a[1] * b[5] + a[2] * b[8];
+	tmp[3] = a[3] * b[0] + a[4] * b[3] + a[5] * b[6];
+	tmp[4] = a[3] * b[1] + a[4] * b[4] + a[5] * b[7];
+	tmp[5] = a[3] * b[2] + a[4] * b[5] + a[5] * b[8];
+	tmp[6] = a[6] * b[0] + a[7] * b[3] + a[8] * b[6];
+	tmp[7] = a[6] * b[1] + a[7] * b[4] + a[8] * b[7];
+	tmp[8] = a[6] * b[2] + a[7] * b[5] + a[8] * b[8];
+	
+	memcpy( dest, tmp, sizeof(RMatrix) );
+}
+
+
+void RMatrix_VectorMult( Coord dest, RMatrix mat, Coord vec ) {
+	Coord		tmp;
+	
+	tmp[0] = mat[0] * vec[0] + mat[1] * vec[1] + mat[2] * vec[2];
+	tmp[1] = mat[3] * vec[0] + mat[4] * vec[1] + mat[5] * vec[2];
+	tmp[2] = mat[6] * vec[0] + mat[7] * vec[1] + mat[8] * vec[2];
+	
+	Vec_Set3D( dest, tmp );
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/RMatrix.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/RMatrix.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,68 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    Provides operations for use on infinite planes.
+**
+** Assumptions:
+**    - Coord is an array of 3 doubles.
+**
+** Comments:
+**
+** $Id: RMatrix.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_TMatrix_h__
+#define __Domain_Geometry_TMatrix_h__
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Functions
+	*/
+	
+	#define ArcTan( o, a ) \
+		(o < 0.0 ? atan( o / a ) + M_PI : o < 0.0 ? atan( o / a ) + 2.0 * M_PI : atan( o / a ))
+	
+	void RMatrix_BuildOrientation( RMatrix dest, Coord zAxis, Coord xAxis );
+	
+	void RMatrix_ApplyRotationX( RMatrix dest, double angle );
+	
+	void RMatrix_ApplyRotationY( RMatrix dest, double angle );
+	
+	void RMatrix_ApplyRotationZ( RMatrix dest, double angle );
+	
+	void RMatrix_Mult( RMatrix dest, RMatrix a, RMatrix b );
+	
+	void RMatrix_VectorMult( Coord dest, RMatrix mat, Coord vec );
+	
+	#define RMatrix_LoadIdentity( dest ) \
+		(dest)[0] = 1.0; (dest)[1] = 0.0; (dest)[2] = 0.0; \
+		(dest)[3] = 0.0; (dest)[4] = 1.0; (dest)[5] = 0.0; \
+		(dest)[6] = 0.0; (dest)[7] = 0.0; (dest)[8] = 1.0
+	
+	
+#endif /* __Domain_Geometry_TMatrix_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/RefinedRegionsGeometry.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/RefinedRegionsGeometry.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,564 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: RefinedRegionsGeometry.c 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "GeometryClass.h"
+#include "RefinedRegionsGeometry.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+
+/* Textual name of this class */
+const Type RefinedRegionsGeometry_Type = "RefinedRegionsGeometry";
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+void* RefinedRegionsGeometry_DefaultNew( Name name )
+{
+	return (void*) _RefinedRegionsGeometry_New(
+		sizeof(RefinedRegionsGeometry), 
+		RefinedRegionsGeometry_Type, 
+		_RefinedRegionsGeometry_Delete, 
+		_RefinedRegionsGeometry_Print,
+		_RefinedRegionsGeometry_Copy,
+		RefinedRegionsGeometry_DefaultNew,
+		_RefinedRegionsGeometry_Construct,
+		_RefinedRegionsGeometry_Build,
+		_RefinedRegionsGeometry_Initialise,
+		_RefinedRegionsGeometry_Execute,
+		_RefinedRegionsGeometry_Destroy,
+		name,
+		False,
+		_RefinedRegionsGeometry_BuildPoints,
+		_RefinedRegionsGeometry_PointAt,
+		NULL );
+}
+
+RefinedRegionsGeometry* RefinedRegionsGeometry_New(
+		Name name,
+		Dictionary*					dictionary )
+{
+	return _RefinedRegionsGeometry_New( 
+		sizeof(RefinedRegionsGeometry), 
+		RefinedRegionsGeometry_Type, 
+		_RefinedRegionsGeometry_Delete, 
+		_RefinedRegionsGeometry_Print,
+		_RefinedRegionsGeometry_Copy,
+		RefinedRegionsGeometry_DefaultNew,
+		_RefinedRegionsGeometry_Construct,
+		_RefinedRegionsGeometry_Build,
+		_RefinedRegionsGeometry_Initialise,
+		_RefinedRegionsGeometry_Execute,
+		_RefinedRegionsGeometry_Destroy,
+		name,
+		True,
+		_RefinedRegionsGeometry_BuildPoints,
+		_RefinedRegionsGeometry_PointAt,
+		dictionary );
+}
+
+
+void RefinedRegionsGeometry_Init(
+		RefinedRegionsGeometry*					self,
+		Name						name,
+		Dictionary*					dictionary )
+{
+	/* General info */
+	self->type = RefinedRegionsGeometry_Type;
+	self->_sizeOfSelf = sizeof(RefinedRegionsGeometry);
+	self->_deleteSelf = False;
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	self->_delete = _RefinedRegionsGeometry_Delete;
+	self->_print = _RefinedRegionsGeometry_Print;
+	self->_copy = _RefinedRegionsGeometry_Copy;
+	self->_defaultConstructor = RefinedRegionsGeometry_DefaultNew;
+	self->_construct = _RefinedRegionsGeometry_Construct;
+	self->_build = _RefinedRegionsGeometry_Build;
+	self->_initialise = _RefinedRegionsGeometry_Initialise;
+	self->_execute = _RefinedRegionsGeometry_Execute;
+	self->_destroy = _RefinedRegionsGeometry_Destroy;
+	self->buildPoints = _RefinedRegionsGeometry_BuildPoints;
+	self->pointAt = _RefinedRegionsGeometry_PointAt;
+	
+	_Stg_Class_Init( (Stg_Class*)self );
+	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+	_Stg_Component_Init( (Stg_Component*)self );
+	
+	_Geometry_Init( (Geometry*)self );
+	
+	/* RefinedRegionsGeometry info */
+	_RefinedRegionsGeometry_Init( self, NULL );
+}
+
+
+RefinedRegionsGeometry* _RefinedRegionsGeometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary )
+{
+	RefinedRegionsGeometry* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(RefinedRegionsGeometry) );
+	self = (RefinedRegionsGeometry*)_Geometry_New(
+		_sizeOfSelf,
+		type,
+		_delete,
+		_print,
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,
+		name,
+		initFlag,
+		buildPoints,
+		pointAt,
+		dictionary );
+	
+	/* General info */
+	
+	/* Virtual info */
+	
+	/* RefinedRegionsGeometry info */
+	if( initFlag ){
+		_RefinedRegionsGeometry_Init( self, NULL );
+	}
+	
+	return self;
+}
+
+void _RefinedRegionsGeometry_Init( RefinedRegionsGeometry* self, IJK size ) {
+	Dimension_Index		dim_I;
+	Dictionary_Entry_Value*	regionsList = NULL;
+
+	/* General and Virtual info should already be set */
+	
+	/* RefinedRegionsGeometry info */
+	self->isConstructed = False;
+
+	self->min[ I_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "minX", 0.0f );
+	self->min[ J_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "minY", 0.0f );
+	self->min[ K_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "minZ", 0.0f );
+
+	self->max[ I_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "maxX", 1.0f );
+	self->max[ J_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "maxY", 1.0f );
+	self->max[ K_AXIS ] = Dictionary_GetDouble_WithDefault( self->dictionary, "maxZ", 1.0f );
+
+	if ( size ) {
+		memcpy( self->countPerDim, size, sizeof(IJK) );
+	}
+	else {
+		self->countPerDim[ I_AXIS ] = Dictionary_GetUnsignedInt_WithDefault( self->dictionary, "meshSizeI", 2 );
+		self->countPerDim[ J_AXIS ] = Dictionary_GetUnsignedInt_WithDefault( self->dictionary, "meshSizeJ", 2 );
+		self->countPerDim[ K_AXIS ] = Dictionary_GetUnsignedInt_WithDefault( self->dictionary, "meshSizeK", 2 );
+	}
+
+	for ( dim_I = 0; dim_I < 3; dim_I++ ) {
+		self->refinedRegionDeltas[dim_I] = 4;
+	}
+	
+	/* Now Read in the refined regions */
+	regionsList = Dictionary_Get( self->dictionary, "RefinedRegions" );	
+	if ( regionsList ) {
+		Index				entryCount = Dictionary_Entry_Value_GetCount( regionsList );
+		Index				entry_I = 0;
+		Dictionary_Entry_Value*		regionEntry;
+		Dictionary*			regionDict;
+		Dimension_Index			dim = 0;
+		double				regionStart = 0;
+		double				regionEnd = 0;
+		unsigned int			refinementFactor = 1;
+		
+		for( entry_I = 0; entry_I < entryCount; entry_I++ ) {
+			regionEntry = Dictionary_Entry_Value_GetElement( regionsList, entry_I );
+			regionDict = Dictionary_Entry_Value_AsDictionary( regionEntry );
+			dim = Dictionary_GetUnsignedInt_WithDefault( regionDict, "dim", 0 );
+			regionStart = Dictionary_GetDouble_WithDefault( regionDict, "regionStart", 0.0 );
+			regionEnd = Dictionary_GetDouble_WithDefault( regionDict, "regionEnd", 1.0 );
+			refinementFactor = Dictionary_GetUnsignedInt_WithDefault( regionDict, "refinementFactor", 2 );
+			_RefinedRegionsGeometry_AddRefinedRegion( self, dim, regionStart, regionEnd, refinementFactor );
+		}	
+	}
+	
+	self->pointCount = self->countPerDim[I_AXIS] * self->countPerDim[J_AXIS] *
+		self->countPerDim[K_AXIS];
+	
+	assert( self->pointCount );
+
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _RefinedRegionsGeometry_Delete( void* refinedRegionsGeometry ) {
+	RefinedRegionsGeometry* self = (RefinedRegionsGeometry*)refinedRegionsGeometry;
+	
+	/* Stg_Class_Delete parent */
+	_Geometry_Delete( self );
+}
+
+
+void _RefinedRegionsGeometry_Print( void* refinedRegionsGeometry, Stream* stream ) {
+	RefinedRegionsGeometry* self = (RefinedRegionsGeometry*)refinedRegionsGeometry;
+	
+	/* Print parent */
+	_Geometry_Print( self, stream );
+	
+	/* General info */
+	Journal_Printf( stream, "RefinedRegionsGeometry (ptr): (%p)\n", self );
+	
+	/* Virtual info */
+	
+	/* RefinedRegionsGeometry info */
+}
+
+void _RefinedRegionsGeometry_Construct( void* refinedRegionsGeometry, Stg_ComponentFactory *cf, void* data ){
+	RefinedRegionsGeometry*  self   = (RefinedRegionsGeometry*)refinedRegionsGeometry;
+	IJK             size;
+	int             shift;
+	Dimension_Index dim;
+	Dimension_Index dim_I;
+
+	self->dictionary =  Dictionary_GetDictionary( cf->componentDict, self->name );
+
+	/* Get Size from Dictionary */
+	dim = Stg_ComponentFactory_GetRootDictUnsignedInt( cf, "dim", 0 );
+		
+	size[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "sizeI", 1 );  
+	size[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "sizeJ", 1 );
+	size[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "sizeK", 1 );
+	if ( dim == 2 )
+		size[ K_AXIS ] = 1;
+
+	/* Shift the size if nessesary */
+	shift = Stg_ComponentFactory_GetInt( cf, self->name, "sizeShift", 0 );
+	for ( dim_I = I_AXIS ; dim_I < dim ; dim_I++ )
+		size[ dim_I ] += shift;
+	
+	_Geometry_Init( (Geometry*)self );
+	_RefinedRegionsGeometry_Init( self, size );
+}
+	
+void _RefinedRegionsGeometry_Build( void* refinedRegionsGeometry, void *data ){
+	
+}
+	
+void _RefinedRegionsGeometry_Initialise( void* refinedRegionsGeometry, void *data ){
+	
+}
+	
+void _RefinedRegionsGeometry_Execute( void* refinedRegionsGeometry, void *data ){
+	
+}
+	
+void _RefinedRegionsGeometry_Destroy( void* refinedRegionsGeometry, void *data ){
+	
+}
+
+
+void* _RefinedRegionsGeometry_Copy( void* refinedRegionsGeometry, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	RefinedRegionsGeometry*	self = (RefinedRegionsGeometry*)refinedRegionsGeometry;
+	RefinedRegionsGeometry*	newRefinedRegionsGeometry;
+	Index		dim_I;
+	
+	newRefinedRegionsGeometry = (RefinedRegionsGeometry*)_Geometry_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	for( dim_I = 0; dim_I < 3; dim_I++ ) {
+		newRefinedRegionsGeometry->countPerDim[dim_I] = 
+			self->countPerDim[dim_I];
+		newRefinedRegionsGeometry->min[dim_I] = self->min[dim_I];
+		newRefinedRegionsGeometry->max[dim_I] = self->max[dim_I];
+		newRefinedRegionsGeometry->refinedRegionCounts[dim_I] = 
+			self->refinedRegionCounts[dim_I];
+		newRefinedRegionsGeometry->refinedRegionSizes[dim_I] = 
+			self->refinedRegionSizes[dim_I];
+		newRefinedRegionsGeometry->refinedRegionDeltas[dim_I] = 
+			self->refinedRegionDeltas[dim_I];
+		memcpy( newRefinedRegionsGeometry->refinedRegions[dim_I],
+			self->refinedRegions[dim_I], 
+			sizeof(RefinedRegion) * self->refinedRegionCounts[dim_I] );
+	}
+	
+	return (void*)newRefinedRegionsGeometry;
+}
+
+
+void _RefinedRegionsGeometry_AddRefinedRegion( void* refinedRegionsGeometry, Index dim,
+		double regionStart, double regionEnd, unsigned int refinementFactor )
+{
+	RefinedRegionsGeometry*	self = (RefinedRegionsGeometry*)refinedRegionsGeometry;
+
+	if ( self->refinedRegionCounts[dim] == self->refinedRegionSizes[dim] )
+	{
+		self->refinedRegionSizes[dim] += self->refinedRegionDeltas[dim];
+		self->refinedRegions[dim] = Memory_Realloc( 
+			self->refinedRegions[dim],
+			self->refinedRegionSizes[dim] * sizeof(RefinedRegion) );
+	}
+	self->refinedRegions[dim][self->refinedRegionCounts[dim]].regionStart = regionStart;
+	self->refinedRegions[dim][self->refinedRegionCounts[dim]].regionEnd = regionEnd;
+	self->refinedRegions[dim][self->refinedRegionCounts[dim]].refinementFactor = refinementFactor;
+	/* Following 2 values are set to zero until real vals calculated later */
+	self->refinedRegions[dim][self->refinedRegionCounts[dim]].numElements = 0;
+	self->refinedRegions[dim][self->refinedRegionCounts[dim]].elementLength = 0.0;
+	self->refinedRegionCounts[dim]++;
+}
+
+
+
+
+
+void _RefinedRegionsGeometry_BuildPoints( void* refinedRegionsGeometry, Coord_List points )
+{
+	RefinedRegionsGeometry*  self = (RefinedRegionsGeometry*)refinedRegionsGeometry;
+	Dimension_Index	dim_I = 0;
+	Index		currRegion_I[3] = { 0, 0, 0 };
+	double		elementLengthNormal[3];
+	Index		numElementsNormal[3];
+	RefinedRegion*	currRefinedRegion = NULL;
+	Index		i;
+	double		increment = 0;
+	IJK		ijk;
+	IJK		prevIJK = {0,0,0};
+	Coord		prevPos = {0,0,0};
+	Bool		withinRefined[3] = { False, False, False };
+	
+	_RefinedRegionsGeometry_CalculateElementLengths( refinedRegionsGeometry, numElementsNormal, elementLengthNormal );
+
+	for( i = 0; i < self->pointCount; i++ ) {
+	
+		ijk[0] = i % self->countPerDim[0];
+		ijk[1] = (i / self->countPerDim[0]) % self->countPerDim[1];
+		ijk[2] = i / (self->countPerDim[0] * self->countPerDim[1]);
+	
+		for ( dim_I = 0; dim_I < 3; dim_I++ ) {
+			if ( ijk[dim_I] == 0 ) {
+				/* Axis reset to 0 - also reset the region iterator*/
+				points[i][dim_I] = self->min[dim_I];
+				currRegion_I[dim_I] = 0;
+			}
+			else if ( ijk[dim_I] == prevIJK[dim_I] ) {
+				/* We haven't moved in this direction this step */
+				points[i][dim_I] = prevPos[dim_I];
+			}
+			else if ( withinRefined[dim_I] ) {
+				currRefinedRegion = &self->refinedRegions[dim_I][currRegion_I[dim_I]];
+				/* We are within a refined block */
+				increment = currRefinedRegion->elementLength;
+				points[i][dim_I] =  prevPos[dim_I] + increment;
+				if ( points[i][dim_I] > ( currRefinedRegion->regionEnd - 1e-6 ) ) {
+					withinRefined[dim_I] = False;
+					(currRegion_I[dim_I])++;
+				}
+			}
+			else if ( ( self->refinedRegions[dim_I] ) &&
+				( currRegion_I[dim_I] < self->refinedRegionCounts[dim_I] ) &&
+				(prevPos[dim_I] > self->refinedRegions[dim_I][currRegion_I[dim_I]].regionStart - 1e-6 ) )
+			{
+				currRefinedRegion = &self->refinedRegions[dim_I][currRegion_I[dim_I]];
+				/* We are entering a refined block */
+				withinRefined[dim_I] = True;
+				increment = currRefinedRegion->elementLength;
+				points[i][dim_I] = prevPos[dim_I] + increment;
+			}	
+			else {
+				/* The "normal" case- not in refined area */
+				points[i][dim_I] = prevPos[dim_I] + elementLengthNormal[dim_I];
+			}
+
+			prevPos[dim_I] = points[i][dim_I];
+			prevIJK[dim_I] = ijk[dim_I];
+		}
+	}
+}
+
+void _RefinedRegionsGeometry_PointAt( void* refinedRegionsGeometry, Index index, Coord point )
+{
+	RefinedRegionsGeometry* self = (RefinedRegionsGeometry*)refinedRegionsGeometry;
+	
+	if( index < self->pointCount ) {
+		Index		i;
+		Bool		withinRefined[3] = { False, False, False };
+		Index		currRegion_I[3] = { 0, 0, 0 };
+		RefinedRegion*	currRefinedRegion = NULL;
+		Dimension_Index	dim_I = 0;
+		double		increment = 0;
+		IJK		ijk;
+		IJK		prevIJK = {0,0,0};
+		Coord		prevPos = {0,0,0};
+		double		elementLengthNormal[3];
+		Index		numElementsNormal[3];
+		
+		_RefinedRegionsGeometry_CalculateElementLengths( refinedRegionsGeometry, numElementsNormal, elementLengthNormal );
+		
+		for( i = 0; i <= index; i++ ) {
+		
+			ijk[0] = i % self->countPerDim[0];
+			ijk[1] = (i / self->countPerDim[0]) % self->countPerDim[1];
+			ijk[2] = i / (self->countPerDim[0] * self->countPerDim[1]);
+		
+			for ( dim_I = 0; dim_I < 3; dim_I++ ) {
+				if ( ijk[dim_I] == 0 ) {
+					/* Axis reset to 0 - also reset the region iterator*/
+					point[dim_I] = self->min[dim_I];
+					currRegion_I[dim_I] = 0;
+				}
+				else if ( ijk[dim_I] == prevIJK[dim_I] ) {
+					/* We haven't moved in this direction this step */
+					point[dim_I] = prevPos[dim_I];
+				}
+				else if ( withinRefined[dim_I] ) {
+					currRefinedRegion = &self->refinedRegions[dim_I][currRegion_I[dim_I]];
+					/* We are within a refined block */
+					increment = currRefinedRegion->elementLength;
+					point[dim_I] =  prevPos[dim_I] + increment;
+					if ( point[dim_I] > ( currRefinedRegion->regionEnd - 1e-6 ) ) {
+						withinRefined[dim_I] = False;
+						(currRegion_I[dim_I])++;
+					}
+				}
+				else if ( ( self->refinedRegions[dim_I] ) &&
+					( currRegion_I[dim_I] < self->refinedRegionCounts[dim_I] ) &&
+					( prevPos[dim_I] > self->refinedRegions[dim_I][currRegion_I[dim_I]].regionStart - 1e-6) )
+				{
+					currRefinedRegion = &self->refinedRegions[dim_I][currRegion_I[dim_I]];
+					/* We are entering a refined block */
+					withinRefined[dim_I] = True;
+					increment = currRefinedRegion->elementLength;
+					point[dim_I] =  prevPos[dim_I] + increment;
+				}	
+				else {
+					/* The "normal" case- not in refined area */
+					point[dim_I] = prevPos[dim_I] + elementLengthNormal[dim_I];
+				}
+
+				prevPos[dim_I] = point[dim_I];
+				prevIJK[dim_I] = ijk[dim_I];
+			}
+		}	
+	}
+	else {
+		point[0] = HUGE_VAL;
+		point[1] = HUGE_VAL;
+		point[2] = HUGE_VAL;
+	}
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
+void _RefinedRegionsGeometry_CalculateElementLengths(
+		RefinedRegionsGeometry*	self,
+		Index			numElementsNormal[3],
+		double			elementLengthNormal[3] )
+{	
+	Dimension_Index	dim_I = 0;
+	Index		currRegion_I = 0;
+	double		remainderLength;
+	RefinedRegion*	currRefinedRegion = NULL;
+	double		summation = 0;
+	double		elLengthBase = 0;
+	double		regionLength;
+
+	for ( dim_I = 0; dim_I < 3; dim_I++ ) {
+		remainderLength = self->max[dim_I] - self->min[dim_I];
+
+		for ( currRegion_I = 0; currRegion_I < self->refinedRegionCounts[dim_I]; currRegion_I++ ) {
+			currRefinedRegion = &self->refinedRegions[dim_I][currRegion_I];
+			remainderLength -= ( currRefinedRegion->regionEnd - currRefinedRegion->regionStart );
+		}
+		
+		summation = 0.0;
+		for ( currRegion_I = 0; currRegion_I < self->refinedRegionCounts[dim_I]; currRegion_I++ ) {
+			currRefinedRegion = &self->refinedRegions[dim_I][currRegion_I];
+			summation += ( currRefinedRegion->regionEnd - currRefinedRegion->regionStart ) *
+				currRefinedRegion->refinementFactor;
+		}	
+		summation += remainderLength * 1;
+			
+		elLengthBase = 1.0 / (self->countPerDim[dim_I] - 1) * summation;	
+		
+		/* Now we have the base element length, calculate the rounded values for each section */
+		for ( currRegion_I = 0; currRegion_I < self->refinedRegionCounts[dim_I]; currRegion_I++ ) {
+			currRefinedRegion = &self->refinedRegions[dim_I][currRegion_I];
+			regionLength = currRefinedRegion->regionEnd - currRefinedRegion->regionStart;
+			currRefinedRegion->numElements = floor( regionLength / elLengthBase *
+				currRefinedRegion->refinementFactor + 0.5 );
+			currRefinedRegion->elementLength = regionLength / currRefinedRegion->numElements;	
+		}	
+
+		/* Do a check to make sure the total number of elements is correct */
+		numElementsNormal[dim_I] = self->countPerDim[dim_I] - 1;
+		for ( currRegion_I = 0; currRegion_I < self->refinedRegionCounts[dim_I]; currRegion_I++ ) {
+			currRefinedRegion = &self->refinedRegions[dim_I][currRegion_I];
+			numElementsNormal[dim_I] -= currRefinedRegion->numElements;
+		}	
+		elementLengthNormal[dim_I] = remainderLength / numElementsNormal[dim_I];
+	}
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/RefinedRegionsGeometry.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/RefinedRegionsGeometry.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,186 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	This class allows the user to specify a regular geometry, but with refinements
+**	in special regions.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: RefinedRegionsGeometry.h 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_RefinedRegionsGeometry_h__
+#define __Domain_Geometry_RefinedRegionsGeometry_h__
+
+	/* Virtual function types */
+	
+	/* Textual name of this class */
+	extern const Type RefinedRegionsGeometry_Type;
+
+	typedef struct RefinedRegion {
+		double		regionStart;
+		double		regionEnd;
+		unsigned int	refinementFactor;
+		Index		numElements;
+		double		elementLength;
+	} RefinedRegion;
+
+	/* RefinedRegionsGeometry information */
+	#define __RefinedRegionsGeometry \
+		/* General info */ \
+		__Geometry \
+		\
+		/* Virtual info */ \
+		\
+		/* RefinedRegionsGeometry info ... */ \
+		IJK				countPerDim; \
+		XYZ				min; \
+		XYZ				max; \
+		Index				refinedRegionCounts[3]; \
+		Index				refinedRegionSizes[3]; \
+		Index				refinedRegionDeltas[3]; \
+		RefinedRegion*			refinedRegions[3]; \
+		
+	struct RefinedRegionsGeometry { __RefinedRegionsGeometry };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/* Create a RefinedRegionsGeometry */
+	void* RefinedRegionsGeometry_DefaultNew( Name name );
+	
+	RefinedRegionsGeometry* RefinedRegionsGeometry_New(
+		Name						name,
+		Dictionary*					dictionary );
+	
+	/* Initialise a RefinedRegionsGeometry */
+	void RefinedRegionsGeometry_Init(
+		RefinedRegionsGeometry*					self,
+		Name						name,
+		Dictionary*					dictionary );
+	
+	/* Creation implementation */
+	RefinedRegionsGeometry* _RefinedRegionsGeometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary );
+	
+	/* Initialisation implementation functions */
+	void _RefinedRegionsGeometry_Init( RefinedRegionsGeometry* self, IJK size );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/* Stg_Class_Delete RefinedRegionsGeometry implementation */
+	void _RefinedRegionsGeometry_Delete( void* blockGeometry );
+	
+	/* Print RefinedRegionsGeometry implementation */
+	void _RefinedRegionsGeometry_Print( void* blockGeometry, Stream* stream );
+	
+	void _RefinedRegionsGeometry_Construct( void* blockGeometry, Stg_ComponentFactory *cf, void* data );
+	
+	void _RefinedRegionsGeometry_Build( void* blockGeometry, void *data );
+	
+	void _RefinedRegionsGeometry_Initialise( void* blockGeometry, void *data );
+	
+	void _RefinedRegionsGeometry_Execute( void* blockGeometry, void *data );
+	
+	void _RefinedRegionsGeometry_Destroy( void* blockGeometry, void *data );
+	
+	/* Copy */
+	#define RefinedRegionsGeometry_Copy( self ) \
+		(RefinedRegionsGeometry*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define RefinedRegionsGeometry_DeepCopy( self ) \
+		(RefinedRegionsGeometry*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	
+	void* _RefinedRegionsGeometry_Copy( void* geometry, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	void _RefinedRegionsGeometry_AddRefinedRegion( void* blockGeometry, Index dimension, double regionStart, double regionEnd, unsigned int refinementFactor );
+
+	void _RefinedRegionsGeometry_BuildPoints( void* blockGeometry, Coord_List points );
+	
+	void _RefinedRegionsGeometry_PointAt( void* blockGeometry, Index index, Coord point );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+
+	/** Calculates element lengths and numbers of elements in each region, including the "normal"
+	unrefined region. A first iteration at the normal length is calculated using:
+	X0 = 1 / globalRes * ( sigma ( Fn * Rn) ) 
+	Where:
+	X0 = unrefined element length, 
+	globalRes = global number of elements in this dimension
+	Fn = requested refinement factor of nth region
+	Rn = Region length of nth region
+
+	We then calculate the number of elements in the refined regions, _rounding off_ to ensure
+	even division:
+	resN = round( Rn / X0 * Fn)
+	where resN = the number of elements in the nth region, others as before.
+
+	And the element length can be calculated as:
+	elLengthN = Rn / resN.
+	
+	The number of elements in the unrefined region is then recovered by subtracting all the
+	other element totals, and the element length calcualted as above.
+	*/
+	void _RefinedRegionsGeometry_CalculateElementLengths(
+		RefinedRegionsGeometry*	self,
+		Index			numElementsNormal[3],
+		double			elementLengthNormal[3] );
+
+	
+#endif /* __Domain_Geometry_RefinedRegionsGeometry_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/RefinedRegionsGeometry.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/RefinedRegionsGeometry.meta	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">RefinedRegionsGeometry</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">Geometry</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">sizeI</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">1</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">sizeJ</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">1</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">sizeK</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">1</param>
+		<param name="Description">...</param>
+	</struct>
+	<struct>
+		<param name="Name">sizeShift</param>
+		<param name="Type">Int</param>
+		<param name="Default">0</param>
+		<param name="Description">...</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+<!-- This component calls in another directory so the info above/below may not be complete-->
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/ShellGeometry.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ShellGeometry.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,334 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: ShellGeometry.c 4081 2007-04-27 06:20:07Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "GeometryClass.h"
+#include "ShellGeometry.h"
+#include "TrigMath.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <assert.h>
+
+
+/* Textual name of this class */
+const Type ShellGeometry_Type = "ShellGeometry";
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+ShellGeometry* ShellGeometry_DefaultNew( Name name )
+{
+	return (ShellGeometry*)_ShellGeometry_New(
+		sizeof(ShellGeometry), 
+		ShellGeometry_Type, 
+		_ShellGeometry_Delete, 
+		_ShellGeometry_Print,
+		NULL,
+		(Stg_Component_DefaultConstructorFunction*)ShellGeometry_DefaultNew,
+		_ShellGeometry_Construct,
+		_ShellGeometry_Build,
+		_ShellGeometry_Initialise,
+		_ShellGeometry_Execute,
+		_ShellGeometry_Destroy,
+		name,
+		False,
+		_ShellGeometry_BuildPoints,
+		_ShellGeometry_PointAt,
+		NULL );
+}
+
+ShellGeometry* ShellGeometry_New(
+		Name name,
+		Dictionary*					dictionary )
+{
+	return _ShellGeometry_New( 
+		sizeof(ShellGeometry), 
+		ShellGeometry_Type, 
+		_ShellGeometry_Delete, 
+		_ShellGeometry_Print,
+		NULL,
+		(Stg_Component_DefaultConstructorFunction*)ShellGeometry_DefaultNew,
+		_ShellGeometry_Construct,
+		_ShellGeometry_Build,
+		_ShellGeometry_Initialise,
+		_ShellGeometry_Execute,
+		_ShellGeometry_Destroy,
+		name,
+		True,
+		_ShellGeometry_BuildPoints,
+		_ShellGeometry_PointAt,
+		dictionary );
+}
+
+
+void ShellGeometry_Init(
+		ShellGeometry*					self,
+		Name						name,
+		Dictionary*					dictionary )
+{
+	/* General info */
+	self->type = ShellGeometry_Type;
+	self->_sizeOfSelf = sizeof(ShellGeometry);
+	self->_deleteSelf = False;
+	self->dictionary = dictionary;
+	
+	/* Virtual info */
+	self->_delete = _ShellGeometry_Delete;
+	self->_print = _ShellGeometry_Print;
+	self->_copy = NULL;
+	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)ShellGeometry_DefaultNew;
+	self->_construct = _ShellGeometry_Construct;
+	self->_build = _ShellGeometry_Build;
+	self->_initialise = _ShellGeometry_Initialise;
+	self->_execute = _ShellGeometry_Execute;
+	self->_destroy = _ShellGeometry_Destroy;
+	self->buildPoints = _ShellGeometry_BuildPoints;
+	self->pointAt = _ShellGeometry_PointAt;
+
+	_Stg_Class_Init( (Stg_Class*)self );
+	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
+	_Stg_Component_Init( (Stg_Component*)self );
+
+	_Geometry_Init( (Geometry*)self );
+	
+	/* ShellGeometry info */
+	_ShellGeometry_Init( self );
+}
+
+
+ShellGeometry* _ShellGeometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary )
+{
+	ShellGeometry* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(ShellGeometry) );
+	self = (ShellGeometry*)_Geometry_New(
+		_sizeOfSelf,
+		type,
+		_delete,
+		_print,
+		_copy, 
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,
+		name, 
+		initFlag,
+		buildPoints,
+		pointAt,
+		dictionary );
+	
+	/* General info */
+	
+	/* Virtual info */
+	
+	/* ShellGeometry info */
+	if( initFlag ){
+		_ShellGeometry_Init( self );
+	}
+	
+	return self;
+}
+
+void _ShellGeometry_Init(
+		ShellGeometry*					self )
+{
+	/* General and Virtual info should already be set */
+	
+	/* ShellGeometry info */
+	self->isConstructed = True;
+	self->size[0] = Dictionary_Entry_Value_AsUnsignedInt( Dictionary_GetDefault( self->dictionary, "meshSizeI",
+		Dictionary_Entry_Value_FromUnsignedInt( 2 ) ) );
+	self->size[1] = Dictionary_Entry_Value_AsUnsignedInt( Dictionary_GetDefault( self->dictionary, "meshSizeJ",
+		Dictionary_Entry_Value_FromUnsignedInt( 2 ) ) );
+	self->size[2] = Dictionary_Entry_Value_AsUnsignedInt( Dictionary_GetDefault( self->dictionary, "meshSizeK",
+		Dictionary_Entry_Value_FromUnsignedInt( 2 ) ) );
+	self->pointCount = self->size[0] * self->size[1] * self->size[2];
+	assert( self->pointCount );
+	
+	self->min[0] = Dictionary_Entry_Value_AsDouble( Dictionary_GetDefault( self->dictionary, "minTheta",
+		Dictionary_Entry_Value_FromDouble( 2.0 * M_PI / 3.0 ) ) );
+	self->min[1] = Dictionary_Entry_Value_AsDouble( Dictionary_GetDefault( self->dictionary, "minPhi",
+		Dictionary_Entry_Value_FromDouble( 2.0 * M_PI / 3.0 ) ) );
+	self->min[2] = Dictionary_Entry_Value_AsDouble( Dictionary_GetDefault( self->dictionary, "minR",
+		Dictionary_Entry_Value_FromDouble( 0.5f ) ) );
+	self->max[0] = Dictionary_Entry_Value_AsDouble( Dictionary_GetDefault( self->dictionary, "maxTheta",
+		Dictionary_Entry_Value_FromDouble( M_PI / 3.0 ) ) );
+	self->max[1] = Dictionary_Entry_Value_AsDouble( Dictionary_GetDefault( self->dictionary, "maxPhi",
+		Dictionary_Entry_Value_FromDouble( M_PI / 3.0 ) ) );
+	self->max[2] = Dictionary_Entry_Value_AsDouble( Dictionary_GetDefault( self->dictionary, "maxR",
+		Dictionary_Entry_Value_FromDouble( 1.0f ) ) );
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _ShellGeometry_Delete( void* shellGeometry ) {
+	ShellGeometry* self = (ShellGeometry*)shellGeometry;
+	
+	/* Stg_Class_Delete parent */
+	_Geometry_Delete( self );
+}
+
+
+void _ShellGeometry_Print( void* shellGeometry, Stream* stream ) {
+	ShellGeometry* self = (ShellGeometry*)shellGeometry;
+	
+	/* Set the Journal for printing informations */
+	Stream* shellGeometryStream;
+	shellGeometryStream = Journal_Register( InfoStream_Type, "ShellGeometryStream" );
+
+	/* Print parent */
+	_Geometry_Print( self, stream );
+	
+	/* General info */
+	Journal_Printf( stream, "ShellGeometry (ptr): (%p)\n", self );
+	
+	/* Virtual info */
+	
+	/* ShellGeometry info */
+}
+
+void _ShellGeometry_Construct( void* shellGeometry, Stg_ComponentFactory *cf, void* data ){
+	
+}
+	
+void _ShellGeometry_Build( void* shellGeometry, void *data ){
+	
+}
+	
+void _ShellGeometry_Initialise( void* shellGeometry, void *data ){
+	
+}
+	
+void _ShellGeometry_Execute( void* shellGeometry, void *data ){
+	
+}
+
+void _ShellGeometry_Destroy( void* shellGeometry, void *data ){
+	
+}
+
+void _ShellGeometry_BuildPoints( void* shellGeometry, Coord_List points )
+{
+	ShellGeometry*  self = (ShellGeometry*)shellGeometry;
+	Index		i;
+	
+	for( i = 0; i < self->pointCount; i++ ) {
+		IJK	ijk;
+		XYZ     coords;
+	
+		ijk[0] = i % self->size[0];
+		ijk[1] = (i / self->size[0]) % self->size[1];
+		ijk[2] = i / (self->size[0] * self->size[1]);
+	
+		coords[0] = self->size[0] > 1 ? self->min[0] + (self->max[0] - self->min[0]) * ((double)ijk[0] / 
+			(double)(self->size[0] - 1)) : self->min[0];
+		coords[1] = self->size[1] > 1 ? self->min[1] + (self->max[1] - self->min[1]) * ((double)ijk[1] / 
+			(double)(self->size[1] - 1)) : self->min[1];
+		coords[2] = self->size[2] > 1 ? self->min[2] + (self->max[2] - self->min[2]) * ((double)ijk[2] / 
+			(double)(self->size[2] - 1)) : self->min[2];
+		
+		points[i][0] = coords[2] * cos( coords[0] ) * sin( coords[1] );
+		points[i][1] = coords[2] * sin( coords[0] ) * sin( coords[1] );
+		points[i][2] = coords[2] * cos( coords[1] );
+	}
+}
+
+
+void _ShellGeometry_PointAt( void* shellGeometry, Index index, Coord point )
+{
+	ShellGeometry* self = (ShellGeometry*)shellGeometry;
+	
+	if( index < self->pointCount ) {
+		IJK	ijk;
+		XYZ     coords;
+	
+		ijk[0] = index % self->size[0];
+		ijk[1] = (index / self->size[0]) % self->size[1];
+		ijk[2] = index / (self->size[0] * self->size[1]);
+	
+		coords[0] = self->size[0] > 1 ? self->min[0] + (self->max[0] - self->min[0]) * ((double)ijk[0] / 
+			(double)(self->size[0] - 1)) : self->min[0];
+		coords[1] = self->size[1] > 1 ? self->min[1] + (self->max[1] - self->min[1]) * ((double)ijk[1] / 
+			(double)(self->size[1] - 1)) : self->min[1];
+		coords[2] = self->size[2] > 1 ? self->min[2] + (self->max[2] - self->min[2]) * ((double)ijk[2] / 
+			(double)(self->size[2] - 1)) : self->min[2];
+		
+		point[0] = coords[2] * cos( coords[0] ) * sin( coords[1] );
+		point[1] = coords[2] * sin( coords[0] ) * sin( coords[1] );
+		point[2] = coords[2] * cos( coords[1] );
+	}
+	else {
+		point[0] = HUGE_VAL;
+		point[1] = HUGE_VAL;
+		point[2] = HUGE_VAL;
+	}
+}
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/ShellGeometry.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ShellGeometry.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,138 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Comments: ) {
+	IrregTopology* self = (IrregTopology*)ir
+**
+** $Id: ShellGeometry.h 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_ShellGeometry_h__
+#define __Domain_Geometry_ShellGeometry_h__
+
+	/* Virtual function types */
+	
+	/* Textual name of this class */
+	extern const Type ShellGeometry_Type;
+
+	/* ShellGeometry information */
+	#define __ShellGeometry \
+		/* General info */ \
+		__Geometry \
+		\
+		/* Virtual info */ \
+		\
+		/* ShellGeometry info ... */ \
+		IJK				size; \
+		XYZ				min; \
+		XYZ				max;
+	struct ShellGeometry { __ShellGeometry };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/* Create a ShellGeometry */
+	ShellGeometry* ShellGeometry_DefaultNew( Name name );
+	
+	ShellGeometry* ShellGeometry_New(
+		Name name,
+		Dictionary*					dictionary );
+	
+	/* Initialise a ShellGeometry */
+	void ShellGeometry_Init(
+		ShellGeometry*					self,
+		Name						name,
+		Dictionary*					dictionary );
+	
+	/* Creation implementation */
+	ShellGeometry* _ShellGeometry_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,
+		Geometry_BuildPointsFunction*			buildPoints,
+		Geometry_PointAtFunction*			pointAt,
+		Dictionary*					dictionary );
+	
+	/* Initialisation implementation functions */
+	void _ShellGeometry_Init(
+		ShellGeometry*					self );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/* Stg_Class_Delete ShellGeometry implementation */
+	void _ShellGeometry_Delete( void* shellGeometry );
+	
+	/* Print ShellGeometry implementation */
+	void _ShellGeometry_Print( void* shellGeometry, Stream* stream );
+	
+	void _ShellGeometry_Construct( void* shellGeometry, Stg_ComponentFactory *cf, void* data );
+	
+	void _ShellGeometry_Build( void* shellGeometry, void *data );
+	
+	void _ShellGeometry_Initialise( void* shellGeometry, void *data );
+	
+	void _ShellGeometry_Execute( void* shellGeometry, void *data );
+
+	void _ShellGeometry_Destroy( void* shellGeometry, void *data );
+	
+	void _ShellGeometry_BuildPoints( void* shellGeometry, Coord_List points );
+	
+	void _ShellGeometry_PointAt( void* shellGeometry, Index index, Coord point );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Public member functions
+	*/
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Private Member functions
+	*/
+	
+	
+#endif /* __Domain_Geometry_ShellGeometry_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/ShellGeometry.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/ShellGeometry.meta	Wed Oct 10 07:21:38 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">ShellGeometry</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">Geometry</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 9f22ec4f42ee -r 5667007f4799 Geometry/src/Simplex.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Simplex.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,216 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Simplex.c 3584 2006-05-16 11:11:07Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <mpi.h>
+
+#include "StGermain/StGermain.h"
+#include "Geometry.h"
+
+
+Bool Simplex_Search3D( double** verts, unsigned* inc, 
+		       unsigned nSimplices, unsigned** inds, 
+		       double* point, double* bc, unsigned* inside )
+{
+	unsigned	s_i;
+
+	assert( inds );
+
+	for( s_i = 0; s_i < nSimplices; s_i++ ) {
+		unsigned	ind_i;
+
+		Simplex_Barycenter3D( verts, inc, inds[s_i], point, bc );
+		for( ind_i = 0; ind_i < 4; ind_i++ ) {
+			if( bc[ind_i] < 0.0 || bc[ind_i] > 1.0 )
+				break;
+		}
+		if( ind_i == 4 ) {
+			*inside = s_i;
+			return True;
+		}
+	}
+
+	return False;
+}
+
+Bool Simplex_Search2D( double** verts, unsigned* inc, 
+		       unsigned nSimplices, unsigned** inds, 
+		       double* point, double* bc, unsigned* inside )
+{
+	unsigned	s_i;
+
+	assert( inds );
+
+	for( s_i = 0; s_i < nSimplices; s_i++ ) {
+		unsigned	ind_i;
+
+		Simplex_Barycenter2D( verts, inc, inds[s_i], point, bc );
+		for( ind_i = 0; ind_i < 3; ind_i++ ) {
+			if( bc[ind_i] < 0.0 || bc[ind_i] > 1.0 )
+				break;
+		}
+		if( ind_i == 3 ) {
+			*inside = s_i;
+			return True;
+		}
+	}
+
+	return False;
+}
+
+void Simplex_Barycenter3D( double** verts, unsigned* inc, unsigned* inds, double* point, double* bc ) {
+	double*	tet[4];
+	double	x0, y0, z0;
+	double	x1, y1, z1;
+	double	x2, y2, z2;
+	double	x3, y3, z3;
+	double	px, py, pz;
+	double	den;
+
+	assert( verts );
+	assert( inc );
+	assert( inds );
+	assert( point );
+	assert( bc );
+	assert( verts[inc[inds[0]]] );
+	assert( verts[inc[inds[1]]] );
+	assert( verts[inc[inds[2]]] );
+	assert( verts[inc[inds[3]]] );
+
+	tet[0] = verts[inc[inds[0]]];
+	tet[1] = verts[inc[inds[1]]];
+	tet[2] = verts[inc[inds[2]]];
+	tet[3] = verts[inc[inds[3]]];
+	x0 = tet[0][0]; x1 = tet[1][0]; x2 = tet[2][0]; x3 = tet[3][0];
+	y0 = tet[0][1]; y1 = tet[1][1]; y2 = tet[2][1]; y3 = tet[3][1];
+	z0 = tet[0][2]; z1 = tet[1][2]; z2 = tet[2][2]; z3 = tet[3][2];
+	px = point[0]; py = point[1]; pz = point[2];
+	den = 1.0 / (x1*(y0*(z3 - z2) + y2*(z0 - z3) + y3*(z2 - z0)) + 
+			     x0*(y2*(z3 - z1) + y1*(z2 - z3) + y3*(z1 - z2)) + 
+			     x2*(y1*(z3 - z0) + y0*(z1 - z3) + y3*(z0 - z1)) + 
+			     x3*(y0*(z2 - z1) + y1*(z0 - z2) + y2*(z1 - z0)));
+
+	bc[1] = -(x0*(py*(z3 - z2) + y2*(pz - z3) + y3*(z2 - pz)) + 
+		   px*(y2*(z3 - z0) + y0*(z2 - z3) + y3*(z0 - z2)) + 
+		   x2*(y0*(z3 - pz) + py*(z0 - z3) + y3*(pz - z0)) + 
+		   x3*(py*(z2 - z0) + y0*(pz - z2) + y2*(z0 - pz))) * den;
+	if( Num_Approx( bc[1], 0.0 ) ) bc[1] = 0.0;
+	else if( Num_Approx( bc[1], 1.0 ) ) bc[1] = 1.0;
+
+	bc[2] = (x0*(py*(z3 - z1) + y1*(pz - z3) + y3*(z1 - pz)) + 
+		  px*(y1*(z3 - z0) + y0*(z1 - z3) + y3*(z0 - z1)) + 
+		  x1*(y0*(z3 - pz) + py*(z0 - z3) + y3*(pz - z0)) + 
+		  x3*(py*(z1 - z0) + y0*(pz - z1) + y1*(z0 - pz))) * den;
+	if( Num_Approx( bc[2], 0.0 ) ) bc[2] = 0.0;
+	else if( Num_Approx( bc[2], 1.0 ) ) bc[2] = 1.0;
+
+	bc[3] = -(x0*(py*(z2 - z1) + y1*(pz - z2) + y2*(z1 - pz)) + 
+		   px*(y1*(z2 - z0) + y0*(z1 - z2) + y2*(z0 - z1)) + 
+		   x1*(y0*(z2 - pz) + py*(z0 - z2) + y2*(pz - z0)) + 
+		   x2*(py*(z1 - z0) + y0*(pz - z1) + y1*(z0 - pz))) * den;
+	if( Num_Approx( bc[3], 0.0 ) ) bc[3] = 0.0;
+	else if( Num_Approx( bc[3], 1.0 ) ) bc[3] = 1.0;
+
+	bc[0] = 1.0 - bc[1] - bc[2] - bc[3];
+	if( Num_Approx( bc[0], 0.0 ) ) bc[0] = 0.0;
+	else if( Num_Approx( bc[0], 1.0 ) ) bc[0] = 1.0;
+}
+
+void Simplex_Barycenter2D( double** verts, unsigned* inc, unsigned* inds, double* point, double* bc ) {
+	double*	tri[3];
+	double	a;
+	double	b;
+	double	c;
+	double	d;
+	double	e;
+	double	f;
+
+	assert( verts );
+	assert( inc );
+	assert( inds );
+	assert( point );
+	assert( bc );
+	assert( verts[inc[inds[0]]] );
+	assert( verts[inc[inds[1]]] );
+	assert( verts[inc[inds[2]]] );
+
+	tri[0] = verts[inc[inds[0]]];
+	tri[1] = verts[inc[inds[1]]];
+	tri[2] = verts[inc[inds[2]]];
+	a = tri[0][0] - tri[2][0];
+	b = tri[1][0] - tri[2][0];
+	c = tri[2][0] - point[0];
+	d = tri[0][1] - tri[2][1];
+	e = tri[1][1] - tri[2][1];
+	f = tri[2][1] - point[1];
+
+	bc[0] = (b * f - c * e) / (a * e - b * d);
+	if( Num_Approx( bc[0], 0.0 ) ) bc[0] = 0.0;
+	else if( Num_Approx( bc[0], 1.0 ) ) bc[0] = 1.0;
+	bc[1] = (a * f - c * d) / (b * d - a * e);
+	if( Num_Approx( bc[1], 0.0 ) ) bc[1] = 0.0;
+	else if( Num_Approx( bc[1], 1.0 ) ) bc[1] = 1.0;
+	bc[2] = 1.0 - bc[0] - bc[1];
+	if( Num_Approx( bc[2], 0.0 ) ) bc[2] = 0.0;
+	else if( Num_Approx( bc[2], 1.0 ) ) bc[2] = 1.0;
+}
+
+double Simplex_Volume( double** verts, unsigned* inc, unsigned* inds ) {
+	static const double	fac = 1.0 / 6.0;
+	double			da[3], db[3], dc[3];
+
+	assert( verts );
+	assert( inc );
+	assert( inds );
+
+	Vec_Sub3D( da, verts[inc[inds[2]]], verts[inc[inds[0]]] );
+	Vec_Sub3D( db, verts[inc[inds[2]]], verts[inc[inds[1]]] );
+	Vec_Sub3D( dc, verts[inc[inds[2]]], verts[inc[inds[2]]] );
+	Vec_Cross3D( db, db, dc );
+
+	return fac * fabs( Vec_Dot3D( da, db ) );
+}
+
+double Simplex_Area( double** verts, unsigned* inc, unsigned* inds ) {
+	unsigned	a = inc[inds[0]];
+	unsigned	b = inc[inds[1]];
+	unsigned	c = inc[inds[2]];
+
+	assert( verts );
+	assert( inc );
+	assert( inds );
+
+	return 0.5 * fabs( verts[a][0] * (verts[c][1] - verts[b][1]) + 
+			   verts[b][0] * (verts[a][1] - verts[c][1]) + 
+			   verts[c][0] * (verts[b][1] - verts[a][1]) );
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Simplex.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Simplex.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,57 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**
+** Assumptions:
+**
+** Invariants:
+**
+** Comments:
+**
+** $Id: Simplex.h 3584 2006-05-16 11:11:07Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Simplex_h__
+#define __Domain_Geometry_Simplex_h__
+
+	Bool Simplex_Search3D( double** verts, unsigned* inc, 
+			       unsigned nSimplices, unsigned** inds, 
+			       double* point, double* bc, unsigned* inside );
+	Bool Simplex_Search2D( double** verts, unsigned* inc, 
+			       unsigned nSimplices, unsigned** inds, 
+			       double* point, double* bc, unsigned* inside );
+
+	void Simplex_Barycenter3D( double** verts, unsigned* inc, unsigned* inds, double* point, double* bc );
+	void Simplex_Barycenter2D( double** verts, unsigned* inc, unsigned* inds, double* point, double* bc );
+
+	double Simplex_Volume( double** verts, unsigned* inc, unsigned* inds );
+	double Simplex_Area( double** verts, unsigned* inc, unsigned* inds );
+
+#endif /* __Domain_Geometry_Simplex_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Simplex.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Simplex.meta	Wed Oct 10 07:21:38 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">
+
+<param name="Name">Simplex</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">StGermain/Discretisation/Geometry/src</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">Stg_Component</param>
+<param name="Description">...</param>
+
+</StGermainData>
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/TensorMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/TensorMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,1044 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  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: TensorMath.c 4081 2007-04-27 06:20:07Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "units.h"
+#include "types.h"
+#include "TensorMath.h"
+#include "VectorMath.h"
+#include "TrigMath.h"
+
+#include <math.h>
+#include <string.h>
+
+/** Mappings from enumerated types to arrays
+This gives the user the option to use:
+References instead of enumerated types.
+TensorMapFT2D[0][0] = FT2D_00
+etc.
+*/
+const unsigned int TensorMapFT2D[2][2] = {{FT2D_00, FT2D_01},{FT2D_10, FT2D_11}};
+
+/** See explanation for TensorMapFT2D */
+const unsigned int TensorMapST2D[2][2] = {{ST2D_00, ST2D_01},{ST2D_01, ST2D_11}};
+
+/** See explanation for TensorMapFT2D */
+const unsigned int TensorMapFT3D[3][3] ={{FT3D_00, FT3D_01, FT3D_02},{FT3D_10, FT3D_11, FT3D_12},{FT3D_20, FT3D_21, FT3D_22}};
+
+/** See explanation for TensorMapFT2D */
+const unsigned int TensorMapST3D[3][3] ={{ST3D_00, ST3D_01, ST3D_02},{ST3D_01, ST3D_11, ST3D_12},{ST3D_02, ST3D_12, ST3D_22}};
+
+/** This is a wrapper that converts a row/col index and a dimension
+into the correct number to reference the correct address of the value
+in the tensorArray function.
+*/
+int TensorArray_TensorMap(Dimension_Index row_I, Dimension_Index col_I, Dimension_Index dim) {
+	switch (dim) {
+		case 3: {
+			return TensorMapFT3D[ row_I ][ col_I ];
+		}
+		case 2: {
+			return TensorMapFT2D[ row_I ][ col_I ];
+		}
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( dim, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+		
+	}
+	return 0;
+}
+
+/** This is a wrapper that converts a row/col index and a dimension
+into the correct number to reference the correct address of the value
+in the symmetricTensor function.
+*/
+int SymmetricTensor_TensorMap(Dimension_Index row_I, Dimension_Index col_I, Dimension_Index dim) {
+	switch (dim) {
+		case 3: {
+			return TensorMapST3D[ row_I ][ col_I ];
+		}
+		case 2: {
+			return TensorMapST2D[ row_I ][ col_I ];
+		}
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( dim, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+		
+	}
+	return 0;
+}
+
+/** This sets the values from a nxn array into a TensorArray */ 
+void TensorArray_SetFromDoubleArray( TensorArray tensor, double** array, Dimension_Index dim ) {
+	Dimension_Index row_I, col_I;
+
+	for ( row_I = 0 ; row_I < dim ; row_I++ ) {
+		for ( col_I = 0 ; col_I < dim ; col_I++ ) {
+			tensor[ MAP_TENSOR( row_I, col_I, dim ) ] = array[ row_I ][ col_I ];
+		}
+	}
+}
+
+/** Converts a symmetric tensor to a full tensor */
+void StGermain_SymmetricTensor_ToTensorArray(SymmetricTensor symTensor, Dimension_Index dim, TensorArray fullTensor) {
+	switch (dim) {
+		case 3:
+			StGermain_SymmetricTensor_ToTensorArray3D(symTensor, fullTensor);
+			return;
+		case 2:
+			StGermain_SymmetricTensor_ToTensorArray2D(symTensor, fullTensor);
+			return;
+		default: {
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+}
+/** This function uses enumerated types to convert symmetric tensors to full tensors */
+void StGermain_SymmetricTensor_ToTensorArray2D(SymmetricTensor symTensor, TensorArray fullTensor) {
+
+	fullTensor[FT2D_00] = symTensor[ST2D_00];
+	fullTensor[FT2D_01] = symTensor[ST2D_01];
+	fullTensor[FT2D_10] = symTensor[ST2D_01];
+	fullTensor[FT2D_11] = symTensor[ST2D_11];
+	
+
+}
+
+/** This function uses enumerated types to convert symmetric tensors to full tensors */
+void StGermain_SymmetricTensor_ToTensorArray3D(SymmetricTensor symTensor, TensorArray fullTensor) {
+	/*Using enumerated types to convert symmetric tensors to full tensors */
+	fullTensor[FT3D_00] = symTensor[ST3D_00];
+	fullTensor[FT3D_01] = symTensor[ST3D_01];
+	fullTensor[FT3D_02] = symTensor[ST3D_02];
+	fullTensor[FT3D_10] = symTensor[ST3D_01];
+	fullTensor[FT3D_11] = symTensor[ST3D_11];
+	fullTensor[FT3D_12] = symTensor[ST3D_12];
+	fullTensor[FT3D_20] = symTensor[ST3D_02];
+	fullTensor[FT3D_21] = symTensor[ST3D_12];
+	fullTensor[FT3D_22] = symTensor[ST3D_22];
+	
+
+}
+
+/** This function converts TensorArray's to square Matrixes */
+void TensorArray_ToMatrix( TensorArray tensor, Dimension_Index dim, double** matrix ) {
+	if (dim == 2) {
+		matrix[0][0] = tensor[FT2D_00] ; matrix[0][1] = tensor[FT2D_01] ;
+		matrix[1][0] = tensor[FT2D_10] ; matrix[1][1] = tensor[FT2D_11] ;
+	}
+	else if (dim == 3) {
+		matrix[0][0] = tensor[FT3D_00];	matrix[0][1] = tensor[FT3D_01];	matrix[0][2] = tensor[FT3D_02];
+		matrix[1][0] = tensor[FT3D_10];	matrix[1][1] = tensor[FT3D_11];	matrix[1][2] = tensor[FT3D_12];
+		matrix[2][0] = tensor[FT3D_20];	matrix[2][1] = tensor[FT3D_21];	matrix[2][2] = tensor[FT3D_22];
+	}
+	else {
+		Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+	}
+}
+
+
+void ZeroMatrix( double** matrix, Index rows, Index cols ) {
+	Index count_I;
+	for( count_I = 0 ; count_I < rows ; count_I++ ) {
+		memset( matrix[ count_I ], 0, (cols*sizeof(double)) );
+	}
+}
+
+
+/** This function extracts out the antiSymmetric part of a tensor Array
+v_{ij} = 0.5 * ( u_{ij} - u_{ji} )
+See http://mathworld.wolfram.com/AntisymmetricPart.html */
+void TensorArray_GetAntisymmetricPart( TensorArray tensor, Dimension_Index dim, TensorArray antiSymmetric ) {
+	switch (dim) {
+		case 3:
+			/* v_{xz} = 0.5*( u_{xz} - u_{zx} ) */
+			antiSymmetric[ TensorMapFT3D[0][2] ] = 0.5 * (tensor[ TensorMapFT3D[0][2] ] - 
+							tensor[ TensorMapFT3D[2][0] ] );
+			
+			/* v_{yz} = 0.5*( u_{yz} - u_{zy} ) */
+			antiSymmetric[ TensorMapFT3D[1][2] ] = 0.5 * (tensor[ TensorMapFT3D[1][2] ] - 
+							tensor[ TensorMapFT3D[2][1] ] );
+			
+			/* v_{zx} = 0.5*( u_{zx} - u_{xz} ) */
+			antiSymmetric[ TensorMapFT3D[2][0] ] = - antiSymmetric[ TensorMapFT3D[0][2] ];
+
+			/* v_{zy} = 0.5*( u_{zy} - u_{yz} ) */	
+			antiSymmetric[ TensorMapFT3D[2][1] ] = - antiSymmetric[ TensorMapFT3D[1][2] ];
+
+			/* v_{zz} = 0.5*( u_{zz} - u_{zz} ) */
+			antiSymmetric[ TensorMapFT3D[2][2] ] = 0.0;
+
+			/* v_{xy} = 0.5*( u_{xy} - u_{yx} ) */
+			antiSymmetric[ TensorMapFT3D[0][1] ] = 0.5 * (tensor[ TensorMapFT3D[0][1] ] - 
+						tensor[ TensorMapFT3D[1][0] ] );
+
+			/* v_{yx} = 0.5*( u_{yx} - u_{xy} ) */
+			antiSymmetric[ TensorMapFT3D[1][0] ] = - antiSymmetric[ TensorMapFT3D[0][1] ];
+
+			/* v_{yy} = 0.5*( u_{yy} - u_{yy} ) */
+			antiSymmetric[ TensorMapFT3D[1][1] ] = 0.0;
+			
+			/* v_{xx} = 0.5*( u_{xx} - u_{xx} ) */
+			antiSymmetric[ TensorMapFT3D[0][0] ] = 0.0;
+			return;
+		case 2:		
+			/* v_{xy} = 0.5*( u_{xy} - u_{yx} ) */
+			antiSymmetric[ TensorMapFT2D[0][1] ] = 0.5 * (tensor[ TensorMapFT2D[0][1] ] - 
+						tensor[ TensorMapFT2D[1][0] ] );
+
+			/* v_{yx} = 0.5*( u_{yx} - u_{xy} ) */
+			antiSymmetric[ TensorMapFT2D[1][0] ] = - antiSymmetric[ TensorMapFT2D[0][1] ];
+
+			/* v_{yy} = 0.5*( u_{yy} - u_{yy} ) */
+			antiSymmetric[ TensorMapFT2D[1][1] ] = 0.0;
+			
+			/* v_{xx} = 0.5*( u_{xx} - u_{xx} ) */
+			antiSymmetric[ TensorMapFT2D[0][0] ] = 0.0;
+			return;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot store tensor for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+}
+
+/** This function calculates the symmetric part of a TensorArray and returns
+it in a SymmetricTensor: 
+v_{ij} = 0.5 * ( u_{ij} + u_{ji} ) 
+see http://mathworld.wolfram.com/SymmetricPart.html 
+It can also be used to convert a symmetric TensorArray to a SymmetricTensor
+if the TensorArray is guaranteed to be Symmetric. (It has no type checking)*/
+void TensorArray_GetSymmetricPart( TensorArray tensor, Dimension_Index dim, SymmetricTensor symmetricTensor ) {
+	switch (dim) {
+		case 2:
+			/* Diagonal Terms */
+			/* v_{xx} = 0.5*( u_{xx} + u_{xx} ) */
+			/* v_{yy} = 0.5*( u_{yy} + u_{yy} ) */
+			symmetricTensor[ TensorMapST2D[0][0] ] = tensor[ TensorMapFT2D[0][0] ]; 
+			symmetricTensor[ TensorMapST2D[1][1] ] = tensor[ TensorMapFT2D[1][1] ]; 
+			
+			/* Off-diagonal Term */
+			/* v_{xy} = 0.5*( u_{xy} + u_{yx} ) */
+			symmetricTensor[ TensorMapST2D[0][1] ] = 
+				0.5 * (tensor[ TensorMapFT2D[0][1] ] + tensor[ TensorMapFT2D[1][0] ]); 
+			return;
+		case 3:
+			/* Diagonal Terms */
+			/* v_{xx} = 0.5*( u_{xx} + u_{xx} ) */
+			/* v_{yy} = 0.5*( u_{yy} + u_{yy} ) */
+			/* v_{zz} = 0.5*( u_{zz} + u_{zz} ) */
+			symmetricTensor[ TensorMapST3D[0][0] ] = tensor[ TensorMapFT3D[0][0] ]; 
+			symmetricTensor[ TensorMapST3D[1][1] ] = tensor[ TensorMapFT3D[1][1] ]; 
+			symmetricTensor[ TensorMapST3D[2][2] ] = tensor[ TensorMapFT3D[2][2] ]; 
+			
+			/* Off-diagonal Terms */
+			/* v_{xy} = 0.5*( u_{xy} + u_{yx} ) */
+			/* v_{xz} = 0.5*( u_{xz} + u_{zx} ) */
+			/* v_{yz} = 0.5*( u_{yz} + u_{zy} ) */
+			symmetricTensor[ TensorMapST3D[0][1] ] =
+				0.5 * (tensor[ TensorMapFT3D[0][1] ] + tensor[ TensorMapFT3D[1][0] ]); 
+		
+			symmetricTensor[ TensorMapST3D[0][2] ] =
+				0.5 * (tensor[ TensorMapFT3D[0][2] ] + tensor[ TensorMapFT3D[2][0] ]); 
+		
+			symmetricTensor[ TensorMapST3D[1][2] ] =
+				0.5 * (tensor[ TensorMapFT3D[1][2] ] + tensor[ TensorMapFT3D[2][1] ]); 
+			return;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot store tensor for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+}
+
+
+/** This function calculates the trace of a tenorArray 
+trace = u_{ii} */
+void TensorArray_GetTrace( TensorArray tensor, Dimension_Index dim, double *trace ) {
+	switch (dim) {
+	  case 1:
+		/* Sum the diagonal terms */
+		*trace = 	tensor[0];
+		break;
+	  case 2:
+		/* Sum the diagonal terms */
+		/*
+		*trace = 	tensor[ MAP_2D_TENSOR( 0, 0 ) ]
+		+ 	tensor[ MAP_2D_TENSOR( 1, 1 ) ];
+		*/
+		*trace = tensor[FT2D_00] + tensor[FT2D_11];
+		break;
+	  case 3:
+		/* Sum the diagonal terms */
+		/*
+		*trace = 	tensor[ MAP_3D_TENSOR( 0, 0 ) ]
+				+	tensor[ MAP_3D_TENSOR( 1, 1 ) ]
+				+	tensor[ MAP_3D_TENSOR( 2, 2 ) ];
+		*/
+		*trace = tensor[FT3D_00] + tensor[FT3D_11] + tensor[FT3D_22];
+		break;
+		  default:{
+		Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot compute trace for tensor in dimension %d (in %s) since dim < 1.\n", dim, __func__);
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+			break;
+		}
+	}
+}
+
+/** This function will calculate the trace of a symmetric tensor type */
+void SymmetricTensor_GetTrace( SymmetricTensor symmTensor, Dimension_Index dim, double *trace ) {
+	switch (dim) {
+	  case 1:
+		*trace = symmTensor[0];
+		break;
+	  case 2:
+		*trace = symmTensor[ST2D_00] + symmTensor[ST2D_11];
+		break;
+	  case 3:
+		*trace = symmTensor[ST3D_00] + symmTensor[ST3D_11] + symmTensor[ST3D_22];
+		break;
+	  default:{
+		Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+		Journal_Printf( error, "Cannot compute trace for symmetric tensor in dimension %d (in %s) since dim is not in the range [1, 3].\n", dim, __func__);
+		Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+			"In func '%s' don't understand dim = %u\n", __func__, dim );
+		break;
+		  }
+	}
+
+}
+
+/** This function prints an unnamed tensorArray */
+void Journal_PrintTensorArray_Unnamed( Stream* stream, TensorArray tensor, Dimension_Index dim ) {
+	Dimension_Index row_I, col_I;
+
+	/* For efficency - Check if stream is enabled */
+	if (!Stream_IsEnable(stream)) return;
+
+	for ( row_I = 0 ; row_I < dim ; row_I++ ) {
+		for ( col_I = 0 ; col_I < dim ; col_I++ ) {
+			Journal_Printf( stream, "%7.5g     ", tensor[ MAP_TENSOR( row_I, col_I, dim ) ] );
+		}
+		Journal_Printf( stream, "\n" );
+	}
+}
+
+/** This function prints an unnamed square 2-D Array */
+void Journal_PrintSquareArray_Unnamed( Stream* stream, double** array, Dimension_Index dim ) {
+	Dimension_Index row_I, col_I;
+
+	/* For efficency - Check if stream is enabled */
+	if (!Stream_IsEnable(stream)) return;
+
+	for ( row_I = 0 ; row_I < dim ; row_I++ ) {
+		for ( col_I = 0 ; col_I < dim ; col_I++ ) {
+			Journal_Printf( stream, "%7.5g     ", array[row_I][col_I] );
+		}
+		Journal_Printf( stream, "\n" );
+	}
+}
+
+/** This function prints an unnamed SymmetricTensor */
+void Journal_PrintSymmetricTensor_Unnamed( Stream* stream, SymmetricTensor tensor, Dimension_Index dim ) {
+	Dimension_Index row_I, col_I;
+	/* For efficency - Check if stream is enabled */
+	if (!Stream_IsEnable(stream)) return;
+
+	for ( row_I = 0 ; row_I < dim ; row_I++ ) {
+		for ( col_I = 0 ; col_I < dim ; col_I++ ) {
+			Journal_Printf( stream, "%7.5g     ", tensor[ MAP_SYMM_TENSOR( row_I, col_I, dim ) ] );
+		}
+		Journal_Printf( stream, "\n" );
+	}
+}
+
+/** This function calculates the second Invariant of a TensorArray: 
+u = \sqrt{ 0.5 u_{ij} u_{ij} } */
+double TensorArray_2ndInvariant( TensorArray tensor, Dimension_Index dim ) {
+	double invariant = 0.0;
+	switch( dim ) {
+		case 3:
+			invariant += 
+				tensor[4] * tensor[4] +
+				tensor[5] * tensor[5] +
+				tensor[6] * tensor[6] +
+				tensor[7] * tensor[7] +
+				tensor[8] * tensor[8] ;
+		case 2:
+			invariant += 
+				tensor[1] * tensor[1] +
+				tensor[2] * tensor[2] +
+				tensor[3] * tensor[3] ;
+		case 1:
+			invariant += tensor[0] * tensor[0];
+			break;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot read tensor for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+	return sqrt( 0.5 * invariant );
+}
+
+/** This function calculates the second Invariant of a SymmetricTensor:  
+u = \sqrt{ 0.5 u_{ij} u_{ij} } */
+double SymmetricTensor_2ndInvariant( SymmetricTensor tensor, Dimension_Index dim ) {
+	double invariant = 0.0;
+	
+	switch( dim ) {
+		case 3:
+			invariant = 
+				0.5 * ( tensor[ TensorMapST3D[0][0] ] * tensor[ TensorMapST3D[0][0] ]   +
+				        tensor[ TensorMapST3D[1][1] ] * tensor[ TensorMapST3D[1][1] ]   +
+				        tensor[ TensorMapST3D[2][2] ] * tensor[ TensorMapST3D[2][2] ] ) +
+				
+				tensor[ TensorMapST3D[0][1] ] * tensor[ TensorMapST3D[1][0] ] +
+				tensor[ TensorMapST3D[0][2] ] * tensor[ TensorMapST3D[2][0] ] +
+				tensor[ TensorMapST3D[1][2] ] * tensor[ TensorMapST3D[2][1] ] ;
+			break;
+		case 2:
+			invariant = 
+				0.5 * ( tensor[ TensorMapST2D[0][0] ] * tensor[ TensorMapST2D[0][0] ]   +
+				        tensor[ TensorMapST2D[1][1] ] * tensor[ TensorMapST2D[1][1] ] ) +
+				tensor[ TensorMapST2D[0][1] ] * tensor[ TensorMapST2D[1][0] ] ;
+			break;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot read tensor for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+	return sqrt( invariant );
+}
+
+
+/** a_i * u_{ij} * b_j */
+double TensorArray_MultiplyByVectors( TensorArray tensor, double* a, double* b, Dimension_Index dim ) {
+	double result = 0.0;
+
+	switch( dim ) {
+		case 3:
+			result = 
+				a[0] * tensor[ FT3D_00 ] * b[0] +
+				a[0] * tensor[ FT3D_01 ] * b[1] +
+				a[0] * tensor[ FT3D_02 ] * b[2] +
+
+				a[1] * tensor[ FT3D_10 ] * b[0] +
+				a[1] * tensor[ FT3D_11 ] * b[1] +
+				a[1] * tensor[ FT3D_12 ] * b[2] +
+
+				a[2] * tensor[ FT3D_20 ] * b[0] +
+				a[2] * tensor[ FT3D_21 ] * b[1] +
+				a[2] * tensor[ FT3D_22 ] * b[2] ;
+			break;
+		case 2:
+			result = 
+				a[0] * tensor[ FT2D_00 ] * b[0] +
+				a[0] * tensor[ FT2D_01 ] * b[1] +
+
+				a[1] * tensor[ FT2D_10 ] * b[0] +
+				a[1] * tensor[ FT2D_11 ] * b[1] ;
+			break;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot read tensor for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+	return result;
+}
+
+/** returns u_{ij} * a_j */
+void SymmetricTensor_ApplyOnVector( SymmetricTensor tensor, double* vector, Dimension_Index dim, XYZ result ) {
+	switch( dim ) {
+		case 3:
+			result[0] = 
+				tensor[ TensorMapST3D[0][0] ] * vector[0] +
+				tensor[ TensorMapST3D[0][1] ] * vector[1] +
+				tensor[ TensorMapST3D[0][2] ] * vector[2] ;
+
+			result[1] = 	
+				tensor[ TensorMapST3D[1][0] ] * vector[0] +
+				tensor[ TensorMapST3D[1][1] ] * vector[1] +
+				tensor[ TensorMapST3D[1][2] ] * vector[2] ;
+
+			result[2] = 	
+				tensor[ TensorMapST3D[2][0] ] * vector[0] +
+				tensor[ TensorMapST3D[2][1] ] * vector[1] +
+				tensor[ TensorMapST3D[2][2] ] * vector[2] ;
+			break;
+		case 2:
+			result[0] = 
+				tensor[ TensorMapST2D[0][0] ] * vector[0] +
+				tensor[ TensorMapST2D[0][1] ] * vector[1] ;
+
+			result[1] = 
+				tensor[ TensorMapST2D[1][0] ] * vector[0] +
+				tensor[ TensorMapST2D[1][1] ] * vector[1] ;
+			break;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot read tensor for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+}
+
+
+/** returns a_i * u_{ij} * b_j */
+double SymmetricTensor_MultiplyByVectors( SymmetricTensor tensor, double* a, double* b, Dimension_Index dim ) {
+	double result = 0.0;
+
+	switch( dim ) {
+		case 3:
+			result = 
+				a[0] * tensor[ TensorMapST3D[0][0] ] * b[0] +
+				a[0] * tensor[ TensorMapST3D[0][1] ] * b[1] +
+				a[0] * tensor[ TensorMapST3D[0][2] ] * b[2] +
+
+				a[1] * tensor[ TensorMapST3D[1][0] ] * b[0] +
+				a[1] * tensor[ TensorMapST3D[1][1] ] * b[1] +
+				a[1] * tensor[ TensorMapST3D[1][2] ] * b[2] +
+
+				a[2] * tensor[ TensorMapST3D[2][0] ] * b[0] +
+				a[2] * tensor[ TensorMapST3D[2][1] ] * b[1] +
+				a[2] * tensor[ TensorMapST3D[2][2] ] * b[2] ;
+			break;
+		case 2:
+			result = 
+				a[0] * tensor[ TensorMapST2D[0][0] ] * b[0] +
+				a[0] * tensor[ TensorMapST2D[0][1] ] * b[1] +
+
+				a[1] * tensor[ TensorMapST2D[1][0] ] * b[0] +
+				a[1] * tensor[ TensorMapST2D[1][1] ] * b[1] ;
+			break;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMath" );
+			Journal_Printf( error, "Cannot read tensor for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+	return result;
+}
+
+void SymmetricTensor_ToMatrix( SymmetricTensor tensor, Dimension_Index dim, double** matrix ) {
+	if (dim == 2) {
+		matrix[0][0] = tensor[ST2D_00] ; matrix[0][1] = tensor[ST2D_01] ;
+		matrix[1][0] = tensor[ST2D_01] ; matrix[1][1] = tensor[ST2D_11] ;
+	}
+	else if (dim == 3) {
+		matrix[0][0] = tensor[ST3D_00];	matrix[0][1] = tensor[ST3D_01];	matrix[0][2] = tensor[ST3D_02];
+		matrix[1][0] = tensor[ST3D_01];	matrix[1][1] = tensor[ST3D_11];	matrix[1][2] = tensor[ST3D_12];
+		matrix[2][0] = tensor[ST3D_02];	matrix[2][1] = tensor[ST3D_12];	matrix[2][2] = tensor[ST3D_22];
+	}
+	else {
+		Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+	}
+}
+		
+void TensorArray_Zero( TensorArray tensor ) {
+	memset( tensor, 0, sizeof(TensorArray) );
+}
+void SymmetricTensor_Zero( SymmetricTensor tensor ) {
+	memset( tensor, 0, sizeof(SymmetricTensor) );
+}
+
+
+int _QsortEigenvalue( const void* _a, const void* _b ) {
+	Eigenvector* a = (Eigenvector*) _a;
+	Eigenvector* b = (Eigenvector*) _b;
+
+	if ( a->eigenvalue > b->eigenvalue )
+		return 1;
+	else
+		return -1;
+}
+
+
+void SymmetricTensor_CalcAllEigenvalues( SymmetricTensor tensor, Dimension_Index dim, Eigenvector* eigenvectorList ) {
+	if ( dim == 2 ) 
+		SymmetricTensor_CalcAllEigenvalues2D( tensor, eigenvectorList );
+	else 
+		SymmetricTensor_CalcAllEigenvalues3D( tensor, eigenvectorList );
+}
+
+/* 
+For a symmetric 2D Matrix, Eigenvalues are given by: 
+\lambda = \frac{u_{00} + u_{11}}{2} \pm \sqrt{ \left(\frac{u_{00} - u_{11}}{2}\right)^2 + u_{01} }
+*/
+void SymmetricTensor_CalcAllEigenvalues2D( SymmetricTensor tensor, Eigenvector* eigenvectorList ) {
+	double descriminantRoot, average;
+	
+	descriminantRoot = sqrt( 0.25 * (tensor[ST2D_00] - tensor[ST2D_11]) * 
+				(tensor[ST2D_00] - tensor[ST2D_11]) + tensor[ST2D_01] * tensor[ST2D_01] );
+
+	average = 0.5 * (tensor[ST2D_00] + tensor[ST2D_11]);
+
+	eigenvectorList[0].eigenvalue = average - descriminantRoot;
+	eigenvectorList[1].eigenvalue = average + descriminantRoot;
+}
+
+#define EQL(A,B)    (fabs( (A) - (B) ) < 1.0e-8) 
+/**
+Calculates the roots of the characteristic polynomial given by
+det( [tensor] - \lambda [I] ) = 0
+1.0 \lambda^3 + a2 \lambda^2 + a1 \lambda + a0 = 0
+Results compared with applet located at http://www.math.ubc.ca/~israel/applet/mcalc/matcalc.html */
+void SymmetricTensor_CalcAllEigenvalues3D( SymmetricTensor tensor, Eigenvector* eigenvectorList ) {
+	double a2, a1, a0;
+	double rootList[3];
+
+	/*
+	a3 = 1.0
+	a2 = - tensor_xx - tensor_yy - tensor_zz
+	a1 = tensor_xx * tensor_yy  +  tensor_xx * tensor_zz  +  
+		tensor_yy * tensor_zz  -  tensor_xy^2  -  tensor_xz^2  - tensor_yz^2 
+	a0 = -tensor_xx * tensor_yy * tensor_zz  - 
+		2 * tensor_xy * tensor_xz * tensor_yz  + 
+		tensor_xx * tensor_yz^2  +  tensor_yy * tensor_xz^2  +  tensor_zz * tensor_xy^2
+	*/
+
+	a2 = - tensor[ST3D_00] - tensor[ST3D_11] - tensor[ST3D_22];
+	a1 = (tensor[ST3D_00] * tensor[ST3D_11])  +  
+		 (tensor[ST3D_00] * tensor[ST3D_22])  +  
+		 (tensor[ST3D_11] * tensor[ST3D_22])  -  
+		 (tensor[ST3D_01] * tensor[ST3D_01])  -  
+		 (tensor[ST3D_02] * tensor[ST3D_02])  -  
+		 (tensor[ST3D_12] * tensor[ST3D_12]);
+	a0 = - 	  (tensor[ST3D_00] * tensor[ST3D_11] * tensor[ST3D_22])  -  
+		2.0 * (tensor[ST3D_01] * tensor[ST3D_02] * tensor[ST3D_12]) +  
+			  (tensor[ST3D_00] * tensor[ST3D_12] * tensor[ST3D_12])  +  
+			  (tensor[ST3D_11] * tensor[ST3D_02] * tensor[ST3D_02])  +  
+			  (tensor[ST3D_22] * tensor[ST3D_01] * tensor[ST3D_01]);
+	
+	CubicSolver_OnlyRealRoots( a2, a1, a0, rootList );
+
+	eigenvectorList[0].eigenvalue = rootList[0];
+	eigenvectorList[1].eigenvalue = rootList[1];
+	eigenvectorList[2].eigenvalue = rootList[2];
+}
+/** Wrapper to calculate 2 and 3D eigenvectors */
+void SymmetricTensor_CalcAllEigenvectors( SymmetricTensor tensor, Dimension_Index dim, Eigenvector* eigenvectorList ) {
+	if ( dim == 2 ) 
+		SymmetricTensor_CalcAllEigenvectors2D( tensor, eigenvectorList );
+	else 
+		SymmetricTensor_CalcAllEigenvectors3D( tensor, eigenvectorList );
+}
+/** Calculates an eigenvector for a given 2D SymmetricTensor */
+Bool SymmetricTensor_CalcEigenvector2D( SymmetricTensor tensor, Eigenvector* eigenvector ) {
+	if ( fabs(tensor[ST2D_01]) > fabs(eigenvector->eigenvalue - tensor[ST2D_00]) ) {
+		eigenvector->vector[0] = 1.0;
+		eigenvector->vector[1] = (eigenvector->eigenvalue - tensor[ST2D_00])/tensor[ST2D_01];
+	}
+	else {
+		eigenvector->vector[0] = tensor[ST2D_01]/(eigenvector->eigenvalue - tensor[ST2D_00]);
+		eigenvector->vector[1] = 1.0;
+	}
+	StGermain_VectorNormalise( eigenvector->vector, 2 );
+
+	return True;
+}
+
+/** Calculates eigenvectors for 2D SymmetricTensor's only. This is guaranteed to
+return real eigenvectors and eigenvalues */
+void SymmetricTensor_CalcAllEigenvectors2D( SymmetricTensor tensor, Eigenvector* eigenvectorList ) {
+	SymmetricTensor_CalcAllEigenvalues2D( tensor, eigenvectorList );
+	
+	if ( EQL(tensor[ST2D_01],0.0) ) {
+		/* [ a 0 ] */
+		/* [ 0 b ] */
+		if ( EQL(eigenvectorList[0].eigenvalue, tensor[ST2D_00]) ) {
+			eigenvectorList[0].vector[0] = 1.0;
+			eigenvectorList[0].vector[1] = 0.0;
+
+			eigenvectorList[1].vector[0] = 0.0;
+			eigenvectorList[1].vector[1] = 1.0;
+			return;
+		}
+		else {
+			eigenvectorList[0].vector[0] = 0.0;
+			eigenvectorList[0].vector[1] = 1.0;
+
+			eigenvectorList[1].vector[0] = 1.0;
+			eigenvectorList[1].vector[1] = 0.0;
+			return;
+		}
+	}
+
+	/* First Eigenvector */
+	SymmetricTensor_CalcEigenvector2D( tensor, &eigenvectorList[0] );
+	SymmetricTensor_CalcEigenvector2D( tensor, &eigenvectorList[1] );
+
+	/* Don't need to sort here because SymmetricTensor_CalcEigenvalues2D already has them sorted */
+}
+
+/** Calculates an eigenvector for a given 3D SymmetricTensor */
+Bool SymmetricTensor_CalcEigenvector3D( SymmetricTensor tensor, Eigenvector* eigenvector ) {
+	double A, B, C, d, e, f;
+
+	A = tensor[ST3D_00] - eigenvector->eigenvalue;
+	B = tensor[ST3D_11] - eigenvector->eigenvalue;
+	C = tensor[ST3D_22] - eigenvector->eigenvalue;
+	d = tensor[ST3D_01];
+	e = tensor[ST3D_02];
+	f = tensor[ST3D_12];
+
+	if ( ! EQL(B*e, f*d) && ! EQL( e, 0.0 ) ) {
+		eigenvector->vector[0] = 1.0;
+		eigenvector->vector[1] = (f*A - d*e)/(B*e - f*d);
+		eigenvector->vector[2] = (-A - d * eigenvector->vector[1] ) / e ;
+	}	
+	else if ( ! EQL(f*A, d*e) && ! EQL( e, 0.0 ) ) {
+		eigenvector->vector[0] = (B*e - f*d)/(f*A - d*e);
+		eigenvector->vector[1] = 1.0;
+		eigenvector->vector[2] = (-d - A*eigenvector->vector[0])/e;
+	}
+	else if ( ! EQL(d*d, B*A) && ! EQL( d, 0.0 ) ) {
+		eigenvector->vector[0] = (B*e - f*d)/(d*d - B*A);
+		eigenvector->vector[1] = (-e - A*eigenvector->vector[0])/d;
+		eigenvector->vector[2] = 1.0;
+	}
+	else {
+		return False;
+	}
+
+	StGermain_VectorNormalise( eigenvector->vector, 3 );
+
+	return True;
+}
+
+/** Calculates eigenvectors for 3D SymmetricTensor's only. This is guaranteed to
+return real eigenvectors and eigenvalues */
+void SymmetricTensor_CalcAllEigenvectors3D( SymmetricTensor tensor, Eigenvector* eigenvectorList ) {
+	Dimension_Index dim_I;
+	Bool            result;
+
+	SymmetricTensor_CalcAllEigenvalues3D( tensor, eigenvectorList );
+
+	for ( dim_I = 0 ; dim_I < 3 ; dim_I++ ) {
+		result = SymmetricTensor_CalcEigenvector3D( tensor, &eigenvectorList[dim_I] );
+
+		if ( ! result ) {
+			SymmetricTensor_CalcAllEigenvectorsJacobi( tensor, 3, eigenvectorList );
+			return;
+		}
+	}
+
+	EigenvectorList_Sort( eigenvectorList, 3 );
+}
+
+
+void SymmetricTensor_CalcAllEigenvectorsJacobi( SymmetricTensor tensor, Dimension_Index dim, Eigenvector* eigenvectorList ){
+	double** matrix = Memory_Alloc_2DArray( double, dim, dim, "Matrix" );
+		
+	SymmetricTensor_ToMatrix( tensor, dim, matrix);
+	Matrix_CalcAllEigenvectorsJacobi( matrix, dim, eigenvectorList );
+	Memory_Free( matrix );
+}
+
+/** Modified code from Numerical Recipies */
+/**
+Numerical Recipies in C
+Second Edition, 1992
+pp. 463-469
+*/
+/* Works for symmetric matrix */
+/* Order N^3 !! */
+/**
+Compared results with applet located at
+http://www.math.ubc.ca/~israel/applet/mcalc/matcalc.html
+*/
+#define ROTATE(a,i,j,k,l)\
+	g=a[i][j];\
+	h=a[k][l];\
+	a[i][j]=g-s*(h+g*tau);\
+	a[k][l]=h+s*(g-h*tau);
+
+#define ROTATE_EIGENVECTOR_LIST(eigenvectorList,i,j,k,l)\
+	g=eigenvectorList[i].vector[j];\
+	h=eigenvectorList[k].vector[l];\
+	eigenvectorList[i].vector[j]=g-s*(h+g*tau);\
+	eigenvectorList[k].vector[l]=h+s*(g-h*tau); 
+
+/** Calculate all Eigenvectors for a Symmetric Tensor converted to a Matrix 
+using the Jacobi Method. This method will ONLY work with symmetric real tensors.
+See: Numerical Recipies in C
+Second Edition, 1992
+pp. 463-469,
+
+*/
+void Matrix_CalcAllEigenvectorsJacobi(double **matrix, Index count, Eigenvector* eigenvectorList ) {
+	int j,iq,ip,i;
+	double tresh,theta,tau,t,sum,s,h,g,c,*b,*z;
+
+	b = Memory_Alloc_Array( double, count, "b" );
+	z = Memory_Alloc_Array( double, count, "z" );
+
+	for ( ip = 0 ; ip < count ; ip++ ) {
+		/* Initialise Identity Matrix */
+		for ( iq = 0 ; iq < count ; iq++ ) eigenvectorList[ip].vector[iq]=0.0;
+		eigenvectorList[ip].vector[ip]=1.0;
+		
+		/* Initialise b and eigenvalues to diagonal of matrix */
+		b[ip] = eigenvectorList[ip].eigenvalue = matrix[ip][ip];
+		/* This vector will accumulate terms of the form ta_{pq} as in eq 11.1.14 of Numerical Recipies */
+		z[ip]=0.0;
+	}
+
+	for ( i = 1 ; i <= 50 ; i++ ) {
+
+		/* Sum the off-diagonal elements */
+		sum = 0.0;
+		for ( ip = 0 ; ip < count-1 ; ip++ ) {
+			for ( iq = ip+1 ; iq < count ; iq++ )
+				sum += fabs(matrix[ip][iq]);
+		}
+		/* The normal return, which relies on quadratic convergence to machine underflow */
+		if (sum == 0.0) 
+			break;
+
+		if (i < 4)
+			tresh = 0.2 * sum / (count*count);
+		else
+			tresh=0.0;
+
+		for ( ip = 0; ip < count-1 ; ip++ ) {
+			for ( iq = ip+1 ; iq < count ; iq++) {
+				g=100.0*fabs(matrix[ip][iq]);
+
+				/* After the first four sweeps, skip the rotation if the off-diagonal element is small */
+				if (i > 4 && (fabs(eigenvectorList[ip].eigenvalue)+g) == fabs(eigenvectorList[ip].eigenvalue)
+								&& (fabs(eigenvectorList[iq].eigenvalue)+g) == fabs(eigenvectorList[iq].eigenvalue))
+					matrix[ip][iq]=0.0;
+				else if (fabs(matrix[ip][iq]) > tresh) {
+					h=eigenvectorList[iq].eigenvalue - eigenvectorList[ip].eigenvalue;
+					if ((double)(fabs(h)+g) == (double)fabs(h))
+						t=(matrix[ip][iq])/h;	/* t = 1/(2theta) */
+					else {
+						theta=0.5*h/(matrix[ip][iq]);
+						t=1.0/(fabs(theta)+sqrt(1.0+theta*theta));
+						if (theta < 0.0) t = -t;
+					}
+					c=1.0/sqrt(1+t*t);
+					s=t*c;
+					tau=s/(1.0+c);
+					h=t*matrix[ip][iq];
+					z[ip] -= h;
+					z[iq] += h;
+					eigenvectorList[ip].eigenvalue -= h;
+					eigenvectorList[iq].eigenvalue += h;
+					matrix[ip][iq]=0.0;
+					for ( j = 0 ; j <= ip-1 ; j++ ) {
+						ROTATE(matrix,j,ip,j,iq)
+					}
+					for ( j = ip+1 ; j <= iq-1 ; j++ ) {
+						ROTATE(matrix,ip,j,j,iq)
+					}
+					for ( j = iq+1 ; j < count ; j++ ) {
+						ROTATE(matrix,ip,j,iq,j)
+					}
+					for ( j = 0 ; j < count ; j++ ) {
+						ROTATE_EIGENVECTOR_LIST(eigenvectorList,ip,j,iq,j)
+					}
+				}
+			}
+		}
+		for ( ip = 0 ; ip < count ; ip++ ) {
+			b[ip] += z[ip];
+			eigenvectorList[ip].eigenvalue =b[ip];
+			z[ip]=0.0;
+		}
+	}
+	
+	Memory_Free(z);
+	Memory_Free(b);
+	
+	EigenvectorList_Sort( eigenvectorList, count );
+}
+
+
+/** Sorts the eigenvectors according to the value of the eigenvalue - from smallest to greatest */
+void EigenvectorList_Sort( Eigenvector* eigenvectorList, Index count ) {
+	qsort( eigenvectorList, count, sizeof( Eigenvector ), _QsortEigenvalue );
+}
+/** Calculates the determinant of a matrix, independent of the ordering of the axis.*/
+double StGermain_MatrixDeterminant_AxisIndependent( double** matrix, Dimension_Index dim, Coord_Index A_axis, Coord_Index B_axis, Coord_Index C_axis ) {
+	switch (dim) {
+		case 1:
+			return matrix[A_axis][A_axis];
+		case 2:
+			return matrix[A_axis][A_axis]*matrix[B_axis][B_axis] - matrix[A_axis][B_axis]*matrix[B_axis][A_axis];
+		case 3:
+			return 
+				matrix[A_axis][A_axis] *
+					( matrix[B_axis][B_axis]*matrix[C_axis][C_axis] - matrix[B_axis][C_axis]*matrix[C_axis][B_axis] ) 
+				- matrix[A_axis][B_axis] *
+					( matrix[B_axis][A_axis]*matrix[C_axis][C_axis] - matrix[B_axis][C_axis]*matrix[C_axis][A_axis] )
+				+ matrix[A_axis][C_axis] *
+					( matrix[B_axis][A_axis]*matrix[C_axis][B_axis] - matrix[B_axis][B_axis]*matrix[C_axis][A_axis] );
+		default: {
+			Stream* error = Journal_Register( Error_Type , CURR_MODULE_NAME );
+			Journal_Printf(error, "Function %s doesn't support dimension %d.\n", __func__, dim);
+			Journal_Firewall( False, Journal_Register( Error_Type, "TensorMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}
+	return 0; /* Silly, but TAU-PDT complains otherwise */
+}
+
+/** Solves a cubic. See:  
+Eric W. Weisstein. "Cubic Formula." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/CubicFormula.html */
+void CubicSolver_OnlyRealRoots( double a2, double a1, double a0, double* rootList ) {
+	double Q, R;
+	double D;
+	double theta;
+	double factor;
+
+	Q = (3.0 * a1 - a2 * a2)/9.0;                                   /* Equation 20 */
+	R = (9.0*a2*a1 - 27.0 * a0 - 2.0 * a2 * a2 * a2)/54.0;          /* Equation 21 */
+
+	/* Get Polynomial Discrimanent  (Equation 47) */
+	D = Q*Q*Q + R*R;
+		
+	if ( EQL( D, 0.0 ) ) {
+		double halfB;
+
+		if ( R < 0.0 ) 
+			halfB = - pow( -R, 1.0/3.0 );
+		else
+			halfB = pow( R, 1.0/3.0 );
+
+		rootList[0] = -a2/3.0 + 2.0 * halfB;
+		rootList[1] = rootList[2] = -a2/3.0 - halfB;
+		return;
+	}
+	Journal_Firewall( D <= 0.0, Journal_Register( Error_Type, "CubicSolver" ),
+			"In func %s - Polynomial discrimanent %g is positive which means there are complex solutions.\nCannot solve equation x^3 + %.4f x^2 + %.4f x + %.4f = 0\n", __func__ , D, a2, a1, a0 );
+
+
+	theta = acos( R/sqrt( -Q*Q*Q ) )/3.0;
+	factor = 2.0 * sqrt( -Q );
+
+	rootList[0] = factor * cos( theta ) - a2/3.0;
+	rootList[1] = factor * cos( theta + 2.0*M_PI/3.0 ) - a2/3.0;
+	rootList[2] = factor * cos( theta + 4.0*M_PI/3.0 ) - a2/3.0;
+}
+
+
+/** Uses Cramer's rule to solve a system of linear equations 
+ * see http://mathworld.wolfram.com/CramersRule.html */
+void TensorArray_SolveSystem( TensorArray tensorArray, double* solution, double* rightHandSide, Dimension_Index dim ) {
+	double determinant;
+	switch ( dim ) {
+		case 3: {
+			determinant = + tensorArray[ FT3D_00 ] *
+								( tensorArray[ FT3D_11 ] * tensorArray[ FT3D_22 ] -
+								  tensorArray[ FT3D_21 ] * tensorArray[ FT3D_12 ] )
+							- tensorArray[ FT3D_01 ] *
+								( tensorArray[ FT3D_10 ] * tensorArray[ FT3D_22 ] -
+								  tensorArray[ FT3D_12 ] * tensorArray[ FT3D_20 ] )
+							+ tensorArray[ FT3D_02 ] *
+								( tensorArray[ FT3D_10 ] * tensorArray[ FT3D_21 ] -
+								  tensorArray[ FT3D_11 ] * tensorArray[ FT3D_20 ] );
+
+			solution[ 0 ] = ( rightHandSide[0] * 
+								( tensorArray[ FT3D_11 ] * tensorArray[ FT3D_22 ] -
+								  tensorArray[ FT3D_21 ] * tensorArray[ FT3D_12 ] )
+							- tensorArray[ FT3D_01 ] *
+								( rightHandSide[1] * tensorArray[ FT3D_22 ] -
+								  tensorArray[ FT3D_12 ] * rightHandSide[2] )
+							+ tensorArray[ FT3D_02 ] *
+								( rightHandSide[1] * tensorArray[ FT3D_21 ] -
+								  tensorArray[ FT3D_11 ] * rightHandSide[2] ))/determinant;
+
+			solution[ 1 ] = ( tensorArray[ FT3D_00 ] *
+								( rightHandSide[1] * tensorArray[ FT3D_22 ] -
+								  rightHandSide[2] * tensorArray[ FT3D_12 ] )
+							- rightHandSide[0] * 
+								( tensorArray[ FT3D_10 ] * tensorArray[ FT3D_22 ] -
+								  tensorArray[ FT3D_12 ] * tensorArray[ FT3D_20 ] )
+							+ tensorArray[ FT3D_02 ] *
+								( tensorArray[ FT3D_10 ] * rightHandSide[2] -
+								  rightHandSide[1] * tensorArray[ FT3D_20 ] ))/determinant;
+
+			solution[ 2 ] = ( tensorArray[ FT3D_00 ] *
+								( tensorArray[ FT3D_11 ] * rightHandSide[2] -
+								  tensorArray[ FT3D_21 ] * rightHandSide[1] )
+							- tensorArray[ FT3D_01 ] *
+								( tensorArray[ FT3D_10 ] * rightHandSide[2] -
+								  rightHandSide[1] * tensorArray[ FT3D_20 ] )
+							+ rightHandSide[0] *
+								( tensorArray[ FT3D_10 ] * tensorArray[ FT3D_21 ] -
+								  tensorArray[ FT3D_11 ] * tensorArray[ FT3D_20 ] ))/determinant;
+			return;
+		}
+
+		case 2:
+			determinant = tensorArray[ FT2D_00 ] * tensorArray[ FT2D_11 ] 
+			            - tensorArray[ FT2D_10 ] * tensorArray[ FT2D_01 ];
+			
+			solution[ 0 ] = (rightHandSide[0] * tensorArray[ FT2D_11 ] - 
+				tensorArray[ FT2D_01 ] * rightHandSide[1])/determinant;
+			
+			solution[ 1 ] = (rightHandSide[1] * tensorArray[ FT2D_00 ] - 
+				tensorArray[ FT2D_10 ] * rightHandSide[0])/determinant;
+
+			return;
+		default: 
+			Journal_Firewall( 
+					False, 
+					Journal_Register( Error_Type, CURR_MODULE_NAME ),
+					"Function %s - doesn't understand dim = %u\n", __func__, dim );
+	}
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/TensorMath.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/TensorMath.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,222 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    Provides basic tensor operations.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: TensorMath.h 3909 2006-12-19 04:43:56Z JulianGiordani $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_TensorMath_h__
+#define __Domain_Geometry_TensorMath_h__
+
+	/* TensorArray - Tensor (t_{ij}) here is defined in 2D as
+	 * t_{00} = tensor[0] t_{01} = tensor[1]
+	 * t_{10} = tensor[2] t_{11} = tensor[3] 
+	 *
+	 * and in 3D as
+	 * t_{00} = tensor[0] t_{01} = tensor[1] t_{02} = tensor[2]
+	 * t_{10} = tensor[3] t_{11} = tensor[4] t_{12} = tensor[5]
+	 * t_{20} = tensor[6] t_{21} = tensor[7] t_{22} = tensor[8]
+	 *
+	 * */
+
+	/** SymmetricTensor - stores only unique components 
+	 * in 2D
+	 * tensor[0] = u_{00}
+	 * tensor[1] = u_{11}
+	 * tensor[2] = u_{12} = u_{21}
+	 *
+	 * in 3D
+	 * tensor[0] = u_{00}
+	 * tensor[1] = u_{11}
+	 * tensor[2] = u_{22}
+	 * tensor[3] = u_{01} = u_{10}
+	 * tensor[4] = u_{02} = u_{20}
+	 * tensor[5] = u_{12} = u_{21}
+	 */
+
+	typedef struct {
+		XYZ    vector;
+		double eigenvalue;
+	} Eigenvector;
+
+/** TensorIndex creates an enumerated type that can be used as 
+Tensor indices for referencing:
+These indexes are defined as: 
+	ST ~ symmetric tensorArray
+	FT ~ full tensorArray \\
+	2D ~ in 2 dimensions \\
+	3D ~ in 3 dimensions \\
+For example, tensorArray[FT2D_00] \\
+
+And the indexes follow this naming scheme (for full tensors):
+For 2D:
+\left{ 	a_{00},	a_{01} \\
+		a_{10},	a_{11} \right}
+For 3D:		
+\left{ 	a_{00},	a_{01},	a_{02} \\
+		a_{10},	a_{11},	a_{12} \\
+		a_{20}, a_{21}, a_{22} \right}
+
+Symmetric tensors only use the upper triangle indicee definitions.
+
+*/
+ typedef enum TensorIndexST2D { ST2D_00=0, ST2D_11=1, ST2D_01=2 } TensorIndexST2D;
+ /** See description for TensorIndexST2D */
+ typedef enum TensorIndexFT2D { FT2D_00=0, FT2D_11=3, FT2D_01=1, FT2D_10=2 } TensorIndexFT2D;
+ /** See description for TensorIndexST2D */
+ typedef enum TensorIndexST3D { ST3D_00=0, ST3D_11=1, ST3D_22=2, ST3D_01=3, ST3D_02=4, ST3D_12=5} TensorIndexST3D;
+  /** See description for TensorIndexST2D */
+ typedef enum TensorIndexFT3D { FT3D_00=0, FT3D_11=4, FT3D_22=8, FT3D_01=1, FT3D_02=2, FT3D_10=3, FT3D_12=5, FT3D_20=6, FT3D_21=7} TensorIndexFT3D;
+
+/*Define mapping function for enumerated types to arrays */
+extern const unsigned int TensorMapFT2D[2][2];
+extern const unsigned int TensorMapST2D[2][2];
+extern const unsigned int TensorMapFT3D[3][3];
+extern const unsigned int TensorMapST3D[3][3];
+
+/*Define TensorArray mapping functions */
+ 
+int TensorArray_TensorMap(Dimension_Index row_I, Dimension_Index col_I, Dimension_Index dim);
+int SymmetricTensor_TensorMap(Dimension_Index row_I, Dimension_Index col_I, Dimension_Index dim);	
+
+/** Alternate mapping index for 2D TensorArray */ 
+#define MAP_2D_TENSOR( ii, jj )  ( (jj) + 2*(ii) )
+
+ /** Alternate mapping index for 3D TensorArray */ 
+#define MAP_3D_TENSOR( ii, jj )  ( (jj) + 3*(ii) )
+
+/** Alternate wrapper for indexing a TensorArray */
+#define MAP_TENSOR( ii, jj, dim ) \
+	((dim) == 2 ? MAP_2D_TENSOR( ii, jj ) : MAP_3D_TENSOR( ii, jj ))
+
+/** Alternate mapping index for 2D SymmetricTensor */ 
+#define MAP_2D_SYMM_TENSOR( ii, jj )  ( (ii) == (jj) ? (ii) : 2 )
+
+/** Alternate mapping index for 2D SymmetricTensor */ 
+#define MAP_3D_SYMM_TENSOR( ii, jj )  ( (ii) == (jj) ? (ii) : ((ii) + (jj) + 2) )
+
+/** Alternate wrapper for indexing a SymmetricTensor */
+#define MAP_SYMM_TENSOR( ii, jj, dim ) \
+	(dim == 2 ? MAP_2D_SYMM_TENSOR( ii, jj ) : MAP_3D_SYMM_TENSOR( ii, jj ))
+
+/** Function calculates component size of symmetric tensor given it's dimension */
+#define StGermain_nSymmetricTensorVectorComponents( dim ) (Index) (0.5 * ((dim) * ((dim) + 1)))
+
+/** Prints the tensorArray, and it's name in the code */
+#define Journal_PrintTensorArray(stream, tensor, dim) \
+	do {	\
+		Journal_Printf( stream, #tensor " - \n" ); \
+		Journal_PrintTensorArray_Unnamed( stream, tensor, dim ); \
+	} while(0) 
+	
+/** Prints the Symmetric Tensor, and it's name in the code */
+#define Journal_PrintSymmetricTensor(stream, tensor, dim) \
+	do {	\
+		Journal_Printf( stream, #tensor " - \n" ); \
+		Journal_PrintSymmetricTensor_Unnamed( stream, tensor, dim ); \
+	} while (0)
+	
+/** Prints a square matrix, and it's name in the code */
+#define Journal_PrintSquareArray(stream, array, dim) \
+	do {	\
+		Journal_Printf( stream, #array " - \n" ); \
+		Journal_PrintSquareArray_Unnamed( stream, array, dim ); \
+	} while (0)
+	
+/* Define Tensor conversion functions */ 
+void StGermain_SymmetricTensor_ToTensorArray(SymmetricTensor symTensor, Dimension_Index dim, TensorArray fullTensor);
+	
+void StGermain_SymmetricTensor_ToTensorArray2D(SymmetricTensor symTensor, TensorArray fullTensor);
+void StGermain_SymmetricTensor_ToTensorArray3D(SymmetricTensor symTensor, TensorArray fullTensor);
+
+void TensorArray_ToMatrix( TensorArray tensor, Dimension_Index dim, double** matrix );	
+void SymmetricTensor_ToMatrix( SymmetricTensor tensor, Dimension_Index dim, double** matrix ) ;
+	
+/* Define Tensor conversion / extraction functions */	
+void TensorArray_SetFromDoubleArray( TensorArray tensor, double** array, Dimension_Index dim ) ;
+void TensorArray_GetAntisymmetricPart( TensorArray tensor, Dimension_Index dim, TensorArray antiSymmetric ) ;
+void TensorArray_GetSymmetricPart( TensorArray tensor, Dimension_Index dim, SymmetricTensor symmetricTensor ) ;
+
+/* Define Print functions */	
+void Journal_PrintTensorArray_Unnamed( Stream* stream, TensorArray tensor, Dimension_Index dim ) ;
+void Journal_PrintSymmetricTensor_Unnamed( Stream* stream, SymmetricTensor tensor, Dimension_Index dim ) ;
+void Journal_PrintSquareArray_Unnamed( Stream* stream, double** array, Dimension_Index dim ) ;
+
+/* Define Full Tensor and Symmetric Tensor, 'trace' functions */ 
+void TensorArray_GetTrace( TensorArray tensor, Dimension_Index dim, double *trace );
+void SymmetricTensor_GetTrace( SymmetricTensor tensor, Dimension_Index dim, double *trace );
+	
+double TensorArray_2ndInvariant( TensorArray tensor, Dimension_Index dim ) ;
+double SymmetricTensor_2ndInvariant( SymmetricTensor tensor, Dimension_Index dim ) ;
+
+/* Define Null / Zero matrices */
+void TensorArray_Zero( TensorArray tensor ) ;
+void SymmetricTensor_Zero( SymmetricTensor tensor ) ;
+void ZeroMatrix( double** matrix, Index rows, Index cols ) ;
+
+/* Define tensorArray Vector functions */
+double TensorArray_MultiplyByVectors( TensorArray tensor, double* a, double* b, Dimension_Index dim ) ;
+
+void SymmetricTensor_ApplyOnVector( SymmetricTensor tensor, double* vector, Dimension_Index dim, XYZ result ) ;
+double SymmetricTensor_MultiplyByVectors( SymmetricTensor tensor, double* a, double* b, Dimension_Index dim ) ;
+
+
+/* Eigenvector Stuff - All Eigenvector calculations sort eigenvectors from smallest to largest */
+void SymmetricTensor_CalcAllEigenvalues( SymmetricTensor tensor, Dimension_Index dim, Eigenvector* eigenvectorList ) ;
+void SymmetricTensor_CalcAllEigenvalues2D( SymmetricTensor tensor, Eigenvector* eigenvectorList ) ;
+void SymmetricTensor_CalcAllEigenvalues3D( SymmetricTensor tensor, Eigenvector* eigenvectorList ) ;
+
+void SymmetricTensor_CalcAllEigenvectors( SymmetricTensor tensor, Dimension_Index dim, Eigenvector* eigenvectorList ) ;
+
+Bool SymmetricTensor_CalcEigenvector2D( SymmetricTensor tensor, Eigenvector* eigenvector ) ;
+void SymmetricTensor_CalcAllEigenvectors2D( SymmetricTensor tensor, Eigenvector* eigenvectorList ) ;
+
+Bool SymmetricTensor_CalcEigenvector3D( SymmetricTensor tensor, Eigenvector* eigenvector ) ;
+void SymmetricTensor_CalcAllEigenvectors3D( SymmetricTensor tensor, Eigenvector* eigenvectorList ) ;
+
+void SymmetricTensor_CalcAllEigenvectorsJacobi( SymmetricTensor tensor, Dimension_Index dim, Eigenvector* eigenvectorList );
+void Matrix_CalcAllEigenvectorsJacobi(double **matrix, Index count, Eigenvector* eigenvectorList ) ;
+
+/* Sorts the eigenvectors according to the value of the eigenvalue - from smallest to greatest */
+void EigenvectorList_Sort( Eigenvector* eigenvectorList, Index count ) ;
+
+/* Define other useful tensor and matrix functions */
+#define StGermain_MatrixDeterminant( matrix, dim ) StGermain_MatrixDeterminant_AxisIndependent( matrix, dim, I_AXIS, J_AXIS, K_AXIS )
+double StGermain_MatrixDeterminant_AxisIndependent( double** matrix, Dimension_Index dim, Coord_Index A_axis, Coord_Index B_axis, Coord_Index C_axis ) ;
+
+void CubicSolver_OnlyRealRoots( double a2, double a1, double a0, double* rootList ) ;
+
+void TensorArray_SolveSystem( TensorArray tensorArray, double* solution, double* rightHandSide, Dimension_Index dim ) ;
+
+#endif /* __Domain_Geometry_TensorMath_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/TensorMultMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/TensorMultMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,671 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**	Alireza Asgari, Researcher, Deakin University.
+**  Julian Giordani, Researcher, Monash Cluster Computing, Monash University
+**
+**  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: TensorMultMath.c  $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "units.h"
+#include "types.h"
+#include "TensorMath.h"
+#include "VectorMath.h"
+#include "TensorMultMath.h"
+#include <math.h>
+#include <string.h>
+
+#define STG_TENSORMULT_ERROR 1.0e-15;
+
+/** Create Identity Tensor */
+void TensorArray_Identity(Dimension_Index dim, TensorArray tensorArray){
+
+	Dimension_Index index;
+	/* Check dimension */
+	if ( (dim != 2)&&(dim != 3) ) {		
+		Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+		Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+		Journal_Firewall( dim, error,
+			"In func '%s' don't understand dim = %u\n", __func__, dim );
+	}
+	
+	/* Calculate indentity matrix */
+	for (index = 0; index < (dim * dim); index++){
+		tensorArray[index] = 0.0;	
+	}
+	for (index = 0; index < dim; index++ ){
+		tensorArray[TensorArray_TensorMap(index, index, dim)] = 1.0;
+	}			
+	return;
+}
+
+/** Create Identity SymmetricTensor */
+void SymmetricTensor_Identity(Dimension_Index dim, SymmetricTensor symmetricTensor) {
+
+	Dimension_Index index;
+	/* Check dimension */
+	if ( (dim != 2)&&(dim != 3) ) {		
+		Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+		Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+		Journal_Firewall( dim, error,
+			"In func '%s' don't understand dim = %u\n", __func__, dim );
+	}
+	
+	/* Calculate indentity matrix: zero max = (0.5 * ((dim) * ((dim) + 1)) [Triangular number]*/
+	for (index = 0; index < (0.5 * (dim * (dim + 1 )) ); index++){
+		symmetricTensor[index] = 0.0;	
+	}
+	for (index = 0; index < dim; index++ ){
+		symmetricTensor[SymmetricTensor_TensorMap(index, index, dim)] = 1.0;
+	}			
+	return;
+}
+
+/** Calculates the transpose of a given tensor array */
+void TensorArray_Transpose(TensorArray tensor, Dimension_Index dim, TensorArray result){
+switch (dim) {
+        case 3:
+            result[FT3D_00] = tensor[FT3D_00];
+            result[FT3D_01] = tensor[FT3D_10];
+            result[FT3D_02] = tensor[FT3D_20];
+            result[FT3D_10] = tensor[FT3D_01];
+            result[FT3D_11] = tensor[FT3D_11];
+            result[FT3D_12] = tensor[FT3D_21];
+            result[FT3D_20] = tensor[FT3D_02];
+            result[FT3D_21] = tensor[FT3D_12];
+            result[FT3D_22] = tensor[FT3D_22];
+            return;
+        case 2:
+            result[FT2D_00] = tensor[FT2D_00];
+            result[FT2D_01] = tensor[FT2D_10];
+            result[FT2D_10] = tensor[FT2D_01];
+            result[FT2D_11] = tensor[FT2D_11];
+            break;
+        default: {
+           	Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+           	Journal_Printf( error, "Cannot read tensor for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( dim, error,
+				"In func '%s' don't understand dim = %u\n", __func__, dim );;
+            }
+        }
+}
+
+/** Adds tensorA to tensorB and returns answer in TensorArray result */
+void TensorArray_Add(TensorArray tensorA, TensorArray tensorB, Dimension_Index dim, TensorArray result) {
+    Dimension_Index index;
+	
+	if ( (dim != 2)&&(dim != 3) ) {		
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+			Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( dim, error,
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+    for (index = 0; index < (dim * dim); index++){
+        result[index] = tensorA[index] + tensorB[index];
+    }
+}
+
+/** Subtracts tensorB from tensorA and returns answer in TensorArray result*/
+void TensorArray_Subtract(	TensorArray tensorArrayA, TensorArray tensorArrayB, Dimension_Index dim, 
+							TensorArray result) 
+{
+	Dimension_Index index;
+	
+		if ( (dim != 2)&&(dim != 3) ) {		
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+			Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( dim, error,
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	    for (index = 0; index < (dim * dim); index++){
+        result[index] = tensorArrayA[index] - tensorArrayB[index];
+    }
+}
+
+/** Multiplies two TensorArray's */ 
+void TensorArray_MultiplyByTensorArray(	TensorArray tensorA, TensorArray tensorB, Dimension_Index dim, TensorArray result) {
+	
+	switch (dim) {
+        case 3:
+            result[FT3D_00] = 	tensorA[FT3D_00] * tensorB[FT3D_00] 
+							+ 	tensorA[FT3D_01] * tensorB[FT3D_10]
+							+ 	tensorA[FT3D_02] * tensorB[FT3D_20];
+		
+            result[FT3D_01] =	tensorA[FT3D_00] * tensorB[FT3D_01]
+							+	tensorA[FT3D_01] * tensorB[FT3D_11]
+							+	tensorA[FT3D_02] * tensorB[FT3D_21];
+        
+			result[FT3D_02] =	tensorA[FT3D_00] * tensorB[FT3D_02]
+							+	tensorA[FT3D_01] * tensorB[FT3D_12]
+							+ 	tensorA[FT3D_02] * tensorB[FT3D_22];
+
+            result[FT3D_10] =	tensorA[FT3D_10] * tensorB[FT3D_00]
+							+	tensorA[FT3D_11] * tensorB[FT3D_10]
+							+	tensorA[FT3D_12] * tensorB[FT3D_20];
+		
+            result[FT3D_11] =	tensorA[FT3D_10] * tensorB[FT3D_01]
+							+ 	tensorA[FT3D_11] * tensorB[FT3D_11]
+							+	tensorA[FT3D_12] * tensorB[FT3D_21];
+        
+			result[FT3D_12] =	tensorA[FT3D_10] * tensorB[FT3D_02]
+							+ 	tensorA[FT3D_11] * tensorB[FT3D_12]
+							+	tensorA[FT3D_12] * tensorB[FT3D_22];
+
+            result[FT3D_20] =	tensorA[FT3D_20] * tensorB[FT3D_00]
+							+	tensorA[FT3D_21] * tensorB[FT3D_10]
+							+	tensorA[FT3D_22] * tensorB[FT3D_20];
+							
+            result[FT3D_21]	=	tensorA[FT3D_20] * tensorB[FT3D_01]
+							+	tensorA[FT3D_21] * tensorB[FT3D_11]
+							+	tensorA[FT3D_22] * tensorB[FT3D_21];
+							
+            result[FT3D_22] =	tensorA[FT3D_20] * tensorB[FT3D_02]
+							+	tensorA[FT3D_21] * tensorB[FT3D_12]
+							+	tensorA[FT3D_22] * tensorB[FT3D_22];
+            return;
+        case 2:
+            result[FT2D_00]	=	tensorA[FT2D_00] * tensorB[FT2D_00] 
+							+ 	tensorA[FT2D_01] * tensorB[FT2D_10];
+		
+            result[FT2D_01]	=	tensorA[FT2D_00] * tensorB[FT2D_01]
+							+ 	tensorA[FT2D_01] * tensorB[FT2D_11];
+
+            result[FT2D_10]	=	tensorA[FT2D_10] * tensorB[FT2D_00]
+							+	tensorA[FT2D_11] * tensorB[FT2D_10];
+		
+            result[FT2D_11]	=	tensorA[FT2D_10] * tensorB[FT2D_01]
+							+	tensorA[FT2D_11] * tensorB[FT2D_11];
+            return;
+        default: {
+           Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+           Journal_Printf( error, "Cannot read tensor for dimension %d in %s.\n", dim, __func__);
+           	Journal_Firewall( dim, Journal_Register( Error_Type, "TensorMultMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );;
+            }
+    }
+
+}
+
+
+
+/** Multiplies tensor A, on the right by it's transpose, A^T to give A*A^T 
+And returns the answer in a symmetric tensor*/
+void TensorArray_MultiplyByRightTranspose(TensorArray tensor, Dimension_Index dim, SymmetricTensor result) {
+
+	TensorArray tensorTranspose;
+	TensorArray fullTensorResult;
+
+
+	TensorArray_Transpose(tensor, dim, tensorTranspose);
+	TensorArray_MultiplyByTensorArray(tensor, tensorTranspose, dim, fullTensorResult);
+	
+	/** Answer is automatically a symmetric tensor by definition */	
+	TensorArray_GetSymmetricPart( fullTensorResult, dim, result ) ;
+
+	return;
+}
+
+/** Multiplies tensor A, on the left by it's transpose, A^T to give A^T * A 
+And returns the answer in a symmetric tensor*/
+void TensorArray_MultiplyByLeftTranspose(TensorArray tensor, Dimension_Index dim, SymmetricTensor result) {
+
+	TensorArray tensorTranspose;
+	TensorArray fullTensorResult;
+
+	TensorArray_Transpose( tensor, dim, tensorTranspose);
+	TensorArray_MultiplyByTensorArray( tensorTranspose, tensor, dim, fullTensorResult );
+	
+	/** Answer is automatically a symmetric tensor by definition */	
+	TensorArray_GetSymmetricPart( fullTensorResult, dim, result);
+	return;
+}
+
+/**	Multiplies TensorArray by SymmetricTensor, and gives answer in a TensorArray:
+	A * symB */
+void TensorArray_MultiplyBySymmetricTensor(	TensorArray tensorArray, SymmetricTensor symmetricTensor,
+											Dimension_Index dim, TensorArray result)
+{
+switch (dim) {
+        case 3:
+            result[FT3D_00] = 	tensorArray[FT3D_00] * symmetricTensor[ST3D_00] 
+							+ 	tensorArray[FT3D_01] * symmetricTensor[ST3D_01]
+							+ 	tensorArray[FT3D_02] * symmetricTensor[ST3D_02];
+		
+            result[FT3D_01] =	tensorArray[FT3D_00] * symmetricTensor[ST3D_01]
+							+	tensorArray[FT3D_01] * symmetricTensor[ST3D_11]
+							+	tensorArray[FT3D_02] * symmetricTensor[ST3D_12];
+        
+			result[FT3D_02] =	tensorArray[FT3D_00] * symmetricTensor[ST3D_02]
+							+	tensorArray[FT3D_01] * symmetricTensor[ST3D_12]
+							+ 	tensorArray[FT3D_02] * symmetricTensor[ST3D_22];
+
+            result[FT3D_10] =	tensorArray[FT3D_10] * symmetricTensor[ST3D_00]
+							+	tensorArray[FT3D_11] * symmetricTensor[ST3D_01]
+							+	tensorArray[FT3D_12] * symmetricTensor[ST3D_02];
+		
+            result[FT3D_11] =	tensorArray[FT3D_10] * symmetricTensor[ST3D_01]
+							+ 	tensorArray[FT3D_11] * symmetricTensor[ST3D_11]
+							+	tensorArray[FT3D_12] * symmetricTensor[ST3D_12];
+        
+			result[FT3D_12] =	tensorArray[FT3D_10] * symmetricTensor[ST3D_02]
+							+ 	tensorArray[FT3D_11] * symmetricTensor[ST3D_12]
+							+	tensorArray[FT3D_12] * symmetricTensor[ST3D_22];
+
+            result[FT3D_20] =	tensorArray[FT3D_20] * symmetricTensor[ST3D_00]
+							+	tensorArray[FT3D_21] * symmetricTensor[ST3D_01]
+							+	tensorArray[FT3D_22] * symmetricTensor[ST3D_02];
+							
+            result[FT3D_21]	=	tensorArray[FT3D_20] * symmetricTensor[ST3D_01]
+							+	tensorArray[FT3D_21] * symmetricTensor[ST3D_11]
+							+	tensorArray[FT3D_22] * symmetricTensor[ST3D_12];
+							
+            result[FT3D_22] =	tensorArray[FT3D_20] * symmetricTensor[ST3D_02]
+							+	tensorArray[FT3D_21] * symmetricTensor[ST3D_12]
+							+	tensorArray[FT3D_22] * symmetricTensor[ST3D_22];
+            return;
+        case 2:
+            result[FT2D_00]	=	tensorArray[FT2D_00] * symmetricTensor[ST2D_00] 
+							+ 	tensorArray[FT2D_01] * symmetricTensor[ST2D_01];
+		
+            result[FT2D_01]	=	tensorArray[FT2D_00] * symmetricTensor[ST2D_01]
+							+ 	tensorArray[FT2D_01] * symmetricTensor[ST2D_11];
+
+            result[FT2D_10]	=	tensorArray[FT2D_10] * symmetricTensor[ST2D_00]
+							+	tensorArray[FT2D_11] * symmetricTensor[ST2D_01];
+		
+            result[FT2D_11]	=	tensorArray[FT2D_10] * symmetricTensor[ST2D_01]
+							+	tensorArray[FT2D_11] * symmetricTensor[ST2D_11];
+            return;
+        default: {
+           Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+           Journal_Printf( error, "Cannot read tensor for dimension %d in %s.\n", dim, __func__);
+           	Journal_Firewall( dim, Journal_Register( Error_Type, "TensorMultMath" ),
+				"In func '%s' don't understand dim = %u\n", __func__, dim );;
+            }
+		}
+}
+
+/**	Multiplies SymmetricTensor by TensorArray and gives answer in a TensorArray:
+	symA * B */
+void SymmetricTensor_MultiplyByTensorArray(	TensorArray tensorArray, SymmetricTensor symmetricTensor,
+											Dimension_Index dim, TensorArray result)
+{
+	TensorArray fullTensor;
+	StGermain_SymmetricTensor_ToTensorArray(symmetricTensor, dim, fullTensor);
+	TensorArray_MultiplyByTensorArray(fullTensor, tensorArray, dim, result);
+	return;
+}
+
+/** Multiplies a tensorArray by vector on the left: v * A */
+void TensorArray_MultiplyByLeftVector(	TensorArray tensorArray, double* vector, 
+										Dimension_Index dim, double* result) 
+{
+	switch (dim) {
+		case 3:
+			result[0] = vector[0] * tensorArray[FT3D_00] +
+						vector[1] * tensorArray[FT3D_10] +
+						vector[2] * tensorArray[FT3D_20];
+		
+			result[1] = vector[0] * tensorArray[FT3D_01] +
+						vector[1] * tensorArray[FT3D_11] +
+						vector[2] * tensorArray[FT3D_21];
+		
+			result[2] = vector[0] * tensorArray[FT3D_02] +
+						vector[1] * tensorArray[FT3D_12] +
+						vector[2] * tensorArray[FT3D_22];		
+			return;
+		case 2:
+			result[0] = vector[0] * tensorArray[FT2D_00] 
+					  + vector[1] * tensorArray[FT2D_10];
+		
+			result[1] = vector[0] * tensorArray[FT2D_01] 
+					  + vector[1] * tensorArray[FT2D_11];		
+			return;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+			Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( dim, error,
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}		
+		return;
+}
+
+/** Multiplies a tensorArray by vector on the right:  A * v */
+void TensorArray_MultiplyByRightVector(	TensorArray tensorArray, double* vector, 
+										Dimension_Index dim, double* result)
+{
+	switch (dim) {
+		case 3:
+			result[0] = tensorArray[FT3D_00] * vector[0] +
+						tensorArray[FT3D_01] * vector[1] +
+						tensorArray[FT3D_02] * vector[2];
+		
+			result[1] = tensorArray[FT3D_10] * vector[0] +
+						tensorArray[FT3D_11] * vector[1] +
+						tensorArray[FT3D_12] * vector[2];
+		
+			result[2] = tensorArray[FT3D_20] * vector[0] +
+						tensorArray[FT3D_21] * vector[1] +
+						tensorArray[FT3D_22] * vector[2];		
+			return;
+		case 2:
+			result[0] = tensorArray[FT2D_00] * vector[0] + 
+						tensorArray[FT2D_01] * vector[1];
+		
+			result[1] = tensorArray[FT2D_10] * vector[0] +
+					  	tensorArray[FT2D_11] * vector[1];		
+			return;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+			Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( dim, error,
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+		}
+	}		
+	return;	
+	
+}
+
+/** Calculates the determinant of a TensorArray*/
+double TensorArray_CalcDeterminant(TensorArray tensorArray, Dimension_Index dim) {
+
+    double determinant;
+    switch ( dim ) {
+        case 3:{
+            determinant =   tensorArray[ FT3D_00] *
+                                ( tensorArray[ FT3D_11 ] * tensorArray[ FT3D_22 ] -
+                                  tensorArray[ FT3D_21 ] * tensorArray[ FT3D_12 ] )
+                            - tensorArray[ FT3D_01 ] *
+                                ( tensorArray[ FT3D_10 ] * tensorArray[ FT3D_22 ] -
+                                  tensorArray[ FT3D_12 ] * tensorArray[ FT3D_20 ] )
+                            + tensorArray[ FT3D_02 ] *
+                                ( tensorArray[ FT3D_10 ] * tensorArray[ FT3D_21 ] -
+                                  tensorArray[ FT3D_11 ] * tensorArray[ FT3D_20 ] );
+            return determinant;
+            }
+        case 2:{
+            determinant = tensorArray[ FT2D_00 ] * tensorArray[ FT2D_11 ]
+                        - tensorArray[ FT2D_10 ] * tensorArray[ FT2D_01 ];
+            return determinant;
+            }
+        default: {
+ 			Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+			Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+			Journal_Firewall( dim, error,
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+        }
+    }
+	return 0;
+}
+
+/** Calculates the inverse of a tensorArray for non-zero determinants.  */
+void TensorArray_CalcInverse(TensorArray tensor, Dimension_Index dim, TensorArray result) {
+	
+	double determinant;
+	/* Calculate determinant */
+	determinant = TensorArray_CalcDeterminant(tensor, dim);	
+	TensorArray_CalcInverseWithDeterminant(tensor, determinant, dim, result);
+	return;
+}
+
+/** Calculates inverse of tensorArray for non-zero determinant when given a value 
+for the determinant. This allows the use of different determinants 
+if such calculation is needed.*/
+void TensorArray_CalcInverseWithDeterminant(TensorArray tensor, double determinant, Dimension_Index dim, TensorArray result) {
+	double  errorValue;
+
+	/* Check if determinant is zero or close to zero*/
+	errorValue = STG_TENSORMULT_ERROR;
+	if (fabs(determinant) <= errorValue) {
+			Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+			Journal_Printf( error, "Error in '%s', Cannot calculate inverse of singular tensorArray:\n", 
+							__func__); 
+			Journal_PrintTensorArray( error, tensor, dim);
+			Journal_Printf( error, "Determinant, %g is zero or near zero. \n", determinant);
+		Journal_Firewall( False, Journal_Register( ErrorStream_Type, "TensorMultMath" ),
+				"In func '%s',TensorArray is singular, cannot divide by zero determinant, %g\n", __func__, determinant );
+		return;		
+	}
+	
+	/** Uses formula : 
+	A^{-1} \= \frac{(-1)^i + j(M_{ij})}{detA} 
+	*/ 
+	switch (dim) {
+			case 3:
+				result[FT3D_00] = ( tensor[FT3D_11] * tensor[FT3D_22] - 
+									tensor[FT3D_21] * tensor[FT3D_12] ) / determinant;
+				result[FT3D_10] = ( tensor[FT3D_20] * tensor[FT3D_12] - 
+									tensor[FT3D_10] * tensor[FT3D_22] ) / determinant;
+				result[FT3D_20] = ( tensor[FT3D_10] * tensor[FT3D_21] - 
+									tensor[FT3D_20] * tensor[FT3D_11] ) / determinant;
+	
+				result[FT3D_01] = ( tensor[FT3D_21] * tensor[FT3D_02] - 
+									tensor[FT3D_01] * tensor[FT3D_22] ) / determinant;
+				result[FT3D_11] = ( tensor[FT3D_00] * tensor[FT3D_22] - 
+									tensor[FT3D_20] * tensor[FT3D_02] ) / determinant;
+				result[FT3D_21] = ( tensor[FT3D_20] * tensor[FT3D_01] - 
+									tensor[FT3D_00] * tensor[FT3D_21] ) / determinant;
+	
+				result[FT3D_02] = ( tensor[FT3D_01] * tensor[FT3D_12] - 
+									tensor[FT3D_11] * tensor[FT3D_02] ) / determinant;
+				result[FT3D_12] = ( tensor[FT3D_10] * tensor[FT3D_02] - 
+									tensor[FT3D_00] * tensor[FT3D_12] ) / determinant;
+				result[FT3D_22] = ( tensor[FT3D_00] * tensor[FT3D_11] - 
+									tensor[FT3D_10] * tensor[FT3D_01] ) / determinant;
+				break;
+			case 2:
+				result[FT2D_00] = tensor[FT2D_11] / determinant;
+				result[FT2D_01] = ( -1.0 * tensor[FT2D_01] ) / determinant;
+				result[FT2D_10] = ( -1.0 * tensor[FT2D_10] ) / determinant;
+				result[FT2D_11] = tensor[FT2D_00] / determinant;
+				break;
+			default: {
+ 				Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+				Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+				Journal_Firewall( dim, error,
+				"In func '%s' don't understand dim = %u\n", __func__, dim );
+				}
+		}
+}
+
+
+/** Calculate double dot product of two tensors */
+double TensorArray_DoubleContraction(TensorArray tensorA,TensorArray tensorB, Dimension_Index dim){
+    double contraction;
+    Dimension_Index i, j;
+	/** \[\sigma:\epsilon=\sum_{i=1}^{n}\sum_{i=1}^{n}\sigma_{ij}\epsilon_{ij}\]  */
+	/* Check dimension */
+	if ( (dim != 2)&&(dim != 3) ) {		
+		Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+		Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+		Journal_Firewall( dim, error,
+			"In func '%s' don't understand dim = %u\n", __func__, dim );
+	}
+	
+	/* Calculate contraction */
+	contraction = 0.0;
+	for ( i = 0; i < dim; i++) {
+		for (j = 0; j < dim; j++) {
+			contraction = 	contraction + 
+							tensorA[ TensorArray_TensorMap(i, j, dim) ] * 
+							tensorB[ TensorArray_TensorMap(i, j, dim) ];       
+		}        
+	}
+
+    return contraction;
+}
+
+/** Calculate double dot product of two symmteric tensors */
+double SymmetricTensor_DoubleContraction(SymmetricTensor tensorA, SymmetricTensor tensorB, Dimension_Index dim)
+{
+    double contraction;
+    Dimension_Index i, j;
+	
+	/* Check dimension */
+	if ( (dim != 2)&&(dim != 3) ) {		
+		Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+		Journal_Printf( error, "Cannot get tensor value for dimension %d in %s.\n", dim, __func__);
+		Journal_Firewall( dim, error,
+			"In func '%s' don't understand dim = %u\n", __func__, dim );
+	}
+	
+	/* Calculate contraction */
+	contraction = 0.0;
+	for ( i = 0; i < dim; i++) {
+		for (j = 0; j < dim; j++) {
+			contraction = 	contraction + 
+							tensorA[ SymmetricTensor_TensorMap(i, j, dim) ] * 
+							tensorB[ SymmetricTensor_TensorMap(i, j, dim) ];       
+		}        
+	}
+
+    return contraction;
+}
+
+/************ All NonSquareMatrix Functions assume the output Matrix/Vector data structure is already initialised *******/
+/** This function calculates the transpose of a non-square nxm 2D matrix
+	It requires the row and column dimensions, and assumes an answer matrix
+	that is the correct size, ie mxn */
+void NonSquareMatrix_Transpose( double** originalMatrix, Dimension_Index rowDimOrig, 
+	Dimension_Index colDimOrig, double** newMatrix ) {
+	Dimension_Index row_I, col_I;
+	if ((rowDimOrig <=0) || (colDimOrig <=0)) {
+        Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+
+		Journal_Firewall( False, error,
+				"In func '%s' don't understand rows = %u or cols = %u\n", 
+			__func__, rowDimOrig, colDimOrig );
+	}
+	for( row_I = 0 ; row_I < rowDimOrig ; row_I++ ) {
+		for( col_I = 0 ; col_I < colDimOrig ; col_I++ ) {
+			newMatrix[ col_I ][ row_I ] = originalMatrix[ row_I ][ col_I ];
+		}
+	}
+	return;
+}
+
+void NonSquareMatrix_MultiplicationByNonSquareMatrix( double **AMatrix, int rowDimA, int colDimA,
+					 double **BMatrix, int rowDimB, int colDimB, 
+					 double** resultMatrix ) {
+	int counter;
+	for( counter = 0 ; counter < rowDimA ; counter++ ) {
+		memset( resultMatrix[counter], 0, sizeof( double ) * colDimB );
+	}
+NonSquareMatrix_CumulativeMultiplicationByNonSquareMatrix(AMatrix,rowDimA,colDimA,
+					 BMatrix,rowDimB, colDimB, 
+					 resultMatrix );	
+	
+}
+/** This function multiplies 2 non square matrices. It requires the row and column 
+	dimensions for each matrix. Columns In Matrix A = Rows In Matrix B
+	resultMatrix_ik = AMatrix_ij x BMatrix_jk */
+void NonSquareMatrix_CumulativeMultiplicationByNonSquareMatrix( double **AMatrix, 
+					 int rowDimA, int colDimA,
+					 double **BMatrix, int rowDimB, int colDimB, 
+					 double** resultMatrix ) {
+			
+  int row_I, col_I; /* location with resultMatrix  */
+  int counter;      /* counter which facilitates the multiplication of AMatrix and BMatrix */
+	/** Error Checking Code */
+	Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+					 
+	if (colDimA != rowDimB) {
+		Journal_Firewall( False, error,
+				"In func '%s'  row dimension B, %u != column dimension A, %u\n", 
+			__func__, rowDimB, colDimA );
+	}
+	if ((AMatrix == NULL) || (BMatrix == NULL) || (resultMatrix == NULL) ) {
+			Journal_Firewall( False, error,
+				"In func '%s', Input matrices: %s %s, or Output matrix: %s is NULL \n", 
+			__func__, AMatrix, BMatrix, resultMatrix);
+	}
+	/** End error checking code */
+	/** Calculate result matrix */
+	for( row_I = 0 ; row_I < rowDimA ; row_I++ ) {
+		for( col_I = 0 ; col_I < colDimB ; col_I++ ) {
+			/** resultMatrix[ row_I ][ col_I] = AMatrix_ij x BMatrix_jk */
+		       	for( counter = 0 ; counter < colDimA ; counter++ ) {
+				resultMatrix[ row_I ][ col_I ] += ( AMatrix[row_I][counter] * BMatrix[counter][col_I] );
+			}
+		}
+	}
+}
+
+/** This function multiplies a M x N matrices by a N vector.. It requires the column 
+	dimensions of the matrix and the row dimension. Columns In Matrix A = Rows In Vector B
+	resultMatrix_ij = AMatrix_ij x BVector_j */
+void NonSquareMatrix_MatrixVectorMultiplication( double** AMatrix, int rowsInA, int colsInA,
+		     double* BVec, int rowsInB,double* resultVector ) {
+  /*This assumes the resultVector is of the correct length. */
+	memset(resultVector,0,sizeof(double)* rowsInA);		 
+	NonSquareMatrix_CumulativeMatrixVectorMultiplication( AMatrix, rowsInA, colsInA,
+		                     BVec, rowsInB, resultVector);						   
+}
+/**This function multiplies a M x N matrices by a N vector, and then adds this result
+to the passed in 'solution Vector'. It requires the column 
+	dimensions of the matrix and the row dimension. Columns In Matrix A = Rows In Vector B
+	resultMatrix_ij = AMatrix_ij x BVector_j
+*/
+void NonSquareMatrix_CumulativeMatrixVectorMultiplication( double** AMatrix, int rowsInA, int colsInA,
+		                               double* BVec, int rowsInB, double* resultVector ) {
+  int row_I, col_I; /* counters through matrix rows and columns respectively */
+	Stream* error = Journal_Register( ErrorStream_Type, "TensorMultMath" );
+	Journal_Firewall( ( colsInA == rowsInB ), error,
+			"In func '%s' column dimensions of A_Matrix = %d is not equal to the row dimensions of B_Vec = %d\n",
+			__func__, colsInA, rowsInB );
+	Journal_Firewall( (resultVector != NULL) || (AMatrix != NULL) || (BVec != NULL) , error,
+			"In func '%s', Input matrices: %p %p, or Output matrix: %p is NULL \n", 
+			__func__, AMatrix, BVec, resultVector);
+	/* calculate the result Vector */
+	for( row_I = 0 ; row_I < rowsInA ; row_I++ ) {
+		for( col_I = 0 ; col_I < colsInA ; col_I++ ) {
+			resultVector[ row_I ] += AMatrix[ row_I ][ col_I ] * BVec[ col_I ];
+		}
+	}
+}
+
+/** Prints out a non square matrix if given the row and col dimension */
+void Journal_PrintNonSquareMatrix_Unnamed( Stream* stream, double** NonSquareMatrix, 
+	Dimension_Index rowDim, Dimension_Index colDim ) 
+{
+	Dimension_Index row_I, col_I;
+
+	/* For efficency - Check if stream is enabled */
+	if (!Stream_IsEnable(stream)) return;
+	
+	for ( row_I = 0 ; row_I < rowDim ; row_I++ ) {
+		for ( col_I = 0 ; col_I < colDim ; col_I++ ) {
+			Journal_Printf( stream, "%7.5g	", NonSquareMatrix[row_I][col_I] );
+			}
+		Journal_Printf( stream, "\n" );
+	}
+		
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/TensorMultMath.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/TensorMultMath.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,109 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**	Alireza Asgari, Researcher, Deakin University.
+**  Julian Giordani, Researcher, Monash Cluster Computing, Monash University
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    Provides basic tensor and vector multiplication operations for 2D and 3D.
+**
+** Assumptions:
+** Comments:
+**
+** $Id: TensorMultMath.h  $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_TensorMultMath_h__
+#define __Domain_Geometry_TensorMultMath_h__
+
+/* Added to enhance Tensor math for Solid Mechanics applications */
+
+/* TODO These should be in TensorMath  */
+void TensorArray_Identity(Dimension_Index dim, TensorArray tensorArray );
+void SymmetricTensor_Identity(Dimension_Index dim, SymmetricTensor symmetricTensor) ;
+
+/* Basic operations */
+void TensorArray_Transpose(TensorArray tensorArray, Dimension_Index dim, TensorArray result);
+void TensorArray_Add(	TensorArray tensorArrayA, TensorArray tensorArrayB, 
+						Dimension_Index dim, TensorArray result);
+void TensorArray_Subtract(	TensorArray tensorArrayA, TensorArray tensorArrayB, Dimension_Index dim,
+							TensorArray result);
+
+/* Multiplication Operations */
+
+void TensorArray_MultiplyByTensorArray(	TensorArray tensorArrayA, TensorArray tensorArrayB, 
+										Dimension_Index dim, TensorArray result);
+void TensorArray_MultiplyByRightTranspose(TensorArray tensorArray, Dimension_Index dim, SymmetricTensor result);
+void TensorArray_MultiplyByLeftTranspose(TensorArray tensorArray, Dimension_Index dim, SymmetricTensor result);
+void TensorArray_MultiplyBySymmetricTensor(	TensorArray tensorArray, SymmetricTensor symmetricTensor,
+											Dimension_Index dim, TensorArray result);
+void TensorArray_MultiplyByLeftVector(	TensorArray tensorArray, double* vector, 
+										Dimension_Index dim, double* result);
+void TensorArray_MultiplyByRightVector(	TensorArray tensorArray, double* vector, 
+										Dimension_Index dim, double* result); 
+
+/* Other useful operations */
+double TensorArray_CalcDeterminant(TensorArray tensorArray, Dimension_Index dim);
+void TensorArray_CalcInverse( TensorArray tensorA, Dimension_Index dim, TensorArray result);
+void TensorArray_CalcInverseWithDeterminant(TensorArray tensor, double determinant, Dimension_Index dim, TensorArray result);
+
+
+/* Useful operations in Solid Mechanics */
+double TensorArray_DoubleContraction(TensorArray tensorArrayA,TensorArray tensorArrayB, Dimension_Index dim);
+double SymmetricTensor_DoubleContraction(SymmetricTensor tensorA, SymmetricTensor tensorB, Dimension_Index dim);
+
+/* Non-square matrix operations */
+void NonSquareMatrix_Transpose( double** originalMatrix, Dimension_Index rowDimOrig, 
+	Dimension_Index colDimOrig, double** newMatrix );
+
+void NonSquareMatrix_MultiplicationByNonSquareMatrix( double **AMatrix, int rowsInA, int colsInA,
+					 double **BMatrix, int rowsInB, int colsInB, 
+					 double** resultMatrix );	
+
+void NonSquareMatrix_CumulativeMultiplicationByNonSquareMatrix( double **AMatrix, int rowDimA, int colDimA,
+					 double **BMatrix, int rowDimB, int colDimB, 
+					 double** resultMatrix );
+
+void NonSquareMatrix_MatrixVectorMultiplication( double** AMatrix, int rowsInA, int colsInA,
+		                               double* BVec, int rowsInB, double* resultVector );
+void NonSquareMatrix_CumulativeMatrixVectorMultiplication( double** AMatrix, int rowsInA, int colsInA,
+		                               double* BVec, int rowsInB, double* resultVector ); 						   
+/** Print a named NonSquareMatrix */
+#define Journal_PrintNonSquareMatrix(stream, matrix, rowDim, colDim) \
+	do {	\
+		Journal_Printf( stream, #matrix " - \n" ); \
+		Journal_PrintNonSquareMatrix_Unnamed( stream, matrix, rowDim, colDim ); \
+	} while(0) 
+	
+void Journal_PrintNonSquareMatrix_Unnamed( Stream* stream, double** NonSquareMatrix, 
+	Dimension_Index rowDim, Dimension_Index colDim ) ;
+
+
+
+
+#endif /* __Domain_Geometry_TensorMultMath_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Topology.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Topology.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,167 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: Topology.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "Topology.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+
+/* Textual name of this class */
+const Type Topology_Type = "Topology";
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Constructors
+*/
+
+Topology* _Topology_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,
+		Topology_NeighbourCountFunction*		neighbourCount,
+		Topology_BuildNeighboursFunction*		buildNeighbours )
+{
+	Topology* self;
+	
+	/* Allocate memory */
+	assert( _sizeOfSelf >= sizeof(Topology) );
+	self = (Topology*)_Stg_Component_New( _sizeOfSelf, type, _delete, _print, _copy, _defaultConstructor, _construct, _build, 
+			_initialise, _execute, _destroy, name, NON_GLOBAL );
+	
+	/* General info */
+	
+	/* Virtual info */
+	self->neighbourCount = neighbourCount;
+	self->buildNeighbours = buildNeighbours;
+	
+	/* Topology info */
+	if( initFlag ){
+		_Topology_Init( self );
+	}
+	
+	return self;
+}
+
+void _Topology_Init(
+		Topology*					self )
+{
+	/* General and Virtual info should already be set */
+	
+	/* Topology info */
+	self->isConstructed = True;
+	self->indexCount = 0;
+}
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Virtual functions
+*/
+
+void _Topology_Delete( void* topology ) {
+	Topology* self = (Topology*)topology;
+	
+	/* Stg_Class_Delete parent */
+	_Stg_Component_Delete( self );
+}
+
+
+void _Topology_Print( void* topology, Stream* stream ) {
+	Topology* self = (Topology*)topology;
+	
+	/* Set the Journal for printing informations */
+	Stream* topologyStream;
+	topologyStream = Journal_Register( InfoStream_Type, "TopologyStream" );
+
+	/* Print parent */
+	_Stg_Component_Print( self, stream );
+	
+	/* General info */
+	Journal_Printf( stream, "Topology (ptr): (%p)\n", self );
+	
+	/* Virtual info */
+	
+	/* Topology info */
+}
+
+
+void* _Topology_Copy( void* topology, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	Topology*	self = (Topology*)topology;
+	Topology*	newTopology;
+	
+	newTopology = (Topology*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	/* Virtual methods */
+	newTopology->neighbourCount = self->neighbourCount;
+	newTopology->buildNeighbours = self->buildNeighbours;
+	
+	newTopology->indexCount = self->indexCount;
+	
+	return (void*)newTopology;
+}
+
+
+NeighbourIndex Topology_NeighbourCount( void* topology, Index index ) {
+	Topology* self = (Topology*)topology;
+	assert( topology );
+	return self->neighbourCount( self, index );
+}
+
+void Topology_BuildNeighbours( void* topology, Index index, NeighbourIndex* neighbours ) {
+	Topology* self = (Topology*)topology;
+	assert( topology );
+	self->buildNeighbours( self, index, neighbours );
+}
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Public Functions
+*/
+
+
+/*----------------------------------------------------------------------------------------------------------------------------------
+** Private Functions
+*/
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Topology.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Topology.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,155 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+** Role:
+**	Abstract class which handles the 3D topology for an element or node. 
+**	This includes responsibility for finding neighbour information
+**	for a given element or node.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: Topology.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_Topology_h__
+#define __Domain_Geometry_Topology_h__
+	
+	/** Textual name of this class */
+	extern const Type Topology_Type;
+	
+	/* Virtual function types */
+	typedef NeighbourIndex	(Topology_NeighbourCountFunction)   ( void* topology, Index index );
+	typedef void		(Topology_BuildNeighboursFunction)  ( void* topology, Index index, NeighbourIndex* neighbours );
+	
+	/** Topology class contents (see Topology) */
+	#define __Topology \
+		/* General info */ \
+		/** Parent class - Stg_Component */ \
+		__Stg_Component \
+		\
+		/* Virtual info */ \
+		/**	Virtual function ptr for Topology_NeighbourCount() */ \
+		Topology_NeighbourCountFunction*		neighbourCount; \
+		/**	Virtual function ptr for Topology_BuildNeighbours() */ \
+		Topology_BuildNeighboursFunction*		buildNeighbours; \
+		\
+		/* Stg_Class info */ \
+		/** The maximum number of nodes/elements in the mesh */ \
+		Index						indexCount;
+
+	/**	Abstract class which handles the 3D topology for an element or node
+	- see Topology.h for member functions. */
+	struct Topology { __Topology };
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	
+	/** Creation implementation */
+
+	Topology* _Topology_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,
+		Topology_NeighbourCountFunction*			neighbourCount,
+		Topology_BuildNeighboursFunction*			buildNeighbours );
+	
+	/** Initialisation implementation functions */
+	void _Topology_Init(
+		Topology*						self );
+	
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+	
+	/** Stg_Class_Delete() implementation */
+	void _Topology_Delete( void* topology );
+	
+	/** Stg_Class_Print() implementation */
+	void _Topology_Print( void* topology, Stream* stream);
+	
+	/* Copy */
+	#define Topology_Copy( self ) \
+		(Topology*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define Topology_DeepCopy( self ) \
+		(Topology*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	
+	void* _Topology_Copy( void* topology, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Virtual functions
+	*/
+
+	/** Returns the number of neigbours for the given element. If the mesh
+	system is 2D or 1D, the count will be decreased appropriately. For regular
+	systems, the IJKTopology::dynamicSizes parameter effects the count. If
+	False, the count will ignore the possibility of neighbours outside the
+	mesh not existing. If True, the count will return the number of 
+	neighbours that actually exist. */
+	NeighbourIndex Topology_NeighbourCount( void* topology, Index index );
+	
+	/** Returns a dynamically allocated array containing the Index
+	number of the neighbours of a given node or element.
+	
+	Assumes that the neighbours input array has been pre-allocated to the 
+	correct size, as returned by Topology_NeighbourCount().
+
+	For regular topologies, the returned contents of the neighbours array
+	depends on the IJKTopology::dynamicSizes parameter. If False, the
+	positions in the array indexing Neigbours that don't exist will be 
+	filled with Topology_Invalid(). If true, neigbours that don't exist
+	will be skipped and only neighbours that exist will be returned.
+	*/
+	void Topology_BuildNeighbours( void* topology, Index index, NeighbourIndex* neighbours );
+	
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Functions/Macros
+	*/
+
+	/** This macro defines what should be used to record an invalid value, eg an
+	element in the neighbour table that doesn't exist (if you're on the outside
+	boundary on the mesh. */
+	#define Topology_Invalid( self ) \
+		(self)->indexCount
+	
+#endif /* __Domain_Geometry_Topology_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/Topology.meta
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/Topology.meta	Wed Oct 10 07:21:38 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">Topology</param>
+<param name="Author">...</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Geometry/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</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">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">...</param>
+
+</StGermainData>
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/TrigMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/TrigMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,127 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  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: TrigMath.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include <math.h>
+
+#include "units.h"
+#include "types.h"
+#include "TrigMath.h"
+
+#include <assert.h>
+
+#define RADIUS sphericalCoords[0]
+#define THETA  sphericalCoords[1]
+#define PHI    sphericalCoords[2]
+#define X      rectangularCoords[0]
+#define Y      rectangularCoords[1]
+#define Z      rectangularCoords[2]
+
+/** StGermain_RectangularToSpherical - Converts a from rectanglar coordinates to spherical coordinates */
+/* Macros (X, Y, Z) and (RADIUS, THETA, PHI) are used for clarity - See macros defined above */
+void StGermain_RectangularToSpherical(double* sphericalCoords, double* rectangularCoords, Index dim) {
+	double theta_sin_solution1, theta_sin_solution2;
+	double theta_cos_solution1, theta_cos_solution2;
+	
+	if (dim == 2) {
+		RADIUS = sqrt(X*X + Y*Y);
+
+		/* Get first solution for arcos */
+		theta_cos_solution1 = acos(X/RADIUS);		
+		
+		/* Get first solution for arcsin */
+		theta_sin_solution1 = asin(Y/RADIUS);		
+	}
+	else if (dim == 3) { 
+		RADIUS = sqrt(X*X + Y*Y + Z*Z);
+		PHI = acos(Z/RADIUS);
+
+		/* Get first solution for arcos */
+		theta_cos_solution1 = acos( X/ (RADIUS*sin(PHI)) );		/* Solution is between 0 and PI i.e. quadrant 1 and 2 */
+		
+		/* Get first solution for arcsin */
+		theta_sin_solution1 = asin( Y/(RADIUS*sin(PHI)) );		/* Solution is between -PI/2 and PI/2 i.e. quadrant 1 and 4 */
+	}
+	else {
+		Stream* error = Journal_Register( Error_Type , __FILE__ );
+		Journal_Printf( error, "Func %s does not work with dimension %u\n", __func__, dim );
+		exit(EXIT_FAILURE);
+	}
+
+	/* Get second solution for arcos */
+	theta_cos_solution2 = 2.0 * M_PI - theta_cos_solution1;			/* Solution is between PI and 2 PI - i.e. quadrant 3 and 4 */
+
+	/* Get second solution for arcsin */
+	theta_sin_solution2 = M_PI - theta_sin_solution1;			/* Solution is between PI/2 and 3PI/2 - i.e. quadrant 2 and 3 */
+	
+	/* Find sine and cosine solutions that match up */
+	if ( StGermain_TrigQuadrant( theta_cos_solution1 ) ==  StGermain_TrigQuadrant(theta_sin_solution1) 
+		||  StGermain_TrigQuadrant( theta_cos_solution1 ) ==  StGermain_TrigQuadrant( theta_sin_solution2 ) ) { 
+		THETA = theta_cos_solution1;
+	}
+	else { 
+		THETA = theta_cos_solution2;
+	}
+}
+
+
+/** StGermain_SphericalToRectangular - Converts a from spherical coordinates to rectanglar coordinates */
+/* Macros (X, Y, Z) and (RADIUS, THETA, PHI) are used for clarity - See macros defined above */
+void StGermain_SphericalToRectangular(double* rectangularCoords, double* sphericalCoords, Index dim) {
+	X = RADIUS * cos(THETA);
+	Y = RADIUS * sin(THETA);
+	
+	if (dim == 3) {
+		X = X * sin(PHI);
+		Y = Y * sin(PHI);
+		Z = RADIUS * cos(PHI);
+	}
+}
+
+/** StGermain_TrigDomain - Gets angle into domain between 0 and 2\pi */
+double StGermain_TrigDomain(double angle) {
+	if (angle > 0)
+		return fmod( angle, 2.0 * M_PI );
+	else 
+		return (2.0 * M_PI - fmod( fabs(angle), 2.0 * M_PI ));
+}
+
+/** StGermain_TrigQuadrant - Returns 0 (UPPER_RIGHT_QUADRANT), 1 (UPPER_LEFT_QUADRANT), 
+2 (LOWER_RIGHT_QUADRANT), or 3 (LOWER_RIGHT_QUADRANT) depending on what quadrant the angle is in */
+char StGermain_TrigQuadrant(double angle) {
+	/* Gets radian into correct domain */
+	angle = StGermain_TrigDomain(angle);
+	
+	/* return angle * \frac{2}{\pi} */
+	return (char) (angle * M_2_PI);
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/TrigMath.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/TrigMath.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,66 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    Provides basic vector operations.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: TrigMath.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_TrigMath_h__
+#define __Domain_Geometry_TrigMath_h__
+
+	#define UPPER_RIGHT_QUADRANT 	0
+	#define UPPER_LEFT_QUADRANT 	1
+	#define LOWER_LEFT_QUADRANT 	2
+	#define LOWER_RIGHT_QUADRANT 	3
+	
+	#ifndef M_PI
+		#define M_PI   3.14159265358979323846
+	#endif
+	#ifndef M_1_PI
+		#define M_1_PI 0.31830988618379067154
+	#endif
+	#ifndef M_2_PI
+		#define M_2_PI 0.63661977236758134308
+	#endif
+
+	#define StGermain_RadianToDegree(RAD) (180.0 * M_1_PI * (RAD))
+	#define StGermain_DegreeToRadian(DEG) (M_PI / 180.0 * (DEG))
+
+	void StGermain_RectangularToSpherical(double* sphericalCoords, double* rectangularCoords, Index dim) ;
+	void StGermain_SphericalToRectangular(double* rectangularCoords, double* sphericalCoords, Index dim) ;
+
+	double StGermain_TrigDomain(double angle) ;
+	char StGermain_TrigQuadrant(double angle) ;
+
+#endif /* __Domain_Geometry_TrigMath_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/VectorMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/VectorMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,477 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  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: VectorMath.c 4081 2007-04-27 06:20:07Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+
+#include "units.h"
+#include "types.h"
+#include "VectorMath.h"
+#include "TrigMath.h"
+
+#include <math.h>
+#include <assert.h>
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Macros
+*/
+
+
+/*--------------------------------------------------------------------------------------------------------------------------
+** Functions
+*/
+
+/** (Assumes 3D) Define a cross product of 2 vectors */
+void Vec_Cross3D( double* dst, double* a, double* b ) {
+	double	tmp[3];
+
+	tmp[0] = a[1] * b[2] - a[2] * b[1];
+	tmp[1] = a[2] * b[0] - a[0] * b[2];
+	tmp[2] = a[0] * b[1] - a[1] * b[0];
+
+	Vec_Set3D( dst, tmp );
+}
+
+/** (Assumes 3D) Divide a vector by a real */
+void Vec_Div2D( double* dst, double* a, double s ) {
+	double	inv = 1.0 / s;
+
+	Vec_Scale2D( dst, a, inv );
+}
+
+void Vec_Div3D( double* dst, double* a, double s ) {
+	double	inv = 1.0 / s;
+
+	Vec_Scale3D( dst, a, inv );
+}
+
+/** Calculate the normal of the vector. (ie length = 1 )*/
+void Vec_Norm3D( double* dst, double* a ) {
+	double	invMag = 1.0 / Vec_Mag3D( a );
+
+	Vec_Scale3D( dst, a, invMag );
+}
+
+void Vec_Norm2D( double* dst, double* a ) {
+	double	invMag = 1.0 / Vec_Mag2D( a );
+
+	Vec_Scale2D( dst, a, invMag );
+}
+
+/** Swap coordinates according to i,j, k index */
+void Vec_Swizzle( double* dst, double* src, unsigned char iInd, unsigned char jInd, unsigned char kInd ) {
+	assert( iInd < 3 && jInd < 3 && kInd < 3 );
+	
+	dst[0] = src[iInd];
+	dst[1] = src[jInd];
+	dst[2] = src[kInd];
+}
+
+
+/** StGermain_RotateVector takes an argument 'vectorToRotate', to rotate around a second vector 'axis' through an angle 
+'theta' radians. The rotated vector is stored in vector from the first argument. Each vector: 'rotatedVector', 
+'vectorToRotate' and 'axis' must be the size of 3 doubles. The function uses Rodrigues' Rotation Formula 
+which was taken from: 
+Eric W. Weisstein et al. "Rodrigues' Rotation Formula." From MathWorld--A Wolfram Web Resource. 
+http://mathworld.wolfram.com/RodriguesRotationFormula.html. */
+void StGermain_RotateVector(double* rotatedVector, double* vector, double* w, double theta) {
+	double rotationMatrix[3][3]; 	/* Indicies [Column][Row] */
+	double cosTheta = cos(theta);
+	double sinTheta = sin(theta);
+	
+	rotationMatrix[0][0] = cosTheta + w[0] * w[0] * (1.0 - cosTheta);
+	rotationMatrix[0][1] = w[0] * w[1] * (1.0 - cosTheta) - w[2] * sinTheta;
+	rotationMatrix[0][2] = w[1] * sinTheta + w[0] * w[2] * (1.0 - cosTheta);
+
+	rotationMatrix[1][0] = w[2] * sinTheta + w[0] * w[1] * (1.0 - cosTheta);
+	rotationMatrix[1][1] = cosTheta + w[1] * w[1] * (1.0 - cosTheta);
+	rotationMatrix[1][2] = -w[0] * sinTheta + w[1] * w[2] * (1.0 - cosTheta);
+	
+	rotationMatrix[2][0] = -w[1] * sinTheta + w[0] * w[2] * (1.0 - cosTheta);
+	rotationMatrix[2][1] = w[0] * sinTheta + w[1] * w[2] * (1.0 - cosTheta);
+	rotationMatrix[2][2] = cosTheta + w[2] * w[2] * (1.0 - cosTheta);
+
+	rotatedVector[0] = rotationMatrix[0][0]*vector[0] + rotationMatrix[0][1]*vector[1] + rotationMatrix[0][2]*vector[2];
+	rotatedVector[1] = rotationMatrix[1][0]*vector[0] + rotationMatrix[1][1]*vector[1] + rotationMatrix[1][2]*vector[2];
+	rotatedVector[2] = rotationMatrix[2][0]*vector[0] + rotationMatrix[2][1]*vector[1] + rotationMatrix[2][2]*vector[2];
+}		
+
+/** StGermain_RotateCoordinateAxis multiplies a vector with a Rotation Matrix to rotate it around a co-ordinate axis -
+Is a simpler function than StGermain_RotateVector for more specific cases where the vector is to be rotated around one of the axes of the co-ordinate system. The arguments are the same except the the 'axis' argument is of type 'Index' which could be either I_AXIS, J_AXIS or K_AXIS. Vectors have to be the size of 3 doubles.
+See, Eric W. Weisstein. "Rotation Matrix." 
+From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/RotationMatrix.htm */
+void StGermain_RotateCoordinateAxis( double* rotatedVector, double* vector, Index axis, double theta ) {
+	
+	/* Rotation around one axis will always leave the component on that axis alone */
+	rotatedVector[axis] = vector[axis];
+	
+	switch (axis) {
+		case K_AXIS: /* Rotate around Z axis */
+			rotatedVector[0] =  vector[0]*cos(theta) - vector[1]*sin(theta);
+			rotatedVector[1] =  vector[0]*sin(theta) + vector[1]*cos(theta);
+			return;
+		case I_AXIS:  /* Rotate around X axis */
+			rotatedVector[1] =  vector[1]*cos(theta) - vector[2]*sin(theta);
+			rotatedVector[2] =  vector[1]*sin(theta) + vector[2]*cos(theta);
+			return;
+		case J_AXIS: /* Rotate around Y axis */
+			rotatedVector[0] =  vector[0]*cos(theta) + vector[2]*sin(theta);
+			rotatedVector[2] = -vector[0]*sin(theta) + vector[2]*cos(theta);
+			return;
+		default: {
+			Stream* error = Journal_Register( ErrorStream_Type, "VectorMath" );
+			Journal_Printf( error, "Impossible axis to rotate around in %s.", __func__);
+			exit(EXIT_FAILURE);
+		}
+	}
+}
+
+/** Subtracts one vector from another - 
+destination = vector1 - vector2
+Destination vector may be the same as either of the other two input vectors 
+Function is optimised for 1-3 dimensions but will work for any dimension */
+void StGermain_VectorSubtraction(double* destination, double* vector1, double* vector2, Index dim) {
+	switch (dim) {
+		case 3: 
+			destination[2] = vector1[2] - vector2[2];
+		case 2:
+			destination[1] = vector1[1] - vector2[1];
+		case 1: 
+			destination[0] = vector1[0] - vector2[0];
+			return;
+		default: {
+			Index d;
+			for ( d = 0 ; d < dim ; d++ ) 
+				destination[d] = vector1[d] - vector2[d];
+			return;
+		}
+	}	
+}
+
+/** Adds two vectors - 
+destination = vector1 + vector2
+Destination vector may be the same as either of the other two input vectors 
+Function is optimised for 1-3 dimensions but will work for any dimension */
+void StGermain_VectorAddition(double* destination, double* vector1, double* vector2, Index dim) {
+	switch (dim) {
+		case 3: 
+			destination[2] = vector1[2] + vector2[2];
+		case 2:
+			destination[1] = vector1[1] + vector2[1];
+		case 1: 
+			destination[0] = vector1[0] + vector2[0];
+			return;
+		default: {
+			Index d;
+			for ( d = 0 ; d < dim ; d++ ) 
+				destination[d] = vector1[d] + vector2[d];
+			return;
+		}
+	}	
+}
+
+/** StGermain_VectorMagnitude calculates the magnitude of a vector
+|v| = \sqrt{ v . v } 
+This function uses function StGermain_VectorDotProduct to calculate v . v. 
+Vector has to be of size dim doubles */
+double StGermain_VectorMagnitude(double* vector, Index dim) {
+	return sqrt(StGermain_VectorDotProduct(vector,vector,dim));
+}
+
+/** StGermain_VectorDotProduct calculates the magnitude of a vector
+|v| = \sqrt{ v . v } 
+This function uses function StGermain_VectorDotProduct to calculate v . v. 
+Vectors have to be of size dim doubles
+*/
+double StGermain_VectorDotProduct(double* vector1, double* vector2, Index dim) {
+	double dotProduct = 0.0;
+
+	switch (dim) {
+		case 3:	
+			dotProduct = dotProduct + vector1[2] * vector2[2];
+		case 2:
+			dotProduct = dotProduct + vector1[1] * vector2[1];
+		case 1:
+			dotProduct = dotProduct + vector1[0] * vector2[0];
+			break;
+		default: {
+			Index d;
+			for ( d = 0 ; d < dim ; d++ ) 
+				dotProduct = dotProduct + vector1[d] * vector2[d];
+			break;
+		}
+	}
+	
+	return dotProduct;
+}
+
+/** See Eric W. Weisstein. "Cross Product." 
+From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/CrossProduct.html 
+Tested against http://www.engplanet.com/redirect.html?3859 */
+void StGermain_VectorCrossProduct(double* destination, double* vector1, double* vector2) {
+	destination[0] = vector1[1]*vector2[2] - vector1[2]*vector2[1];
+	destination[1] = vector1[2]*vector2[0] - vector1[0]*vector2[2];
+	destination[2] = vector1[0]*vector2[1] - vector1[1]*vector2[0];
+}
+
+/** StGermain_VectorCrossProductMagnitude - See Eric W. Weisstein. "Cross Product." 
+From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/CrossProduct.html 
+|a \times b| = |a||b|\sqrt{ 1 - (\hat a . \hat b)^2}
+*/
+double StGermain_VectorCrossProductMagnitude( double* vector1, double* vector2, Dimension_Index dim ) {
+	double mag1       = StGermain_VectorMagnitude( vector1, dim );
+	double mag2       = StGermain_VectorMagnitude( vector2, dim );
+	double dotProduct = StGermain_VectorDotProduct( vector1, vector2, dim );
+	
+	return mag1 * mag2 * sqrt( 1.0 - dotProduct * dotProduct / (mag1 * mag1 * mag2 * mag2) );
+}
+
+
+/** StGermain_ScalarTripleProduct - Calculates the scalar vector product of three vectors -
+ * see Eric W. Weisstein. "Scalar Triple Product." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/ScalarTripleProduct.html
+ * Assumes 3 Dimensions */
+double StGermain_ScalarTripleProduct( double* vectorA, double* vectorB, double* vectorC ) {
+	double crossProduct[3];
+	
+	StGermain_VectorCrossProduct( crossProduct, vectorB, vectorC );
+	return StGermain_VectorDotProduct( vectorA, crossProduct, 3 );
+}
+
+
+/** StGermain_VectorNormalise calculates the magnitude of a vector
+\hat v = frac{v} / {|v|}
+This function uses function StGermain_VectorDotProduct to calculate v . v. 
+Vector has to be of size dim doubles */
+void StGermain_VectorNormalise(double* vector, Index dim) {
+	double mag;
+
+	mag = StGermain_VectorMagnitude( vector , dim );
+	switch (dim) {
+		case 3: 
+			vector[2] = vector[2]/mag;
+		case 2:
+			vector[1] = vector[1]/mag;
+		case 1: 
+			vector[0] = vector[0]/mag;
+			break;
+		default: {
+			Index d;
+			for ( d = 0 ; d < dim ; d++ ) 
+				vector[d] = vector[d]/mag;
+			break;
+		}
+	}	
+}
+
+/** Finds the angle between two vectors 
+\cos{\theta} = \frac{a.b}{|a||b|}
+Uses StGermain_AngleBetweenVectors and StGermain_VectorMagnitude
+Vectors has to be of size dim doubles */
+double StGermain_AngleBetweenVectors( double* vectorA, double* vectorB, Index dim ) {
+	double dotProduct = StGermain_VectorDotProduct(vectorA, vectorB, dim);
+	double magA = StGermain_VectorMagnitude( vectorA, dim );
+	double magB = StGermain_VectorMagnitude( vectorB, dim );
+
+	double value = dotProduct/ (magA * magB);
+
+	if (value >= 1.0)
+		return 0.0;
+	if (value <= -1.0)
+		return M_PI;
+
+	return acos( value );
+}
+
+/** Calculates the distance between two points - given by their position vectors relative to the origin
+distance = |a - b|
+Uses StGermain_VectorSubtraction and StGermain_VectorMagnitude
+Position vectors have to be of size dim doubles */
+double StGermain_DistanceBetweenPoints( double* pos1, double* pos2, Index dim) {
+	double mag;
+	double *vector;
+	
+	/* Allocate memory */
+	vector = Memory_Alloc_Array( double, dim, "Vector" );
+	
+	/* vector between points */
+	StGermain_VectorSubtraction( vector, pos1, pos2, dim ) ;
+	mag = StGermain_VectorMagnitude( vector, dim );
+
+	Memory_Free( vector );
+	return mag;
+}
+
+/** Given three points which define a plane, StGermain_NormalToPlane will give the unit vector which is normal to that plane
+Uses StGermain_VectorSubtraction, StGermain_VectorCrossProduct and StGermain_VectorNormalise
+Position vectors and normal have to be of size 3 doubles */
+void StGermain_NormalToPlane( double* normal, double* pos0, double* pos1, double* pos2) {
+	double vector1[3], vector2[3];
+
+	StGermain_VectorSubtraction( vector1, pos1, pos0, 3) ;
+	StGermain_VectorSubtraction( vector2, pos2, pos0, 3) ;
+	
+	StGermain_VectorCrossProduct( normal, vector1, vector2 );
+
+	StGermain_VectorNormalise( normal, 3 );
+}
+
+#define ONE_THIRD 0.3333333333333333333
+/** Calculates the position vector to the centroid of a triangle whose verticies are given by position vectors 
+Position vectors have to be of size dim doubles */
+void StGermain_TriangleCentroid( double* centroid, double* pos0, double* pos1, double* pos2, Index dim) {
+
+	switch (dim) {
+		case 3:
+			centroid[2] = ONE_THIRD * (pos0[2] + pos1[2] + pos2[2]);
+		case 2: 
+			centroid[1] = ONE_THIRD * (pos0[1] + pos1[1] + pos2[1]);
+		case 1:
+			centroid[0] = ONE_THIRD * (pos0[0] + pos1[0] + pos2[0]);
+			return;
+		default: {
+			Index d;
+			for ( d = 0 ; d < dim ; d++ ) 
+				centroid[d] = ONE_THIRD * (pos0[d] + pos1[d] + pos2[d]);
+			return;
+		}
+	}
+}
+
+/** Calculates the area of a triangle whose verticies are given by position vectors 
+Position vectors have to be of size dim doubles 
+Only works for dim == 2 or dim == 3
+*/
+double StGermain_TriangleArea( double* pos0, double* pos1, double* pos2, Index dim ) {
+	double normal[3];
+	double vector1[3], vector2[3];
+	double area;
+
+	if (dim != 2 && dim != 3) return 0.0;
+
+	vector1[2] = vector2[2] = 0.0;
+
+	StGermain_VectorSubtraction( vector1, pos1, pos0, dim) ;
+	StGermain_VectorSubtraction( vector2, pos2, pos0, dim) ;
+
+	StGermain_VectorCrossProduct( normal, vector1, vector2 );
+	
+	area = 0.5 * StGermain_VectorMagnitude(normal, dim);
+	return area;
+}
+
+/** StGermain_ConvexQuadrilateralArea - See Eric W. Weisstein. "Quadrilateral." 
+ * From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Quadrilateral.html
+ * Area = \frac{1}{2}| p \times q | where p and q are diagonals of a convex polygon
+ * This function will not work for dim > 3 and verticies have to be given in a winding direction
+*/
+double StGermain_ConvexQuadrilateralArea( double* vertexCoord1, double* vertexCoord2, double* vertexCoord3, double* vertexCoord4, Dimension_Index dim ) {
+	Coord diagonal1;	
+	Coord diagonal2;
+
+	/* Calculate Diagonals */
+	StGermain_VectorSubtraction( diagonal1, vertexCoord3, vertexCoord1, dim );
+	StGermain_VectorSubtraction( diagonal2, vertexCoord4, vertexCoord2, dim );
+
+	return 0.5 * StGermain_VectorCrossProductMagnitude( diagonal1, diagonal2, dim );
+}
+
+/** StGermain_ParallelepipedVolume - Calculates the volume of parallelepiped -
+ * see Eric W. Weisstein et al. "Parallelepiped." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Parallelepiped.html
+ * Assumes 3 Dimensions */
+double StGermain_ParallelepipedVolume( 
+		double* coordLeftBottomFront, 
+		double* coordRightBottomFront, 
+		double* coordLeftTopFront, 
+		double* coordLeftBottomBack ) {
+
+	double vectorA[3], vectorB[3], vectorC[3];
+
+	/* Find vectors which define Parallelepiped */
+	StGermain_VectorSubtraction( vectorA, coordRightBottomFront, coordLeftBottomFront, 3 );
+	StGermain_VectorSubtraction( vectorB, coordLeftTopFront,     coordLeftBottomFront, 3 );
+	StGermain_VectorSubtraction( vectorC, coordLeftBottomBack,   coordLeftBottomFront, 3 );
+
+	return fabs( StGermain_ScalarTripleProduct( vectorA, vectorB, vectorC ) );
+}	
+
+/** StGermain_ParallelepipedVolumeFromCoordList - 
+ * shortcut for StGermain_ParallelepipedVolume - assuming nodes laid out in order of
+ * 	Left Bottom Front        
+ * 	Right Bottom Front        
+ * 	Right Top Front
+ * 	Left Top_Front             
+ * 	Left Bottom Back       
+ * 	Right Bottom Back      
+ * 	Right Top Back 
+ * 	Left Top Back   */
+double StGermain_ParallelepipedVolumeFromCoordList( Coord_List list ) {
+	return StGermain_ParallelepipedVolume( list[ 0 ], list[ 1 ], list[ 3 ], list[ 4 ] );
+}
+
+/** StGermain_AverageCoord - Does simple average of coordinates */
+void StGermain_AverageCoord( double* coord, double** coordList, Index count, Dimension_Index dim ) {
+	double factor = 1.0/(double)count;
+	Index  coord_I;
+	
+	/* Initialise */
+	coord[ I_AXIS ] = coord[ J_AXIS ] = coord[ K_AXIS ] = 0.0;
+
+	/* Sum verticies */
+	for ( coord_I = 0 ; coord_I < count ; coord_I++ ) {
+		coord[ I_AXIS ] += coordList[ coord_I ][ I_AXIS ];
+		coord[ J_AXIS ] += coordList[ coord_I ][ J_AXIS ];
+		if (dim == 3)
+			coord[ K_AXIS ] += coordList[ coord_I ][ K_AXIS ];
+	}
+
+	/* Find Average */
+	coord[ I_AXIS ] *= factor;
+	coord[ J_AXIS ] *= factor;
+	if (dim == 3)
+		coord[ K_AXIS ] *= factor;
+}
+/** Prints a vector of any non-zero positive length 
+Uses %lf print statement*/
+void StGermain_PrintVector( Stream* stream, double* vector, Index dim ) {
+	Index d;
+
+	if ( dim <= 0 ) {
+		Journal_Printf( stream, "{<NON_POSITIVE DIMENSION %d>}\n", dim );
+		return;
+	}
+
+	Journal_Printf( stream, "{");
+	for ( d = 0 ; d < dim - 1 ; d++ ) 
+		Journal_Printf( stream, "%lf, ", vector[d] );
+	
+	Journal_Printf( stream, "%lf}\n", vector[d] );
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/VectorMath.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/VectorMath.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,163 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    Provides basic vector operations.
+**
+** Assumptions:
+**    - Coord is an array of 3 doubles.
+**
+** Comments:
+**    In any operation that involves two or more input vectors, those vectors 
+**    may be one and the same; it may be assumed that such an occurence will be
+**    handled.
+**
+** $Id: VectorMath.h 4081 2007-04-27 06:20:07Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_VectorMath_h__
+#define __Domain_Geometry_VectorMath_h__
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Macros
+	*/
+
+	#define Vec_Set2D( dst, src )			\
+		((dst)[0] = (src)[0],			\
+		 (dst)[1] = (src)[1], 0)
+
+	#define Vec_Set3D( dst, src )			\
+		(Vec_Set2D( dst, src ),			\
+		 (dst)[2] = (src)[2], 0)
+
+	#define Vec_SetScalar2D( dst, x, y )		\
+		((dst)[0] = x,				\
+		 (dst)[1] = y, 0)
+
+	#define Vec_SetScalar3D( dst, x, y, z )		\
+		(Vec_SetScalar2D( dst, x, y ),		\
+		 (dst)[2] = z, 0)
+
+	#define Vec_Add2D( dst, a, b )			\
+		((dst)[0] = (a)[0] + (b)[0],		\
+		 (dst)[1] = (a)[1] + (b)[1], 0)
+
+	#define Vec_Add3D( dst, a, b )			\
+		(Vec_Add2D( dst, a, b ),		\
+		 (dst)[2] = (a)[2] + (b)[2], 0)
+
+	#define Vec_Sub2D( dst, a, b )			\
+		((dst)[0] = (a)[0] - (b)[0],		\
+		 (dst)[1] = (a)[1] - (b)[1], 0)
+
+	#define Vec_Sub3D( dst, a, b )			\
+		(Vec_Sub2D( dst, a, b ),		\
+		 (dst)[2] = (a)[2] - (b)[2], 0)
+
+	#define Vec_Dot2D( a, b )			\
+		((a)[0] * (b)[0] + (a)[1] * (b)[1])
+
+	#define Vec_Dot3D( a, b )			\
+		(Vec_Dot2D( a, b ) + (a)[2] * (b)[2])
+
+	#define Vec_Scale2D( dst, a, s )		\
+		((dst)[0] = (a)[0] * (s),		\
+		 (dst)[1] = (a)[1] * (s), 0)
+
+	#define Vec_Scale3D( dst, a, s )		\
+		(Vec_Scale2D( dst, a, s ),		\
+		 (dst)[2] = (a)[2] * (s), 0)
+
+	#define Vec_MagSq2D( a )			\
+		Vec_Dot2D( a, a )
+
+	#define Vec_MagSq3D( a )			\
+		Vec_Dot3D( a, a )
+
+	#define Vec_Mag2D( a )				\
+		sqrt( Vec_MagSq2D( a ) )
+
+	#define Vec_Mag3D( a )				\
+		sqrt( Vec_MagSq3D( a ) )
+
+	#define Vec_Proj2D( dst, a, b )					\
+		(Vec_Norm2D( dst, b ),					\
+		 Vec_Scale2D( dst, dst, Vec_Dot2D( a, b ) ), 0)
+
+	#define Vec_Proj3D( dst, a, b )					\
+		(Vec_Norm3D( dst, b ),					\
+		 Vec_Scale3D( dst, dst, Vec_Dot3D( a, b ) ), 0)
+
+
+	/*--------------------------------------------------------------------------------------------------------------------------
+	** Functions
+	*/
+
+	void Vec_Cross3D( double* dst, double* a, double* b );
+	void Vec_Div2D( double* dst, double* a, double s );
+	void Vec_Div3D( double* dst, double* a, double s );
+	void Vec_Norm2D( double* dst, double* a );
+	void Vec_Norm3D( double* dst, double* a );
+
+	void StGermain_RotateVector(double* rotatedVector, double* vector, double* w, double theta) ;
+	void StGermain_RotateCoordinateAxis( double* rotatedVector, double* vector, Index axis, double theta ) ;
+	void StGermain_VectorSubtraction(double* destination, double* vector1, double* vector2, Index dim) ;
+	void StGermain_VectorAddition(double* destination, double* vector1, double* vector2, Index dim) ;
+	double StGermain_VectorMagnitude(double* vector, Index dim) ;
+	double StGermain_VectorDotProduct(double* vector1, double* vector2, Index dim) ;
+	void StGermain_VectorCrossProduct(double* destination, double* vector1, double* vector2) ;
+	double StGermain_VectorCrossProductMagnitude( double* vector1, double* vector2, Dimension_Index dim ) ;
+	double StGermain_ScalarTripleProduct( double* vectorA, double* vectorB, double* vectorC ) ;
+
+	void StGermain_VectorNormalise(double* vector, Index dim) ;
+	double StGermain_AngleBetweenVectors( double* vectorA, double* vectorB, Index dim ) ;
+	double StGermain_DistanceBetweenPoints( double* pos1, double* pos2, Index dim) ;
+	void StGermain_NormalToPlane( double* normal, double* pos0, double* pos1, double* pos2) ;
+
+	void StGermain_TriangleCentroid( double* centroid, double* pos0, double* pos1, double* pos2, Index dim) ;
+	double StGermain_TriangleArea( double* pos0, double* pos1, double* pos2, Index dim ) ;
+	double StGermain_ConvexQuadrilateralArea( double* vertexCoord1, double* vertexCoord2, 
+						  double* vertexCoord3, double* vertexCoord4, 
+						  Dimension_Index dim ) ;
+	double StGermain_ParallelepipedVolume( double* coordLeftBottomFront, 
+					       double* coordRightBottomFront, 
+					       double* coordLeftTopFront, 
+					       double* coordLeftBottomBack );
+	double StGermain_ParallelepipedVolumeFromCoordList( Coord_List list ) ;
+	
+	void StGermain_AverageCoord( double* coord, double** coordList, Index count, Dimension_Index dim ) ;
+	void StGermain_PrintVector( Stream* stream, double* vector, Index dim ) ;
+
+	/** Print a named vector. Name comes from vector variable in file*/
+	#define StGermain_PrintNamedVector(stream, vector, dim)		\
+		do {							\
+			Journal_Printf( stream, #vector " - " );	\
+			StGermain_PrintVector( stream, vector, dim );	\
+		} while(0)
+
+#endif /* __Domain_Geometry_VectorMath_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/isinf.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/isinf.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,50 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	isinf is a popular macro but doesn't is not standard... this file implements it for systems that dont.
+**
+** Assumptions:
+**	Implemented for OSF... no idea about others at this time
+**
+** Comments:
+**
+** $Id: isinf.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_isinf_h__
+#define __Domain_Geometry_isinf_h__
+	
+	#include <math.h>
+	
+	#ifndef isinf
+		#define isinf( value )	( finite( value ) ? 0 : isnan( value ) ? 0 : 1 )
+	#endif
+	
+#endif /* __Domain_Geometry_isinf_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/makefile	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,127 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+##
+## Authors:
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: makefile 3982 2007-01-23 03:52:15Z 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 = StgDomainGeometry
+libstatic = yes
+libdynamic = yes
+includes = StgDomain/Geometry
+
+SRCS = \
+	Dimension.c \
+	VectorMath.c \
+	TensorMath.c \
+	TrigMath.c \
+	ComplexMath.c \
+	Line.c \
+	Plane.c \
+	Edge.c \
+	RMatrix.c \
+	Topology.c \
+	IJKTopology.c \
+	IJK6Topology.c \
+	IJK26Topology.c \
+	IrregTopology.c \
+	GeometryClass.c \
+	BlockGeometry.c \
+	RefinedRegionsGeometry.c \
+	ShellGeometry.c \
+	IrregGeometry.c \
+	QuadEdge.c \
+	Delaunay.c \
+	ParallelDelaunay.c \
+	Init.c \
+	Finalise.c \
+	ComplexVectorMath.c \
+	TensorMultMath.c \
+	Simplex.c \
+	Hex.c
+ifdef USE_OPTIONAL_MATH
+	SRCS += FullTensorMath.c
+endif
+
+HDRS = \
+	units.h \
+	types.h \
+	isinf.h \
+	Dimension.h \
+	VectorMath.h \
+	TensorMath.h \
+	TrigMath.h \
+	ComplexMath.h \
+	Line.h \
+	Plane.h \
+	Edge.h \
+	RMatrix.h \
+	Topology.h \
+	IJKTopology.h \
+	IJK6Topology.h \
+	IJK26Topology.h \
+	IrregTopology.h \
+	GeometryClass.h \
+	ShellGeometry.h \
+	BlockGeometry.h \
+	RefinedRegionsGeometry.h \
+	IrregGeometry.h \
+	QuadEdge.h \
+	Delaunay.h \
+	ParallelDelaunay.h \
+	Init.h \
+	Finalise.h \
+	Geometry.h \
+	ComplexVectorMath.h \
+	stg_lapack.h \
+	FullTensorMath.h \
+	TensorMultMath.h \
+	Simplex.h \
+	Hex.h
+
+PROJ_CFLAGS += ${F77_SYMBOL_TRANSLATION}
+EXTERNAL_INCLUDES = 
+EXTERNAL_LIBS = #-L${LIB_DIR} ${RPATH_LFLAGS}
+
+packages = STGERMAIN MPI XML
+
+ifdef USE_OPTIONAL_MATH
+	# For full tensor math it needs some blas lapack functions only if available
+	packages := LAPACK_BLAS ${packages}
+endif
+
+ifdef SYSTEM_SIZEOF_LONG
+	PROJ_CFLAGS += -DSYSTEM_SIZEOF_LONG=${SYSTEM_SIZEOF_LONG}
+endif
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/stg_lapack.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/stg_lapack.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,55 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** Role:
+**    The Lapack headers in c.
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id: ComplexMath.h 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_stg_lapack_h__
+#define __Domain_Geometry_stg_lapack_h__
+
+#ifdef FORTRAN_NORMAL
+	#define stg_dgeev dgeev
+#elif FORTRAN_SINGLE_TRAILINGBAR
+	#define stg_dgeev dgeev_
+#elif FORTRAN_DOUBLE_TRAILINGBAR
+	#define stg_dgeev dgeev__
+#elif FORTRAN_UPPERCASE
+	#define stg_dgeev DGEEV
+#else 
+	/* FALLBACK - eg for Intel MKL C implementation*/
+	#define stg_dgeev dgeev
+#endif	
+
+#endif
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/types.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/types.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,114 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	Basic framework types.
+**
+** Assumptions:
+**	None as yet.
+**
+** Comments:
+**	None as yet.
+**
+** $Id: types.h 4026 2007-03-13 11:42:25Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_types_h__
+#define __Domain_Geometry_types_h__
+
+
+	typedef Index		NeighbourIndex;
+
+	/** Describes a plane in 3D space, ie. Ax + By + Cz = d */
+	typedef double		Plane[4];             
+	/** Type used for indexing into lists of planes */ 
+	typedef Index		Plane_Index;
+	typedef Plane*		Plane_List;
+
+
+	/** Stores three indices per triangle, each index refering to a coordinate stored in an external list */
+	typedef Index		Triangle[3];
+	/** Type used for indexing into lists of triangles */
+	typedef Index		Triangle_Index;
+	/** A type used to point to the head of a list of triangles */
+	typedef Triangle*	Triangle_List;
+	
+	/** Stores the three planes needed to describe the 3D boundary of a triangle */
+	typedef Plane		TriangleBoundary[3];
+
+	/** Describes an edge between two points. Stored as two indices into an external coordinate list */
+	typedef Index		Edge[2];
+	/** Type used for indexing into lists of edges */
+	typedef Index		Edge_Index;
+	/** A type used to point to the head of a list of edges */
+	typedef Edge*		Edge_List;
+
+	/** Every edge can be touching at most two faces/elements/triangles. This type consists of two indices into
+	 an external list of faces/elements/triangles describing the faces touched by an edge. */	
+	typedef Index		EdgeFaces[2];
+	typedef EdgeFaces*	EdgeFaces_List;
+	typedef Index		EdgeFaces_Index;
+
+	typedef double		Stg_Line[4];
+	typedef Index		Line_Index;
+	typedef Stg_Line*	Stg_Line_List;
+
+	typedef Coord		Line3[2];
+	
+	
+	typedef double		RMatrix[9];
+	
+	typedef Index		Dimension_Index;
+	typedef Index		IJK[3];				/* ijk indices, positive, not constrained */
+	typedef Index*		Indices;			/* array/list of indices */
+	typedef enum Axis { I_AXIS=0, J_AXIS=1, K_AXIS=2 } Axis;
+
+	typedef Coord*				Coord_List;
+	typedef Index				Coord_Index;
+	typedef long int 			QuadEdgeRef;
+
+	typedef struct Topology			Topology;
+	typedef struct IJKTopology		IJKTopology;
+	typedef struct IJK6Topology		IJK6Topology;
+	typedef struct IJK26Topology	IJK26Topology;
+	typedef struct IrregTopology	IrregTopology;
+	typedef struct Geometry			Geometry;
+	typedef struct BlockGeometry	BlockGeometry;
+	typedef struct RefinedRegionsGeometry	RefinedRegionsGeometry;
+	typedef struct ShellGeometry	ShellGeometry;
+	typedef struct IrregGeometry	IrregGeometry;
+	typedef struct QuadEdge			QuadEdge;
+	typedef struct QuadEdgePool		QuadEdgePool;
+	typedef struct VoronoiVertexPool		VoronoiVertexPool;
+	typedef struct Delaunay			Delaunay;
+	typedef struct ParallelDelaunay	ParallelDelaunay;
+
+	
+#endif /* __Domain_Geometry_types_h__ */
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/src/units.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/src/units.h	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,67 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**	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 publishdify 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: units.h 3735 2006-08-01 08:05:14Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Domain_Geometry_units_h__
+#define __Domain_Geometry_units_h__
+
+	#define MAX_SYMMETRIC_TENSOR_COMPONENTS 6
+	#define MAX_TENSOR_COMPONENTS           9
+	
+	/** Defines a complex number as 2 doubles */
+	typedef double Cmplx[2];
+	/** Defines a set of 3 doubles */
+	typedef double XYZ[3];
+	typedef XYZ Coord;
+	/**Defines a set of 3 floats */
+	typedef float XYZF[3];
+	typedef XYZF CoordF;
+	/** Defines a set of 3 integers that can be used to index
+	into vectors */
+	typedef int XYZI[3];
+	typedef XYZI CoordI;
+	/** Defines a set of 3 Cmplx */
+	typedef Cmplx XYZC[3];
+	typedef XYZC CoordC;
+
+	typedef double SymmetricTensor[ MAX_SYMMETRIC_TENSOR_COMPONENTS ];
+	typedef double TensorArray[ MAX_TENSOR_COMPONENTS ];
+	typedef Cmplx ComplexTensorArray[MAX_TENSOR_COMPONENTS]; 
+
+#endif /* __Domain_Geometry_units_h__ */
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/Makefile.def
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/Makefile.def	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,73 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+##
+## Authors:
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: Makefile.def 3960 2007-01-11 02:20:49Z KathleenHumble $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+def_tst = libStGermainDiscretisationGeometry
+
+def_srcs = \
+	testDimensionMacros.c \
+	testVectorMath.c \
+	testTensorMath.c \
+	testTrigMath.c \
+	testComplexMath.c \
+	testEdge.c \
+	testPlane.c \
+	testLine.c \
+	testRMatrix.c \
+	testBlockGeometry.c \
+	testRefinedRegionsGeometry.c \
+	testShellGeometry.c \
+	testIrregGeometry.c \
+	testIJK6Topology.c \
+	testIJK26Topology.c \
+	testDelaunay.c \
+	testParallelDelaunay.c \
+	testComplexVectorMath.c \
+	testTensorMultMath.c
+	
+def_checks = \
+	testDimensionMacros.0of1.sh \
+	testVectorMath.0of1.sh \
+	testTensorMath.0of1.sh \
+	testTrigMath.0of1.sh \
+	testComplexMath.0of1.sh \
+	testEdge.0of1.sh \
+	testPlane.0of1.sh \
+	testLine.0of1.sh \
+	testBlockGeometry.0of1.sh \
+	testRefinedRegionsGeometry.0of1.sh \
+	testShellGeometry.0of1.sh \
+	testIrregGeometry.0of1.sh \
+	testIJK6Topology.0of1.sh \
+	testIJK26Topology.0of1.sh \
+	testDelaunay.0of1.sh \
+	testParallelDelaunay.0of1.sh \
+	testParallelDelaunay.0of2.sh \
+	testComplexVectorMath.0of1.sh \
+	testTensorMultMath.0of1.sh \
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/data/points.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/data/points.xml	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,47 @@
+<?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">
+	
+	<!-- using an <asciidata> tag without specifying syntax:- will read in
+	according to the data structure already defined in the code, or else just
+	add as a set of strings-->
+	<list name="pointList">
+		<asciidata>
+			<columnDefinition name="x" type="double"/>
+			<columnDefinition name="y" type="double"/>
+			<columnDefinition name="z" type="double"/>
+0.2 0.9 0.1
+0.1 0.7 0.0
+0.2 0.5 0.08
+0.3 0.3 0.1
+0.2 0.1 0.1
+
+0.3 0.9 0.3
+0.2 0.7 0.2
+0.3 0.5 0.28
+0.4 0.3 0.3
+0.3 0.1 0.3
+
+0.5 0.9 0.5
+0.4 0.7 0.4
+0.5 0.5 0.48
+0.6 0.3 0.4
+0.5 0.1 0.4
+
+0.7 0.9 0.7
+0.6 0.7 0.6
+0.7 0.5 0.68
+0.8 0.3 0.7
+0.7 0.1 0.7
+
+0.8 0.9 0.9
+0.7 0.7 0.8
+0.8 0.5 0.88
+0.9 0.3 0.9
+0.8 0.1 0.9
+
+		</asciidata>
+	</list>
+</StGermainData>
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/makefile	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,102 @@
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+##
+## Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+##
+## Authors:
+##	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+##	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+##	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+##	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+##	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+##	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+##
+##  This library is free software; you can redistribute it and/or
+##  modify it under the terms of the GNU Lesser General Public
+##  License as published by the Free Software Foundation; either
+##  version 2.1 of the License, or (at your option) any later version.
+##
+##  This library is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+##  Lesser General Public License for more details.
+##
+##  You should have received a copy of the GNU Lesser General Public
+##  License along with this library; if not, write to the Free Software
+##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+##
+## $Id: makefile 3982 2007-01-23 03:52:15Z 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
+
+tests = libStGermainDomainGeometry
+
+ifdef USE_OPTIONAL_MATH
+	def_checks += testFullTensorMath.0of1.sh
+endif
+	 
+SRCS = \
+	testDimensionMacros.c \
+	testVectorMath.c \
+	testTensorMath.c \
+	testTrigMath.c \
+	testComplexMath.c \
+	testEdge.c \
+	testPlane.c \
+	testLine.c \
+	testRMatrix.c \
+	testBlockGeometry.c \
+	testRefinedRegionsGeometry.c \
+	testShellGeometry.c \
+	testIrregGeometry.c \
+	testIJK6Topology.c \
+	testIJK26Topology.c \
+	testDelaunay.c \
+	testParallelDelaunay.c \
+	testComplexVectorMath.c \
+	testTensorMultMath.c
+ifdef USE_OPTIONAL_MATH
+	SRCS += testFullTensorMath.c
+endif 
+
+checks = \
+	testDimensionMacros.0of1.sh \
+	testVectorMath.0of1.sh \
+	testTensorMath.0of1.sh \
+	testTrigMath.0of1.sh \
+	testComplexMath.0of1.sh \
+	testEdge.0of1.sh \
+	testPlane.0of1.sh \
+	testLine.0of1.sh \
+	testBlockGeometry.0of1.sh \
+	testRefinedRegionsGeometry.0of1.sh \
+	testShellGeometry.0of1.sh \
+	testIrregGeometry.0of1.sh \
+	testIJK6Topology.0of1.sh \
+	testIJK26Topology.0of1.sh \
+	testDelaunay.0of1.sh \
+	testParallelDelaunay.0of1.sh \
+	testParallelDelaunay.0of2.sh \
+	testComplexVectorMath.0of1.sh \
+	testTensorMultMath.0of1.sh
+
+PROJ_LIBS = 
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT}
+EXTERNAL_LIBS = -L${LIB_DIR} -lStgDomainGeometry ${RPATH_LFLAGS} 
+
+packages = STGERMAIN MPI XML MATH
+
+ifdef USE_OPTIONAL_MATH
+	# For full tensor math it needs some blas lapack functions only if available
+	packages := LAPACK_BLAS ${packages}
+	ifneq (Darwin,${SYSTEM})
+		EXTERNAL_LIBS +=  -lg2c
+	endif
+endif
+
+include ${PROJ_ROOT}/Makefile.vmake
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/small.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/small.txt	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,18 @@
+17
+1.000000 0.000000
+0.923880 0.382683
+0.707107 0.707107
+0.382683 0.923880
+0.000000 1.000000
+-0.382683 0.923880
+-0.707107 0.707107
+-0.923880 0.382683
+-1.000000 0.000000
+-0.923880 -0.382683
+-0.707107 -0.707107
+-0.382683 -0.923880
+-0.000000 -1.000000
+0.382683 -0.923880
+0.707107 -0.707107
+0.923880 -0.382683
+0.000000 0.000000
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testBlockGeometry.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testBlockGeometry.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,133 @@
+StGermain Framework. Copyright (C) 2003-2005 VPAC.
+Individual point test:
+	Point 0 : { 0, 0, 0 }
+	Point 1 : { 0.333333, 0, 0 }
+	Point 2 : { 0.666667, 0, 0 }
+	Point 3 : { 1, 0, 0 }
+	Point 4 : { 0, 0.333333, 0 }
+	Point 5 : { 0.333333, 0.333333, 0 }
+	Point 6 : { 0.666667, 0.333333, 0 }
+	Point 7 : { 1, 0.333333, 0 }
+	Point 8 : { 0, 0.666667, 0 }
+	Point 9 : { 0.333333, 0.666667, 0 }
+	Point 10 : { 0.666667, 0.666667, 0 }
+	Point 11 : { 1, 0.666667, 0 }
+	Point 12 : { 0, 1, 0 }
+	Point 13 : { 0.333333, 1, 0 }
+	Point 14 : { 0.666667, 1, 0 }
+	Point 15 : { 1, 1, 0 }
+	Point 16 : { 0, 0, 0.333333 }
+	Point 17 : { 0.333333, 0, 0.333333 }
+	Point 18 : { 0.666667, 0, 0.333333 }
+	Point 19 : { 1, 0, 0.333333 }
+	Point 20 : { 0, 0.333333, 0.333333 }
+	Point 21 : { 0.333333, 0.333333, 0.333333 }
+	Point 22 : { 0.666667, 0.333333, 0.333333 }
+	Point 23 : { 1, 0.333333, 0.333333 }
+	Point 24 : { 0, 0.666667, 0.333333 }
+	Point 25 : { 0.333333, 0.666667, 0.333333 }
+	Point 26 : { 0.666667, 0.666667, 0.333333 }
+	Point 27 : { 1, 0.666667, 0.333333 }
+	Point 28 : { 0, 1, 0.333333 }
+	Point 29 : { 0.333333, 1, 0.333333 }
+	Point 30 : { 0.666667, 1, 0.333333 }
+	Point 31 : { 1, 1, 0.333333 }
+	Point 32 : { 0, 0, 0.666667 }
+	Point 33 : { 0.333333, 0, 0.666667 }
+	Point 34 : { 0.666667, 0, 0.666667 }
+	Point 35 : { 1, 0, 0.666667 }
+	Point 36 : { 0, 0.333333, 0.666667 }
+	Point 37 : { 0.333333, 0.333333, 0.666667 }
+	Point 38 : { 0.666667, 0.333333, 0.666667 }
+	Point 39 : { 1, 0.333333, 0.666667 }
+	Point 40 : { 0, 0.666667, 0.666667 }
+	Point 41 : { 0.333333, 0.666667, 0.666667 }
+	Point 42 : { 0.666667, 0.666667, 0.666667 }
+	Point 43 : { 1, 0.666667, 0.666667 }
+	Point 44 : { 0, 1, 0.666667 }
+	Point 45 : { 0.333333, 1, 0.666667 }
+	Point 46 : { 0.666667, 1, 0.666667 }
+	Point 47 : { 1, 1, 0.666667 }
+	Point 48 : { 0, 0, 1 }
+	Point 49 : { 0.333333, 0, 1 }
+	Point 50 : { 0.666667, 0, 1 }
+	Point 51 : { 1, 0, 1 }
+	Point 52 : { 0, 0.333333, 1 }
+	Point 53 : { 0.333333, 0.333333, 1 }
+	Point 54 : { 0.666667, 0.333333, 1 }
+	Point 55 : { 1, 0.333333, 1 }
+	Point 56 : { 0, 0.666667, 1 }
+	Point 57 : { 0.333333, 0.666667, 1 }
+	Point 58 : { 0.666667, 0.666667, 1 }
+	Point 59 : { 1, 0.666667, 1 }
+	Point 60 : { 0, 1, 1 }
+	Point 61 : { 0.333333, 1, 1 }
+	Point 62 : { 0.666667, 1, 1 }
+	Point 63 : { 1, 1, 1 }
+
+Total point test:
+	Point 0 : { 0, 0, 0 }
+	Point 1 : { 0.333333, 0, 0 }
+	Point 2 : { 0.666667, 0, 0 }
+	Point 3 : { 1, 0, 0 }
+	Point 4 : { 0, 0.333333, 0 }
+	Point 5 : { 0.333333, 0.333333, 0 }
+	Point 6 : { 0.666667, 0.333333, 0 }
+	Point 7 : { 1, 0.333333, 0 }
+	Point 8 : { 0, 0.666667, 0 }
+	Point 9 : { 0.333333, 0.666667, 0 }
+	Point 10 : { 0.666667, 0.666667, 0 }
+	Point 11 : { 1, 0.666667, 0 }
+	Point 12 : { 0, 1, 0 }
+	Point 13 : { 0.333333, 1, 0 }
+	Point 14 : { 0.666667, 1, 0 }
+	Point 15 : { 1, 1, 0 }
+	Point 16 : { 0, 0, 0.333333 }
+	Point 17 : { 0.333333, 0, 0.333333 }
+	Point 18 : { 0.666667, 0, 0.333333 }
+	Point 19 : { 1, 0, 0.333333 }
+	Point 20 : { 0, 0.333333, 0.333333 }
+	Point 21 : { 0.333333, 0.333333, 0.333333 }
+	Point 22 : { 0.666667, 0.333333, 0.333333 }
+	Point 23 : { 1, 0.333333, 0.333333 }
+	Point 24 : { 0, 0.666667, 0.333333 }
+	Point 25 : { 0.333333, 0.666667, 0.333333 }
+	Point 26 : { 0.666667, 0.666667, 0.333333 }
+	Point 27 : { 1, 0.666667, 0.333333 }
+	Point 28 : { 0, 1, 0.333333 }
+	Point 29 : { 0.333333, 1, 0.333333 }
+	Point 30 : { 0.666667, 1, 0.333333 }
+	Point 31 : { 1, 1, 0.333333 }
+	Point 32 : { 0, 0, 0.666667 }
+	Point 33 : { 0.333333, 0, 0.666667 }
+	Point 34 : { 0.666667, 0, 0.666667 }
+	Point 35 : { 1, 0, 0.666667 }
+	Point 36 : { 0, 0.333333, 0.666667 }
+	Point 37 : { 0.333333, 0.333333, 0.666667 }
+	Point 38 : { 0.666667, 0.333333, 0.666667 }
+	Point 39 : { 1, 0.333333, 0.666667 }
+	Point 40 : { 0, 0.666667, 0.666667 }
+	Point 41 : { 0.333333, 0.666667, 0.666667 }
+	Point 42 : { 0.666667, 0.666667, 0.666667 }
+	Point 43 : { 1, 0.666667, 0.666667 }
+	Point 44 : { 0, 1, 0.666667 }
+	Point 45 : { 0.333333, 1, 0.666667 }
+	Point 46 : { 0.666667, 1, 0.666667 }
+	Point 47 : { 1, 1, 0.666667 }
+	Point 48 : { 0, 0, 1 }
+	Point 49 : { 0.333333, 0, 1 }
+	Point 50 : { 0.666667, 0, 1 }
+	Point 51 : { 1, 0, 1 }
+	Point 52 : { 0, 0.333333, 1 }
+	Point 53 : { 0.333333, 0.333333, 1 }
+	Point 54 : { 0.666667, 0.333333, 1 }
+	Point 55 : { 1, 0.333333, 1 }
+	Point 56 : { 0, 0.666667, 1 }
+	Point 57 : { 0.333333, 0.666667, 1 }
+	Point 58 : { 0.666667, 0.666667, 1 }
+	Point 59 : { 1, 0.666667, 1 }
+	Point 60 : { 0, 1, 1 }
+	Point 61 : { 0.333333, 1, 1 }
+	Point 62 : { 0.666667, 1, 1 }
+	Point 63 : { 1, 1, 1 }
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testBlockGeometry.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testBlockGeometry.0of1.sh	Wed Oct 10 07:21:38 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 "testBlockGeometry " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testBlockGeometry.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testBlockGeometry.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,98 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testBlockGeometry.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+
+
+int main( int argc, char* argv[] ) {
+	Dictionary*	dictionary;
+	Geometry*	geometry;
+	Coord_List	points;
+	Index		i;
+	MPI_Comm	CommWorld;
+	int		rank;
+	int		numProcessors;
+	
+	/* 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 );
+	
+	StgDomainGeometry_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	dictionary = Dictionary_New();
+	Dictionary_Add( dictionary, "meshSizeI", Dictionary_Entry_Value_FromUnsignedInt( 4 ) );
+	Dictionary_Add( dictionary, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( 4 ) );
+	Dictionary_Add( dictionary, "meshSizeK", Dictionary_Entry_Value_FromUnsignedInt( 4 ) );
+	
+	geometry = (Geometry*)BlockGeometry_New( "blockGeometry", dictionary );
+	
+	printf( "Individual point test:\n" );
+	for( i = 0; i < geometry->pointCount; i++ ) {
+		Coord point;
+		
+		printf( "\tPoint %u : ", i );
+		geometry->pointAt( geometry, i, point );
+		printf( "{ %g, %g, %g }\n", point[0], point[1], point[2] );
+	}
+	printf( "\n" );
+	
+	printf( "Total point test:\n" );
+	points = Memory_Alloc_Array( Coord, geometry->pointCount, "points" );
+	geometry->buildPoints( geometry, points );
+	for( i = 0; i < geometry->pointCount; i++ ) {
+		printf( "\tPoint %u : ", i );
+		geometry->pointAt( geometry, i, points[i] );
+		printf( "{ %g, %g, %g }\n", points[i][0], points[i][1], points[i][2] );
+	}
+	printf( "\n" );
+	if( points )
+		Memory_Free( points );
+	
+	Stg_Class_Delete( dictionary );
+	
+	StgDomainGeometry_Finalise();
+	
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testComplexMath.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testComplexMath.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,74 @@
+StGermain Framework revision 3839. Copyright (C) 2003-2005 VPAC.
+
+----------------- Testing Complex Journal Printing Macro -----------------
+x = 1.0000000 + 2.0000000 i
+y = -1.5000000 + 3.0000000 i
+u = -1.5000000 - 3.0000000 i
+v = 1.5000000 - 3.0000000 i
+i = 0.0000000 + 1.0000000 i
+
+----------------- Testing Addition -----------------
+dest = -0.5000000 + 5.0000000 i
+x = -0.5000000 + 5.0000000 i
+
+----------------- Testing Subtraction -----------------
+x = 1.0000000 + 2.0000000 i
+dest = 2.5000000 - 1.0000000 i
+
+----------------- Testing Multiplication -----------------
+dest = -7.5000000 + 0.0000000 i
+y = -7.5000000 + 0.0000000 i
+
+----------------- Testing Division -----------------
+y = -1.5000000 + 3.0000000 i
+dest = 0.4000000 - 0.5333333 i
+
+----------------- Testing Real Number Math stuff -----------------
+dest = 0.5000000 + 3.0000000 i
+dest = 5.5000000 - 3.0000000 i
+dest = -0.1500000 + 0.3000000 i
+dest = -0.1333333 - 0.2666667 i
+Answer within tolerance 1e-15 of 1.00000 + i 0.00000
+
+----------------- Testing Conjugate -----------------
+x = 1.0000000 - 2.0000000 i
+x = 1.0000000 + 2.0000000 i
+
+----------------- Testing Complex Polar Stuff -----------------
+x = 2.2361 e^{i 1.1071} = 1.0000 + 2.0000
+y = 3.3541 e^{i 2.0344} = -1.5000 + 3.0000
+u = 3.3541 e^{i -2.0344} = -1.5000 + -3.0000
+v = 3.3541 e^{i -1.1071} = 1.5000 + -3.0000
+i = 1.0000 e^{i 1.5708} = 0.0000 + 1.0000
+-i = 1.0000 e^{i -1.5708} = 0.0000 + -1.0000
+
+----------------- Testing Complex to real Power Stuff -----------------
+dest = -3.0000000 + 4.0000000 i
+dest = -3.0000000 + 4.0000000 i
+dest = -11.0000000 - 2.0000000 i
+dest = -11.0000000 - 2.0000000 i
+dest = 0.9628349 + 1.5578995 i
+dest = -1.5000000 + 3.0000000 i
+
+----------------- Testing Complex to complex Power Stuff -----------------
+dest = 0.0078744 + 0.0073865 i
+
+----------------- Testing The Most Beautiful Equation in Mathematics e^{i \pi} + 1 = 0 -----------------
+e^{i \pi} = dest = -1.0000000 + 0.0000000 i
+
+----------------- Another Beautiful Equation i^i = e^{-\pi/2} -----------------
+e^{-\pi/2} = 0.20788 = dest = 0.2078796 + 0.0000000 i
+
+----------------- Testing Exponential -----------------
+e^{2 + 3i} = dest = -7.3151101 + 1.0427437 i
+dest = -7.3151101 + 1.0427437 i
+e^{-5 + 7i} = dest = 0.0050798 + 0.0044267 i
+dest = 0.0050798 + 0.0044267 i
+e^{i \pi} = dest = -1.0000000 + 0.0000000 i
+
+----------------- Testing Copy and Zero -----------------
+x = -5.0000000 + 7.0000000 i
+dest = -1.0000000 + 0.0000000 i
+dest = -5.0000000 + 7.0000000 i
+dest = 0.0000000 + 0.0000000 i
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testComplexMath.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testComplexMath.0of1.sh	Wed Oct 10 07:21:38 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 "testComplexMath " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testComplexMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testComplexMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,234 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**
+**  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: testComplexMath.c 3847 2006-10-11 02:38:21Z KathleenHumble $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+
+#undef Journal_PrintCmplx
+/** Print a complex number.
+Will use %.5f formatting */
+#define Journal_PrintCmplx( stream, self ) \
+                Journal_Printf( stream, #self " = %.7f %c %.7f i\n", (self)[ REAL_PART ], (self)[ IMAG_PART ] >= 0.0 ? '+' : '-', fabs( (self)[ IMAG_PART ] ) )
+
+#define TESTCOMPLEXMATH_TOL 1e-15
+
+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 );
+	
+	StGermain_Init( &argc, &argv );
+	
+	StgDomainGeometry_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 ) {
+		Cmplx x = {1, 2};
+		Cmplx y = {-1.5, 3};
+		Cmplx u = {-1.5, -3};
+		Cmplx v = {1.5, -3};
+		Cmplx i = {0, 1};
+		Cmplx minus_i = {0, -1};
+		Cmplx e = {M_E, 0};
+		Cmplx ipi = {0, M_PI};
+		Cmplx dest;
+		double mod, theta;
+		Stream* stream = Journal_Register( InfoStream_Type, "ComplexMath" );
+		
+		Journal_Printf(stream, "\n----------------- Testing Complex Journal Printing Macro -----------------\n" );
+		Journal_PrintCmplx( stream, x );	
+		Journal_PrintCmplx( stream, y );	
+		Journal_PrintCmplx( stream, u );	
+		Journal_PrintCmplx( stream, v );	
+		Journal_PrintCmplx( stream, i );	
+
+		Journal_Printf(stream, "\n----------------- Testing Addition -----------------\n" );
+		Cmplx_Add( x, y, dest );
+		Cmplx_Add( x, y, x );
+		Journal_PrintCmplx( stream, dest );	
+		Journal_PrintCmplx( stream, x );	
+		
+		Journal_Printf(stream, "\n----------------- Testing Subtraction -----------------\n" );
+		Cmplx_Subtract( x, y, x );
+		Cmplx_Subtract( x, y, dest );
+		Journal_PrintCmplx( stream, x );		
+		Journal_PrintCmplx( stream, dest );	
+
+		Journal_Printf(stream, "\n----------------- Testing Multiplication -----------------\n" );
+		Cmplx_Multiply( x, y, dest );
+		Cmplx_Multiply( x, y, y );
+		Journal_PrintCmplx( stream, dest );	
+		Journal_PrintCmplx( stream, y );	
+
+		Journal_Printf(stream, "\n----------------- Testing Division -----------------\n" );
+		Cmplx_Division( y, x, y );
+		Cmplx_Division( x, y, dest );
+		Journal_PrintCmplx( stream, y );	
+		Journal_PrintCmplx( stream, dest );	
+		
+		Journal_Printf(stream, "\n----------------- Testing Real Number Math stuff -----------------\n" );
+		Cmplx_AddReal( y, 2, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_RealMinusCmplx( y, 4, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_RealMultiply( y, 0.1, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_RealDivideByCmplx( y, 1.0, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_Multiply( y, dest, dest );
+		/* Test here for tolerances */
+		if (fabs(dest[IMAG_PART]) <= TESTCOMPLEXMATH_TOL ) {
+			Journal_Printf(stream, "Answer within tolerance %g of %.5f + i %.5f\n", 
+				TESTCOMPLEXMATH_TOL,
+				dest[REAL_PART],
+				fabs(0));
+		}
+		else{
+			Journal_Printf(stream, "Answer not within tolerance %g of %.5f + i %.5f\n", 
+				TESTCOMPLEXMATH_TOL,
+				1,
+				0);
+		}
+
+		Journal_Printf(stream, "\n----------------- Testing Conjugate -----------------\n" );
+		Cmplx_Conjugate( x, x );
+		Journal_PrintCmplx( stream, x );	
+		Cmplx_Conjugate( x, x );
+		Journal_PrintCmplx( stream, x );	
+
+		Journal_Printf(stream, "\n----------------- Testing Complex Polar Stuff -----------------\n" );
+		mod = Cmplx_Modulus(x);
+		theta = Cmplx_Argument( x );
+		Journal_Printf(stream, "x = %2.4lf e^{i %2.4lf} = %2.4lf + %2.4lf\n", mod, theta, mod * cos(theta), mod *sin(theta));
+		mod = Cmplx_Modulus(y);
+		theta = Cmplx_Argument( y );
+		Journal_Printf(stream, "y = %2.4lf e^{i %2.4lf} = %2.4lf + %2.4lf\n", mod, theta, mod * cos(theta), mod *sin(theta));
+		mod = Cmplx_Modulus(u);
+		theta = Cmplx_Argument( u );
+		Journal_Printf(stream, "u = %2.4lf e^{i %2.4lf} = %2.4lf + %2.4lf\n", mod, theta, mod * cos(theta), mod *sin(theta));
+		mod = Cmplx_Modulus(v);
+		theta = Cmplx_Argument( v );
+		Journal_Printf(stream, "v = %2.4lf e^{i %2.4lf} = %2.4lf + %2.4lf\n", mod, theta, mod * cos(theta), mod *sin(theta));
+		mod = Cmplx_Modulus(i);
+		theta = Cmplx_Argument( i );
+		Journal_Printf(stream, "i = %2.4lf e^{i %2.4lf} = %2.4lf + %2.4lf\n", mod, theta, mod * cos(theta), mod *sin(theta));
+		mod = Cmplx_Modulus(minus_i);
+		theta = Cmplx_Argument( minus_i );
+		Journal_Printf(stream, "-i = %2.4lf e^{i %2.4lf} = %2.4lf + %2.4lf\n", mod, theta, mod * cos(theta), mod *sin(theta));
+	
+		Journal_Printf(stream, "\n----------------- Testing Complex to real Power Stuff -----------------\n" );
+		Cmplx_RealPower( x, 2.0, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_Multiply( x, x, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_Multiply( dest, x, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_RealPower( x, 3.0, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_Sqrt( y, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_RealPower( dest, 2.0, dest );
+		Journal_PrintCmplx( stream, dest );	
+		
+		Journal_Printf(stream, "\n----------------- Testing Complex to complex Power Stuff -----------------\n" );
+		Cmplx_CmplxPower( x, y, dest );
+		Journal_PrintCmplx( stream, dest );	
+
+
+		Journal_Printf(stream, "\n----------------- Testing The Most Beautiful Equation in Mathematics e^{i \\pi} + 1 = 0 -----------------\n" );
+		Journal_Printf( stream, "e^{i \\pi} = ");
+		Cmplx_CmplxPower( e, ipi, dest );
+		Journal_PrintCmplx( stream, dest );	
+
+		Journal_Printf(stream, "\n----------------- Another Beautiful Equation i^i = e^{-\\pi/2} -----------------\n" );
+		Cmplx_CmplxPower( i, i, dest );
+		Journal_Printf( stream, "e^{-\\pi/2} = %2.5lf = ", exp( -M_PI * 0.5 ) );
+		Journal_PrintCmplx( stream, dest );	
+
+		Journal_Printf(stream, "\n----------------- Testing Exponential -----------------\n" );
+		Journal_Printf( stream, "e^{2 + 3i} = ");
+		x[ REAL_PART ] = 2.0;
+		x[ IMAG_PART ] = 3.0;
+		Cmplx_Exp( x, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_CmplxPower( e, x, dest );
+		Journal_PrintCmplx( stream, dest );	
+
+		Journal_Printf( stream, "e^{-5 + 7i} = ");
+		x[ REAL_PART ] = -5.0;
+		x[ IMAG_PART ] = 7.0;
+		Cmplx_Exp( x, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_CmplxPower( e, x, dest );
+		Journal_PrintCmplx( stream, dest );	
+
+		Journal_Printf( stream, "e^{i \\pi} = ");
+		Cmplx_Exp( ipi, dest );
+		Journal_PrintCmplx( stream, dest );	
+		
+		Journal_Printf(stream, "\n----------------- Testing Copy and Zero -----------------\n" );
+		Journal_PrintCmplx( stream, x );	
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_Copy( x, dest );
+		Journal_PrintCmplx( stream, dest );	
+		Cmplx_Zero( dest );
+		Journal_PrintCmplx( stream, dest );	
+
+	}
+	
+	printf("\n");
+	StgDomainGeometry_Finalise();
+	
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testComplexVectorMath.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testComplexVectorMath.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,228 @@
+StGermain Framework revision 3673. Copyright (C) 2003-2005 VPAC.
+Basic tests:
+d = 
+d[0] = 1 + 1 i
+d[1] = 1 + 0 i
+d[2] = 0 + 1 i
+Set Complex Scalar
+d = 
+d[0] = 1 + 0 i
+d[1] = 2 + 1 i
+d[2] = 1.5 + 1 i
+Set c = d
+c = 
+c[0] = 1 + 0 i
+c[1] = 2 + 1 i
+c[2] = 1.5 + 1 i
+b = c + d 
+b = 
+b[0] = 2 + 0 i
+b[1] = 4 + 2 i
+b[2] = 3 + 2 i
+a = b - d 
+a = 
+a[0] = 1 + 0 i
+a[1] = 2 + 1 i
+a[2] = 1.5 + 1 i
+d = a x e 
+e = 
+e[0] = 1 + 0 i
+e[1] = 2 + 2 i
+e[2] = -3 - 1 i
+d = 
+d[0] = -6 - 10 i
+d[1] = 4.5 + 2 i
+d[2] = 0 + 1 i
+value = a . e 
+value = -0.5 + 1.5 i
+b = 
+b[0] = 2 + 0 i
+b[1] = 4 + 2 i
+b[2] = 3 + 2 i
+b = (2 + i) * b 
+b = 
+b[0] = 4 + 2 i
+b[1] = 6 + 8 i
+b[2] = 4 + 7 i
+b = 3 * b 
+b = 
+b[0] = 12 + 6 i
+b[1] = 18 + 24 i
+b[2] = 12 + 21 i
+b = 
+b[0] = 0 + 1 i
+b[1] = 1 + 1 i
+b[2] = 0 + 1 i
+|b| = 2
+d = proj a onto b 
+d = 
+d[0] = -2.75 + 0 i
+d[1] = -2.75 + 2.75 i
+d[2] = -2.75 + 0 i
+e = a / value 
+value = 2 + 1 i
+e = 
+e[0] = 0.4 - 0.2 i
+e[1] = 1 + 0 i
+e[2] = 0.8 + 0.1 i
+b = 
+b[0] = 0 + 1 i
+b[1] = 1 + 1 i
+b[2] = 0 + 1 i
+Norm(b) = 
+b[0] = 0 + 0.5 i
+b[1] = 0.5 + 0.5 i
+b[2] = 0 + 0.5 i
+|b| = 1
+a  = 
+a[0] = 1 + 0 i
+a[1] = 2 + 1 i
+a[2] = 1.5 + 1 i
+swizzle(a)(k, i, j) = 
+a[0] = 1.5 + 1 i
+a[1] = 1 + 0 i
+a[2] = 2 + 1 i
+
+****************************
+Vectors - A, B, C, and D
+A - {7.4 + i 1, 2 + i 0, 5 + i 1, 1 + i 0, 3 + i 2, -42 + i 0}
+B - {4 + i 2, 2.3 + i 0, 5.8 + i 0, 6 + i 0, -12 + i 0, 39289 + i 0}
+C - {23 + i 0, 5 + i 0, -14 + i 0, 32 + i 0, -21 + i 1, 78 + i 0}
+D - {23 + i 0, 5 + i 0, -14 + i 0, 32 + i 0, -21 + i 0, 78 + i 0}
+
+****************************
+i - {1 + i 0, 0 + i 0, 0 + i 0}
+j - {0 + i 0, 1 + i 0, 0 + i 0}
+k - {0 + i 0, 0 + i 0, 1 + i 0}
+Axis Rotation
+K Rotated 1.5708 radians around I axis - 
+Answer within tolerance 1e-16 of expected result: j - {0 + i 0, 1 + i 0, 0 + i 0}
+Angle Rotation
+K Rotated 1.5708 radians around I axis - 
+Answer within tolerance 1e-16 of expected result: j - {0 + i 0, 1 + i 0, 0 + i 0}
+Axis Rotation
+I Rotated 1.5708 radians around J axis - 
+Answer within tolerance 1e-16 of expected result: k - {0 + i 0, 0 + i 0, 1 + i 0}
+Angle Rotation
+I Rotated 1.5708 radians around J axis - 
+Answer within tolerance 1e-16 of expected result: k - {0 + i 0, 0 + i 0, 1 + i 0}
+Axis Rotation
+J Rotated 1.5708 radians around K axis - 
+Answer within tolerance 1e-16 of expected result: i - {1 + i 0, 0 + i 0, 0 + i 0}
+Angle Rotation
+J Rotated 1.5708 radians around K axis - 
+Answer within tolerance 1e-16 of expected result: i - {1 + i 0, 0 + i 0, 0 + i 0}
+I Rotated 0.785398 radians around J axis and 0.785398 radians around K axis: 
+vector - {0.5 + i 0, -0.707107 + i 0, 0.5 + i 0}
+J Rotated 0.785398 radians around I axis and 0.785398 radians around K axis: 
+vector - {0.707107 + i 0, 0.5 + i 0, -0.5 + i 0}
+K Rotated 0.785398 radians around I axis and 0.785398 radians around J axis: 
+vector - {-0.707107 + i 0, 0.5 + i 0, 0.5 + i 0}
+
+****************************
+vector = A + B
+vector - {<NON_POSITIVE DIMENSION 0>}
+vector - {11.4 + i 3}
+vector - {11.4 + i 3, 4.3 + i 0}
+vector - {11.4 + i 3, 4.3 + i 0, 10.8 + i 1}
+vector - {11.4 + i 3, 4.3 + i 0, 10.8 + i 1, 7 + i 0}
+vector - {11.4 + i 3, 4.3 + i 0, 10.8 + i 1, 7 + i 0, -9 + i 2}
+vector - {11.4 + i 3, 4.3 + i 0, 10.8 + i 1, 7 + i 0, -9 + i 2, 39247 + i 0}
+
+****************************
+vector = A - B
+vector - {<NON_POSITIVE DIMENSION 0>}
+vector - {3.4 + i -1}
+vector - {3.4 + i -1, -0.3 + i 0}
+vector - {3.4 + i -1, -0.3 + i 0, -0.8 + i 1}
+vector - {3.4 + i -1, -0.3 + i 0, -0.8 + i 1, -5 + i 0}
+vector - {3.4 + i -1, -0.3 + i 0, -0.8 + i 1, -5 + i 0, 15 + i 2}
+vector - {3.4 + i -1, -0.3 + i 0, -0.8 + i 1, -5 + i 0, 15 + i 2, -39331 + i 0}
+
+****************************
+Check Magnitude Function
+dim = 0 magnitude A = 0.000
+dim = 0 magnitude B = 0.000
+dim = 1 magnitude A = 7.467
+dim = 1 magnitude B = 4.472
+dim = 2 magnitude A = 7.722
+dim = 2 magnitude B = 4.854
+dim = 3 magnitude A = 9.243
+dim = 3 magnitude B = 7.306
+dim = 4 magnitude A = 9.295
+dim = 4 magnitude B = 9.402
+dim = 5 magnitude A = 9.755
+dim = 5 magnitude B = 15.215
+dim = 6 magnitude A = 43.036
+dim = 6 magnitude B = 39289.003
+
+****************************
+Check Dot Product Function
+value = A . B 
+dim = 0 dot product = 0.000 + 0.000 i
+dim = 1 dot product = 27.600 + 18.800 i
+dim = 2 dot product = 32.200 + 18.800 i
+dim = 3 dot product = 61.200 + 24.600 i
+dim = 4 dot product = 67.200 + 24.600 i
+dim = 5 dot product = 31.200 + 0.600 i
+dim = 6 dot product = -1650106.800 + 0.600 i
+
+****************************
+Check Cross Product Function
+ A x B in 3-D
+vector - {0.1 + i -2.3, -24.92 + i 8.2, 9.02 + i -1.7}
+
+****************************
+Checking centroid function
+vector - {<NON_POSITIVE DIMENSION 0>}
+vector - {11.4667 + i 1}
+vector - {11.4667 + i 1, 3.1 + i 0}
+vector - {11.4667 + i 1, 3.1 + i 0, -1.06667 + i 0.333333}
+vector - {11.4667 + i 1, 3.1 + i 0, -1.06667 + i 0.333333, 13 + i 0}
+vector - {11.4667 + i 1, 3.1 + i 0, -1.06667 + i 0.333333, 13 + i 0, -10 + i 1}
+vector - {11.4667 + i 1, 3.1 + i 0, -1.06667 + i 0.333333, 13 + i 0, -10 + i 1, 13108.3 + i 0}
+
+****************************
+Check Normalisation Function
+2-D
+
+A - {7.4 + i 1, 2 + i 0}
+A - {0.958328 + i 0.129504, 0.259007 + i 0}
+mag = 1.000
+3-D
+
+B - {4 + i 2, 2.3 + i 0, 5.8 + i 0}
+B - {0.547462 + i 0.273731, 0.314791 + i 0, 0.79382 + i 0}
+mag = 1.000
+5-D
+
+C - {23 + i 0, 5 + i 0, -14 + i 0, 32 + i 0, -21 + i 1}
+C - {0.488765 + i 0, 0.106253 + i 0, -0.297509 + i 0, 0.680021 + i 0, -0.446264 + i 0.0212506}
+mag = 1.000
+
+****************************
+Check StGermain_ComplexVectorCrossProductMagnitude
+A - {1 + i 1, 2 + i 0, 3 + i 0}
+B - {4 + i 0, 5 + i 0, 6 + i 3}
+mag = 7.6 + -7.37 i (2D)
+mag = 22.4 + -18.6 i (3D)
+
+****************************
+Check StGermain_ComplexScalarTripleProduct 
+matrix[0] - {1 + i 1, 2 + i 0, 3 + i 2}
+matrix[1] - {4 + i 0, 5 + i 3, 6 + i 0}
+matrix[2] - {7 + i 1, 8 + i 0, 11 + i 1}
+scalar triple product: value = 14 - 32 i
+scalar triple product: value = 14 - 32 i
+scalar triple product: value = 14 - 32 i
+
+****************************
+Check Vector_ToComplexVector function 
+realVector - {1.000000, 2.000000, 3.000000}
+matrix[0] - {1 + i 0, 2 + i 0, 3 + i 0}
+
+****************************
+Check ComplexVector_ToVector function 
+matrix[0] - {5 + i 0, 6 + i 0, 7 + i 0}
+realVector - {5.000000, 6.000000, 7.000000}
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testComplexVectorMath.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testComplexVectorMath.0of1.sh	Wed Oct 10 07:21:38 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 "testComplexVectorMath " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testComplexVectorMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testComplexVectorMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,531 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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: testVectorMath.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.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 );
+	
+	StgDomainGeometry_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+
+	stream = Journal_Register( Info_Type, "ComplexVectorMath" );
+	
+	if( argc >= 2 ) {
+		procToWatch = atoi( argv[1] );
+	}
+	else {
+		procToWatch = 0;
+	}
+	if( rank == procToWatch ) {
+		CoordC	a, b, c;
+		CoordC	d = { {1.0, 1.0}, {1.0, 0.0}, {0.0, 1.0} };
+		CoordC	e = { {1.0, 0.0}, {2.0, 2.0}, {-3.0, -1.0} };
+		Cmplx value = {1.0, 1.0}; 
+		Cmplx c1 = {1.0, 0.0};
+		Cmplx c2 = {2.0, 1.0};
+		Cmplx c3 = {1.5, 1.0};
+		
+		Journal_Printf( stream,  "Basic tests:\n" );
+		Journal_Printf( stream, "d = \n");
+		Journal_PrintCmplx( stream, d[0]);
+		Journal_PrintCmplx( stream, d[1]);
+		Journal_PrintCmplx( stream, d[2]);
+		 
+		Journal_Printf( stream, "Set Complex Scalar\n");
+		ComplexVector_SetScalar( c1, c2, c3, d );
+		Journal_Printf( stream, "d = \n");
+		Journal_PrintCmplx( stream, d[0]);
+		Journal_PrintCmplx( stream, d[1]);
+		Journal_PrintCmplx( stream, d[2]);
+
+		Journal_Printf( stream, "Set c = d\n");
+		ComplexVector_Set( d, c );
+		Journal_Printf( stream, "c = \n");
+		Journal_PrintCmplx( stream, c[0]);
+		Journal_PrintCmplx( stream, c[1]);
+		Journal_PrintCmplx( stream, c[2]);
+
+		ComplexVector_Add(c, d, b );
+		Journal_Printf( stream,  "b = c + d \n");
+		Journal_Printf( stream, "b = \n");
+		Journal_PrintCmplx( stream, b[0]);
+		Journal_PrintCmplx( stream, b[1]);
+		Journal_PrintCmplx( stream, b[2]);
+
+		ComplexVector_Sub( b, d, a );
+		Journal_Printf( stream,  "a = b - d \n");
+		Journal_Printf( stream, "a = \n");
+		Journal_PrintCmplx( stream, a[0]);
+		Journal_PrintCmplx( stream, a[1]);
+		Journal_PrintCmplx( stream, a[2]);
+
+		ComplexVector_Cross( a, e, d );		
+		Journal_Printf( stream,  "d = a x e \n");
+		Journal_Printf( stream, "e = \n");
+		Journal_PrintCmplx( stream, e[0]);
+		Journal_PrintCmplx( stream, e[1]);
+		Journal_PrintCmplx( stream, e[2]);		
+		Journal_Printf( stream, "d = \n");
+		Journal_PrintCmplx( stream, d[0]);
+		Journal_PrintCmplx( stream, d[1]);
+		Journal_PrintCmplx( stream, d[2]);
+		
+		ComplexVector_Dot( a, e, value );
+		Journal_Printf( stream,  "value = a . e \n");
+		Journal_PrintCmplx( stream, value);
+		
+		value[REAL_PART] = 2.0;
+		value[IMAG_PART] = 1.0;
+		Journal_Printf( stream, "b = \n");
+		Journal_PrintCmplx( stream, b[0]);
+		Journal_PrintCmplx( stream, b[1]);
+		Journal_PrintCmplx( stream, b[2]);		
+		ComplexVector_Mult( b, value, b);
+		Journal_Printf( stream,  "b = (2 + i) * b \n");
+		Journal_Printf( stream, "b = \n");
+		Journal_PrintCmplx( stream, b[0]);
+		Journal_PrintCmplx( stream, b[1]);
+		Journal_PrintCmplx( stream, b[2]);
+		
+		ComplexVector_MultReal(b, 3.0, b);
+		Journal_Printf( stream,  "b = 3 * b \n");
+		Journal_Printf( stream, "b = \n");
+		Journal_PrintCmplx( stream, b[0]);
+		Journal_PrintCmplx( stream, b[1]);
+		Journal_PrintCmplx( stream, b[2]);	
+
+		b[0][REAL_PART] = 0.0; b[0][IMAG_PART] = 1.0; 
+		b[1][REAL_PART] = 1.0; b[1][IMAG_PART] = 1.0;
+		b[2][REAL_PART] = 0.0; b[2][IMAG_PART] = 1.0;
+		
+		Journal_Printf( stream,  "b = \n");
+		Journal_PrintCmplx( stream, b[0]);
+		Journal_PrintCmplx( stream, b[1]);
+		Journal_PrintCmplx( stream, b[2]);
+
+		Journal_Printf( stream,  "|b| = %g\n", ComplexVector_Mag(b));
+				
+		ComplexVector_Proj(a, b, d);
+		Journal_Printf( stream,  "d = proj a onto b \n");
+		Journal_Printf( stream, "d = \n");
+		Journal_PrintCmplx( stream, d[0]);
+		Journal_PrintCmplx( stream, d[1]);
+		Journal_PrintCmplx( stream, d[2]);			
+		
+		ComplexVector_Div(a, value, e);
+		Journal_Printf( stream,  "e = a / value \n");
+		Journal_PrintCmplx( stream, value);
+		Journal_Printf( stream, "e = \n");
+		Journal_PrintCmplx( stream, e[0]);
+		Journal_PrintCmplx( stream, e[1]);
+		Journal_PrintCmplx( stream, e[2]);
+
+		Journal_Printf( stream, "b = \n");
+		Journal_PrintCmplx( stream, b[0]);
+		Journal_PrintCmplx( stream, b[1]);
+		Journal_PrintCmplx( stream, b[2]);
+		ComplexVector_Norm( b, b );
+		Journal_Printf( stream,  "Norm(b) = \n");
+		Journal_PrintCmplx( stream, b[0]);
+		Journal_PrintCmplx( stream, b[1]);
+		Journal_PrintCmplx( stream, b[2]);
+	
+
+		Journal_Printf( stream,  "|b| = %g\n", ComplexVector_Mag(b));
+		
+		Journal_Printf( stream,  "a  = \n");
+		Journal_PrintCmplx( stream, a[0]);
+		Journal_PrintCmplx( stream, a[1]);
+		Journal_PrintCmplx( stream, a[2]);
+		
+		ComplexVector_Swizzle(a, K_AXIS, I_AXIS, J_AXIS, a);
+		Journal_Printf( stream,  "swizzle(a)(k, i, j) = \n");
+		Journal_PrintCmplx( stream, a[0]);
+		Journal_PrintCmplx( stream, a[1]);
+		Journal_PrintCmplx( stream, a[2]);
+		
+
+	}
+	if( rank == procToWatch ) {
+		#define STG_COMPLEXVECTOR_TOL 1e-16;
+		
+		Cmplx i[] = {{1.00000000, 0.000000000},{0.00000000, 0.000000000},{0.000000000, 0.00000000}};
+		Cmplx j[] = {{0.00000000, 0.00000000},{1.0000000, 0.00000000},{0.00000000, 0.0000000}};
+		Cmplx k[] = {{0.00000000, 0.000000000},{0.00000000, 0.000000000},{1.000000000, 0.000000000}};
+		Cmplx A[] = {{7.4, 1.0}, {  2, 0.0}, {  5, 1.0}, { 1, 0.0}, {  3, 2.0}, {  -42, 0.0}};
+		Cmplx B[] = {{  4, 2.0}, {2.3, 0.0}, {5.8, 0.0}, { 6, 0.0}, {-12, 0.0}, {39289, 0.0}};
+		Cmplx C[] = {{23, 0.0}, {  5, 0.0}, {-14, 0.0}, {32, 0.0}, {-21, 1.0}, {	78, 0.0}};
+		Cmplx D[] = {{23, 0.0}, {  5, 0.0}, {-14, 0.0}, {32, 0.0}, {-21, 0.0}, {   78, 0.0}};
+		double angle;
+		Cmplx **matrix;
+		Cmplx vector[6], differenceVector[6];
+		Cmplx *coordList[4];
+		int d;
+		double realVector[3], tolerance;
+		Cmplx dotProductResult;
+		Cmplx value;
+		
+		tolerance = STG_COMPLEXVECTOR_TOL;
+		
+		coordList[0] = A;
+		coordList[1] = B;
+		coordList[2] = C;
+		coordList[3] = D;
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf(stream, "Vectors - A, B, C, and D\n");
+		
+		StGermain_PrintNamedComplexVector( stream, A, 6 );
+		StGermain_PrintNamedComplexVector( stream, B, 6 );
+		StGermain_PrintNamedComplexVector( stream, C, 6 );
+		StGermain_PrintNamedComplexVector( stream, D, 6 );
+
+		/* Check Rotation functions */
+		Journal_Printf( stream, "\n****************************\n");
+
+		StGermain_PrintNamedComplexVector( stream, i, 3 );
+		StGermain_PrintNamedComplexVector( stream, j, 3 );
+		StGermain_PrintNamedComplexVector( stream, k, 3 );
+
+		
+		angle = M_PI / 2.0;
+	
+		
+		Journal_Printf(stream, "Axis Rotation\n");				
+		StGermain_RotateCoordinateAxisComplex( k, I_AXIS, angle, vector ) ;
+		Journal_Printf( stream, "K Rotated %g radians around I axis - \n", angle);
+		Cmplx_Subtract(vector[0], j[0], differenceVector[0]);
+		Cmplx_Subtract(vector[1], j[1], differenceVector[1]);
+		Cmplx_Subtract(vector[2], j[2], differenceVector[2]);
+		
+		if ( (Cmplx_Modulus(differenceVector[0]) < tolerance) && 
+			 (Cmplx_Modulus(differenceVector[1]) < tolerance) &&
+			 (Cmplx_Modulus(differenceVector[2]) < tolerance) ) {
+			Journal_Printf( stream, "Answer within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, j, 3);
+		}
+		else {
+			Journal_Printf( stream, "Answer not within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, j, 3);
+		}
+		
+		Journal_Printf(stream, "Angle Rotation\n");		
+		StGermain_RotateComplexVector(k, angle,0.0, 0.0, vector);
+		Journal_Printf( stream, "K Rotated %g radians around I axis - \n", angle); 
+		Cmplx_Subtract(vector[0], j[0], differenceVector[0]);
+		Cmplx_Subtract(vector[1], j[1], differenceVector[1]);
+		Cmplx_Subtract(vector[2], j[2], differenceVector[2]);
+		
+		if ( (Cmplx_Modulus(differenceVector[0]) < tolerance) && 
+			 (Cmplx_Modulus(differenceVector[1]) < tolerance) &&
+			 (Cmplx_Modulus(differenceVector[2]) < tolerance) ) {
+			Journal_Printf( stream, "Answer within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, j, 3);
+		}
+		else {
+			Journal_Printf( stream, "Answer not within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, j, 3);
+		}
+		
+		Journal_Printf(stream, "Axis Rotation\n");		
+		StGermain_RotateCoordinateAxisComplex( i, J_AXIS, angle, vector );
+		Journal_Printf( stream, "I Rotated %g radians around J axis - \n", angle); 
+		Cmplx_Subtract(vector[0], k[0], differenceVector[0]);
+		Cmplx_Subtract(vector[1], k[1], differenceVector[1]);
+		Cmplx_Subtract(vector[2], k[2], differenceVector[2]);
+		
+		if ( (Cmplx_Modulus(differenceVector[0]) < tolerance) && 
+			 (Cmplx_Modulus(differenceVector[1]) < tolerance) &&
+			 (Cmplx_Modulus(differenceVector[2]) < tolerance) ) {
+			Journal_Printf( stream, "Answer within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, k, 3);
+		}
+		else {
+			Journal_Printf( stream, "Answer not within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, k, 3);
+		}
+
+		
+		Journal_Printf(stream, "Angle Rotation\n");
+		StGermain_RotateComplexVector(i, 0.0, angle, 0.0, vector );
+		Journal_Printf( stream, "I Rotated %g radians around J axis - \n", angle); 
+		Cmplx_Subtract(vector[0], k[0], differenceVector[0]);
+		Cmplx_Subtract(vector[1], k[1], differenceVector[1]);
+		Cmplx_Subtract(vector[2], k[2], differenceVector[2]);
+		
+		if ( (Cmplx_Modulus(differenceVector[0]) < tolerance) && 
+			 (Cmplx_Modulus(differenceVector[1]) < tolerance) &&
+			 (Cmplx_Modulus(differenceVector[2]) < tolerance) ) {
+			Journal_Printf( stream, "Answer within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, k, 3);
+		}
+		else {
+			Journal_Printf( stream, "Answer not within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, k, 3);
+		}
+		
+		Journal_Printf(stream, "Axis Rotation\n");		
+		StGermain_RotateCoordinateAxisComplex( j, K_AXIS, angle, vector );
+		Journal_Printf( stream, "J Rotated %g radians around K axis - \n", angle); 
+		Cmplx_Subtract(vector[0], i[0], differenceVector[0]);
+		Cmplx_Subtract(vector[1], i[1], differenceVector[1]);
+		Cmplx_Subtract(vector[2], i[2], differenceVector[2]);
+		
+		if ( (Cmplx_Modulus(differenceVector[0]) < tolerance) && 
+			 (Cmplx_Modulus(differenceVector[1]) < tolerance) &&
+			 (Cmplx_Modulus(differenceVector[2]) < tolerance) ) {
+			Journal_Printf( stream, "Answer within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, i, 3);
+		}
+		else {
+			Journal_Printf( stream, "Answer not within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, i, 3);
+		}
+
+		
+		Journal_Printf(stream, "Angle Rotation\n");
+		StGermain_RotateComplexVector( j, 0.0, 0.0, angle, vector );
+		Journal_Printf( stream, "J Rotated %g radians around K axis - \n", angle); 
+		Cmplx_Subtract(vector[0], i[0], differenceVector[0]);
+		Cmplx_Subtract(vector[1], i[1], differenceVector[1]);
+		Cmplx_Subtract(vector[2], i[2], differenceVector[2]);
+		
+		if ( (Cmplx_Modulus(differenceVector[0]) < tolerance) && 
+			 (Cmplx_Modulus(differenceVector[1]) < tolerance) &&
+			 (Cmplx_Modulus(differenceVector[2]) < tolerance) ) {
+			Journal_Printf( stream, "Answer within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, i, 3);
+		}
+		else {
+			Journal_Printf( stream, "Answer not within tolerance %g of expected result: ", tolerance);
+			StGermain_PrintNamedComplexVector( stream, i, 3);
+		}
+
+	
+		angle = M_PI / 4.0;
+
+		StGermain_RotateComplexVector(i, 0.0, angle, angle, vector );
+		Journal_Printf( stream, "I Rotated %g radians around J axis "
+		"and %2g radians around K axis: \n", angle, angle);
+		StGermain_PrintNamedComplexVector( stream, vector, 3 );
+
+		StGermain_RotateComplexVector(j, angle, 0.0, angle, vector );
+		Journal_Printf( stream, "J Rotated %g radians around I axis "
+		"and %g radians around K axis: \n", angle, angle); 
+		StGermain_PrintNamedComplexVector( stream, vector, 3 );
+
+		StGermain_RotateComplexVector(k, angle, angle, 0.0, vector );
+		Journal_Printf( stream, "K Rotated %g radians around I axis "
+		"and %g radians around J axis: \n", angle, angle); 
+		StGermain_PrintNamedComplexVector( stream, vector, 3 );
+
+
+		/* Check addition function */
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "vector = A + B\n");
+		for ( d = 0 ; d <= 6 ; d++ ) {
+			StGermain_ComplexVectorAddition( vector, A, B, d );
+			StGermain_PrintNamedComplexVector( stream, vector, d );
+		}
+
+		/* Check subtraction function */
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "vector = A - B\n");
+		for ( d = 0 ; d <= 6 ; d++ ) {
+			StGermain_ComplexVectorSubtraction( vector, A, B, d );
+			StGermain_PrintNamedComplexVector( stream, vector, d );
+		}
+	
+		/* Check Magnitude Function */
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "Check Magnitude Function\n");
+		for ( d = 0 ; d <= 6 ; d++ ) {
+			Journal_Printf( stream, "dim = %d magnitude A = %2.3f\n", d, StGermain_ComplexVectorMagnitude( A, d ) );
+			Journal_Printf( stream, "dim = %d magnitude B = %2.3f\n", d, StGermain_ComplexVectorMagnitude( B, d ) );
+		}
+
+		/* Check Dot Product */
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "Check Dot Product Function\n");
+		Journal_Printf( stream, "value = A . B \n");
+		
+		for (d = 0; d <=6; d++) {
+		StGermain_ComplexVectorDotProduct(A, B, d, dotProductResult);			
+		Journal_Printf( stream, "dim = %d dot product = %2.3f + %2.3f i\n",
+			d, dotProductResult[0], dotProductResult[1] );
+		}
+		
+
+		/* Check Cross Product */
+		/* Tested against http://www.engplanet.com/redirect.html?3859 */
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "Check Cross Product Function\n");
+		Journal_Printf( stream, " A x B in 3-D\n");
+		StGermain_ComplexVectorCrossProduct( vector, A, B );
+		StGermain_PrintNamedComplexVector( stream, vector, 3 );
+
+
+		/* Checking centroid function */
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "Checking centroid function\n");
+		for ( d = 0 ; d <= 6 ; d++ ) {
+			StGermain_ComplexTriangleCentroid( vector, A, B, C, d );
+			StGermain_PrintNamedComplexVector( stream, vector, d );
+		}
+
+
+		/* Check Normalisation Function */
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "Check Normalisation Function\n");
+		
+		Journal_Printf( stream, "2-D\n\n");
+		d = 2;
+		StGermain_PrintNamedComplexVector( stream, A, d );
+		StGermain_ComplexVectorNormalise( A, d );
+		StGermain_PrintNamedComplexVector( stream, A, d);
+		Journal_Printf( stream, "mag = %2.3f\n", StGermain_ComplexVectorMagnitude( A, d ) );
+
+		Journal_Printf( stream, "3-D\n\n");
+		d = 3;
+		StGermain_PrintNamedComplexVector( stream, B, d );
+		StGermain_ComplexVectorNormalise( B, d );
+		StGermain_PrintNamedComplexVector( stream, B, d);
+		Journal_Printf( stream, "mag = %2.3f\n", StGermain_ComplexVectorMagnitude( B, d ) );
+
+		Journal_Printf( stream, "5-D\n\n");
+		d = 5;
+		StGermain_PrintNamedComplexVector( stream, C, d );
+		StGermain_ComplexVectorNormalise( C, d );
+		StGermain_PrintNamedComplexVector( stream, C, d);
+		Journal_Printf( stream, "mag = %2.3f\n", StGermain_ComplexVectorMagnitude( C, d ) );
+
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "Check StGermain_ComplexVectorCrossProductMagnitude\n");
+		A[0][REAL_PART] = 1.0; A[0][IMAG_PART] = 1.0; 
+		A[1][REAL_PART] = 2.0; A[1][IMAG_PART] = 0.0;
+		A[2][REAL_PART] = 3.0; A[2][IMAG_PART] = 0.0;
+		B[0][REAL_PART] = 4.0; B[0][IMAG_PART] = 0.0;
+		B[1][REAL_PART] = 5.0; B[1][IMAG_PART] = 0.0;
+		B[2][REAL_PART] = 6.0; B[2][IMAG_PART] = 3.0;
+		StGermain_PrintNamedComplexVector( stream, A, 3);
+		StGermain_PrintNamedComplexVector( stream, B, 3);
+		
+		StGermain_ComplexVectorCrossProductMagnitude(A, B, 2, value ) ;
+		Journal_Printf( stream, "mag = %2.3g + %2.3g i (2D)\n", value[REAL_PART], value[IMAG_PART] );
+		
+		StGermain_ComplexVectorCrossProductMagnitude(A, B, 3, value ) ;
+		Journal_Printf( stream, "mag = %2.3g + %2.3g i (3D)\n", value[REAL_PART], value[IMAG_PART] );
+
+
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "Check StGermain_ComplexScalarTripleProduct \n");
+		
+		matrix = Memory_Alloc_2DArray( Cmplx, 3, 3, "matrix" );
+		
+		matrix[0][0][REAL_PART] = 1.0; 	matrix[0][0][IMAG_PART] = 1.0;
+		matrix[0][1][REAL_PART] = 2.0; 	matrix[0][1][IMAG_PART] = 0.0; 
+		matrix[0][2][REAL_PART] = 3.0; 	matrix[0][2][IMAG_PART] = 2.0;
+		matrix[1][0][REAL_PART] = 4.0; 	matrix[1][0][IMAG_PART] = 0.0;
+		matrix[1][1][REAL_PART] = 5.0; 	matrix[1][1][IMAG_PART] = 3.0; 
+		matrix[1][2][REAL_PART] = 6.0; 	matrix[1][2][IMAG_PART] = 0.0;
+		matrix[2][0][REAL_PART] = 7.0; 	matrix[2][0][IMAG_PART] = 1.0;
+		matrix[2][1][REAL_PART] = 8.0; 	matrix[2][1][IMAG_PART] = 0.0;
+		matrix[2][2][REAL_PART] = 11.0; matrix[2][2][IMAG_PART] = 1.0;
+		StGermain_PrintNamedComplexVector( stream, matrix[0], 3);
+		StGermain_PrintNamedComplexVector( stream, matrix[1], 3);
+		StGermain_PrintNamedComplexVector( stream, matrix[2], 3);
+
+		StGermain_ComplexScalarTripleProduct( matrix[0], matrix[1], matrix[2], value );
+		Journal_Printf( stream, "scalar triple product: ");
+		Journal_PrintCmplx( stream, value );
+		
+		StGermain_ComplexScalarTripleProduct( matrix[2], matrix[0], matrix[1], value );
+		Journal_Printf( stream, "scalar triple product: ");
+		Journal_PrintCmplx( stream, value );
+		StGermain_ComplexScalarTripleProduct( matrix[1], matrix[2], matrix[0], value );
+		Journal_Printf( stream, "scalar triple product: ");
+		Journal_PrintCmplx( stream, value );
+		
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "Check Vector_ToComplexVector function \n");
+		
+		realVector[0] = 1.0; realVector[1] = 2.0; realVector[2] = 3.0;
+		
+		StGermain_PrintNamedVector(stream, realVector, 3);
+		Vector_ToComplexVector(realVector, 3, matrix[0]) ;
+		StGermain_PrintNamedComplexVector( stream, matrix[0], 3);
+
+		Journal_Printf( stream, "\n****************************\n");
+		Journal_Printf( stream, "Check ComplexVector_ToVector function \n");	
+		
+		matrix[0][0][REAL_PART] = 5.0; 	matrix[0][0][IMAG_PART] = 0.0;
+		matrix[0][1][REAL_PART] = 6.0; 	matrix[0][1][IMAG_PART] = 0.0; 
+		matrix[0][2][REAL_PART] = 7.0; 	matrix[0][2][IMAG_PART] = 0.0;
+		
+		StGermain_PrintNamedComplexVector( stream, matrix[0], 3);
+		ComplexVector_ToVector(matrix[0], 3, realVector) ;
+		StGermain_PrintNamedVector(stream, realVector, 3);
+
+		
+		Memory_Free( matrix );
+
+
+	}
+	
+	Journal_Printf( stream, "\n");
+	StgDomainGeometry_Finalise();
+	
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testDelaunay.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testDelaunay.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,9 @@
+StGermain Framework revision 3470. Copyright (C) 2003-2005 VPAC.
+Testing triangulation of a regular mesh:
+Regular mesh triangulation test passed..
+
+Testing triangulation of irregular point-sets:
+Irregular point-set triangulation test passed..
+
+Testing triangulation of regular polygons:
+Regular polygon triangulation test passed..
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testDelaunay.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testDelaunay.0of1.sh	Wed Oct 10 07:21:38 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 "testDelaunay small.txt" "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testDelaunay.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testDelaunay.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,271 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testEdge.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+
+typedef enum pointsType_t{
+	Irregular,
+	Regular,
+	Polygon
+}pointsType;
+
+#define PI 3.1415926535897932384626
+
+void generatePoints( CoordF *sites, int numSites, pointsType *p )
+{
+	int num, i, j;
+	
+	assert( sites );
+
+	num = numSites;
+	
+	if( *p == Irregular ){
+		for( i=0; i<num; i++ ){
+			sites[i][0] = drand48();
+			sites[i][1] = drand48();
+		}
+	}
+	else if (*p == Regular){
+		int count = 0;
+		num = sqrt((float)num);
+		for( i=0; i<num; i++ ){
+			for( j=0; j<num; j++ ){
+				sites[count][0] = ((float)i)*(1/((float)num));
+				sites[count][1] = ((float)j)*(1/((float)num));
+
+				count++;
+			}
+		}
+	}
+	else if( *p == Polygon ){
+		for( i=0; i<num-1; i++ ){
+			sites[i][0] = cos( ((float)i)*2.0*PI/((float)(num-1)) );
+			sites[i][1] = sin( ((float)i)*2.0*PI/((float)(num-1)) );
+		}
+	}
+}
+
+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 );
+	
+	StGermain_Init( &argc, &argv );
+	
+	StgDomainGeometry_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 ) {
+		Delaunay *d = NULL;
+		DelaunayAttributes attr;
+		CoordF *sites;
+		int i = 0, j = 0;
+		pointsType p;
+		Dictionary *dictionary = Dictionary_New();
+		
+		attr.BuildBoundingTriangle = 0;
+		attr.BuildTriangleIndices = 1;
+		attr.BuildTriangleNeighbours = 1;
+		attr.CreateVoronoiVertices = 1;
+		attr.CalculateVoronoiSides = 1;
+		attr.CalculateVoronoiSurfaceArea = 1;
+		attr.FindNeighbours = 1;
+
+		/* Testing regular point-set */
+		printf( "Testing triangulation of a regular mesh:\n" );
+		{
+			int pass = 1, k = 0;
+			float sqroot = 0, area = 0;
+			
+			int array[10] = { 16, 25, 36, 49, 64, 81, 100, 121, 144, 269 };
+			
+			#define epsilon 0.001
+			
+			for( j=0; j<10; j++ ){
+			
+				i = array[j];
+				
+				p = Regular;
+
+				sites = Memory_Alloc_Array(  CoordF, i, "TestDelauney_CoordF_pointSet" );
+				memset( sites, 0, sizeof( CoordF ) * i );
+		
+				generatePoints( sites, i, &p );
+			
+				d = Delaunay_New( "Delaunay", dictionary, sites, i, 0, &attr );
+		
+				Stg_Component_Build( d, NULL, True );
+
+				sqroot = sqrt( (float)i );
+
+				area = (1.0f/sqroot) * (1.0f/sqroot);
+				
+				for( k=0; k<i; k++ ){
+					if( d->hull[k] ) continue;
+					
+					if( (k > 0) && (k< sqrt((float)k)) )
+						if( FABS( area - d->voronoiArea[k] ) > epsilon ) pass = 0;
+				}
+
+				Stg_Class_Delete( d );
+
+				Memory_Free( sites );
+			}
+
+			printf( "Regular mesh triangulation test %s\n\n", pass?"passed..":"failed..!" );
+			
+		}
+
+		
+		/* Testing irregular point-set */
+		printf( "Testing triangulation of irregular point-sets:\n" );
+		{
+			int pass = 1;
+			
+			for( i=10; i<210; i++ ){
+			
+				p = Irregular;
+				
+				sites = Memory_Alloc_Array( CoordF, i, "TestDelauney_CoordF_irregPointSet" );
+				memset( sites, 0, sizeof( CoordF ) * i );
+		
+				generatePoints( sites, i, &p );
+			
+				d = Delaunay_New( "Delaunay", dictionary, sites, i, 0, &attr );
+		
+				Stg_Component_Build( d, NULL, True );
+
+				if( d->numFaces !=  (d->numEdges - d->numSites+2) ){
+					pass = 0;
+				}
+
+				Stg_Class_Delete( d );
+
+				Memory_Free( sites );
+			}
+
+			printf( "Irregular point-set triangulation test %s\n\n", pass?"passed..":"failed..!" );
+			
+		}
+		
+		
+		/* Testing regular polygons with a single node at the centre. */
+		printf( "Testing triangulation of regular polygons:\n" );
+		{
+			float theta = 0.0, area = 0.0, a = 0.0;
+			float side = 0.0, voronoiArea = 0.0;
+			#define epsilon 0.001
+			int pass = 1;
+			
+			do{
+				FILE *f = NULL;
+				p = Polygon;
+				if( argc < 3 ){
+					printf( "Expects file name. Aborting..\n" );
+					exit(0);
+				}
+	
+				if( ( f = fopen(argv[2], "r+") ) == NULL ){
+					printf( "Failed to open %s. Aborting..\n", argv[1] );
+					exit(0);
+				}
+	
+				fscanf( f, "%d", &i );
+				/*printf( "reading %d points from %s..\n", i, argv[1] );*/
+			
+				theta = 2*PI/((float)(i-1));
+				
+				sites = Memory_Alloc_Array(CoordF, i, "TestDelauney_CoordF_regPolygon" );
+				memset( sites, 0, sizeof( CoordF ) * i );
+
+				j = 0;
+				while( fscanf( f, "%f %f", &(sites[j][0]), &(sites[j][1]) ) != EOF ){
+					j++;
+				}
+			
+				d = Delaunay_New( "Delaunay", dictionary, sites, i, 0, &attr );
+		
+				Stg_Component_Build( d, NULL, True );
+				
+				for( j=0; j<i; j++ ){
+					if( (sites[j][0] == 0.0) && (sites[j][1] == 0.0) ){
+						side = d->voronoiSides[j][0];
+						voronoiArea = d->voronoiArea[j];
+						break;
+					}
+				}
+				
+				a = ( (side/2.0f)/sin(theta/2.0f) );
+				area = (0.5 * a * a * sin( theta )) * ((float)(i-1));
+
+				if( FABS(area - voronoiArea) > epsilon ){
+					pass = 0;
+				}
+			
+				fclose( f );
+				Stg_Class_Delete( d );
+
+				Memory_Free( sites );
+			}while(0);
+
+			printf( "Regular polygon triangulation test %s\n", pass?"passed..":"failed..!" );
+		}
+		Stg_Class_Delete( dictionary );
+	}
+	
+	StgDomainGeometry_Finalise();
+	
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testDimensionMacros.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testDimensionMacros.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,141 @@
+StGermain Framework. Copyright (C) 2003-2005 VPAC.
++++ 1D Tests +++
+
+(3,0,0) in mesh sized 8*0*0 -> index 3
+which maps back to (3,0,0)
+(0,3,0) in mesh sized 0*8*0 -> index 3
+which maps back to (0,3,0)
+(0,0,3) in mesh sized 0*0*8 -> index 3
+which maps back to (0,0,3)
+
++++ 2D Tests +++
+
+(3,4,0) in mesh sized 8*8*0 -> index 35
+which maps back to (3,4,0)
+(3,0,4) in mesh sized 8*0*8 -> index 35
+which maps back to (3,0,4)
+(0,3,4) in mesh sized 0*8*8 -> index 35
+which maps back to (0,3,4)
+
++++ 3D Tests +++
+
+(0,0,0) in mesh sized 3*4*5 -> index 0
+which maps back to (0,0,0)
+(1,0,0) in mesh sized 3*4*5 -> index 1
+which maps back to (1,0,0)
+(2,0,0) in mesh sized 3*4*5 -> index 2
+which maps back to (2,0,0)
+(0,1,0) in mesh sized 3*4*5 -> index 3
+which maps back to (0,1,0)
+(1,1,0) in mesh sized 3*4*5 -> index 4
+which maps back to (1,1,0)
+(2,1,0) in mesh sized 3*4*5 -> index 5
+which maps back to (2,1,0)
+(0,2,0) in mesh sized 3*4*5 -> index 6
+which maps back to (0,2,0)
+(1,2,0) in mesh sized 3*4*5 -> index 7
+which maps back to (1,2,0)
+(2,2,0) in mesh sized 3*4*5 -> index 8
+which maps back to (2,2,0)
+(0,3,0) in mesh sized 3*4*5 -> index 9
+which maps back to (0,3,0)
+(1,3,0) in mesh sized 3*4*5 -> index 10
+which maps back to (1,3,0)
+(2,3,0) in mesh sized 3*4*5 -> index 11
+which maps back to (2,3,0)
+(0,0,1) in mesh sized 3*4*5 -> index 12
+which maps back to (0,0,1)
+(1,0,1) in mesh sized 3*4*5 -> index 13
+which maps back to (1,0,1)
+(2,0,1) in mesh sized 3*4*5 -> index 14
+which maps back to (2,0,1)
+(0,1,1) in mesh sized 3*4*5 -> index 15
+which maps back to (0,1,1)
+(1,1,1) in mesh sized 3*4*5 -> index 16
+which maps back to (1,1,1)
+(2,1,1) in mesh sized 3*4*5 -> index 17
+which maps back to (2,1,1)
+(0,2,1) in mesh sized 3*4*5 -> index 18
+which maps back to (0,2,1)
+(1,2,1) in mesh sized 3*4*5 -> index 19
+which maps back to (1,2,1)
+(2,2,1) in mesh sized 3*4*5 -> index 20
+which maps back to (2,2,1)
+(0,3,1) in mesh sized 3*4*5 -> index 21
+which maps back to (0,3,1)
+(1,3,1) in mesh sized 3*4*5 -> index 22
+which maps back to (1,3,1)
+(2,3,1) in mesh sized 3*4*5 -> index 23
+which maps back to (2,3,1)
+(0,0,2) in mesh sized 3*4*5 -> index 24
+which maps back to (0,0,2)
+(1,0,2) in mesh sized 3*4*5 -> index 25
+which maps back to (1,0,2)
+(2,0,2) in mesh sized 3*4*5 -> index 26
+which maps back to (2,0,2)
+(0,1,2) in mesh sized 3*4*5 -> index 27
+which maps back to (0,1,2)
+(1,1,2) in mesh sized 3*4*5 -> index 28
+which maps back to (1,1,2)
+(2,1,2) in mesh sized 3*4*5 -> index 29
+which maps back to (2,1,2)
+(0,2,2) in mesh sized 3*4*5 -> index 30
+which maps back to (0,2,2)
+(1,2,2) in mesh sized 3*4*5 -> index 31
+which maps back to (1,2,2)
+(2,2,2) in mesh sized 3*4*5 -> index 32
+which maps back to (2,2,2)
+(0,3,2) in mesh sized 3*4*5 -> index 33
+which maps back to (0,3,2)
+(1,3,2) in mesh sized 3*4*5 -> index 34
+which maps back to (1,3,2)
+(2,3,2) in mesh sized 3*4*5 -> index 35
+which maps back to (2,3,2)
+(0,0,3) in mesh sized 3*4*5 -> index 36
+which maps back to (0,0,3)
+(1,0,3) in mesh sized 3*4*5 -> index 37
+which maps back to (1,0,3)
+(2,0,3) in mesh sized 3*4*5 -> index 38
+which maps back to (2,0,3)
+(0,1,3) in mesh sized 3*4*5 -> index 39
+which maps back to (0,1,3)
+(1,1,3) in mesh sized 3*4*5 -> index 40
+which maps back to (1,1,3)
+(2,1,3) in mesh sized 3*4*5 -> index 41
+which maps back to (2,1,3)
+(0,2,3) in mesh sized 3*4*5 -> index 42
+which maps back to (0,2,3)
+(1,2,3) in mesh sized 3*4*5 -> index 43
+which maps back to (1,2,3)
+(2,2,3) in mesh sized 3*4*5 -> index 44
+which maps back to (2,2,3)
+(0,3,3) in mesh sized 3*4*5 -> index 45
+which maps back to (0,3,3)
+(1,3,3) in mesh sized 3*4*5 -> index 46
+which maps back to (1,3,3)
+(2,3,3) in mesh sized 3*4*5 -> index 47
+which maps back to (2,3,3)
+(0,0,4) in mesh sized 3*4*5 -> index 48
+which maps back to (0,0,4)
+(1,0,4) in mesh sized 3*4*5 -> index 49
+which maps back to (1,0,4)
+(2,0,4) in mesh sized 3*4*5 -> index 50
+which maps back to (2,0,4)
+(0,1,4) in mesh sized 3*4*5 -> index 51
+which maps back to (0,1,4)
+(1,1,4) in mesh sized 3*4*5 -> index 52
+which maps back to (1,1,4)
+(2,1,4) in mesh sized 3*4*5 -> index 53
+which maps back to (2,1,4)
+(0,2,4) in mesh sized 3*4*5 -> index 54
+which maps back to (0,2,4)
+(1,2,4) in mesh sized 3*4*5 -> index 55
+which maps back to (1,2,4)
+(2,2,4) in mesh sized 3*4*5 -> index 56
+which maps back to (2,2,4)
+(0,3,4) in mesh sized 3*4*5 -> index 57
+which maps back to (0,3,4)
+(1,3,4) in mesh sized 3*4*5 -> index 58
+which maps back to (1,3,4)
+(2,3,4) in mesh sized 3*4*5 -> index 59
+which maps back to (2,3,4)
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testDimensionMacros.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testDimensionMacros.0of1.sh	Wed Oct 10 07:21:38 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 "testDimensionMacros " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testDimensionMacros.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testDimensionMacros.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,114 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testDimensionMacros.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+
+void testDimensionMacros_DoOneTest( IJK coord, IJK meshSize );
+
+int main( int argc, char* argv[] ) {
+	IJK coord;
+	IJK meshSize;
+	Index i, j, k;
+	MPI_Comm CommWorld;
+	int rank;
+	int numProcessors;
+	
+	/* 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 );
+	StgDomainGeometry_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	printf( "+++ 1D Tests +++\n\n" );
+	coord[I_AXIS] = 3; coord[J_AXIS] = 0; coord[K_AXIS] = 0;
+	meshSize[I_AXIS] = 8; meshSize[J_AXIS] = 0; meshSize[K_AXIS] = 0;
+	testDimensionMacros_DoOneTest( coord, meshSize );
+	
+	coord[I_AXIS] = 0; coord[J_AXIS] = 3; coord[K_AXIS] = 0;
+	meshSize[I_AXIS] = 0; meshSize[J_AXIS] = 8; meshSize[K_AXIS] = 0;
+	testDimensionMacros_DoOneTest( coord, meshSize );
+	
+	coord[I_AXIS] = 0; coord[J_AXIS] = 0; coord[K_AXIS] = 3;
+	meshSize[I_AXIS] = 0; meshSize[J_AXIS] = 0; meshSize[K_AXIS] = 8;
+	testDimensionMacros_DoOneTest( coord, meshSize );
+
+	printf( "\n+++ 2D Tests +++\n\n" );
+	coord[I_AXIS] = 3; coord[J_AXIS] = 4; coord[K_AXIS] = 0;
+	meshSize[I_AXIS] = 8; meshSize[J_AXIS] = 8; meshSize[K_AXIS] = 0;
+	testDimensionMacros_DoOneTest( coord, meshSize );
+	
+	coord[I_AXIS] = 3; coord[J_AXIS] = 0; coord[K_AXIS] = 4;
+	meshSize[I_AXIS] = 8; meshSize[J_AXIS] = 0; meshSize[K_AXIS] = 8;
+	testDimensionMacros_DoOneTest( coord, meshSize );
+	
+	coord[I_AXIS] = 0; coord[J_AXIS] = 3; coord[K_AXIS] = 4;
+	meshSize[I_AXIS] = 0; meshSize[J_AXIS] = 8; meshSize[K_AXIS] = 8;
+	testDimensionMacros_DoOneTest( coord, meshSize );
+	
+	printf( "\n+++ 3D Tests +++\n\n" );
+	meshSize[I_AXIS] = 3; meshSize[J_AXIS] = 4; meshSize[K_AXIS] = 5;
+	for ( k=0; k < meshSize[K_AXIS]; k++ ) {
+		for ( j=0; j < meshSize[J_AXIS]; j++ ) {
+			for ( i=0; i < meshSize[I_AXIS]; i++ ) {
+				coord[I_AXIS] = i; coord[J_AXIS] = j; coord[K_AXIS] = k;
+				testDimensionMacros_DoOneTest( coord, meshSize );
+			}
+		}
+	}	
+	
+	StgDomainGeometry_Finalise();
+	StGermain_Finalise();
+	MPI_Finalize();
+	return 0;
+}
+
+void testDimensionMacros_DoOneTest( IJK coord, IJK meshSize ) {
+	IJK newCoord;
+	Index element_I;
+	
+	printf( "(%d,%d,%d) in mesh sized %d*%d*%d -> ",
+		coord[0], coord[1], coord[2],
+		meshSize[0], meshSize[1], meshSize[2] );
+	
+	Dimension_3DTo1D( coord, meshSize, &element_I );
+	printf( "index %d\n", element_I );
+	Dimension_1DTo3D( element_I, meshSize, newCoord );
+	printf( "which maps back to (%d,%d,%d)\n", 
+		newCoord[0], newCoord[1], newCoord[2] );
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testEdge.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testEdge.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,202 @@
+StGermain Framework. Copyright (C) 2003-2005 VPAC.
+Edge: 0, points: { 0, 1 }, faces: { 0, 100 }
+Edge: 1, points: { 1, 2 }, faces: { 0, 1 }
+Edge: 2, points: { 2, 0 }, faces: { 0, 100 }
+Edge: 3, points: { 1, 3 }, faces: { 1, 100 }
+Edge: 4, points: { 3, 2 }, faces: { 1, 2 }
+Edge: 5, points: { 3, 4 }, faces: { 2, 3 }
+Edge: 6, points: { 4, 2 }, faces: { 2, 100 }
+Edge: 7, points: { 3, 5 }, faces: { 3, 100 }
+Edge: 8, points: { 5, 4 }, faces: { 3, 4 }
+Edge: 9, points: { 5, 6 }, faces: { 4, 5 }
+Edge: 10, points: { 6, 4 }, faces: { 4, 100 }
+Edge: 11, points: { 5, 7 }, faces: { 5, 100 }
+Edge: 12, points: { 7, 6 }, faces: { 5, 6 }
+Edge: 13, points: { 7, 8 }, faces: { 6, 7 }
+Edge: 14, points: { 8, 6 }, faces: { 6, 100 }
+Edge: 15, points: { 7, 9 }, faces: { 7, 100 }
+Edge: 16, points: { 9, 8 }, faces: { 7, 8 }
+Edge: 17, points: { 9, 10 }, faces: { 8, 9 }
+Edge: 18, points: { 10, 8 }, faces: { 8, 100 }
+Edge: 19, points: { 9, 11 }, faces: { 9, 100 }
+Edge: 20, points: { 11, 10 }, faces: { 9, 10 }
+Edge: 21, points: { 11, 12 }, faces: { 10, 11 }
+Edge: 22, points: { 12, 10 }, faces: { 10, 100 }
+Edge: 23, points: { 11, 13 }, faces: { 11, 100 }
+Edge: 24, points: { 13, 12 }, faces: { 11, 12 }
+Edge: 25, points: { 13, 14 }, faces: { 12, 13 }
+Edge: 26, points: { 14, 12 }, faces: { 12, 100 }
+Edge: 27, points: { 13, 15 }, faces: { 13, 100 }
+Edge: 28, points: { 15, 14 }, faces: { 13, 14 }
+Edge: 29, points: { 15, 16 }, faces: { 14, 15 }
+Edge: 30, points: { 16, 14 }, faces: { 14, 100 }
+Edge: 31, points: { 15, 17 }, faces: { 15, 100 }
+Edge: 32, points: { 17, 16 }, faces: { 15, 16 }
+Edge: 33, points: { 17, 18 }, faces: { 16, 17 }
+Edge: 34, points: { 18, 16 }, faces: { 16, 100 }
+Edge: 35, points: { 17, 19 }, faces: { 17, 100 }
+Edge: 36, points: { 19, 18 }, faces: { 17, 18 }
+Edge: 37, points: { 19, 20 }, faces: { 18, 19 }
+Edge: 38, points: { 20, 18 }, faces: { 18, 100 }
+Edge: 39, points: { 19, 21 }, faces: { 19, 100 }
+Edge: 40, points: { 21, 20 }, faces: { 19, 20 }
+Edge: 41, points: { 21, 22 }, faces: { 20, 21 }
+Edge: 42, points: { 22, 20 }, faces: { 20, 100 }
+Edge: 43, points: { 21, 23 }, faces: { 21, 100 }
+Edge: 44, points: { 23, 22 }, faces: { 21, 22 }
+Edge: 45, points: { 23, 24 }, faces: { 22, 23 }
+Edge: 46, points: { 24, 22 }, faces: { 22, 100 }
+Edge: 47, points: { 23, 25 }, faces: { 23, 100 }
+Edge: 48, points: { 25, 24 }, faces: { 23, 24 }
+Edge: 49, points: { 25, 26 }, faces: { 24, 25 }
+Edge: 50, points: { 26, 24 }, faces: { 24, 100 }
+Edge: 51, points: { 25, 27 }, faces: { 25, 100 }
+Edge: 52, points: { 27, 26 }, faces: { 25, 26 }
+Edge: 53, points: { 27, 28 }, faces: { 26, 27 }
+Edge: 54, points: { 28, 26 }, faces: { 26, 100 }
+Edge: 55, points: { 27, 29 }, faces: { 27, 100 }
+Edge: 56, points: { 29, 28 }, faces: { 27, 28 }
+Edge: 57, points: { 29, 30 }, faces: { 28, 29 }
+Edge: 58, points: { 30, 28 }, faces: { 28, 100 }
+Edge: 59, points: { 29, 31 }, faces: { 29, 100 }
+Edge: 60, points: { 31, 30 }, faces: { 29, 30 }
+Edge: 61, points: { 31, 32 }, faces: { 30, 31 }
+Edge: 62, points: { 32, 30 }, faces: { 30, 100 }
+Edge: 63, points: { 31, 33 }, faces: { 31, 100 }
+Edge: 64, points: { 33, 32 }, faces: { 31, 32 }
+Edge: 65, points: { 33, 34 }, faces: { 32, 33 }
+Edge: 66, points: { 34, 32 }, faces: { 32, 100 }
+Edge: 67, points: { 33, 35 }, faces: { 33, 100 }
+Edge: 68, points: { 35, 34 }, faces: { 33, 34 }
+Edge: 69, points: { 35, 36 }, faces: { 34, 35 }
+Edge: 70, points: { 36, 34 }, faces: { 34, 100 }
+Edge: 71, points: { 35, 37 }, faces: { 35, 100 }
+Edge: 72, points: { 37, 36 }, faces: { 35, 36 }
+Edge: 73, points: { 37, 38 }, faces: { 36, 37 }
+Edge: 74, points: { 38, 36 }, faces: { 36, 100 }
+Edge: 75, points: { 37, 39 }, faces: { 37, 100 }
+Edge: 76, points: { 39, 38 }, faces: { 37, 38 }
+Edge: 77, points: { 39, 40 }, faces: { 38, 39 }
+Edge: 78, points: { 40, 38 }, faces: { 38, 100 }
+Edge: 79, points: { 39, 41 }, faces: { 39, 100 }
+Edge: 80, points: { 41, 40 }, faces: { 39, 40 }
+Edge: 81, points: { 41, 42 }, faces: { 40, 41 }
+Edge: 82, points: { 42, 40 }, faces: { 40, 100 }
+Edge: 83, points: { 41, 43 }, faces: { 41, 100 }
+Edge: 84, points: { 43, 42 }, faces: { 41, 42 }
+Edge: 85, points: { 43, 44 }, faces: { 42, 43 }
+Edge: 86, points: { 44, 42 }, faces: { 42, 100 }
+Edge: 87, points: { 43, 45 }, faces: { 43, 100 }
+Edge: 88, points: { 45, 44 }, faces: { 43, 44 }
+Edge: 89, points: { 45, 46 }, faces: { 44, 45 }
+Edge: 90, points: { 46, 44 }, faces: { 44, 100 }
+Edge: 91, points: { 45, 47 }, faces: { 45, 100 }
+Edge: 92, points: { 47, 46 }, faces: { 45, 46 }
+Edge: 93, points: { 47, 48 }, faces: { 46, 47 }
+Edge: 94, points: { 48, 46 }, faces: { 46, 100 }
+Edge: 95, points: { 47, 49 }, faces: { 47, 100 }
+Edge: 96, points: { 49, 48 }, faces: { 47, 48 }
+Edge: 97, points: { 49, 50 }, faces: { 48, 49 }
+Edge: 98, points: { 50, 48 }, faces: { 48, 100 }
+Edge: 99, points: { 49, 51 }, faces: { 49, 100 }
+Edge: 100, points: { 51, 50 }, faces: { 49, 50 }
+Edge: 101, points: { 51, 52 }, faces: { 50, 51 }
+Edge: 102, points: { 52, 50 }, faces: { 50, 100 }
+Edge: 103, points: { 51, 53 }, faces: { 51, 100 }
+Edge: 104, points: { 53, 52 }, faces: { 51, 52 }
+Edge: 105, points: { 53, 54 }, faces: { 52, 53 }
+Edge: 106, points: { 54, 52 }, faces: { 52, 100 }
+Edge: 107, points: { 53, 55 }, faces: { 53, 100 }
+Edge: 108, points: { 55, 54 }, faces: { 53, 54 }
+Edge: 109, points: { 55, 56 }, faces: { 54, 55 }
+Edge: 110, points: { 56, 54 }, faces: { 54, 100 }
+Edge: 111, points: { 55, 57 }, faces: { 55, 100 }
+Edge: 112, points: { 57, 56 }, faces: { 55, 56 }
+Edge: 113, points: { 57, 58 }, faces: { 56, 57 }
+Edge: 114, points: { 58, 56 }, faces: { 56, 100 }
+Edge: 115, points: { 57, 59 }, faces: { 57, 100 }
+Edge: 116, points: { 59, 58 }, faces: { 57, 58 }
+Edge: 117, points: { 59, 60 }, faces: { 58, 59 }
+Edge: 118, points: { 60, 58 }, faces: { 58, 100 }
+Edge: 119, points: { 59, 61 }, faces: { 59, 100 }
+Edge: 120, points: { 61, 60 }, faces: { 59, 60 }
+Edge: 121, points: { 61, 62 }, faces: { 60, 61 }
+Edge: 122, points: { 62, 60 }, faces: { 60, 100 }
+Edge: 123, points: { 61, 63 }, faces: { 61, 100 }
+Edge: 124, points: { 63, 62 }, faces: { 61, 62 }
+Edge: 125, points: { 63, 64 }, faces: { 62, 63 }
+Edge: 126, points: { 64, 62 }, faces: { 62, 100 }
+Edge: 127, points: { 63, 65 }, faces: { 63, 100 }
+Edge: 128, points: { 65, 64 }, faces: { 63, 64 }
+Edge: 129, points: { 65, 66 }, faces: { 64, 65 }
+Edge: 130, points: { 66, 64 }, faces: { 64, 100 }
+Edge: 131, points: { 65, 67 }, faces: { 65, 100 }
+Edge: 132, points: { 67, 66 }, faces: { 65, 66 }
+Edge: 133, points: { 67, 68 }, faces: { 66, 67 }
+Edge: 134, points: { 68, 66 }, faces: { 66, 100 }
+Edge: 135, points: { 67, 69 }, faces: { 67, 100 }
+Edge: 136, points: { 69, 68 }, faces: { 67, 68 }
+Edge: 137, points: { 69, 70 }, faces: { 68, 69 }
+Edge: 138, points: { 70, 68 }, faces: { 68, 100 }
+Edge: 139, points: { 69, 71 }, faces: { 69, 100 }
+Edge: 140, points: { 71, 70 }, faces: { 69, 70 }
+Edge: 141, points: { 71, 72 }, faces: { 70, 71 }
+Edge: 142, points: { 72, 70 }, faces: { 70, 100 }
+Edge: 143, points: { 71, 73 }, faces: { 71, 100 }
+Edge: 144, points: { 73, 72 }, faces: { 71, 72 }
+Edge: 145, points: { 73, 74 }, faces: { 72, 73 }
+Edge: 146, points: { 74, 72 }, faces: { 72, 100 }
+Edge: 147, points: { 73, 75 }, faces: { 73, 100 }
+Edge: 148, points: { 75, 74 }, faces: { 73, 74 }
+Edge: 149, points: { 75, 76 }, faces: { 74, 75 }
+Edge: 150, points: { 76, 74 }, faces: { 74, 100 }
+Edge: 151, points: { 75, 77 }, faces: { 75, 100 }
+Edge: 152, points: { 77, 76 }, faces: { 75, 76 }
+Edge: 153, points: { 77, 78 }, faces: { 76, 77 }
+Edge: 154, points: { 78, 76 }, faces: { 76, 100 }
+Edge: 155, points: { 77, 79 }, faces: { 77, 100 }
+Edge: 156, points: { 79, 78 }, faces: { 77, 78 }
+Edge: 157, points: { 79, 80 }, faces: { 78, 79 }
+Edge: 158, points: { 80, 78 }, faces: { 78, 100 }
+Edge: 159, points: { 79, 81 }, faces: { 79, 100 }
+Edge: 160, points: { 81, 80 }, faces: { 79, 80 }
+Edge: 161, points: { 81, 82 }, faces: { 80, 81 }
+Edge: 162, points: { 82, 80 }, faces: { 80, 100 }
+Edge: 163, points: { 81, 83 }, faces: { 81, 100 }
+Edge: 164, points: { 83, 82 }, faces: { 81, 82 }
+Edge: 165, points: { 83, 84 }, faces: { 82, 83 }
+Edge: 166, points: { 84, 82 }, faces: { 82, 100 }
+Edge: 167, points: { 83, 85 }, faces: { 83, 100 }
+Edge: 168, points: { 85, 84 }, faces: { 83, 84 }
+Edge: 169, points: { 85, 86 }, faces: { 84, 85 }
+Edge: 170, points: { 86, 84 }, faces: { 84, 100 }
+Edge: 171, points: { 85, 87 }, faces: { 85, 100 }
+Edge: 172, points: { 87, 86 }, faces: { 85, 86 }
+Edge: 173, points: { 87, 88 }, faces: { 86, 87 }
+Edge: 174, points: { 88, 86 }, faces: { 86, 100 }
+Edge: 175, points: { 87, 89 }, faces: { 87, 100 }
+Edge: 176, points: { 89, 88 }, faces: { 87, 88 }
+Edge: 177, points: { 89, 90 }, faces: { 88, 89 }
+Edge: 178, points: { 90, 88 }, faces: { 88, 100 }
+Edge: 179, points: { 89, 91 }, faces: { 89, 100 }
+Edge: 180, points: { 91, 90 }, faces: { 89, 90 }
+Edge: 181, points: { 91, 92 }, faces: { 90, 91 }
+Edge: 182, points: { 92, 90 }, faces: { 90, 100 }
+Edge: 183, points: { 91, 93 }, faces: { 91, 100 }
+Edge: 184, points: { 93, 92 }, faces: { 91, 92 }
+Edge: 185, points: { 93, 94 }, faces: { 92, 93 }
+Edge: 186, points: { 94, 92 }, faces: { 92, 100 }
+Edge: 187, points: { 93, 95 }, faces: { 93, 100 }
+Edge: 188, points: { 95, 94 }, faces: { 93, 94 }
+Edge: 189, points: { 95, 96 }, faces: { 94, 95 }
+Edge: 190, points: { 96, 94 }, faces: { 94, 100 }
+Edge: 191, points: { 95, 97 }, faces: { 95, 100 }
+Edge: 192, points: { 97, 96 }, faces: { 95, 96 }
+Edge: 193, points: { 97, 98 }, faces: { 96, 97 }
+Edge: 194, points: { 98, 96 }, faces: { 96, 100 }
+Edge: 195, points: { 97, 99 }, faces: { 97, 100 }
+Edge: 196, points: { 99, 98 }, faces: { 97, 98 }
+Edge: 197, points: { 99, 100 }, faces: { 98, 99 }
+Edge: 198, points: { 100, 98 }, faces: { 98, 100 }
+Edge: 199, points: { 99, 101 }, faces: { 99, 100 }
+Edge: 200, points: { 101, 100 }, faces: { 99, 100 }
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testEdge.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testEdge.0of1.sh	Wed Oct 10 07:21:38 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 "testEdge " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testEdge.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testEdge.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,100 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testEdge.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.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 );
+	
+	StGermain_Init( &argc, &argv );
+	
+	StgDomainGeometry_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 ) {
+		Triangle	tri[100];
+		Triangle_Index	triCount = 100;
+		Edge_Index	edgeCount;
+		Edge_List	edge;
+		EdgeFaces_List	edgeFace;
+		Triangle_Index	tri_I;
+		Edge_Index	edge_I;
+
+		tri[0][0] = 0;
+		tri[0][1] = 1;
+		tri[0][2] = 2;
+		for( tri_I = 1; tri_I < triCount; tri_I++ )
+		{
+			tri[tri_I][0] = tri[tri_I - 1][0] + 1;
+			tri[tri_I][1] = tri[tri_I - 1][2] + 1;
+			tri[tri_I][2] = tri[tri_I - 1][1] + 1;
+		}
+
+		edgeCount = Edge_BuildList_FromTriangles( tri, triCount, &edge, &edgeFace );
+
+		for( edge_I = 0; edge_I < edgeCount; edge_I++ )
+		{
+			printf( "Edge: %u, points: { %u, %u }, ", edge_I, edge[edge_I][0], edge[edge_I][1] );
+			printf( "faces: { %u, %u }\n", edgeFace[edge_I][0], edgeFace[edge_I][1] );
+		}
+
+		if( edge ) Memory_Free( edge );
+		if( edgeFace ) Memory_Free( edgeFace );
+	}
+	
+	StgDomainGeometry_Finalise();
+	
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testFullTensorMath.0of1.FullTensorMath.txt.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testFullTensorMath.0of1.FullTensorMath.txt.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,261 @@
+
+/*******************    Test Eigenvector 1   ************************/
+Symmetric 2D Case from Kresig, p. 371f
+
+Matrix to solve for eigenvectors is:
+tensorArray - 
+     -5           2     
+      2          -2     
+
+Eigenvalues within tolerance, 1e-06 of:
+eigenvectorListCompare[0].eigenvalue = -1 + 0 i
+eigenvectorListCompare[1].eigenvalue = -6 + 0 i
+
+Eigenvectors within tolerance, 1e-06 of:
+eigenvectorListCompare[0].vector - {-0.447214 + i 0, -0.894427 + i 0}
+eigenvectorListCompare[1].vector - {-0.894427 + i 0, 0.447214 + i 0}
+
+/*******************    Test Eigenvector 2   ************************/
+Symmetric 3D Case - tested against:
+http://www.arndt-bruenner.de/mathe/scripts/engl_eigenwert.htm - 3/11/04.
+Matrix to solve for eigenvectors is:
+tensorArray - 
+      2           7          11     
+      7           3          13     
+     11          13           5     
+
+Eigenvalues within tolerance, 1e-06 of:
+eigenvectorListCompare[0].eigenvalue = -4.4597 + 0 i
+eigenvectorListCompare[1].eigenvalue = -9.9685 + 0 i
+eigenvectorListCompare[2].eigenvalue = 24.428 + 0 i
+
+Eigenvectors within tolerance, 1e-06 of:
+eigenvectorListCompare[0].vector - {-0.786471 + i 0, 0.61348 + i 0, 0.0714557 + i 0}
+eigenvectorListCompare[1].vector - {-0.364102 + i 0, -0.553977 + i 0, 0.748692 + i 0}
+eigenvectorListCompare[2].vector - {-0.498892 + i 0, -0.562807 + i 0, -0.659056 + i 0}
+
+/*******************    Test Eigenvector 3   ************************/
+Non-Symmetric test for 2-D
+
+tensorArray - 
+      4           4     
+      3           5     
+
+Eigenvalues within tolerance, 1e-06 of:
+eigenvectorListCompare[0].eigenvalue = 1 + 0 i
+eigenvectorListCompare[1].eigenvalue = 8 + 0 i
+
+Eigenvectors within tolerance, 1e-06 of:
+eigenvectorListCompare[0].vector - {-0.8 + i 0, 0.6 + i 0}
+eigenvectorListCompare[1].vector - {-0.707107 + i 0, -0.707107 + i 0}
+
+
+/*******************    Test Eigenvector 4   ************************/
+Non-Symmetric Test for 3-D
+
+tensorArray - 
+      4           0           3     
+      0           5           0     
+      2           5           6     
+
+Eigenvalues within tolerance, 1e-06 of:
+eigenvectorListCompare[0].eigenvalue = 2.3542 + 0 i
+eigenvectorListCompare[1].eigenvalue = 5 + 0 i
+eigenvectorListCompare[2].eigenvalue = 7.6458 + 0 i
+
+Eigenvectors within tolerance, 1e-06 of:
+eigenvectorListCompare[0].vector - {-0.87674 + i 0, 0 + i 0, 0.480965 + i 0}
+eigenvectorListCompare[1].vector - {-0.867472 + i 0, 0.40482 + i 0, -0.289157 + i 0}
+eigenvectorListCompare[2].vector - {-0.635406 + i 0, 0 + i 0, -0.772178 + i 0}
+
+
+/*******************    Test Eigenvector 5   ************************/
+Non-Symmetric test with zero entries for 2-D
+
+tensorArray - 
+      4           0     
+      1           5     
+
+Eigenvalues within tolerance, 1e-06 of:
+eigenvectorListCompare[0].eigenvalue = 4 + 0 i
+eigenvectorListCompare[1].eigenvalue = 5 + 0 i
+
+Eigenvectors within tolerance, 1e-06 of:
+eigenvectorListCompare[0].vector - {0.707107 + i 0, -0.707107 + i 0}
+eigenvectorListCompare[1].vector - {0 + i 0, 1 + i 0}
+
+
+/*******************    Test Eigenvector 6   ************************/
+Non-Symmetric test with complex eigenvalues for 2-D
+
+Tested against Soluions in:
+Elementary Differential Equations and Boundary Value Problems, 6th Ed
+By William E. Boyce and Richard C. DiPrima
+Problem: ch 7.3, question 16
+
+tensorArray - 
+      3          -2     
+      4          -1     
+
+Eigenvalues within tolerance, 1e-06 of:
+eigenvectorListCompare[0].eigenvalue = 1 + 2 i
+eigenvectorListCompare[1].eigenvalue = 1 - 2 i
+
+Eigenvectors within tolerance, 1e-06 of:
+eigenvectorListCompare[0].vector - {0.408248 + i 0.408248, 0.816497 + i 0}
+eigenvectorListCompare[1].vector - {0.408248 + i -0.408248, 0.816497 + i 0}
+
+/*******************    Test Eigenvector 7   ************************/
+Non-Symmetric test with complex eigenvalues for 3-D
+Tested against Soluions in:
+Elementary Differential Equations and Boundary Value Problems, 6th Ed
+By William E. Boyce and Richard C. DiPrima
+Problem: ch 7.3, question 21
+
+tensorArray - 
+      1           0           0     
+      2           1          -2     
+      3           2           1     
+
+Eigenvalues within tolerance, 1e-06 of:
+eigenvectorListCompare[0].eigenvalue = 1 + 0 i
+eigenvectorListCompare[1].eigenvalue = 1 + 2 i
+eigenvectorListCompare[2].eigenvalue = 1 - 2 i
+
+Eigenvectors within tolerance, 1e-06 of:
+eigenvectorListCompare[0].vector - {0.485071 + i 0, -0.727607 + i 0, 0.485071 + i 0}
+eigenvectorListCompare[1].vector - {0 + i 0, 0.707107 + i 0, 0 + i -0.707107}
+eigenvectorListCompare[2].vector - {0 + i 0, 0.707107 + i 0, 0 + i 0.707107}
+
+
+/*******************    Eigenvector Test  8  ************************/
+Test Calc eigenvectors function with repeated roots
+
+Tested against Solutions in:
+Elementary Differential Equations and Boundary Value Problems, 6th Ed
+By William E. Boyce and Richard C. DiPrima
+Problem: ch 7.3, question 24
+
+tensorArray - 
+      3           2           4     
+      2           0           2     
+      4           2           3     
+
+Eigenvalues within tolerance, 1e-06 of:
+eigenvectorListCompare[0].eigenvalue = -1 + 0 i
+eigenvectorListCompare[1].eigenvalue = -1 + 0 i
+eigenvectorListCompare[2].eigenvalue = 8 + 0 i
+
+Non-repeated Eigenvector within tolerance, 1e-06,
+And Repeated Eigenvectors follow pattern:
+2 * x_1 + x_2 + 2 * x_3 = 0 to within tolerance, 1e-06 of:
+One set of correct eigenvectors: 
+eigenvectorListCompare[0].vector - {0 + i 0, -0.894427 + i 0, 0.447214 + i 0}
+eigenvectorListCompare[1].vector - {-0.719905 + i 0, 0.519697 + i 0, 0.460056 + i 0}
+eigenvectorListCompare[2].vector - {0.666667 + i 0, 0.333333 + i 0, 0.666667 + i 0}
+
+For repeated eigenvalues with non-degenerate eigenvectors, 
+eigenvectors have to be in same plane as solution vectors 
+rather than exactly the same, as eigenvectors can be arbitrarily set
+based on the specific tensor array equation.
+For this problem, solution for repeated eigenvectors collapses to:
+2 * x_1 + x_2 + 2 * x_3 = 0
+Eigenvectors are then set based on what x_1, x_2 and x_3 are set to equal.
+
+/*******************    Test  10  ************************/
+Test print ComplexTensorArray function
+
+2-D
+complexTensorArray - 
+      4 +       0 i      4 +       1 i
+      3 +    0.33 i      5 +     100 i
+3-D
+complexTensorArray - 
+      1 +     0.5 i      2 +       0 i      3 +       0 i
+      4 +       0 i      5 +       1 i      6 +       2 i
+      7 +       0 i      8 +       0 i      9 +      30 i
+
+/*******************    Test  11  ************************/
+Test print ComplexMatrix function
+
+2-D
+complexMatrix - 
+      1 +       0 i      2 +       1 i
+      3 +    0.33 i      5 +     100 i
+3-D
+complexMatrix - 
+      1 +       0 i      2 +       1 i      4 +       1 i
+      3 +    0.33 i      5 +     100 i      5 +    10.5 i
+     30 +    0.33 i    0.5 +     100 i    5.5 +    10.5 i
+
+/*******************    Test  12  ************************/
+Test TensorArray to ComplexTensorArray conversion function
+
+2-D conversion
+tensorArray - 
+      1           3     
+      4           5     
+complexTensorArray - 
+      1 +       0 i      3 +       0 i
+      4 +       0 i      5 +       0 i
+3-D conversion
+tensorArray - 
+      1           3           4     
+      5           7           8     
+      9          11          12     
+complexTensorArray - 
+      1 +       0 i      3 +       0 i      4 +       0 i
+      5 +       0 i      7 +       0 i      8 +       0 i
+      9 +       0 i     11 +       0 i     12 +       0 i
+
+/*******************    Test  13  ************************/
+Test ComplexTensorArray to ComplexMatrix conversion function
+
+2-D conversion
+complexTensorArray - 
+      1 +     0.5 i      2 +       0 i
+      3 +       0 i      4 +       0 i
+complexMatrix - 
+      1 +     0.5 i      2 +       0 i
+      3 +       0 i      4 +       0 i
+3-D conversion
+complexTensorArray - 
+      1 +     0.5 i      2 +       0 i      3 +       0 i
+      4 +       0 i      5 +       1 i      6 +       2 i
+      7 +       0 i      8 +       0 i      9 +      30 i
+complexMatrix - 
+      1 +     0.5 i      2 +       0 i      3 +       0 i
+      4 +       0 i      5 +       1 i      6 +       2 i
+      7 +       0 i      8 +       0 i      9 +      30 i
+
+/*******************    Test  14  ************************/
+Test ComplexTensorArray to TensorArray conversion function
+
+2-D conversion
+complexTensorArray - 
+      1 +       0 i      2 +       0 i
+      3 +       0 i      4 +       0 i
+tensorArray - 
+      1           2     
+      3           4     
+3-D conversion
+complexTensorArray - 
+      1 +       0 i      2 +       0 i      3 +       0 i
+      4 +       0 i      5 +       0 i      6 +       0 i
+      7 +       0 i     88 +       0 i    9.5 +       0 i
+tensorArray - 
+      1           2           3     
+      4           5           6     
+      7          88         9.5     
+Failing conversion
+complexTensorArray - 
+      1 +       1 i      2 +       0 i      3 +       0 i
+      4 +       0 i      5 +       0 i      6 +       0 i
+      7 +       0 i     88 +       0 i    9.5 +       0 i
+Cannot convert to real matrix:
+Indicee 0 in complexTensorArray is complex value.
+complexTensorArray - 
+      1 +       1 i      2 +       0 i      3 +       0 i
+      4 +       0 i      5 +       0 i      6 +       0 i
+      7 +       0 i     88 +       0 i    9.5 +       0 i
+In func 'ComplexTensorArray_ToTensorArray'. Cannot convert ComplexTensor to Real Tensor 
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testFullTensorMath.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testFullTensorMath.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,1 @@
+StGermain Framework revision 3651. Copyright (C) 2003-2005 VPAC.
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testFullTensorMath.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testFullTensorMath.0of1.sh	Wed Oct 10 07:21:38 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 "testFullTensorMath " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testFullTensorMath.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testFullTensorMath.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,920 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+
+
+int main( int argc, char* argv[] ) {
+	MPI_Comm CommWorld;
+	int rank;
+	int numProcessors;
+	int procToWatch;
+	Stream*  stream = Journal_Register( InfoStream_Type, "FullTensorMath" );
+	
+	/* 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 );
+	
+	StgDomainGeometry_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	stJournal->firewallProducesAssert = False;
+	Stream_RedirectFile(Journal_Register( Error_Type, "FullTensorMath"), "FullTensorMath.txt");
+	Stream_RedirectFile(stream, "FullTensorMath.txt");
+	
+	
+	if( argc >= 2 ) {
+		procToWatch = atoi( argv[1] );
+	}
+	else {
+		procToWatch = 0;
+	}
+
+	if( rank == procToWatch ) {
+		double **tensor = Memory_Alloc_2DArray( double, 5, 5, "Tensor" );
+		TensorArray     tensorArray;
+		ComplexTensorArray complexTensorArray;
+		ComplexEigenvector eigenvectorList[3], eigenvectorListCompare[3], eigenvectorListDiffs[3];
+		Cmplx **complexMatrix;
+		double errorTolerance;
+		Cmplx dummy1, dummy2, dummy3;
+		int eigenCount;
+		#define STG_FULLTENSORTEST_ERROR 1.0e-6;
+		
+		errorTolerance = STG_FULLTENSORTEST_ERROR;
+		complexMatrix = Memory_Alloc_2DArray(Cmplx, 3, 3, "complexMatrix" );
+		
+		tensor[0][0] = 3;  tensor[0][1] = 21;   tensor[0][2] = -1; tensor[0][3] = -99; tensor[0][4] = 9;
+		tensor[1][0] = 6;  tensor[1][1] = 5.8;  tensor[1][2] = 32; tensor[1][3] = 3  ; tensor[1][4] = -2.5;
+		tensor[2][0] = 2;  tensor[2][1] = 2;    tensor[2][2] = -7; tensor[2][3] = 2  ; tensor[2][4] = 3.1;
+		tensor[3][0] = -4; tensor[3][1] = 9;    tensor[3][2] = 3 ; tensor[3][3] = 8  ; tensor[3][4] = 6;
+		tensor[4][0] = 3;  tensor[4][1] = 1;    tensor[4][2] = 9 ; tensor[4][3] = 2  ; tensor[4][4] = 12;
+		
+		Journal_Printf(stream, "\n/*******************    Test Eigenvector 1   ************************/\n");
+		Journal_Printf( stream, "Symmetric 2D Case from Kresig, p. 371f\n\n");
+		tensorArray[FT2D_00] = -5;
+		tensorArray[FT2D_11] = -2;
+		tensorArray[FT2D_01] =  2;
+		tensorArray[FT2D_10] =  2;
+
+		Journal_Printf( stream, "Matrix to solve for eigenvectors is:\n");
+		Journal_PrintTensorArray( stream, tensorArray, 2 );
+
+		TensorArray_CalcAllEigenvectors( tensorArray, 2, eigenvectorList );
+		
+		/* Set comparison eigenvecorList with correct solution */
+		eigenvectorListCompare[0].eigenvalue[REAL_PART] = -1;
+		eigenvectorListCompare[0].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[1].eigenvalue[REAL_PART] = -6;
+		eigenvectorListCompare[1].eigenvalue[IMAG_PART] = 0;
+
+		eigenvectorListCompare[0].vector[0][REAL_PART] = -0.447214;
+		eigenvectorListCompare[0].vector[0][IMAG_PART] = 0;
+
+		eigenvectorListCompare[0].vector[1][REAL_PART] = -0.894427;
+		eigenvectorListCompare[0].vector[1][IMAG_PART] = 0;
+
+		eigenvectorListCompare[1].vector[0][REAL_PART] = -0.894427;
+		eigenvectorListCompare[1].vector[0][IMAG_PART] = 0;
+
+		eigenvectorListCompare[1].vector[1][REAL_PART] = 0.447214;
+		eigenvectorListCompare[1].vector[1][IMAG_PART] = 0;
+		
+		/*Check if eigenvalue solution is within tolerance */
+		Cmplx_Subtract(eigenvectorListCompare[0].eigenvalue, eigenvectorList[0].eigenvalue, 
+						eigenvectorListDiffs[0].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[1].eigenvalue, eigenvectorList[1].eigenvalue, 
+						eigenvectorListDiffs[1].eigenvalue);
+
+		if ( ( Cmplx_Modulus(eigenvectorListDiffs[0].eigenvalue) <= errorTolerance ) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[1].eigenvalue) <= errorTolerance) ) 
+		{		
+			Journal_Printf(stream, "\nEigenvalues within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvalues not within tolerance, %g of:\n", errorTolerance); 
+		}
+		
+		/* Print correct eigenvalues */
+		Journal_PrintCmplx(stream,eigenvectorListCompare[0].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[1].eigenvalue );
+				/* Check if eigenvector solutions are within tolerance */
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[0].vector,
+				eigenvectorListCompare[0].vector,
+				eigenvectorList[0].vector, 2);
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[1].vector, 
+				eigenvectorListCompare[1].vector,
+				eigenvectorList[1].vector, 2);		
+		
+		if ( (StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[0].vector, 2) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[1].vector, 2) <=errorTolerance) )
+		{ 
+				
+			Journal_Printf(stream, "\nEigenvectors within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvectors not within tolerance, %g of:\n", errorTolerance); 
+		}
+		/* Print out correct eigenvectors */		
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[0].vector ,2);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[1].vector ,2);
+
+		Journal_Printf( stream, "\n/*******************    Test Eigenvector 2   ************************/\n");
+		Journal_Printf( stream, "Symmetric 3D Case - tested against:\n");
+		Journal_Printf( stream, "http://www.arndt-bruenner.de/mathe/scripts/engl_eigenwert.htm - 3/11/04.\n");
+		tensorArray[FT3D_00] = 2;
+		tensorArray[FT3D_11] = 3;
+		tensorArray[FT3D_22] = 5;
+		tensorArray[FT3D_01] = 7;
+		tensorArray[FT3D_02] = 11;
+		tensorArray[FT3D_12] = 13;
+		tensorArray[FT3D_10] = 7;
+		tensorArray[FT3D_20] = 11;
+		tensorArray[FT3D_21] = 13;		
+
+		Journal_Printf( stream, "Matrix to solve for eigenvectors is:\n");
+		Journal_PrintTensorArray( stream, tensorArray, 3 );
+
+		TensorArray_CalcAllEigenvectors( tensorArray, 3, eigenvectorList );
+
+	/* Set comparison eigenvecorList with correct solution */
+		eigenvectorListCompare[0].eigenvalue[REAL_PART] = -4.45970173;
+		eigenvectorListCompare[0].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[1].eigenvalue[REAL_PART] = -9.96854402;
+		eigenvectorListCompare[1].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[2].eigenvalue[REAL_PART] = 24.42824575;
+		eigenvectorListCompare[2].eigenvalue[IMAG_PART] = 0;
+	
+		dummy1[IMAG_PART] = 0;
+		dummy2[IMAG_PART] = 0;
+		dummy3[IMAG_PART] = 0;
+
+		dummy1[REAL_PART] = -0.786471; 
+		dummy2[REAL_PART] =  0.61348; 	
+		dummy3[REAL_PART] =  0.0714557; 			
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[0].vector );
+		dummy1[REAL_PART] = -0.364102; 
+		dummy2[REAL_PART] = -0.553977; 
+		dummy3[REAL_PART] =  0.748692; 
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[1].vector );
+		dummy1[REAL_PART] = -0.498892; 
+		dummy2[REAL_PART] = -0.562807; 
+		dummy3[REAL_PART] = -0.659056; 								
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[2].vector );
+		
+		/*Check if eigenvalue solution is within tolerance */
+		Cmplx_Subtract(eigenvectorListCompare[0].eigenvalue, eigenvectorList[0].eigenvalue, 
+						eigenvectorListDiffs[0].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[1].eigenvalue, eigenvectorList[1].eigenvalue, 
+						eigenvectorListDiffs[1].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[2].eigenvalue, eigenvectorList[2].eigenvalue, 
+						eigenvectorListDiffs[2].eigenvalue);
+
+		if ( ( Cmplx_Modulus(eigenvectorListDiffs[0].eigenvalue) <= errorTolerance ) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[1].eigenvalue) <= errorTolerance) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[2].eigenvalue) <= errorTolerance) ) {		
+			Journal_Printf(stream, "\nEigenvalues within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvalues not within tolerance, %g of:\n", errorTolerance); 
+		}
+		
+		/* Print correct eigenvalues */
+		Journal_PrintCmplx(stream,eigenvectorListCompare[0].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[1].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[2].eigenvalue );
+		
+		/* Check if eigenvector solutions are within tolerance */
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[0].vector,
+				eigenvectorListCompare[0].vector,
+				eigenvectorList[0].vector, 3);
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[1].vector, 
+				eigenvectorListCompare[1].vector,
+				eigenvectorList[1].vector, 3);		
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[2].vector, 
+				eigenvectorListCompare[2].vector,
+				eigenvectorList[2].vector, 3);
+		
+		
+		if ( (StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[0].vector, 3) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[1].vector, 3) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[2].vector, 3) <=errorTolerance) )
+		{ 
+				
+			Journal_Printf(stream, "\nEigenvectors within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvectors not within tolerance, %g of:\n", errorTolerance); 
+		}
+		/* Print out correct eigenvectors */		
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[0].vector ,3);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[1].vector ,3);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[2].vector ,3);
+		
+		Journal_Printf( stream, "\n/*******************    Test Eigenvector 3   ************************/\n");
+		Journal_Printf( stream, "Non-Symmetric test for 2-D\n\n");
+		
+		tensorArray[FT2D_00] = 4;
+		tensorArray[FT2D_01] = 4;
+		tensorArray[FT2D_10] = 3;
+		tensorArray[FT2D_11] = 5;
+							
+		Journal_PrintTensorArray(stream, tensorArray, 2);
+		TensorArray_CalcAllEigenvectors( tensorArray, 2, eigenvectorList );
+		
+		/* Set comparison eigenvecorList with correct solution */
+		eigenvectorListCompare[0].eigenvalue[REAL_PART] = 1;
+		eigenvectorListCompare[0].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[1].eigenvalue[REAL_PART] = 8;
+		eigenvectorListCompare[1].eigenvalue[IMAG_PART] = 0;
+
+		eigenvectorListCompare[0].vector[0][REAL_PART] = -0.8 ;
+		eigenvectorListCompare[0].vector[0][IMAG_PART] = 0;
+
+		eigenvectorListCompare[0].vector[1][REAL_PART] = 0.6;
+		eigenvectorListCompare[0].vector[1][IMAG_PART] = 0;
+
+		eigenvectorListCompare[1].vector[0][REAL_PART] = -0.707107 ;
+		eigenvectorListCompare[1].vector[0][IMAG_PART] = 0;
+
+		eigenvectorListCompare[1].vector[1][REAL_PART] = -0.707107;
+		eigenvectorListCompare[1].vector[1][IMAG_PART] = 0;
+		
+		/*Check if eigenvalue solution is within tolerance */
+		Cmplx_Subtract(eigenvectorListCompare[0].eigenvalue, eigenvectorList[0].eigenvalue, 
+						eigenvectorListDiffs[0].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[1].eigenvalue, eigenvectorList[1].eigenvalue, 
+						eigenvectorListDiffs[1].eigenvalue);
+
+		if ( ( Cmplx_Modulus(eigenvectorListDiffs[0].eigenvalue) <= errorTolerance ) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[1].eigenvalue) <= errorTolerance) ) 
+		{		
+			Journal_Printf(stream, "\nEigenvalues within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvalues not within tolerance, %g of:\n", errorTolerance); 
+		}
+		
+		/* Print correct eigenvalues */
+		Journal_PrintCmplx(stream,eigenvectorListCompare[0].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[1].eigenvalue );
+				/* Check if eigenvector solutions are within tolerance */
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[0].vector,
+				eigenvectorListCompare[0].vector,
+				eigenvectorList[0].vector, 2);
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[1].vector, 
+				eigenvectorListCompare[1].vector,
+				eigenvectorList[1].vector, 2);		
+		
+		if ( (StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[0].vector, 2) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[1].vector, 2) <=errorTolerance) )
+		{ 
+				
+			Journal_Printf(stream, "\nEigenvectors within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvectors not within tolerance, %g of:\n", errorTolerance); 
+		}
+		/* Print out correct eigenvectors */		
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[0].vector ,2);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[1].vector ,2);
+
+		Journal_Printf( stream, "\n");
+
+		Journal_Printf( stream, "\n/*******************    Test Eigenvector 4   ************************/\n");
+		Journal_Printf( stream, "Non-Symmetric Test for 3-D\n\n");
+		
+		tensorArray[FT3D_00] = 4;
+		tensorArray[FT3D_01] = 0;
+		tensorArray[FT3D_02] = 3;
+		tensorArray[FT3D_10] = 0;
+		tensorArray[FT3D_11] = 5;
+		tensorArray[FT3D_12] = 0;
+		tensorArray[FT3D_20] = 2;		
+		tensorArray[FT3D_21] = 5;
+		tensorArray[FT3D_22] = 6;						
+
+		Journal_PrintTensorArray(stream, tensorArray, 3);
+		TensorArray_CalcAllEigenvectors( tensorArray, 3, eigenvectorList );
+
+		/* Set comparison eigenvecorList with correct solution */
+		eigenvectorListCompare[0].eigenvalue[REAL_PART] = 2.35424868893;
+		eigenvectorListCompare[0].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[1].eigenvalue[REAL_PART] = 5;
+		eigenvectorListCompare[1].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[2].eigenvalue[REAL_PART] = 7.645751311;
+		eigenvectorListCompare[2].eigenvalue[IMAG_PART] = 0;
+	
+		dummy1[IMAG_PART] = 0;
+		dummy2[IMAG_PART] = 0;
+		dummy3[IMAG_PART] = 0;
+
+		dummy1[REAL_PART] = -0.87674 ; 
+		dummy2[REAL_PART] =  0; 	
+		dummy3[REAL_PART] =  0.480965 ; 			
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[0].vector );
+		dummy1[REAL_PART] = -0.867472 ; 
+		dummy2[REAL_PART] = 0.40482; 
+		dummy3[REAL_PART] =  -0.289157 ; 
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[1].vector );
+		dummy1[REAL_PART] = -0.635406; 
+		dummy2[REAL_PART] = 0; 
+		dummy3[REAL_PART] = -0.772178; 								
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[2].vector );
+		
+		/*Check if eigenvalue solution is within tolerance */
+		Cmplx_Subtract(eigenvectorListCompare[0].eigenvalue, eigenvectorList[0].eigenvalue, 
+						eigenvectorListDiffs[0].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[1].eigenvalue, eigenvectorList[1].eigenvalue, 
+						eigenvectorListDiffs[1].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[2].eigenvalue, eigenvectorList[2].eigenvalue, 
+						eigenvectorListDiffs[2].eigenvalue);
+
+		if ( ( Cmplx_Modulus(eigenvectorListDiffs[0].eigenvalue) <= errorTolerance ) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[1].eigenvalue) <= errorTolerance) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[2].eigenvalue) <= errorTolerance) ) {		
+			Journal_Printf(stream, "\nEigenvalues within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvalues not within tolerance, %g of:\n", errorTolerance); 
+		}
+		
+		/* Print correct eigenvalues */
+		Journal_PrintCmplx(stream,eigenvectorListCompare[0].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[1].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[2].eigenvalue );
+		
+		/* Check if eigenvector solutions are within tolerance */
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[0].vector,
+				eigenvectorListCompare[0].vector,
+				eigenvectorList[0].vector, 3);
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[1].vector, 
+				eigenvectorListCompare[1].vector,
+				eigenvectorList[1].vector, 3);		
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[2].vector, 
+				eigenvectorListCompare[2].vector,
+				eigenvectorList[2].vector, 3);
+		
+		
+		if ( (StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[0].vector, 3) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[1].vector, 3) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[2].vector, 3) <=errorTolerance) )
+		{ 
+				
+			Journal_Printf(stream, "\nEigenvectors within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvectors not within tolerance, %g of:\n", errorTolerance); 
+		}
+		/* Print out correct eigenvectors */		
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[0].vector ,3);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[1].vector ,3);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[2].vector ,3);		
+			
+		Journal_Printf( stream, "\n");
+	
+		Journal_Printf( stream, "\n/*******************    Test Eigenvector 5   ************************/\n");
+		Journal_Printf( stream, "Non-Symmetric test with zero entries for 2-D\n\n");
+		
+		tensorArray[FT2D_00] = 4;
+		tensorArray[FT2D_01] = 0;
+		tensorArray[FT2D_10] = 1;
+		tensorArray[FT2D_11] = 5;
+							
+		Journal_PrintTensorArray(stream, tensorArray, 2);
+		TensorArray_CalcAllEigenvectors( tensorArray, 2, eigenvectorList );
+
+		/* Set comparison eigenvecorList with correct solution */
+		eigenvectorListCompare[0].eigenvalue[REAL_PART] = 4;
+		eigenvectorListCompare[0].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[1].eigenvalue[REAL_PART] = 5;
+		eigenvectorListCompare[1].eigenvalue[IMAG_PART] = 0;
+
+		eigenvectorListCompare[0].vector[0][REAL_PART] = 0.707107;
+		eigenvectorListCompare[0].vector[0][IMAG_PART] = 0;
+
+		eigenvectorListCompare[0].vector[1][REAL_PART] = -0.707107;
+		eigenvectorListCompare[0].vector[1][IMAG_PART] = 0;
+
+		eigenvectorListCompare[1].vector[0][REAL_PART] = 0;
+		eigenvectorListCompare[1].vector[0][IMAG_PART] = 0;
+
+		eigenvectorListCompare[1].vector[1][REAL_PART] = 1;
+		eigenvectorListCompare[1].vector[1][IMAG_PART] = 0;
+		
+		/*Check if eigenvalue solution is within tolerance */
+		Cmplx_Subtract(eigenvectorListCompare[0].eigenvalue, eigenvectorList[0].eigenvalue, 
+						eigenvectorListDiffs[0].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[1].eigenvalue, eigenvectorList[1].eigenvalue, 
+						eigenvectorListDiffs[1].eigenvalue);
+
+		if ( ( Cmplx_Modulus(eigenvectorListDiffs[0].eigenvalue) <= errorTolerance ) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[1].eigenvalue) <= errorTolerance) ) 
+		{		
+			Journal_Printf(stream, "\nEigenvalues within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvalues not within tolerance, %g of:\n", errorTolerance); 
+		}
+		
+		/* Print correct eigenvalues */
+		Journal_PrintCmplx(stream,eigenvectorListCompare[0].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[1].eigenvalue );
+				
+		/* Check if eigenvector solutions are within tolerance */
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[0].vector,
+				eigenvectorListCompare[0].vector,
+				eigenvectorList[0].vector, 2);
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[1].vector, 
+				eigenvectorListCompare[1].vector,
+				eigenvectorList[1].vector, 2);		
+		
+		if ( (StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[0].vector, 2) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[1].vector, 2) <=errorTolerance) )
+		{ 
+				
+			Journal_Printf(stream, "\nEigenvectors within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvectors not within tolerance, %g of:\n", errorTolerance); 
+		}
+		/* Print out correct eigenvectors */		
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[0].vector ,2);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[1].vector ,2);
+
+		Journal_Printf( stream, "\n");
+		
+		/* Test for complex answers */
+		Journal_Printf( stream, "\n/*******************    Test Eigenvector 6   ************************/\n");
+		Journal_Printf( stream, "Non-Symmetric test with complex eigenvalues for 2-D\n\n");
+		Journal_Printf( stream, "Tested against Soluions in:\n");	
+		Journal_Printf( stream, "Elementary Differential Equations and Boundary Value Problems, 6th Ed\n");
+		Journal_Printf( stream, "By William E. Boyce and Richard C. DiPrima\n");	
+		Journal_Printf( stream, "Problem: ch 7.3, question 16\n\n");
+		tensorArray[FT2D_00] =  3;
+		tensorArray[FT2D_01] = -2;
+		tensorArray[FT2D_10] =  4;
+		tensorArray[FT2D_11] = -1;
+		
+		Journal_PrintTensorArray(stream, tensorArray, 2);
+		TensorArray_CalcAllEigenvectors( tensorArray, 2, eigenvectorList );
+		
+		/* Set comparison eigenvecorList with correct solution */
+		eigenvectorListCompare[0].eigenvalue[REAL_PART] = 1;
+		eigenvectorListCompare[0].eigenvalue[IMAG_PART] = 2;
+		
+		eigenvectorListCompare[1].eigenvalue[REAL_PART] = 1;
+		eigenvectorListCompare[1].eigenvalue[IMAG_PART] = -2;
+
+		eigenvectorListCompare[0].vector[0][REAL_PART] = 0.408248;
+		eigenvectorListCompare[0].vector[0][IMAG_PART] = 0.408248;
+
+		eigenvectorListCompare[0].vector[1][REAL_PART] = 0.816497 ;
+		eigenvectorListCompare[0].vector[1][IMAG_PART] = 0;
+
+		eigenvectorListCompare[1].vector[0][REAL_PART] = 0.408248;
+		eigenvectorListCompare[1].vector[0][IMAG_PART] = -0.408248;
+
+		eigenvectorListCompare[1].vector[1][REAL_PART] = 0.816497;
+		eigenvectorListCompare[1].vector[1][IMAG_PART] = 0;
+		
+		/*Check if eigenvalue solution is within tolerance */
+		Cmplx_Subtract(eigenvectorListCompare[0].eigenvalue, eigenvectorList[0].eigenvalue, 
+						eigenvectorListDiffs[0].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[1].eigenvalue, eigenvectorList[1].eigenvalue, 
+						eigenvectorListDiffs[1].eigenvalue);
+
+		if ( ( Cmplx_Modulus(eigenvectorListDiffs[0].eigenvalue) <= errorTolerance ) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[1].eigenvalue) <= errorTolerance) ) 
+		{		
+			Journal_Printf(stream, "\nEigenvalues within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvalues not within tolerance, %g of:\n", errorTolerance); 
+		}
+		
+		/* Print correct eigenvalues */
+		Journal_PrintCmplx(stream,eigenvectorListCompare[0].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[1].eigenvalue );
+				/* Check if eigenvector solutions are within tolerance */
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[0].vector,
+				eigenvectorListCompare[0].vector,
+				eigenvectorList[0].vector, 2);
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[1].vector, 
+				eigenvectorListCompare[1].vector,
+				eigenvectorList[1].vector, 2);		
+		
+		if ( (StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[0].vector, 2) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[1].vector, 2) <=errorTolerance) )
+		{ 
+				
+			Journal_Printf(stream, "\nEigenvectors within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvectors not within tolerance, %g of:\n", errorTolerance); 
+		}
+		/* Print out correct eigenvectors */		
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[0].vector ,2);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[1].vector ,2);
+	
+		Journal_Printf( stream, "\n/*******************    Test Eigenvector 7   ************************/\n");
+		Journal_Printf( stream, "Non-Symmetric test with complex eigenvalues for 3-D\n");
+		Journal_Printf( stream, "Tested against Soluions in:\n");	
+		Journal_Printf( stream, "Elementary Differential Equations and Boundary Value Problems, 6th Ed\n");
+		Journal_Printf( stream, "By William E. Boyce and Richard C. DiPrima\n");	
+		Journal_Printf( stream, "Problem: ch 7.3, question 21\n\n");		
+		tensorArray[FT3D_00] = 1;
+		tensorArray[FT3D_01] = 0;
+		tensorArray[FT3D_02] = 0;
+		tensorArray[FT3D_10] = 2;
+		tensorArray[FT3D_11] = 1;
+		tensorArray[FT3D_12] = -2;
+		tensorArray[FT3D_20] = 3;		
+		tensorArray[FT3D_21] = 2;
+		tensorArray[FT3D_22] = 1;
+		
+		Journal_PrintTensorArray(stream, tensorArray, 3);
+		TensorArray_CalcAllEigenvectors( tensorArray, 3, eigenvectorList );
+		/* Set comparison eigenvecorList with correct solution */
+		eigenvectorListCompare[0].eigenvalue[REAL_PART] = 1;
+		eigenvectorListCompare[0].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[1].eigenvalue[REAL_PART] = 1;
+		eigenvectorListCompare[1].eigenvalue[IMAG_PART] = 2;
+		
+		eigenvectorListCompare[2].eigenvalue[REAL_PART] = 1;
+		eigenvectorListCompare[2].eigenvalue[IMAG_PART] = -2;
+		
+		dummy1[REAL_PART] =  0.485071 ; 	dummy1[IMAG_PART] = 0;
+		dummy2[REAL_PART] = -0.727607; 		dummy2[IMAG_PART] = 0;
+		dummy3[REAL_PART] =  0.485071; 		dummy3[IMAG_PART] = 0;
+
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[0].vector );
+
+		dummy1[REAL_PART] = 0; 				dummy1[IMAG_PART] = 0;
+		dummy2[REAL_PART] = 0.707107; 		dummy2[IMAG_PART] = 0;
+		dummy3[REAL_PART] = 0;				dummy3[IMAG_PART] = -0.707107; 
+
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[1].vector );
+
+		dummy1[REAL_PART] = 0; 				dummy1[IMAG_PART] = 0;
+		dummy2[REAL_PART] = 0.707107; 		dummy2[IMAG_PART] = 0;
+		dummy3[REAL_PART] = 0;				dummy3[IMAG_PART] = 0.707107;
+
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[2].vector );
+		
+		/*Check if eigenvalue solution is within tolerance */
+		Cmplx_Subtract(eigenvectorListCompare[0].eigenvalue, eigenvectorList[0].eigenvalue, 
+						eigenvectorListDiffs[0].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[1].eigenvalue, eigenvectorList[1].eigenvalue, 
+						eigenvectorListDiffs[1].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[2].eigenvalue, eigenvectorList[2].eigenvalue, 
+						eigenvectorListDiffs[2].eigenvalue);
+
+		if ( ( Cmplx_Modulus(eigenvectorListDiffs[0].eigenvalue) <= errorTolerance ) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[1].eigenvalue) <= errorTolerance) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[2].eigenvalue) <= errorTolerance) ) {		
+			Journal_Printf(stream, "\nEigenvalues within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvalues not within tolerance, %g of:\n", errorTolerance); 
+		}
+		
+		/* Print correct eigenvalues */
+		Journal_PrintCmplx(stream,eigenvectorListCompare[0].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[1].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[2].eigenvalue );
+		
+		/* Check if eigenvector solutions are within tolerance */
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[0].vector,
+				eigenvectorListCompare[0].vector,
+				eigenvectorList[0].vector, 3);
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[1].vector, 
+				eigenvectorListCompare[1].vector,
+				eigenvectorList[1].vector, 3);		
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[2].vector, 
+				eigenvectorListCompare[2].vector,
+				eigenvectorList[2].vector, 3);
+		
+		
+		if ( (StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[0].vector, 3) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[1].vector, 3) <=errorTolerance) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[2].vector, 3) <=errorTolerance) )
+		{ 
+				
+			Journal_Printf(stream, "\nEigenvectors within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvectors not within tolerance, %g of:\n", errorTolerance); 
+		}
+		/* Print out correct eigenvectors */		
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[0].vector ,3);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[1].vector ,3);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[2].vector ,3);		
+
+		Journal_Printf( stream, "\n");
+		Journal_Printf( stream, "\n/*******************    Eigenvector Test  8  ************************/\n");
+		Journal_Printf( stream, "Test Calc eigenvectors function with repeated roots\n\n");		
+		Journal_Printf( stream, "Tested against Solutions in:\n");	
+		Journal_Printf( stream, "Elementary Differential Equations and Boundary Value Problems, 6th Ed\n");
+		Journal_Printf( stream, "By William E. Boyce and Richard C. DiPrima\n");	
+		Journal_Printf( stream, "Problem: ch 7.3, question 24\n\n");
+		tensorArray[FT3D_00] = 3;
+		tensorArray[FT3D_01] = 2;
+		tensorArray[FT3D_02] = 4;
+		tensorArray[FT3D_10] = 2;
+		tensorArray[FT3D_11] = 0;
+		tensorArray[FT3D_12] = 2;
+		tensorArray[FT3D_20] = 4;		
+		tensorArray[FT3D_21] = 2;
+		tensorArray[FT3D_22] = 3;
+		
+		Journal_PrintTensorArray(stream, tensorArray, 3);
+		TensorArray_CalcAllEigenvectors( tensorArray, 3, eigenvectorList );
+
+		/* Set comparison eigenvecorList with correct solution */
+		eigenvectorListCompare[0].eigenvalue[REAL_PART] = -1;
+		eigenvectorListCompare[0].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[1].eigenvalue[REAL_PART] = -1;
+		eigenvectorListCompare[1].eigenvalue[IMAG_PART] = 0;
+		
+		eigenvectorListCompare[2].eigenvalue[REAL_PART] = 8;
+		eigenvectorListCompare[2].eigenvalue[IMAG_PART] = 0;
+
+		dummy1[IMAG_PART] = 0;
+		dummy2[IMAG_PART] = 0;
+		dummy3[IMAG_PART] = 0;
+
+		dummy1[REAL_PART] = 0; 
+		dummy2[REAL_PART] = -0.894427; 
+		dummy3[REAL_PART] = 0.447214;
+		
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[0].vector );
+
+		dummy1[REAL_PART] = -0.719905 ; 
+		dummy2[REAL_PART] = 0.519697; 
+		dummy3[REAL_PART] = 0.460056; 								
+		
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[1].vector );
+		dummy1[REAL_PART] = 0.666667; 
+		dummy2[REAL_PART] = 0.333333; 
+		dummy3[REAL_PART] = 0.666667; 								
+		
+		ComplexVector_SetScalar( dummy1, dummy2, dummy3, 
+								eigenvectorListCompare[2].vector );
+		
+		/*Check if eigenvalue solution is within tolerance */
+		Cmplx_Subtract(eigenvectorListCompare[0].eigenvalue, eigenvectorList[0].eigenvalue, 
+						eigenvectorListDiffs[0].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[1].eigenvalue, eigenvectorList[1].eigenvalue, 
+						eigenvectorListDiffs[1].eigenvalue);
+		Cmplx_Subtract(eigenvectorListCompare[2].eigenvalue, eigenvectorList[2].eigenvalue, 
+						eigenvectorListDiffs[2].eigenvalue);
+
+		if ( ( Cmplx_Modulus(eigenvectorListDiffs[0].eigenvalue) <= errorTolerance ) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[1].eigenvalue) <= errorTolerance) && 
+			(Cmplx_Modulus(eigenvectorListDiffs[2].eigenvalue) <= errorTolerance) ) {		
+			Journal_Printf(stream, "\nEigenvalues within tolerance, %g of:\n", errorTolerance); 
+		}
+		else {
+			Journal_Printf(stream, "\nEigenvalues not within tolerance, %g of:\n", errorTolerance); 
+		}
+		
+		/* Print correct eigenvalues */
+		Journal_PrintCmplx(stream,eigenvectorListCompare[0].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[1].eigenvalue );
+		Journal_PrintCmplx(stream,eigenvectorListCompare[2].eigenvalue );
+		
+		/* Check if non-repeated eigenvector solution is within tolerance */
+
+		StGermain_ComplexVectorSubtraction(	eigenvectorListDiffs[2].vector, 
+				eigenvectorListCompare[2].vector,
+				eigenvectorList[2].vector, 3);
+		
+		/* Check if repeated eigenvectors follow correct Pattern */
+		for (eigenCount = 0; eigenCount < 2; eigenCount++) {
+			Cmplx_RealMultiply(eigenvectorList[eigenCount].vector[0], 2.0, dummy1 );
+			Cmplx_RealMultiply(eigenvectorList[eigenCount].vector[2], 2.0, dummy2 );
+			Cmplx_Add( eigenvectorList[eigenCount].vector[1], dummy1, dummy3 ) ;
+			Cmplx_Add( dummy3, dummy2, eigenvectorListDiffs[eigenCount].vector[0]);
+		}
+		
+		if ( ((Cmplx_Modulus(eigenvectorListDiffs[0].vector[0])) <= errorTolerance ) &&
+			((Cmplx_Modulus(eigenvectorListDiffs[1].vector[0])) <= errorTolerance ) &&
+			(StGermain_ComplexVectorMagnitude(eigenvectorListDiffs[2].vector, 3) <=errorTolerance) )
+		{ 
+				
+			Journal_Printf(stream, "\nNon-repeated Eigenvector within tolerance, %g,\n", errorTolerance);
+			Journal_Printf(stream, "And Repeated Eigenvectors follow pattern:\n");
+			Journal_Printf(stream, "2 * x_1 + x_2 + 2 * x_3 = 0 to within tolerance, %g of:\n", errorTolerance);
+					
+		}
+		else {
+			Journal_Printf(stream, "\nEither Non-repeated Eigenvector not within tolerance, %g,\n", errorTolerance);
+			Journal_Printf(stream, "Or Repeated Eigenvectors do not follow pattern:\n");
+			Journal_Printf(stream, "2 * x_1 + x_2 + 2 * x_3 = 0 to within tolerance, %g.\n", errorTolerance);
+			Journal_Printf(stream, "Calculated solution:\n");
+			StGermain_PrintNamedComplexVector( stream,eigenvectorList[0].vector ,3);
+			StGermain_PrintNamedComplexVector( stream,eigenvectorList[1].vector ,3);
+			StGermain_PrintNamedComplexVector( stream,eigenvectorList[2].vector ,3);				
+		}
+		/* Print out correct eigenvectors */
+		Journal_Printf(stream, "One set of correct eigenvectors: \n");		
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[0].vector ,3);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[1].vector ,3);
+		StGermain_PrintNamedComplexVector( stream,eigenvectorListCompare[2].vector ,3);		
+			
+		Journal_Printf(stream, "\nFor repeated eigenvalues with non-degenerate eigenvectors, \n");
+		Journal_Printf(stream, "eigenvectors have to be in same plane as solution vectors \n");
+		Journal_Printf(stream, "rather than exactly the same, as eigenvectors can be arbitrarily set\n");
+		Journal_Printf(stream, "based on the specific tensor array equation.\n");
+		Journal_Printf(stream, "For this problem, solution for repeated eigenvectors collapses to:\n");
+		Journal_Printf(stream, "2 * x_1 + x_2 + 2 * x_3 = 0\n");
+		Journal_Printf(stream, "Eigenvectors are then set based on what x_1, x_2 and x_3 are set to equal.\n");
+	
+		
+		
+		/* Test solve complex system functions */
+		Journal_Printf( stream, "\n/*******************    Test  10  ************************/\n");
+		Journal_Printf( stream, "Test print ComplexTensorArray function\n\n");		
+		Journal_Printf( stream, "2-D\n");
+		complexTensorArray[FT2D_00][REAL_PART] = 4;		complexTensorArray[FT2D_00][IMAG_PART] = 0;
+		complexTensorArray[FT2D_01][REAL_PART] = 4;		complexTensorArray[FT2D_01][IMAG_PART] = 1;
+		complexTensorArray[FT2D_10][REAL_PART] = 3;		complexTensorArray[FT2D_10][IMAG_PART] = 0.33;
+		complexTensorArray[FT2D_11][REAL_PART] = 5;		complexTensorArray[FT2D_11][IMAG_PART] = 100;
+		
+		Journal_PrintComplexTensorArray(stream, complexTensorArray, 2);
+		
+		Journal_Printf( stream, "3-D\n");
+		complexTensorArray[FT3D_00][REAL_PART] = 1;		complexTensorArray[FT3D_00][IMAG_PART] = 0.5;
+		complexTensorArray[FT3D_01][REAL_PART] = 2;		complexTensorArray[FT3D_01][IMAG_PART] = 0;
+		complexTensorArray[FT3D_02][REAL_PART] = 3;		complexTensorArray[FT3D_02][IMAG_PART] = 0;
+		complexTensorArray[FT3D_10][REAL_PART] = 4;		complexTensorArray[FT3D_10][IMAG_PART] = 0;
+		complexTensorArray[FT3D_11][REAL_PART] = 5;		complexTensorArray[FT3D_11][IMAG_PART] = 1;
+		complexTensorArray[FT3D_12][REAL_PART] = 6;		complexTensorArray[FT3D_12][IMAG_PART] = 2;
+		complexTensorArray[FT3D_20][REAL_PART] = 7;		complexTensorArray[FT3D_20][IMAG_PART] = 0;
+		complexTensorArray[FT3D_21][REAL_PART] = 8;		complexTensorArray[FT3D_21][IMAG_PART] = 0;
+		complexTensorArray[FT3D_22][REAL_PART] = 9;		complexTensorArray[FT3D_22][IMAG_PART] = 30;	
+		
+		Journal_PrintComplexTensorArray(stream, complexTensorArray, 3);		
+
+		Journal_Printf( stream, "\n/*******************    Test  11  ************************/\n");
+		Journal_Printf( stream, "Test print ComplexMatrix function\n\n");		
+		Journal_Printf( stream, "2-D\n");
+		complexMatrix[0][0][REAL_PART] = 1;		complexMatrix[0][0][IMAG_PART] = 0;
+		complexMatrix[0][1][REAL_PART] = 2;		complexMatrix[0][1][IMAG_PART] = 1;
+		complexMatrix[0][2][REAL_PART] = 4;		complexMatrix[0][2][IMAG_PART] = 1;
+		
+		complexMatrix[1][0][REAL_PART] = 3;		complexMatrix[1][0][IMAG_PART] = 0.33;
+		complexMatrix[1][1][REAL_PART] = 5;		complexMatrix[1][1][IMAG_PART] = 100;
+		complexMatrix[1][2][REAL_PART] = 5;		complexMatrix[1][2][IMAG_PART] = 10.5;
+		
+		complexMatrix[2][0][REAL_PART] = 30;	complexMatrix[2][0][IMAG_PART] = 0.33;
+		complexMatrix[2][1][REAL_PART] = 0.5;	complexMatrix[2][1][IMAG_PART] = 100;
+		complexMatrix[2][2][REAL_PART] = 5.5;	complexMatrix[2][2][IMAG_PART] = 10.5;		
+		
+		Journal_PrintComplexMatrix(stream, complexMatrix, 2);
+		
+		Journal_Printf( stream, "3-D\n");
+		Journal_PrintComplexMatrix(stream, complexMatrix, 3);
+
+		Journal_Printf( stream, "\n/*******************    Test  12  ************************/\n");
+		Journal_Printf( stream, "Test TensorArray to ComplexTensorArray conversion function\n\n");
+		tensorArray[0] = 1 ; 	tensorArray[3] = 5 ;	tensorArray[6] = 9 ; 	
+		tensorArray[1] = 3 ;	tensorArray[4] = 7 ;	tensorArray[7] = 11 ;	
+		tensorArray[2] = 4 ;	tensorArray[5] = 8 ;	tensorArray[8] = 12 ;	
+		
+		Journal_Printf(stream, "2-D conversion\n");
+		Journal_PrintTensorArray(stream, tensorArray, 2);
+		TensorArray_ToComplexTensorArray(tensorArray, complexTensorArray, 2);
+		Journal_PrintComplexTensorArray(stream, complexTensorArray, 2);		
+
+		Journal_Printf(stream, "3-D conversion\n");
+		Journal_PrintTensorArray(stream, tensorArray, 3);
+		TensorArray_ToComplexTensorArray(tensorArray, complexTensorArray, 3);
+		Journal_PrintComplexTensorArray(stream, complexTensorArray, 3);
+
+		Journal_Printf( stream, "\n/*******************    Test  13  ************************/\n");
+		Journal_Printf( stream, "Test ComplexTensorArray to ComplexMatrix conversion function\n\n");
+		complexTensorArray[FT3D_00][REAL_PART] = 1;		complexTensorArray[FT3D_00][IMAG_PART] = 0.5;
+		complexTensorArray[FT3D_01][REAL_PART] = 2;		complexTensorArray[FT3D_01][IMAG_PART] = 0;
+		complexTensorArray[FT3D_02][REAL_PART] = 3;		complexTensorArray[FT3D_02][IMAG_PART] = 0;
+		complexTensorArray[FT3D_10][REAL_PART] = 4;		complexTensorArray[FT3D_10][IMAG_PART] = 0;
+		complexTensorArray[FT3D_11][REAL_PART] = 5;		complexTensorArray[FT3D_11][IMAG_PART] = 1;
+		complexTensorArray[FT3D_12][REAL_PART] = 6;		complexTensorArray[FT3D_12][IMAG_PART] = 2;
+		complexTensorArray[FT3D_20][REAL_PART] = 7;		complexTensorArray[FT3D_20][IMAG_PART] = 0;
+		complexTensorArray[FT3D_21][REAL_PART] = 8;		complexTensorArray[FT3D_21][IMAG_PART] = 0;
+		complexTensorArray[FT3D_22][REAL_PART] = 9;		complexTensorArray[FT3D_22][IMAG_PART] = 30;	
+		
+		Journal_Printf(stream, "2-D conversion\n");
+		Journal_PrintComplexTensorArray(stream, complexTensorArray, 2);
+		ComplexTensorArray_ToComplexMatrix(complexTensorArray, 2, complexMatrix ) ;
+		Journal_PrintComplexMatrix(stream, complexMatrix, 2);		
+
+		Journal_Printf(stream, "3-D conversion\n");
+		Journal_PrintComplexTensorArray(stream, complexTensorArray, 3);
+		ComplexTensorArray_ToComplexMatrix(complexTensorArray, 3, complexMatrix ) ;
+		Journal_PrintComplexMatrix(stream, complexMatrix, 3);	
+		
+		Memory_Free(complexMatrix);
+
+		Journal_Printf( stream, "\n/*******************    Test  14  ************************/\n");
+		Journal_Printf( stream, "Test ComplexTensorArray to TensorArray conversion function\n\n");
+		complexTensorArray[ 0][REAL_PART]  = 1;		complexTensorArray[ 0][IMAG_PART] = 0;	
+		complexTensorArray[ 1][REAL_PART]  = 2;		complexTensorArray[ 1][IMAG_PART] = 0;	
+		complexTensorArray[ 2][REAL_PART]  = 3;		complexTensorArray[ 2][IMAG_PART] = 0;	
+		complexTensorArray[ 3][REAL_PART]  = 4;		complexTensorArray[ 3][IMAG_PART] = 0;	
+		complexTensorArray[ 4][REAL_PART]  = 5;		complexTensorArray[ 4][IMAG_PART] = 0;	
+		complexTensorArray[ 5][REAL_PART]  = 6;		complexTensorArray[ 5][IMAG_PART] = 0;	
+		complexTensorArray[ 6][REAL_PART]  = 7;		complexTensorArray[ 6][IMAG_PART] = 0;	
+		complexTensorArray[ 7][REAL_PART]  = 88;	complexTensorArray[ 7][IMAG_PART] = 0;	
+		complexTensorArray[ 8][REAL_PART]  = 9.5;	complexTensorArray[ 8][IMAG_PART] = 0;	
+		
+		Journal_Printf(stream, "2-D conversion\n");
+		Journal_PrintComplexTensorArray(stream, complexTensorArray, 2);		
+		ComplexTensorArray_ToTensorArray(complexTensorArray, tensorArray, 2);
+		Journal_PrintTensorArray(stream, tensorArray, 2);
+
+		Journal_Printf(stream, "3-D conversion\n");
+		Journal_PrintComplexTensorArray(stream, complexTensorArray, 3);		
+		ComplexTensorArray_ToTensorArray(complexTensorArray, tensorArray, 3);
+		Journal_PrintTensorArray(stream, tensorArray, 3);
+		
+
+		/*Note: This has to be the last test! As it will have an error and cleanly
+		exit the test program.*/
+		Journal_Printf(stream, "Failing conversion\n");
+		complexTensorArray[0][IMAG_PART] = 1;		
+		Journal_PrintComplexTensorArray(stream, complexTensorArray, 3);		
+		ComplexTensorArray_ToTensorArray(complexTensorArray, tensorArray, 3);
+		
+		
+		Memory_Free( tensor );
+	}
+	
+	StgDomainGeometry_Finalise();
+	
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testIJK26Topology.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testIJK26Topology.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,7035 @@
+StGermain Framework revision 3570. Copyright (C) 2003-2005 VPAC.
++++++++++++++ 1D Tests +++++++++++++
+
+topology:{ 1, 1, 1, } - isPeriodic = { False, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [0] = {}
+		Full:
+			|(  0  )|
+	
+topology:{ 1, 1, 1, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [0] = {}
+		Full:
+			|(  0  )|
+	
+topology:{ 2, 1, 1, } - isPeriodic = { False, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [1] = {1, }
+		Full:
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [1] = {0, }
+		Full:
+			-------------------------
+			|   0   |(  1  )|   X   |
+			-------------------------
+	
+topology:{ 2, 1, 1, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [2] = {1, 1, }
+		Full:
+			-------------------------
+			|   1   |(  0  )|   1   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [2] = {0, 0, }
+		Full:
+			-------------------------
+			|   0   |(  1  )|   0   |
+			-------------------------
+	
+topology:{ 3, 1, 1, } - isPeriodic = { False, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [1] = {1, }
+		Full:
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [2] = {0, 2, }
+		Full:
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [1] = {1, }
+		Full:
+			-------------------------
+			|   1   |(  2  )|   X   |
+			-------------------------
+	
+topology:{ 3, 1, 1, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [2] = {2, 1, }
+		Full:
+			-------------------------
+			|   2   |(  0  )|   1   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [2] = {0, 2, }
+		Full:
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [2] = {1, 0, }
+		Full:
+			-------------------------
+			|   1   |(  2  )|   0   |
+			-------------------------
+	
+topology:{ 1, 2, 1, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [1] = {1, }
+		Full:
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+	Item at (0,1,0)->1:
+		Dyn: [1] = {0, }
+		Full:
+			-------------------------
+			|   0   |(  1  )|   X   |
+			-------------------------
+	
+topology:{ 1, 2, 1, } - isPeriodic = { True, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [2] = {1, 1, }
+		Full:
+			-------------------------
+			|   1   |(  0  )|   1   |
+			-------------------------
+	Item at (0,1,0)->1:
+		Dyn: [2] = {0, 0, }
+		Full:
+			-------------------------
+			|   0   |(  1  )|   0   |
+			-------------------------
+	
+topology:{ 1, 3, 1, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [1] = {1, }
+		Full:
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+	Item at (0,1,0)->1:
+		Dyn: [2] = {0, 2, }
+		Full:
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+	Item at (0,2,0)->2:
+		Dyn: [1] = {1, }
+		Full:
+			-------------------------
+			|   1   |(  2  )|   X   |
+			-------------------------
+	
+topology:{ 1, 3, 1, } - isPeriodic = { True, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [2] = {2, 1, }
+		Full:
+			-------------------------
+			|   2   |(  0  )|   1   |
+			-------------------------
+	Item at (0,1,0)->1:
+		Dyn: [2] = {0, 2, }
+		Full:
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+	Item at (0,2,0)->2:
+		Dyn: [2] = {1, 0, }
+		Full:
+			-------------------------
+			|   1   |(  2  )|   0   |
+			-------------------------
+	
++++++++++++++ 2D Tests +++++++++++++
+
+topology:{ 2, 2, 1, } - isPeriodic = { False, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [3] = {1, 2, 3, }
+		Full:
+			-------------------------
+			|   X   |   2   |   3   |
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [3] = {0, 2, 3, }
+		Full:
+			-------------------------
+			|   2   |   3   |   X   |
+			-------------------------
+			|   0   |(  1  )|   X   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (0,1,0)->2:
+		Dyn: [3] = {0, 1, 3, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   X   |(  2  )|   3   |
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->3:
+		Dyn: [3] = {0, 1, 2, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   2   |(  3  )|   X   |
+			-------------------------
+			|   0   |   1   |   X   |
+			-------------------------
+	
+topology:{ 2, 2, 1, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [5] = {1, 1, 3, 2, 3, }
+		Full:
+			-------------------------
+			|   3   |   2   |   3   |
+			-------------------------
+			|   1   |(  0  )|   1   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [5] = {0, 0, 2, 3, 2, }
+		Full:
+			-------------------------
+			|   2   |   3   |   2   |
+			-------------------------
+			|   0   |(  1  )|   0   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (0,1,0)->2:
+		Dyn: [5] = {1, 0, 1, 3, 3, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   3   |(  2  )|   3   |
+			-------------------------
+			|   1   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->3:
+		Dyn: [5] = {0, 1, 0, 2, 2, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   2   |(  3  )|   2   |
+			-------------------------
+			|   0   |   1   |   0   |
+			-------------------------
+	
+topology:{ 2, 2, 1, } - isPeriodic = { False, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [5] = {2, 3, 1, 2, 3, }
+		Full:
+			-------------------------
+			|   X   |   2   |   3   |
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+			|   X   |   2   |   3   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [5] = {2, 3, 0, 2, 3, }
+		Full:
+			-------------------------
+			|   2   |   3   |   X   |
+			-------------------------
+			|   0   |(  1  )|   X   |
+			-------------------------
+			|   2   |   3   |   X   |
+			-------------------------
+	Item at (0,1,0)->2:
+		Dyn: [5] = {0, 1, 3, 0, 1, }
+		Full:
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+			|   X   |(  2  )|   3   |
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->3:
+		Dyn: [5] = {0, 1, 2, 0, 1, }
+		Full:
+			-------------------------
+			|   0   |   1   |   X   |
+			-------------------------
+			|   2   |(  3  )|   X   |
+			-------------------------
+			|   0   |   1   |   X   |
+			-------------------------
+	
+topology:{ 2, 2, 1, } - isPeriodic = { True, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [8] = {3, 2, 3, 1, 1, 3, 2, 3, }
+		Full:
+			-------------------------
+			|   3   |   2   |   3   |
+			-------------------------
+			|   1   |(  0  )|   1   |
+			-------------------------
+			|   3   |   2   |   3   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [8] = {2, 3, 2, 0, 0, 2, 3, 2, }
+		Full:
+			-------------------------
+			|   2   |   3   |   2   |
+			-------------------------
+			|   0   |(  1  )|   0   |
+			-------------------------
+			|   2   |   3   |   2   |
+			-------------------------
+	Item at (0,1,0)->2:
+		Dyn: [8] = {1, 0, 1, 3, 3, 1, 0, 1, }
+		Full:
+			-------------------------
+			|   1   |   0   |   1   |
+			-------------------------
+			|   3   |(  2  )|   3   |
+			-------------------------
+			|   1   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->3:
+		Dyn: [8] = {0, 1, 0, 2, 2, 0, 1, 0, }
+		Full:
+			-------------------------
+			|   0   |   1   |   0   |
+			-------------------------
+			|   2   |(  3  )|   2   |
+			-------------------------
+			|   0   |   1   |   0   |
+			-------------------------
+	
+topology:{ 3, 2, 1, } - isPeriodic = { False, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [3] = {1, 3, 4, }
+		Full:
+			-------------------------
+			|   X   |   3   |   4   |
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [5] = {0, 2, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [3] = {1, 4, 5, }
+		Full:
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+			|   1   |(  2  )|   X   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [3] = {0, 1, 4, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   X   |(  3  )|   4   |
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [5] = {0, 1, 2, 3, 5, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   3   |(  4  )|   5   |
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [3] = {1, 2, 4, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   4   |(  5  )|   X   |
+			-------------------------
+			|   1   |   2   |   X   |
+			-------------------------
+	
+topology:{ 3, 2, 1, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [5] = {2, 1, 5, 3, 4, }
+		Full:
+			-------------------------
+			|   5   |   3   |   4   |
+			-------------------------
+			|   2   |(  0  )|   1   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [5] = {0, 2, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [5] = {1, 0, 4, 5, 3, }
+		Full:
+			-------------------------
+			|   4   |   5   |   3   |
+			-------------------------
+			|   1   |(  2  )|   0   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [5] = {2, 0, 1, 5, 4, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   5   |(  3  )|   4   |
+			-------------------------
+			|   2   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [5] = {0, 1, 2, 3, 5, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   3   |(  4  )|   5   |
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [5] = {1, 2, 0, 4, 3, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   4   |(  5  )|   3   |
+			-------------------------
+			|   1   |   2   |   0   |
+			-------------------------
+	
+topology:{ 3, 2, 1, } - isPeriodic = { False, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [5] = {3, 4, 1, 3, 4, }
+		Full:
+			-------------------------
+			|   X   |   3   |   4   |
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+			|   X   |   3   |   4   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [8] = {3, 4, 5, 0, 2, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [5] = {4, 5, 1, 4, 5, }
+		Full:
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+			|   1   |(  2  )|   X   |
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [5] = {0, 1, 4, 0, 1, }
+		Full:
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+			|   X   |(  3  )|   4   |
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [8] = {0, 1, 2, 3, 5, 0, 1, 2, }
+		Full:
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+			|   3   |(  4  )|   5   |
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [5] = {1, 2, 4, 1, 2, }
+		Full:
+			-------------------------
+			|   1   |   2   |   X   |
+			-------------------------
+			|   4   |(  5  )|   X   |
+			-------------------------
+			|   1   |   2   |   X   |
+			-------------------------
+	
+topology:{ 3, 2, 1, } - isPeriodic = { True, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [8] = {5, 3, 4, 2, 1, 5, 3, 4, }
+		Full:
+			-------------------------
+			|   5   |   3   |   4   |
+			-------------------------
+			|   2   |(  0  )|   1   |
+			-------------------------
+			|   5   |   3   |   4   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [8] = {3, 4, 5, 0, 2, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [8] = {4, 5, 3, 1, 0, 4, 5, 3, }
+		Full:
+			-------------------------
+			|   4   |   5   |   3   |
+			-------------------------
+			|   1   |(  2  )|   0   |
+			-------------------------
+			|   4   |   5   |   3   |
+			-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [8] = {2, 0, 1, 5, 4, 2, 0, 1, }
+		Full:
+			-------------------------
+			|   2   |   0   |   1   |
+			-------------------------
+			|   5   |(  3  )|   4   |
+			-------------------------
+			|   2   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [8] = {0, 1, 2, 3, 5, 0, 1, 2, }
+		Full:
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+			|   3   |(  4  )|   5   |
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [8] = {1, 2, 0, 4, 3, 1, 2, 0, }
+		Full:
+			-------------------------
+			|   1   |   2   |   0   |
+			-------------------------
+			|   4   |(  5  )|   3   |
+			-------------------------
+			|   1   |   2   |   0   |
+			-------------------------
+	
+topology:{ 2, 3, 1, } - isPeriodic = { False, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [3] = {1, 2, 3, }
+		Full:
+			-------------------------
+			|   X   |   2   |   3   |
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [3] = {0, 2, 3, }
+		Full:
+			-------------------------
+			|   2   |   3   |   X   |
+			-------------------------
+			|   0   |(  1  )|   X   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (0,1,0)->2:
+		Dyn: [5] = {0, 1, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   X   |   4   |   5   |
+			-------------------------
+			|   X   |(  2  )|   3   |
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->3:
+		Dyn: [5] = {0, 1, 2, 4, 5, }
+		Full:
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+			|   2   |(  3  )|   X   |
+			-------------------------
+			|   0   |   1   |   X   |
+			-------------------------
+	Item at (0,2,0)->4:
+		Dyn: [3] = {2, 3, 5, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   X   |(  4  )|   5   |
+			-------------------------
+			|   X   |   2   |   3   |
+			-------------------------
+	Item at (1,2,0)->5:
+		Dyn: [3] = {2, 3, 4, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   4   |(  5  )|   X   |
+			-------------------------
+			|   2   |   3   |   X   |
+			-------------------------
+	
+topology:{ 2, 3, 1, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [5] = {1, 1, 3, 2, 3, }
+		Full:
+			-------------------------
+			|   3   |   2   |   3   |
+			-------------------------
+			|   1   |(  0  )|   1   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [5] = {0, 0, 2, 3, 2, }
+		Full:
+			-------------------------
+			|   2   |   3   |   2   |
+			-------------------------
+			|   0   |(  1  )|   0   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (0,1,0)->2:
+		Dyn: [8] = {1, 0, 1, 3, 3, 5, 4, 5, }
+		Full:
+			-------------------------
+			|   5   |   4   |   5   |
+			-------------------------
+			|   3   |(  2  )|   3   |
+			-------------------------
+			|   1   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->3:
+		Dyn: [8] = {0, 1, 0, 2, 2, 4, 5, 4, }
+		Full:
+			-------------------------
+			|   4   |   5   |   4   |
+			-------------------------
+			|   2   |(  3  )|   2   |
+			-------------------------
+			|   0   |   1   |   0   |
+			-------------------------
+	Item at (0,2,0)->4:
+		Dyn: [5] = {3, 2, 3, 5, 5, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   5   |(  4  )|   5   |
+			-------------------------
+			|   3   |   2   |   3   |
+			-------------------------
+	Item at (1,2,0)->5:
+		Dyn: [5] = {2, 3, 2, 4, 4, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   4   |(  5  )|   4   |
+			-------------------------
+			|   2   |   3   |   2   |
+			-------------------------
+	
+topology:{ 2, 3, 1, } - isPeriodic = { False, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [5] = {4, 5, 1, 2, 3, }
+		Full:
+			-------------------------
+			|   X   |   2   |   3   |
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+			|   X   |   4   |   5   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [5] = {4, 5, 0, 2, 3, }
+		Full:
+			-------------------------
+			|   2   |   3   |   X   |
+			-------------------------
+			|   0   |(  1  )|   X   |
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+	Item at (0,1,0)->2:
+		Dyn: [5] = {0, 1, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   X   |   4   |   5   |
+			-------------------------
+			|   X   |(  2  )|   3   |
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->3:
+		Dyn: [5] = {0, 1, 2, 4, 5, }
+		Full:
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+			|   2   |(  3  )|   X   |
+			-------------------------
+			|   0   |   1   |   X   |
+			-------------------------
+	Item at (0,2,0)->4:
+		Dyn: [5] = {2, 3, 5, 0, 1, }
+		Full:
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+			|   X   |(  4  )|   5   |
+			-------------------------
+			|   X   |   2   |   3   |
+			-------------------------
+	Item at (1,2,0)->5:
+		Dyn: [5] = {2, 3, 4, 0, 1, }
+		Full:
+			-------------------------
+			|   0   |   1   |   X   |
+			-------------------------
+			|   4   |(  5  )|   X   |
+			-------------------------
+			|   2   |   3   |   X   |
+			-------------------------
+	
+topology:{ 2, 3, 1, } - isPeriodic = { True, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [8] = {5, 4, 5, 1, 1, 3, 2, 3, }
+		Full:
+			-------------------------
+			|   3   |   2   |   3   |
+			-------------------------
+			|   1   |(  0  )|   1   |
+			-------------------------
+			|   5   |   4   |   5   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [8] = {4, 5, 4, 0, 0, 2, 3, 2, }
+		Full:
+			-------------------------
+			|   2   |   3   |   2   |
+			-------------------------
+			|   0   |(  1  )|   0   |
+			-------------------------
+			|   4   |   5   |   4   |
+			-------------------------
+	Item at (0,1,0)->2:
+		Dyn: [8] = {1, 0, 1, 3, 3, 5, 4, 5, }
+		Full:
+			-------------------------
+			|   5   |   4   |   5   |
+			-------------------------
+			|   3   |(  2  )|   3   |
+			-------------------------
+			|   1   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->3:
+		Dyn: [8] = {0, 1, 0, 2, 2, 4, 5, 4, }
+		Full:
+			-------------------------
+			|   4   |   5   |   4   |
+			-------------------------
+			|   2   |(  3  )|   2   |
+			-------------------------
+			|   0   |   1   |   0   |
+			-------------------------
+	Item at (0,2,0)->4:
+		Dyn: [8] = {3, 2, 3, 5, 5, 1, 0, 1, }
+		Full:
+			-------------------------
+			|   1   |   0   |   1   |
+			-------------------------
+			|   5   |(  4  )|   5   |
+			-------------------------
+			|   3   |   2   |   3   |
+			-------------------------
+	Item at (1,2,0)->5:
+		Dyn: [8] = {2, 3, 2, 4, 4, 0, 1, 0, }
+		Full:
+			-------------------------
+			|   0   |   1   |   0   |
+			-------------------------
+			|   4   |(  5  )|   4   |
+			-------------------------
+			|   2   |   3   |   2   |
+			-------------------------
+	
+topology:{ 3, 3, 1, } - isPeriodic = { False, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [3] = {1, 3, 4, }
+		Full:
+			-------------------------
+			|   X   |   3   |   4   |
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [5] = {0, 2, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [3] = {1, 4, 5, }
+		Full:
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+			|   1   |(  2  )|   X   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [5] = {0, 1, 4, 6, 7, }
+		Full:
+			-------------------------
+			|   X   |   6   |   7   |
+			-------------------------
+			|   X   |(  3  )|   4   |
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [8] = {0, 1, 2, 3, 5, 6, 7, 8, }
+		Full:
+			-------------------------
+			|   6   |   7   |   8   |
+			-------------------------
+			|   3   |(  4  )|   5   |
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [5] = {1, 2, 4, 7, 8, }
+		Full:
+			-------------------------
+			|   7   |   8   |   X   |
+			-------------------------
+			|   4   |(  5  )|   X   |
+			-------------------------
+			|   1   |   2   |   X   |
+			-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [3] = {3, 4, 7, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   X   |(  6  )|   7   |
+			-------------------------
+			|   X   |   3   |   4   |
+			-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [5] = {3, 4, 5, 6, 8, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   6   |(  7  )|   8   |
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [3] = {4, 5, 7, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   7   |(  8  )|   X   |
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+	
+topology:{ 3, 3, 1, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [5] = {2, 1, 5, 3, 4, }
+		Full:
+			-------------------------
+			|   5   |   3   |   4   |
+			-------------------------
+			|   2   |(  0  )|   1   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [5] = {0, 2, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [5] = {1, 0, 4, 5, 3, }
+		Full:
+			-------------------------
+			|   4   |   5   |   3   |
+			-------------------------
+			|   1   |(  2  )|   0   |
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [8] = {2, 0, 1, 5, 4, 8, 6, 7, }
+		Full:
+			-------------------------
+			|   8   |   6   |   7   |
+			-------------------------
+			|   5   |(  3  )|   4   |
+			-------------------------
+			|   2   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [8] = {0, 1, 2, 3, 5, 6, 7, 8, }
+		Full:
+			-------------------------
+			|   6   |   7   |   8   |
+			-------------------------
+			|   3   |(  4  )|   5   |
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [8] = {1, 2, 0, 4, 3, 7, 8, 6, }
+		Full:
+			-------------------------
+			|   7   |   8   |   6   |
+			-------------------------
+			|   4   |(  5  )|   3   |
+			-------------------------
+			|   1   |   2   |   0   |
+			-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [5] = {5, 3, 4, 8, 7, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   8   |(  6  )|   7   |
+			-------------------------
+			|   5   |   3   |   4   |
+			-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [5] = {3, 4, 5, 6, 8, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   6   |(  7  )|   8   |
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [5] = {4, 5, 3, 7, 6, }
+		Full:
+			-------------------------
+			|   X   |   X   |   X   |
+			-------------------------
+			|   7   |(  8  )|   6   |
+			-------------------------
+			|   4   |   5   |   3   |
+			-------------------------
+	
+topology:{ 3, 3, 1, } - isPeriodic = { False, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [5] = {6, 7, 1, 3, 4, }
+		Full:
+			-------------------------
+			|   X   |   3   |   4   |
+			-------------------------
+			|   X   |(  0  )|   1   |
+			-------------------------
+			|   X   |   6   |   7   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [8] = {6, 7, 8, 0, 2, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+			|   6   |   7   |   8   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [5] = {7, 8, 1, 4, 5, }
+		Full:
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+			|   1   |(  2  )|   X   |
+			-------------------------
+			|   7   |   8   |   X   |
+			-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [5] = {0, 1, 4, 6, 7, }
+		Full:
+			-------------------------
+			|   X   |   6   |   7   |
+			-------------------------
+			|   X   |(  3  )|   4   |
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [8] = {0, 1, 2, 3, 5, 6, 7, 8, }
+		Full:
+			-------------------------
+			|   6   |   7   |   8   |
+			-------------------------
+			|   3   |(  4  )|   5   |
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [5] = {1, 2, 4, 7, 8, }
+		Full:
+			-------------------------
+			|   7   |   8   |   X   |
+			-------------------------
+			|   4   |(  5  )|   X   |
+			-------------------------
+			|   1   |   2   |   X   |
+			-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [5] = {3, 4, 7, 0, 1, }
+		Full:
+			-------------------------
+			|   X   |   0   |   1   |
+			-------------------------
+			|   X   |(  6  )|   7   |
+			-------------------------
+			|   X   |   3   |   4   |
+			-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [8] = {3, 4, 5, 6, 8, 0, 1, 2, }
+		Full:
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+			|   6   |(  7  )|   8   |
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [5] = {4, 5, 7, 1, 2, }
+		Full:
+			-------------------------
+			|   1   |   2   |   X   |
+			-------------------------
+			|   7   |(  8  )|   X   |
+			-------------------------
+			|   4   |   5   |   X   |
+			-------------------------
+	
+topology:{ 3, 3, 1, } - isPeriodic = { True, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [8] = {8, 6, 7, 2, 1, 5, 3, 4, }
+		Full:
+			-------------------------
+			|   5   |   3   |   4   |
+			-------------------------
+			|   2   |(  0  )|   1   |
+			-------------------------
+			|   8   |   6   |   7   |
+			-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [8] = {6, 7, 8, 0, 2, 3, 4, 5, }
+		Full:
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+			|   0   |(  1  )|   2   |
+			-------------------------
+			|   6   |   7   |   8   |
+			-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [8] = {7, 8, 6, 1, 0, 4, 5, 3, }
+		Full:
+			-------------------------
+			|   4   |   5   |   3   |
+			-------------------------
+			|   1   |(  2  )|   0   |
+			-------------------------
+			|   7   |   8   |   6   |
+			-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [8] = {2, 0, 1, 5, 4, 8, 6, 7, }
+		Full:
+			-------------------------
+			|   8   |   6   |   7   |
+			-------------------------
+			|   5   |(  3  )|   4   |
+			-------------------------
+			|   2   |   0   |   1   |
+			-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [8] = {0, 1, 2, 3, 5, 6, 7, 8, }
+		Full:
+			-------------------------
+			|   6   |   7   |   8   |
+			-------------------------
+			|   3   |(  4  )|   5   |
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [8] = {1, 2, 0, 4, 3, 7, 8, 6, }
+		Full:
+			-------------------------
+			|   7   |   8   |   6   |
+			-------------------------
+			|   4   |(  5  )|   3   |
+			-------------------------
+			|   1   |   2   |   0   |
+			-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [8] = {5, 3, 4, 8, 7, 2, 0, 1, }
+		Full:
+			-------------------------
+			|   2   |   0   |   1   |
+			-------------------------
+			|   8   |(  6  )|   7   |
+			-------------------------
+			|   5   |   3   |   4   |
+			-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [8] = {3, 4, 5, 6, 8, 0, 1, 2, }
+		Full:
+			-------------------------
+			|   0   |   1   |   2   |
+			-------------------------
+			|   6   |(  7  )|   8   |
+			-------------------------
+			|   3   |   4   |   5   |
+			-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [8] = {4, 5, 3, 7, 6, 1, 2, 0, }
+		Full:
+			-------------------------
+			|   1   |   2   |   0   |
+			-------------------------
+			|   7   |(  8  )|   6   |
+			-------------------------
+			|   4   |   5   |   3   |
+			-------------------------
+	
++++++++++++++ 3D Tests +++++++++++++
+
+topology:{ 3, 3, 3, } - isPeriodic = { False, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [7] = {1, 3, 4, 9, 10, 12, 13, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |(  0  )|   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [11] = {0, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |(  1  )|   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [7] = {1, 4, 5, 10, 11, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |(  2  )|   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [11] = {0, 1, 4, 6, 7, 9, 10, 12, 13, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |(  3  )|   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [17] = {0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |(  4  )|   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [11] = {1, 2, 4, 7, 8, 10, 11, 13, 14, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |(  5  )|   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [7] = {3, 4, 7, 12, 13, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |(  6  )|   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [11] = {3, 4, 5, 6, 8, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |(  7  )|   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [7] = {4, 5, 7, 13, 14, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |(  8  )|   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+	Item at (0,0,1)->9:
+		Dyn: [11] = {0, 1, 3, 4, 10, 12, 13, 18, 19, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |(  9  )|  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,1)->10:
+		Dyn: [17] = {0, 1, 2, 3, 4, 5, 9, 11, 12, 13, 14, 18, 19, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |( 10  )|  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,1)->11:
+		Dyn: [11] = {1, 2, 4, 5, 10, 13, 14, 19, 20, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |( 11  )|   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,1)->12:
+		Dyn: [17] = {0, 1, 3, 4, 6, 7, 9, 10, 13, 15, 16, 18, 19, 21, 22, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |( 12  )|  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+	Item at (1,1,1)->13:
+		Dyn: [26] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |( 13  )|  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+	Item at (2,1,1)->14:
+		Dyn: [17] = {1, 2, 4, 5, 7, 8, 10, 11, 13, 16, 17, 19, 20, 22, 23, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |( 14  )|   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+	Item at (0,2,1)->15:
+		Dyn: [11] = {3, 4, 6, 7, 12, 13, 16, 21, 22, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |( 15  )|  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+	Item at (1,2,1)->16:
+		Dyn: [17] = {3, 4, 5, 6, 7, 8, 12, 13, 14, 15, 17, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |( 16  )|  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+	Item at (2,2,1)->17:
+		Dyn: [11] = {4, 5, 7, 8, 13, 14, 16, 22, 23, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |( 17  )|   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+	Item at (0,0,2)->18:
+		Dyn: [7] = {9, 10, 12, 13, 19, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |( 18  )|  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,2)->19:
+		Dyn: [11] = {9, 10, 11, 12, 13, 14, 18, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |( 19  )|  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,2)->20:
+		Dyn: [7] = {10, 11, 13, 14, 19, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |( 20  )|   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,2)->21:
+		Dyn: [11] = {9, 10, 12, 13, 15, 16, 18, 19, 22, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |( 21  )|  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,1,2)->22:
+		Dyn: [17] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |( 22  )|  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,1,2)->23:
+		Dyn: [11] = {10, 11, 13, 14, 16, 17, 19, 20, 22, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |( 23  )|   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,2,2)->24:
+		Dyn: [7] = {12, 13, 15, 16, 21, 22, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |( 24  )|  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,2,2)->25:
+		Dyn: [11] = {12, 13, 14, 15, 16, 17, 21, 22, 23, 24, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |( 25  )|  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,2,2)->26:
+		Dyn: [7] = {13, 14, 16, 17, 22, 23, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |( 26  )|   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	
+topology:{ 3, 3, 3, } - isPeriodic = { True, False, False, }
+	Item at (0,0,0)->0:
+		Dyn: [11] = {2, 1, 5, 3, 4, 11, 9, 10, 14, 12, 13, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |(  0  )|   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [11] = {0, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |(  1  )|   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [11] = {1, 0, 4, 5, 3, 10, 11, 9, 13, 14, 12, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |(  2  )|   0   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [17] = {2, 0, 1, 5, 4, 8, 6, 7, 11, 9, 10, 14, 12, 13, 17, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |(  3  )|   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [17] = {0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |(  4  )|   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [17] = {1, 2, 0, 4, 3, 7, 8, 6, 10, 11, 9, 13, 14, 12, 16, 17, 15, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |(  5  )|   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [11] = {5, 3, 4, 8, 7, 14, 12, 13, 17, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   8   |(  6  )|   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [11] = {3, 4, 5, 6, 8, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |(  7  )|   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [11] = {4, 5, 3, 7, 6, 13, 14, 12, 16, 17, 15, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |(  8  )|   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+	Item at (0,0,1)->9:
+		Dyn: [17] = {2, 0, 1, 5, 3, 4, 11, 10, 14, 12, 13, 20, 18, 19, 23, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |(  9  )|  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,1)->10:
+		Dyn: [17] = {0, 1, 2, 3, 4, 5, 9, 11, 12, 13, 14, 18, 19, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |( 10  )|  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,1)->11:
+		Dyn: [17] = {1, 2, 0, 4, 5, 3, 10, 9, 13, 14, 12, 19, 20, 18, 22, 23, 21, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |( 11  )|   9   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,1)->12:
+		Dyn: [26] = {2, 0, 1, 5, 3, 4, 8, 6, 7, 11, 9, 10, 14, 13, 17, 15, 16, 20, 18, 19, 23, 21, 22, 26, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |( 12  )|  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+	Item at (1,1,1)->13:
+		Dyn: [26] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |( 13  )|  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+	Item at (2,1,1)->14:
+		Dyn: [26] = {1, 2, 0, 4, 5, 3, 7, 8, 6, 10, 11, 9, 13, 12, 16, 17, 15, 19, 20, 18, 22, 23, 21, 25, 26, 24, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |( 14  )|  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+	Item at (0,2,1)->15:
+		Dyn: [17] = {5, 3, 4, 8, 6, 7, 14, 12, 13, 17, 16, 23, 21, 22, 26, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  17   |( 15  )|  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+	Item at (1,2,1)->16:
+		Dyn: [17] = {3, 4, 5, 6, 7, 8, 12, 13, 14, 15, 17, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |( 16  )|  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+	Item at (2,2,1)->17:
+		Dyn: [17] = {4, 5, 3, 7, 8, 6, 13, 14, 12, 16, 15, 22, 23, 21, 25, 26, 24, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |( 17  )|  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+	Item at (0,0,2)->18:
+		Dyn: [11] = {11, 9, 10, 14, 12, 13, 20, 19, 23, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |( 18  )|  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,2)->19:
+		Dyn: [11] = {9, 10, 11, 12, 13, 14, 18, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |( 19  )|  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,2)->20:
+		Dyn: [11] = {10, 11, 9, 13, 14, 12, 19, 18, 22, 23, 21, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |( 20  )|  18   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,2)->21:
+		Dyn: [17] = {11, 9, 10, 14, 12, 13, 17, 15, 16, 20, 18, 19, 23, 22, 26, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |( 21  )|  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,1,2)->22:
+		Dyn: [17] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |( 22  )|  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,1,2)->23:
+		Dyn: [17] = {10, 11, 9, 13, 14, 12, 16, 17, 15, 19, 20, 18, 22, 21, 25, 26, 24, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |( 23  )|  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,2,2)->24:
+		Dyn: [11] = {14, 12, 13, 17, 15, 16, 23, 21, 22, 26, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  26   |( 24  )|  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,2,2)->25:
+		Dyn: [11] = {12, 13, 14, 15, 16, 17, 21, 22, 23, 24, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |( 25  )|  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,2,2)->26:
+		Dyn: [11] = {13, 14, 12, 16, 17, 15, 22, 23, 21, 25, 24, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |( 26  )|  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	
+topology:{ 3, 3, 3, } - isPeriodic = { False, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [11] = {6, 7, 1, 3, 4, 15, 16, 9, 10, 12, 13, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |(  0  )|   1   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [17] = {6, 7, 8, 0, 2, 3, 4, 5, 15, 16, 17, 9, 10, 11, 12, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |(  1  )|   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [11] = {7, 8, 1, 4, 5, 16, 17, 10, 11, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |(  2  )|   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [11] = {0, 1, 4, 6, 7, 9, 10, 12, 13, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |(  3  )|   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [17] = {0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |(  4  )|   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [11] = {1, 2, 4, 7, 8, 10, 11, 13, 14, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |(  5  )|   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [11] = {3, 4, 7, 0, 1, 12, 13, 15, 16, 9, 10, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |(  6  )|   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [17] = {3, 4, 5, 6, 8, 0, 1, 2, 12, 13, 14, 15, 16, 17, 9, 10, 11, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |(  7  )|   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [11] = {4, 5, 7, 1, 2, 13, 14, 16, 17, 10, 11, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   7   |(  8  )|   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+	Item at (0,0,1)->9:
+		Dyn: [17] = {6, 7, 0, 1, 3, 4, 15, 16, 10, 12, 13, 24, 25, 18, 19, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |(  9  )|  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+	Item at (1,0,1)->10:
+		Dyn: [26] = {6, 7, 8, 0, 1, 2, 3, 4, 5, 15, 16, 17, 9, 11, 12, 13, 14, 24, 25, 26, 18, 19, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |( 10  )|  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+	Item at (2,0,1)->11:
+		Dyn: [17] = {7, 8, 1, 2, 4, 5, 16, 17, 10, 13, 14, 25, 26, 19, 20, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |( 11  )|   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+	Item at (0,1,1)->12:
+		Dyn: [17] = {0, 1, 3, 4, 6, 7, 9, 10, 13, 15, 16, 18, 19, 21, 22, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |( 12  )|  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+	Item at (1,1,1)->13:
+		Dyn: [26] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |( 13  )|  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+	Item at (2,1,1)->14:
+		Dyn: [17] = {1, 2, 4, 5, 7, 8, 10, 11, 13, 16, 17, 19, 20, 22, 23, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |( 14  )|   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+	Item at (0,2,1)->15:
+		Dyn: [17] = {3, 4, 6, 7, 0, 1, 12, 13, 16, 9, 10, 21, 22, 24, 25, 18, 19, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |( 15  )|  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+	Item at (1,2,1)->16:
+		Dyn: [26] = {3, 4, 5, 6, 7, 8, 0, 1, 2, 12, 13, 14, 15, 17, 9, 10, 11, 21, 22, 23, 24, 25, 26, 18, 19, 20, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |( 16  )|  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+	Item at (2,2,1)->17:
+		Dyn: [17] = {4, 5, 7, 8, 1, 2, 13, 14, 16, 10, 11, 22, 23, 25, 26, 19, 20, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |( 17  )|   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+	Item at (0,0,2)->18:
+		Dyn: [11] = {15, 16, 9, 10, 12, 13, 24, 25, 19, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |( 18  )|  19   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,2)->19:
+		Dyn: [17] = {15, 16, 17, 9, 10, 11, 12, 13, 14, 24, 25, 26, 18, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |( 19  )|  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,2)->20:
+		Dyn: [11] = {16, 17, 10, 11, 13, 14, 25, 26, 19, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |( 20  )|   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,2)->21:
+		Dyn: [11] = {9, 10, 12, 13, 15, 16, 18, 19, 22, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |( 21  )|  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,1,2)->22:
+		Dyn: [17] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |( 22  )|  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,1,2)->23:
+		Dyn: [11] = {10, 11, 13, 14, 16, 17, 19, 20, 22, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |( 23  )|   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,2,2)->24:
+		Dyn: [11] = {12, 13, 15, 16, 9, 10, 21, 22, 25, 18, 19, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |( 24  )|  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,2,2)->25:
+		Dyn: [17] = {12, 13, 14, 15, 16, 17, 9, 10, 11, 21, 22, 23, 24, 26, 18, 19, 20, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |( 25  )|  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,2,2)->26:
+		Dyn: [11] = {13, 14, 16, 17, 10, 11, 22, 23, 25, 19, 20, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|  25   |( 26  )|   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	
+topology:{ 3, 3, 3, } - isPeriodic = { True, True, False, }
+	Item at (0,0,0)->0:
+		Dyn: [17] = {8, 6, 7, 2, 1, 5, 3, 4, 17, 15, 16, 11, 9, 10, 14, 12, 13, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |(  0  )|   1   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [17] = {6, 7, 8, 0, 2, 3, 4, 5, 15, 16, 17, 9, 10, 11, 12, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |(  1  )|   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [17] = {7, 8, 6, 1, 0, 4, 5, 3, 16, 17, 15, 10, 11, 9, 13, 14, 12, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |(  2  )|   0   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [17] = {2, 0, 1, 5, 4, 8, 6, 7, 11, 9, 10, 14, 12, 13, 17, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |(  3  )|   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [17] = {0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |(  4  )|   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [17] = {1, 2, 0, 4, 3, 7, 8, 6, 10, 11, 9, 13, 14, 12, 16, 17, 15, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |(  5  )|   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [17] = {5, 3, 4, 8, 7, 2, 0, 1, 14, 12, 13, 17, 15, 16, 11, 9, 10, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   8   |(  6  )|   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [17] = {3, 4, 5, 6, 8, 0, 1, 2, 12, 13, 14, 15, 16, 17, 9, 10, 11, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |(  7  )|   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [17] = {4, 5, 3, 7, 6, 1, 2, 0, 13, 14, 12, 16, 17, 15, 10, 11, 9, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   7   |(  8  )|   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+	Item at (0,0,1)->9:
+		Dyn: [26] = {8, 6, 7, 2, 0, 1, 5, 3, 4, 17, 15, 16, 11, 10, 14, 12, 13, 26, 24, 25, 20, 18, 19, 23, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |(  9  )|  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+	Item at (1,0,1)->10:
+		Dyn: [26] = {6, 7, 8, 0, 1, 2, 3, 4, 5, 15, 16, 17, 9, 11, 12, 13, 14, 24, 25, 26, 18, 19, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |( 10  )|  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+	Item at (2,0,1)->11:
+		Dyn: [26] = {7, 8, 6, 1, 2, 0, 4, 5, 3, 16, 17, 15, 10, 9, 13, 14, 12, 25, 26, 24, 19, 20, 18, 22, 23, 21, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |( 11  )|   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+	Item at (0,1,1)->12:
+		Dyn: [26] = {2, 0, 1, 5, 3, 4, 8, 6, 7, 11, 9, 10, 14, 13, 17, 15, 16, 20, 18, 19, 23, 21, 22, 26, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |( 12  )|  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+	Item at (1,1,1)->13:
+		Dyn: [26] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |( 13  )|  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+	Item at (2,1,1)->14:
+		Dyn: [26] = {1, 2, 0, 4, 5, 3, 7, 8, 6, 10, 11, 9, 13, 12, 16, 17, 15, 19, 20, 18, 22, 23, 21, 25, 26, 24, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |( 14  )|  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+	Item at (0,2,1)->15:
+		Dyn: [26] = {5, 3, 4, 8, 6, 7, 2, 0, 1, 14, 12, 13, 17, 16, 11, 9, 10, 23, 21, 22, 26, 24, 25, 20, 18, 19, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |( 15  )|  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+	Item at (1,2,1)->16:
+		Dyn: [26] = {3, 4, 5, 6, 7, 8, 0, 1, 2, 12, 13, 14, 15, 17, 9, 10, 11, 21, 22, 23, 24, 25, 26, 18, 19, 20, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |( 16  )|  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+	Item at (2,2,1)->17:
+		Dyn: [26] = {4, 5, 3, 7, 8, 6, 1, 2, 0, 13, 14, 12, 16, 15, 10, 11, 9, 22, 23, 21, 25, 26, 24, 19, 20, 18, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |( 17  )|  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+	Item at (0,0,2)->18:
+		Dyn: [17] = {17, 15, 16, 11, 9, 10, 14, 12, 13, 26, 24, 25, 20, 19, 23, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |( 18  )|  19   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,2)->19:
+		Dyn: [17] = {15, 16, 17, 9, 10, 11, 12, 13, 14, 24, 25, 26, 18, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |( 19  )|  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,2)->20:
+		Dyn: [17] = {16, 17, 15, 10, 11, 9, 13, 14, 12, 25, 26, 24, 19, 18, 22, 23, 21, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |( 20  )|  18   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,2)->21:
+		Dyn: [17] = {11, 9, 10, 14, 12, 13, 17, 15, 16, 20, 18, 19, 23, 22, 26, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |( 21  )|  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,1,2)->22:
+		Dyn: [17] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |( 22  )|  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,1,2)->23:
+		Dyn: [17] = {10, 11, 9, 13, 14, 12, 16, 17, 15, 19, 20, 18, 22, 21, 25, 26, 24, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |( 23  )|  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,2,2)->24:
+		Dyn: [17] = {14, 12, 13, 17, 15, 16, 11, 9, 10, 23, 21, 22, 26, 25, 20, 18, 19, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|  26   |( 24  )|  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,2,2)->25:
+		Dyn: [17] = {12, 13, 14, 15, 16, 17, 9, 10, 11, 21, 22, 23, 24, 26, 18, 19, 20, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |( 25  )|  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,2,2)->26:
+		Dyn: [17] = {13, 14, 12, 16, 17, 15, 10, 11, 9, 22, 23, 21, 25, 24, 19, 20, 18, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|  25   |( 26  )|  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	
+topology:{ 3, 3, 3, } - isPeriodic = { False, False, True, }
+	Item at (0,0,0)->0:
+		Dyn: [11] = {18, 19, 21, 22, 1, 3, 4, 9, 10, 12, 13, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |(  0  )|   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [17] = {18, 19, 20, 21, 22, 23, 0, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |(  1  )|   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [11] = {19, 20, 22, 23, 1, 4, 5, 10, 11, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |(  2  )|   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [17] = {18, 19, 21, 22, 24, 25, 0, 1, 4, 6, 7, 9, 10, 12, 13, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |(  3  )|   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [26] = {18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |(  4  )|   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [17] = {19, 20, 22, 23, 25, 26, 1, 2, 4, 7, 8, 10, 11, 13, 14, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |(  5  )|   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [11] = {21, 22, 24, 25, 3, 4, 7, 12, 13, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |(  6  )|   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [17] = {21, 22, 23, 24, 25, 26, 3, 4, 5, 6, 8, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |(  7  )|   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [11] = {22, 23, 25, 26, 4, 5, 7, 13, 14, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |(  8  )|   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+	Item at (0,0,1)->9:
+		Dyn: [11] = {0, 1, 3, 4, 10, 12, 13, 18, 19, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |(  9  )|  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,1)->10:
+		Dyn: [17] = {0, 1, 2, 3, 4, 5, 9, 11, 12, 13, 14, 18, 19, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |( 10  )|  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,1)->11:
+		Dyn: [11] = {1, 2, 4, 5, 10, 13, 14, 19, 20, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |( 11  )|   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,1)->12:
+		Dyn: [17] = {0, 1, 3, 4, 6, 7, 9, 10, 13, 15, 16, 18, 19, 21, 22, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |( 12  )|  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+	Item at (1,1,1)->13:
+		Dyn: [26] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |( 13  )|  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+	Item at (2,1,1)->14:
+		Dyn: [17] = {1, 2, 4, 5, 7, 8, 10, 11, 13, 16, 17, 19, 20, 22, 23, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |( 14  )|   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+	Item at (0,2,1)->15:
+		Dyn: [11] = {3, 4, 6, 7, 12, 13, 16, 21, 22, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |( 15  )|  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+	Item at (1,2,1)->16:
+		Dyn: [17] = {3, 4, 5, 6, 7, 8, 12, 13, 14, 15, 17, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |( 16  )|  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+	Item at (2,2,1)->17:
+		Dyn: [11] = {4, 5, 7, 8, 13, 14, 16, 22, 23, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |( 17  )|   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+	Item at (0,0,2)->18:
+		Dyn: [11] = {9, 10, 12, 13, 19, 21, 22, 0, 1, 3, 4, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |( 18  )|  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,2)->19:
+		Dyn: [17] = {9, 10, 11, 12, 13, 14, 18, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |( 19  )|  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,2)->20:
+		Dyn: [11] = {10, 11, 13, 14, 19, 22, 23, 1, 2, 4, 5, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |( 20  )|   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,2)->21:
+		Dyn: [17] = {9, 10, 12, 13, 15, 16, 18, 19, 22, 24, 25, 0, 1, 3, 4, 6, 7, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |( 21  )|  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+	Item at (1,1,2)->22:
+		Dyn: [26] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 0, 1, 2, 3, 4, 5, 6, 7, 8, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |( 22  )|  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+	Item at (2,1,2)->23:
+		Dyn: [17] = {10, 11, 13, 14, 16, 17, 19, 20, 22, 25, 26, 1, 2, 4, 5, 7, 8, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |( 23  )|   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+	Item at (0,2,2)->24:
+		Dyn: [11] = {12, 13, 15, 16, 21, 22, 25, 3, 4, 6, 7, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |( 24  )|  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+	Item at (1,2,2)->25:
+		Dyn: [17] = {12, 13, 14, 15, 16, 17, 21, 22, 23, 24, 26, 3, 4, 5, 6, 7, 8, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |( 25  )|  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+	Item at (2,2,2)->26:
+		Dyn: [11] = {13, 14, 16, 17, 22, 23, 25, 4, 5, 7, 8, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |( 26  )|   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+	
+topology:{ 3, 3, 3, } - isPeriodic = { True, False, True, }
+	Item at (0,0,0)->0:
+		Dyn: [17] = {20, 18, 19, 23, 21, 22, 2, 1, 5, 3, 4, 11, 9, 10, 14, 12, 13, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |(  0  )|   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [17] = {18, 19, 20, 21, 22, 23, 0, 2, 3, 4, 5, 9, 10, 11, 12, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |(  1  )|   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [17] = {19, 20, 18, 22, 23, 21, 1, 0, 4, 5, 3, 10, 11, 9, 13, 14, 12, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |(  2  )|   0   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [26] = {20, 18, 19, 23, 21, 22, 26, 24, 25, 2, 0, 1, 5, 4, 8, 6, 7, 11, 9, 10, 14, 12, 13, 17, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |(  3  )|   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [26] = {18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |(  4  )|   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [26] = {19, 20, 18, 22, 23, 21, 25, 26, 24, 1, 2, 0, 4, 3, 7, 8, 6, 10, 11, 9, 13, 14, 12, 16, 17, 15, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |(  5  )|   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [17] = {23, 21, 22, 26, 24, 25, 5, 3, 4, 8, 7, 14, 12, 13, 17, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   8   |(  6  )|   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [17] = {21, 22, 23, 24, 25, 26, 3, 4, 5, 6, 8, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |(  7  )|   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [17] = {22, 23, 21, 25, 26, 24, 4, 5, 3, 7, 6, 13, 14, 12, 16, 17, 15, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |(  8  )|   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+	Item at (0,0,1)->9:
+		Dyn: [17] = {2, 0, 1, 5, 3, 4, 11, 10, 14, 12, 13, 20, 18, 19, 23, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |(  9  )|  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,1)->10:
+		Dyn: [17] = {0, 1, 2, 3, 4, 5, 9, 11, 12, 13, 14, 18, 19, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |( 10  )|  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,1)->11:
+		Dyn: [17] = {1, 2, 0, 4, 5, 3, 10, 9, 13, 14, 12, 19, 20, 18, 22, 23, 21, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |( 11  )|   9   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,1)->12:
+		Dyn: [26] = {2, 0, 1, 5, 3, 4, 8, 6, 7, 11, 9, 10, 14, 13, 17, 15, 16, 20, 18, 19, 23, 21, 22, 26, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |( 12  )|  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+	Item at (1,1,1)->13:
+		Dyn: [26] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |( 13  )|  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+	Item at (2,1,1)->14:
+		Dyn: [26] = {1, 2, 0, 4, 5, 3, 7, 8, 6, 10, 11, 9, 13, 12, 16, 17, 15, 19, 20, 18, 22, 23, 21, 25, 26, 24, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |( 14  )|  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+	Item at (0,2,1)->15:
+		Dyn: [17] = {5, 3, 4, 8, 6, 7, 14, 12, 13, 17, 16, 23, 21, 22, 26, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  17   |( 15  )|  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+	Item at (1,2,1)->16:
+		Dyn: [17] = {3, 4, 5, 6, 7, 8, 12, 13, 14, 15, 17, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |( 16  )|  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+	Item at (2,2,1)->17:
+		Dyn: [17] = {4, 5, 3, 7, 8, 6, 13, 14, 12, 16, 15, 22, 23, 21, 25, 26, 24, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |( 17  )|  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+	Item at (0,0,2)->18:
+		Dyn: [17] = {11, 9, 10, 14, 12, 13, 20, 19, 23, 21, 22, 2, 0, 1, 5, 3, 4, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |( 18  )|  19   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (1,0,2)->19:
+		Dyn: [17] = {9, 10, 11, 12, 13, 14, 18, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |( 19  )|  20   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (2,0,2)->20:
+		Dyn: [17] = {10, 11, 9, 13, 14, 12, 19, 18, 22, 23, 21, 1, 2, 0, 4, 5, 3, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |( 20  )|  18   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+	Item at (0,1,2)->21:
+		Dyn: [26] = {11, 9, 10, 14, 12, 13, 17, 15, 16, 20, 18, 19, 23, 22, 26, 24, 25, 2, 0, 1, 5, 3, 4, 8, 6, 7, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |( 21  )|  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+	Item at (1,1,2)->22:
+		Dyn: [26] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 0, 1, 2, 3, 4, 5, 6, 7, 8, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |( 22  )|  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+	Item at (2,1,2)->23:
+		Dyn: [26] = {10, 11, 9, 13, 14, 12, 16, 17, 15, 19, 20, 18, 22, 21, 25, 26, 24, 1, 2, 0, 4, 5, 3, 7, 8, 6, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |( 23  )|  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+	Item at (0,2,2)->24:
+		Dyn: [17] = {14, 12, 13, 17, 15, 16, 23, 21, 22, 26, 25, 5, 3, 4, 8, 6, 7, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  26   |( 24  )|  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+	Item at (1,2,2)->25:
+		Dyn: [17] = {12, 13, 14, 15, 16, 17, 21, 22, 23, 24, 26, 3, 4, 5, 6, 7, 8, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  24   |( 25  )|  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+	Item at (2,2,2)->26:
+		Dyn: [17] = {13, 14, 12, 16, 17, 15, 22, 23, 21, 25, 24, 4, 5, 3, 7, 8, 6, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|  25   |( 26  )|  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   X   |   X   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+	
+topology:{ 3, 3, 3, } - isPeriodic = { False, True, True, }
+	Item at (0,0,0)->0:
+		Dyn: [17] = {24, 25, 18, 19, 21, 22, 6, 7, 1, 3, 4, 15, 16, 9, 10, 12, 13, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |(  0  )|   1   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [26] = {24, 25, 26, 18, 19, 20, 21, 22, 23, 6, 7, 8, 0, 2, 3, 4, 5, 15, 16, 17, 9, 10, 11, 12, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |(  1  )|   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [17] = {25, 26, 19, 20, 22, 23, 7, 8, 1, 4, 5, 16, 17, 10, 11, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |(  2  )|   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [17] = {18, 19, 21, 22, 24, 25, 0, 1, 4, 6, 7, 9, 10, 12, 13, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |(  3  )|   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [26] = {18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |(  4  )|   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [17] = {19, 20, 22, 23, 25, 26, 1, 2, 4, 7, 8, 10, 11, 13, 14, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |(  5  )|   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [17] = {21, 22, 24, 25, 18, 19, 3, 4, 7, 0, 1, 12, 13, 15, 16, 9, 10, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |(  6  )|   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [26] = {21, 22, 23, 24, 25, 26, 18, 19, 20, 3, 4, 5, 6, 8, 0, 1, 2, 12, 13, 14, 15, 16, 17, 9, 10, 11, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |(  7  )|   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [17] = {22, 23, 25, 26, 19, 20, 4, 5, 7, 1, 2, 13, 14, 16, 17, 10, 11, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   7   |(  8  )|   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+	Item at (0,0,1)->9:
+		Dyn: [17] = {6, 7, 0, 1, 3, 4, 15, 16, 10, 12, 13, 24, 25, 18, 19, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |(  9  )|  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+	Item at (1,0,1)->10:
+		Dyn: [26] = {6, 7, 8, 0, 1, 2, 3, 4, 5, 15, 16, 17, 9, 11, 12, 13, 14, 24, 25, 26, 18, 19, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |( 10  )|  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+	Item at (2,0,1)->11:
+		Dyn: [17] = {7, 8, 1, 2, 4, 5, 16, 17, 10, 13, 14, 25, 26, 19, 20, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |( 11  )|   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+	Item at (0,1,1)->12:
+		Dyn: [17] = {0, 1, 3, 4, 6, 7, 9, 10, 13, 15, 16, 18, 19, 21, 22, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |( 12  )|  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+	Item at (1,1,1)->13:
+		Dyn: [26] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |( 13  )|  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+	Item at (2,1,1)->14:
+		Dyn: [17] = {1, 2, 4, 5, 7, 8, 10, 11, 13, 16, 17, 19, 20, 22, 23, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |( 14  )|   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+	Item at (0,2,1)->15:
+		Dyn: [17] = {3, 4, 6, 7, 0, 1, 12, 13, 16, 9, 10, 21, 22, 24, 25, 18, 19, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |( 15  )|  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+	Item at (1,2,1)->16:
+		Dyn: [26] = {3, 4, 5, 6, 7, 8, 0, 1, 2, 12, 13, 14, 15, 17, 9, 10, 11, 21, 22, 23, 24, 25, 26, 18, 19, 20, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |( 16  )|  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+	Item at (2,2,1)->17:
+		Dyn: [17] = {4, 5, 7, 8, 1, 2, 13, 14, 16, 10, 11, 22, 23, 25, 26, 19, 20, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |( 17  )|   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+	Item at (0,0,2)->18:
+		Dyn: [17] = {15, 16, 9, 10, 12, 13, 24, 25, 19, 21, 22, 6, 7, 0, 1, 3, 4, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+				|   X   |( 18  )|  19   |
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+	Item at (1,0,2)->19:
+		Dyn: [26] = {15, 16, 17, 9, 10, 11, 12, 13, 14, 24, 25, 26, 18, 20, 21, 22, 23, 6, 7, 8, 0, 1, 2, 3, 4, 5, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |( 19  )|  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+	Item at (2,0,2)->20:
+		Dyn: [17] = {16, 17, 10, 11, 13, 14, 25, 26, 19, 22, 23, 7, 8, 1, 2, 4, 5, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+				|  19   |( 20  )|   X   |
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+	Item at (0,1,2)->21:
+		Dyn: [17] = {9, 10, 12, 13, 15, 16, 18, 19, 22, 24, 25, 0, 1, 3, 4, 6, 7, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  24   |  25   |
+				-------------------------
+				|   X   |( 21  )|  22   |
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+	Item at (1,1,2)->22:
+		Dyn: [26] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 0, 1, 2, 3, 4, 5, 6, 7, 8, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |( 22  )|  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+	Item at (2,1,2)->23:
+		Dyn: [17] = {10, 11, 13, 14, 16, 17, 19, 20, 22, 25, 26, 1, 2, 4, 5, 7, 8, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  25   |  26   |   X   |
+				-------------------------
+				|  22   |( 23  )|   X   |
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+	Item at (0,2,2)->24:
+		Dyn: [17] = {12, 13, 15, 16, 9, 10, 21, 22, 25, 18, 19, 3, 4, 6, 7, 0, 1, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   X   |   9   |  10   |
+				-------------------------
+				|   X   |  15   |  16   |
+				-------------------------
+				|   X   |  12   |  13   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   X   |  18   |  19   |
+				-------------------------
+				|   X   |( 24  )|  25   |
+				-------------------------
+				|   X   |  21   |  22   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   X   |   0   |   1   |
+				-------------------------
+				|   X   |   6   |   7   |
+				-------------------------
+				|   X   |   3   |   4   |
+				-------------------------
+	Item at (1,2,2)->25:
+		Dyn: [26] = {12, 13, 14, 15, 16, 17, 9, 10, 11, 21, 22, 23, 24, 26, 18, 19, 20, 3, 4, 5, 6, 7, 8, 0, 1, 2, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |( 25  )|  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+	Item at (2,2,2)->26:
+		Dyn: [17] = {13, 14, 16, 17, 10, 11, 22, 23, 25, 19, 20, 4, 5, 7, 8, 1, 2, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  10   |  11   |   X   |
+				-------------------------
+				|  16   |  17   |   X   |
+				-------------------------
+				|  13   |  14   |   X   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  19   |  20   |   X   |
+				-------------------------
+				|  25   |( 26  )|   X   |
+				-------------------------
+				|  22   |  23   |   X   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   1   |   2   |   X   |
+				-------------------------
+				|   7   |   8   |   X   |
+				-------------------------
+				|   4   |   5   |   X   |
+				-------------------------
+	
+topology:{ 3, 3, 3, } - isPeriodic = { True, True, True, }
+	Item at (0,0,0)->0:
+		Dyn: [26] = {26, 24, 25, 20, 18, 19, 23, 21, 22, 8, 6, 7, 2, 1, 5, 3, 4, 17, 15, 16, 11, 9, 10, 14, 12, 13, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |(  0  )|   1   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+	Item at (1,0,0)->1:
+		Dyn: [26] = {24, 25, 26, 18, 19, 20, 21, 22, 23, 6, 7, 8, 0, 2, 3, 4, 5, 15, 16, 17, 9, 10, 11, 12, 13, 14, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |(  1  )|   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+	Item at (2,0,0)->2:
+		Dyn: [26] = {25, 26, 24, 19, 20, 18, 22, 23, 21, 7, 8, 6, 1, 0, 4, 5, 3, 16, 17, 15, 10, 11, 9, 13, 14, 12, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |(  2  )|   0   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+	Item at (0,1,0)->3:
+		Dyn: [26] = {20, 18, 19, 23, 21, 22, 26, 24, 25, 2, 0, 1, 5, 4, 8, 6, 7, 11, 9, 10, 14, 12, 13, 17, 15, 16, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |(  3  )|   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+	Item at (1,1,0)->4:
+		Dyn: [26] = {18, 19, 20, 21, 22, 23, 24, 25, 26, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |(  4  )|   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+	Item at (2,1,0)->5:
+		Dyn: [26] = {19, 20, 18, 22, 23, 21, 25, 26, 24, 1, 2, 0, 4, 3, 7, 8, 6, 10, 11, 9, 13, 14, 12, 16, 17, 15, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |(  5  )|   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+	Item at (0,2,0)->6:
+		Dyn: [26] = {23, 21, 22, 26, 24, 25, 20, 18, 19, 5, 3, 4, 8, 7, 2, 0, 1, 14, 12, 13, 17, 15, 16, 11, 9, 10, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   8   |(  6  )|   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+	Item at (1,2,0)->7:
+		Dyn: [26] = {21, 22, 23, 24, 25, 26, 18, 19, 20, 3, 4, 5, 6, 8, 0, 1, 2, 12, 13, 14, 15, 16, 17, 9, 10, 11, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |(  7  )|   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+	Item at (2,2,0)->8:
+		Dyn: [26] = {22, 23, 21, 25, 26, 24, 19, 20, 18, 4, 5, 3, 7, 6, 1, 2, 0, 13, 14, 12, 16, 17, 15, 10, 11, 9, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   7   |(  8  )|   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+	Item at (0,0,1)->9:
+		Dyn: [26] = {8, 6, 7, 2, 0, 1, 5, 3, 4, 17, 15, 16, 11, 10, 14, 12, 13, 26, 24, 25, 20, 18, 19, 23, 21, 22, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |(  9  )|  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+	Item at (1,0,1)->10:
+		Dyn: [26] = {6, 7, 8, 0, 1, 2, 3, 4, 5, 15, 16, 17, 9, 11, 12, 13, 14, 24, 25, 26, 18, 19, 20, 21, 22, 23, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |( 10  )|  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+	Item at (2,0,1)->11:
+		Dyn: [26] = {7, 8, 6, 1, 2, 0, 4, 5, 3, 16, 17, 15, 10, 9, 13, 14, 12, 25, 26, 24, 19, 20, 18, 22, 23, 21, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |( 11  )|   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+	Item at (0,1,1)->12:
+		Dyn: [26] = {2, 0, 1, 5, 3, 4, 8, 6, 7, 11, 9, 10, 14, 13, 17, 15, 16, 20, 18, 19, 23, 21, 22, 26, 24, 25, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |( 12  )|  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+	Item at (1,1,1)->13:
+		Dyn: [26] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |( 13  )|  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+	Item at (2,1,1)->14:
+		Dyn: [26] = {1, 2, 0, 4, 5, 3, 7, 8, 6, 10, 11, 9, 13, 12, 16, 17, 15, 19, 20, 18, 22, 23, 21, 25, 26, 24, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |( 14  )|  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+	Item at (0,2,1)->15:
+		Dyn: [26] = {5, 3, 4, 8, 6, 7, 2, 0, 1, 14, 12, 13, 17, 16, 11, 9, 10, 23, 21, 22, 26, 24, 25, 20, 18, 19, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |( 15  )|  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+	Item at (1,2,1)->16:
+		Dyn: [26] = {3, 4, 5, 6, 7, 8, 0, 1, 2, 12, 13, 14, 15, 17, 9, 10, 11, 21, 22, 23, 24, 25, 26, 18, 19, 20, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |( 16  )|  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+	Item at (2,2,1)->17:
+		Dyn: [26] = {4, 5, 3, 7, 8, 6, 1, 2, 0, 13, 14, 12, 16, 15, 10, 11, 9, 22, 23, 21, 25, 26, 24, 19, 20, 18, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |( 17  )|  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+	Item at (0,0,2)->18:
+		Dyn: [26] = {17, 15, 16, 11, 9, 10, 14, 12, 13, 26, 24, 25, 20, 19, 23, 21, 22, 8, 6, 7, 2, 0, 1, 5, 3, 4, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+				|  20   |( 18  )|  19   |
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+	Item at (1,0,2)->19:
+		Dyn: [26] = {15, 16, 17, 9, 10, 11, 12, 13, 14, 24, 25, 26, 18, 20, 21, 22, 23, 6, 7, 8, 0, 1, 2, 3, 4, 5, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+				|  18   |( 19  )|  20   |
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+	Item at (2,0,2)->20:
+		Dyn: [26] = {16, 17, 15, 10, 11, 9, 13, 14, 12, 25, 26, 24, 19, 18, 22, 23, 21, 7, 8, 6, 1, 2, 0, 4, 5, 3, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+				|  19   |( 20  )|  18   |
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+	Item at (0,1,2)->21:
+		Dyn: [26] = {11, 9, 10, 14, 12, 13, 17, 15, 16, 20, 18, 19, 23, 22, 26, 24, 25, 2, 0, 1, 5, 3, 4, 8, 6, 7, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  26   |  24   |  25   |
+				-------------------------
+				|  23   |( 21  )|  22   |
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+	Item at (1,1,2)->22:
+		Dyn: [26] = {9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 0, 1, 2, 3, 4, 5, 6, 7, 8, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  24   |  25   |  26   |
+				-------------------------
+				|  21   |( 22  )|  23   |
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+	Item at (2,1,2)->23:
+		Dyn: [26] = {10, 11, 9, 13, 14, 12, 16, 17, 15, 19, 20, 18, 22, 21, 25, 26, 24, 1, 2, 0, 4, 5, 3, 7, 8, 6, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  25   |  26   |  24   |
+				-------------------------
+				|  22   |( 23  )|  21   |
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+	Item at (0,2,2)->24:
+		Dyn: [26] = {14, 12, 13, 17, 15, 16, 11, 9, 10, 23, 21, 22, 26, 25, 20, 18, 19, 5, 3, 4, 8, 6, 7, 2, 0, 1, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  11   |   9   |  10   |
+				-------------------------
+				|  17   |  15   |  16   |
+				-------------------------
+				|  14   |  12   |  13   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  20   |  18   |  19   |
+				-------------------------
+				|  26   |( 24  )|  25   |
+				-------------------------
+				|  23   |  21   |  22   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   2   |   0   |   1   |
+				-------------------------
+				|   8   |   6   |   7   |
+				-------------------------
+				|   5   |   3   |   4   |
+				-------------------------
+	Item at (1,2,2)->25:
+		Dyn: [26] = {12, 13, 14, 15, 16, 17, 9, 10, 11, 21, 22, 23, 24, 26, 18, 19, 20, 3, 4, 5, 6, 7, 8, 0, 1, 2, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|   9   |  10   |  11   |
+				-------------------------
+				|  15   |  16   |  17   |
+				-------------------------
+				|  12   |  13   |  14   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  18   |  19   |  20   |
+				-------------------------
+				|  24   |( 25  )|  26   |
+				-------------------------
+				|  21   |  22   |  23   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   0   |   1   |   2   |
+				-------------------------
+				|   6   |   7   |   8   |
+				-------------------------
+				|   3   |   4   |   5   |
+				-------------------------
+	Item at (2,2,2)->26:
+		Dyn: [26] = {13, 14, 12, 16, 17, 15, 10, 11, 9, 22, 23, 21, 25, 24, 19, 20, 18, 4, 5, 3, 7, 8, 6, 1, 2, 0, }
+		Full:
+			-1 in 3rd dim plane
+				-------------------------
+				|  10   |  11   |   9   |
+				-------------------------
+				|  16   |  17   |  15   |
+				-------------------------
+				|  13   |  14   |  12   |
+				-------------------------
+			ref item's plane in 3rd dim
+				-------------------------
+				|  19   |  20   |  18   |
+				-------------------------
+				|  25   |( 26  )|  24   |
+				-------------------------
+				|  22   |  23   |  21   |
+				-------------------------
+			+1 3rd dim
+				-------------------------
+				|   1   |   2   |   0   |
+				-------------------------
+				|   7   |   8   |   6   |
+				-------------------------
+				|   4   |   5   |   3   |
+				-------------------------
+	
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testIJK26Topology.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testIJK26Topology.0of1.sh	Wed Oct 10 07:21:38 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 "testIJK26Topology " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testIJK26Topology.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testIJK26Topology.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,190 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testIJK26Topology.c 3583 2006-05-16 10:06:22Z PatrickSunter $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+
+void Test_TestTopologyOfSize( Dictionary* dictionary, IJK ijkSize, Bool periodic[3], Stream* stream ) {	
+	IJK26Topology*	topology;
+	Index		i,j,k;
+	Index elNum;
+	Index           sizeI, sizeJ, sizeK;
+
+	sizeI = ijkSize[I_AXIS];
+	sizeJ = ijkSize[J_AXIS];
+	sizeK = ijkSize[K_AXIS];
+
+	topology = IJK26Topology_New_All( "Topology", NULL, ijkSize, periodic );
+	Journal_Printf( stream, "topology:{ " );
+	for ( i=0; i < 3; i++ ) {
+		Journal_Printf( stream, "%d, ", topology->size[i] );
+	}
+	Journal_Printf( stream, "}" );
+
+	Journal_Printf( stream, " - isPeriodic = { " );
+	for ( i=0; i < 3; i++ ) {
+		Journal_Printf( stream, "%s, ", StG_BoolToStringMap[topology->isPeriodic[i]] );
+	}
+	Journal_Printf( stream, "}\n" );
+
+	Stream_Indent( stream );
+
+	for ( k=0; k < sizeK; k++ ) {
+		for ( j=0; j < sizeJ; j++ ) {
+			for ( i=0; i < sizeI; i++ ) {
+				IJK_3DTo1D_3( topology, i, j, k, &elNum );
+				Journal_Printf( stream, "Item at (%d,%d,%d)->%d:\n", 
+					i, j, k, elNum );
+				Stream_Indent( stream );
+				Journal_Printf( stream, "Dyn: " );
+				topology->dynamicSizes = True;
+				IJK26Topology_PrintNeighboursOfIndex( topology, elNum, stream );
+				Journal_Printf( stream, "Full:\n" );
+				Stream_Indent( stream );
+				topology->dynamicSizes = False;
+				IJK26Topology_PrintNeighboursOfIndex( topology, elNum, stream );
+				Stream_UnIndent( stream );
+				Stream_UnIndent( stream );
+			}
+		}	
+	}
+	Journal_Printf( stream, "\n" );
+
+	Stream_UnIndent( stream );
+
+	Stg_Class_Delete( topology );
+}	
+
+
+int main( int argc, char* argv[] ) {
+	Dictionary*	dictionary;
+	MPI_Comm	CommWorld;
+	int		rank;
+	int		numProcessors;
+	Bool            periodic[3] = { False, False, False };
+	unsigned int    ii, jj, kk;
+	Stream*         stream;
+	IJK             ijkSize;
+	
+	/* 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 );
+	
+	StgDomainGeometry_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	stream = Journal_Register( Info_Type, argv[0] );
+	Stream_Enable( stream, True );
+
+	dictionary = Dictionary_New();
+	Dictionary_Add( dictionary, "meshSizeI", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+	Dictionary_Add( dictionary, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+	Dictionary_Add( dictionary, "meshSizeK", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+
+	Journal_Printf( stream, "+++++++++++++ 1D Tests +++++++++++++\n\n" );
+	ijkSize[I_AXIS] = 1;
+	ijkSize[J_AXIS] = 1;
+	ijkSize[K_AXIS] = 1;
+	periodic[I_AXIS] = False;
+	periodic[J_AXIS] = False;
+	periodic[K_AXIS] = False;
+	for ( ijkSize[I_AXIS] = 1; ijkSize[I_AXIS] <= 3; ijkSize[I_AXIS]++ ) {
+		for ( ii=False; ii < 2; ii++ ) {
+			periodic[I_AXIS] = ii;
+			Test_TestTopologyOfSize( dictionary, ijkSize, periodic, stream );
+		}	
+	}
+	ijkSize[I_AXIS] = 1;
+	periodic[I_AXIS] = True;	/* Leave this on just to make sure it has no effect on J axis */
+	for ( ijkSize[J_AXIS] = 2; ijkSize[J_AXIS] <= 3; ijkSize[J_AXIS]++ ) {
+		for ( ii=False; ii < 2; ii++ ) {
+			periodic[J_AXIS] = ii;
+			Test_TestTopologyOfSize( dictionary, ijkSize, periodic, stream );
+		}	
+	}
+
+	Journal_Printf( stream, "+++++++++++++ 2D Tests +++++++++++++\n\n" );
+	ijkSize[I_AXIS] = 1;
+	ijkSize[J_AXIS] = 1;
+	ijkSize[K_AXIS] = 1;
+	periodic[I_AXIS] = False;
+	periodic[J_AXIS] = False;
+	periodic[K_AXIS] = False;
+	for ( ijkSize[J_AXIS] = 2; ijkSize[J_AXIS] <= 3; ijkSize[J_AXIS]++ ) {
+		for ( ijkSize[I_AXIS] = 2; ijkSize[I_AXIS] <= 3; ijkSize[I_AXIS]++ ) {
+			for ( jj=False; jj < 2; jj++ ) {
+				periodic[J_AXIS] = jj;
+				for ( ii=False; ii < 2; ii++ ) {
+					periodic[I_AXIS] = ii;
+					Test_TestTopologyOfSize( dictionary, ijkSize, periodic, stream );
+				}
+			}
+		}
+	}
+
+	Journal_Printf( stream, "+++++++++++++ 3D Tests +++++++++++++\n\n" );
+	ijkSize[I_AXIS] = 3;
+	ijkSize[J_AXIS] = 3;
+	ijkSize[K_AXIS] = 3;
+	periodic[I_AXIS] = False;
+	periodic[J_AXIS] = False;
+	periodic[K_AXIS] = False;
+	for ( kk=False; kk < 2; kk++ ) {
+		periodic[K_AXIS] = kk;
+
+		for ( jj=False; jj < 2; jj++ ) {
+			periodic[J_AXIS] = jj;
+
+			for ( ii=False; ii < 2; ii++ ) {
+				periodic[I_AXIS] = ii;
+				Test_TestTopologyOfSize( dictionary, ijkSize, periodic, stream );
+			}
+		}
+	}	
+
+	Stg_Class_Delete( dictionary );
+		
+	StgDomainGeometry_Finalise();
+	
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testIJK6Topology.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testIJK6Topology.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,334 @@
+StGermain Framework. Copyright (C) 2003-2005 VPAC.
++++ 1D Tests +++
+
+*** Construction test ***
+topology->size[0-2] = { 3, 1, 1, }
+
+*** Topology_NeighbourCount() and BuildNeighbour() tests. ***
+
+Reference object, loc (0,0,0) (0)
+Dynamic:
+	ElNbrs[0-0] = {1, }
+Non-Dynamic
+	ElNbrs[0-1] = {1, 3(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-1] = {1, 2, }
+
+Reference object, loc (1,0,0) (1)
+Dynamic:
+	ElNbrs[0-1] = {2, 0, }
+Non-Dynamic
+	ElNbrs[0-1] = {2, 0, }
+Non-Dynamic, Periodic
+	ElNbrs[0-1] = {2, 0, }
+
+Reference object, loc (2,0,0) (2)
+Dynamic:
+	ElNbrs[0-0] = {1, }
+Non-Dynamic
+	ElNbrs[0-1] = {3(Inv), 1, }
+Non-Dynamic, Periodic
+	ElNbrs[0-1] = {0, 1, }
+
++++ 2D Tests +++
+
+*** Construction test ***
+topology->size[0-2] = { 3, 3, 1, }
+
+*** Topology_NeighbourCount() and BuildNeighbour() tests. ***
+
+Reference object, loc (0,0,0) (0)
+Dynamic:
+	ElNbrs[0-1] = {1, 3, }
+Non-Dynamic
+	ElNbrs[0-3] = {1, 3, 9(Inv), 9(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-3] = {1, 3, 2, 6, }
+
+Reference object, loc (1,0,0) (1)
+Dynamic:
+	ElNbrs[0-2] = {2, 4, 0, }
+Non-Dynamic
+	ElNbrs[0-3] = {2, 4, 0, 9(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-3] = {2, 4, 0, 7, }
+
+Reference object, loc (2,0,0) (2)
+Dynamic:
+	ElNbrs[0-1] = {5, 1, }
+Non-Dynamic
+	ElNbrs[0-3] = {9(Inv), 5, 1, 9(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-3] = {0, 5, 1, 8, }
+
+Reference object, loc (0,1,0) (3)
+Dynamic:
+	ElNbrs[0-2] = {4, 6, 0, }
+Non-Dynamic
+	ElNbrs[0-3] = {4, 6, 9(Inv), 0, }
+Non-Dynamic, Periodic
+	ElNbrs[0-3] = {4, 6, 5, 0, }
+
+Reference object, loc (1,1,0) (4)
+Dynamic:
+	ElNbrs[0-3] = {5, 7, 3, 1, }
+Non-Dynamic
+	ElNbrs[0-3] = {5, 7, 3, 1, }
+Non-Dynamic, Periodic
+	ElNbrs[0-3] = {5, 7, 3, 1, }
+
+Reference object, loc (2,1,0) (5)
+Dynamic:
+	ElNbrs[0-2] = {8, 4, 2, }
+Non-Dynamic
+	ElNbrs[0-3] = {9(Inv), 8, 4, 2, }
+Non-Dynamic, Periodic
+	ElNbrs[0-3] = {3, 8, 4, 2, }
+
+Reference object, loc (0,2,0) (6)
+Dynamic:
+	ElNbrs[0-1] = {7, 3, }
+Non-Dynamic
+	ElNbrs[0-3] = {7, 9(Inv), 9(Inv), 3, }
+Non-Dynamic, Periodic
+	ElNbrs[0-3] = {7, 0, 8, 3, }
+
+Reference object, loc (1,2,0) (7)
+Dynamic:
+	ElNbrs[0-2] = {8, 6, 4, }
+Non-Dynamic
+	ElNbrs[0-3] = {8, 9(Inv), 6, 4, }
+Non-Dynamic, Periodic
+	ElNbrs[0-3] = {8, 1, 6, 4, }
+
+Reference object, loc (2,2,0) (8)
+Dynamic:
+	ElNbrs[0-1] = {7, 5, }
+Non-Dynamic
+	ElNbrs[0-3] = {9(Inv), 9(Inv), 7, 5, }
+Non-Dynamic, Periodic
+	ElNbrs[0-3] = {6, 2, 7, 5, }
+
++++ 3D Tests +++
+
+*** Construction test ***
+topology->size[0-2] = { 3, 3, 3, }
+
+*** Topology_NeighbourCount() and BuildNeighbour() tests. ***
+
+Reference object, loc (0,0,0) (0)
+Dynamic:
+	ElNbrs[0-2] = {1, 3, 9, }
+Non-Dynamic
+	ElNbrs[0-5] = {1, 3, 9, 27(Inv), 27(Inv), 27(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {1, 3, 9, 2, 6, 18, }
+
+Reference object, loc (1,0,0) (1)
+Dynamic:
+	ElNbrs[0-3] = {2, 4, 10, 0, }
+Non-Dynamic
+	ElNbrs[0-5] = {2, 4, 10, 0, 27(Inv), 27(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {2, 4, 10, 0, 7, 19, }
+
+Reference object, loc (2,0,0) (2)
+Dynamic:
+	ElNbrs[0-2] = {5, 11, 1, }
+Non-Dynamic
+	ElNbrs[0-5] = {27(Inv), 5, 11, 1, 27(Inv), 27(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {0, 5, 11, 1, 8, 20, }
+
+Reference object, loc (0,1,0) (3)
+Dynamic:
+	ElNbrs[0-3] = {4, 6, 12, 0, }
+Non-Dynamic
+	ElNbrs[0-5] = {4, 6, 12, 27(Inv), 0, 27(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {4, 6, 12, 5, 0, 21, }
+
+Reference object, loc (1,1,0) (4)
+Dynamic:
+	ElNbrs[0-4] = {5, 7, 13, 3, 1, }
+Non-Dynamic
+	ElNbrs[0-5] = {5, 7, 13, 3, 1, 27(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {5, 7, 13, 3, 1, 22, }
+
+Reference object, loc (2,1,0) (5)
+Dynamic:
+	ElNbrs[0-3] = {8, 14, 4, 2, }
+Non-Dynamic
+	ElNbrs[0-5] = {27(Inv), 8, 14, 4, 2, 27(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {3, 8, 14, 4, 2, 23, }
+
+Reference object, loc (0,2,0) (6)
+Dynamic:
+	ElNbrs[0-2] = {7, 15, 3, }
+Non-Dynamic
+	ElNbrs[0-5] = {7, 27(Inv), 15, 27(Inv), 3, 27(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {7, 0, 15, 8, 3, 24, }
+
+Reference object, loc (1,2,0) (7)
+Dynamic:
+	ElNbrs[0-3] = {8, 16, 6, 4, }
+Non-Dynamic
+	ElNbrs[0-5] = {8, 27(Inv), 16, 6, 4, 27(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {8, 1, 16, 6, 4, 25, }
+
+Reference object, loc (2,2,0) (8)
+Dynamic:
+	ElNbrs[0-2] = {17, 7, 5, }
+Non-Dynamic
+	ElNbrs[0-5] = {27(Inv), 27(Inv), 17, 7, 5, 27(Inv), }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {6, 2, 17, 7, 5, 26, }
+
+Reference object, loc (0,0,1) (9)
+Dynamic:
+	ElNbrs[0-3] = {10, 12, 18, 0, }
+Non-Dynamic
+	ElNbrs[0-5] = {10, 12, 18, 27(Inv), 27(Inv), 0, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {10, 12, 18, 11, 15, 0, }
+
+Reference object, loc (1,0,1) (10)
+Dynamic:
+	ElNbrs[0-4] = {11, 13, 19, 9, 1, }
+Non-Dynamic
+	ElNbrs[0-5] = {11, 13, 19, 9, 27(Inv), 1, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {11, 13, 19, 9, 16, 1, }
+
+Reference object, loc (2,0,1) (11)
+Dynamic:
+	ElNbrs[0-3] = {14, 20, 10, 2, }
+Non-Dynamic
+	ElNbrs[0-5] = {27(Inv), 14, 20, 10, 27(Inv), 2, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {9, 14, 20, 10, 17, 2, }
+
+Reference object, loc (0,1,1) (12)
+Dynamic:
+	ElNbrs[0-4] = {13, 15, 21, 9, 3, }
+Non-Dynamic
+	ElNbrs[0-5] = {13, 15, 21, 27(Inv), 9, 3, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {13, 15, 21, 14, 9, 3, }
+
+Reference object, loc (1,1,1) (13)
+Dynamic:
+	ElNbrs[0-5] = {14, 16, 22, 12, 10, 4, }
+Non-Dynamic
+	ElNbrs[0-5] = {14, 16, 22, 12, 10, 4, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {14, 16, 22, 12, 10, 4, }
+
+Reference object, loc (2,1,1) (14)
+Dynamic:
+	ElNbrs[0-4] = {17, 23, 13, 11, 5, }
+Non-Dynamic
+	ElNbrs[0-5] = {27(Inv), 17, 23, 13, 11, 5, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {12, 17, 23, 13, 11, 5, }
+
+Reference object, loc (0,2,1) (15)
+Dynamic:
+	ElNbrs[0-3] = {16, 24, 12, 6, }
+Non-Dynamic
+	ElNbrs[0-5] = {16, 27(Inv), 24, 27(Inv), 12, 6, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {16, 9, 24, 17, 12, 6, }
+
+Reference object, loc (1,2,1) (16)
+Dynamic:
+	ElNbrs[0-4] = {17, 25, 15, 13, 7, }
+Non-Dynamic
+	ElNbrs[0-5] = {17, 27(Inv), 25, 15, 13, 7, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {17, 10, 25, 15, 13, 7, }
+
+Reference object, loc (2,2,1) (17)
+Dynamic:
+	ElNbrs[0-3] = {26, 16, 14, 8, }
+Non-Dynamic
+	ElNbrs[0-5] = {27(Inv), 27(Inv), 26, 16, 14, 8, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {15, 11, 26, 16, 14, 8, }
+
+Reference object, loc (0,0,2) (18)
+Dynamic:
+	ElNbrs[0-2] = {19, 21, 9, }
+Non-Dynamic
+	ElNbrs[0-5] = {19, 21, 27(Inv), 27(Inv), 27(Inv), 9, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {19, 21, 0, 20, 24, 9, }
+
+Reference object, loc (1,0,2) (19)
+Dynamic:
+	ElNbrs[0-3] = {20, 22, 18, 10, }
+Non-Dynamic
+	ElNbrs[0-5] = {20, 22, 27(Inv), 18, 27(Inv), 10, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {20, 22, 1, 18, 25, 10, }
+
+Reference object, loc (2,0,2) (20)
+Dynamic:
+	ElNbrs[0-2] = {23, 19, 11, }
+Non-Dynamic
+	ElNbrs[0-5] = {27(Inv), 23, 27(Inv), 19, 27(Inv), 11, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {18, 23, 2, 19, 26, 11, }
+
+Reference object, loc (0,1,2) (21)
+Dynamic:
+	ElNbrs[0-3] = {22, 24, 18, 12, }
+Non-Dynamic
+	ElNbrs[0-5] = {22, 24, 27(Inv), 27(Inv), 18, 12, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {22, 24, 3, 23, 18, 12, }
+
+Reference object, loc (1,1,2) (22)
+Dynamic:
+	ElNbrs[0-4] = {23, 25, 21, 19, 13, }
+Non-Dynamic
+	ElNbrs[0-5] = {23, 25, 27(Inv), 21, 19, 13, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {23, 25, 4, 21, 19, 13, }
+
+Reference object, loc (2,1,2) (23)
+Dynamic:
+	ElNbrs[0-3] = {26, 22, 20, 14, }
+Non-Dynamic
+	ElNbrs[0-5] = {27(Inv), 26, 27(Inv), 22, 20, 14, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {21, 26, 5, 22, 20, 14, }
+
+Reference object, loc (0,2,2) (24)
+Dynamic:
+	ElNbrs[0-2] = {25, 21, 15, }
+Non-Dynamic
+	ElNbrs[0-5] = {25, 27(Inv), 27(Inv), 27(Inv), 21, 15, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {25, 18, 6, 26, 21, 15, }
+
+Reference object, loc (1,2,2) (25)
+Dynamic:
+	ElNbrs[0-3] = {26, 24, 22, 16, }
+Non-Dynamic
+	ElNbrs[0-5] = {26, 27(Inv), 27(Inv), 24, 22, 16, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {26, 19, 7, 24, 22, 16, }
+
+Reference object, loc (2,2,2) (26)
+Dynamic:
+	ElNbrs[0-2] = {25, 23, 17, }
+Non-Dynamic
+	ElNbrs[0-5] = {27(Inv), 27(Inv), 27(Inv), 25, 23, 17, }
+Non-Dynamic, Periodic
+	ElNbrs[0-5] = {24, 20, 8, 25, 23, 17, }
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testIJK6Topology.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testIJK6Topology.0of1.sh	Wed Oct 10 07:21:38 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 "testIJK6Topology " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testIJK6Topology.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testIJK6Topology.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,150 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testIJK6Topology.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+
+
+void Test_PrintNeighbours( IJK6Topology* topology, Index i, Index j, Index k, Bool dynamicSizes ) {
+	Index elNum;
+	NeighbourIndex nbrCount;
+	NeighbourIndex* elNbrs;
+	char* dynStr;
+
+	topology->dynamicSizes = dynamicSizes;
+	if ( dynamicSizes ) {
+		dynStr = "on";
+	} 
+	else {
+		dynStr = "off";
+	}
+	
+	IJK_3DTo1D_3( topology, i, j, k, &elNum );
+	nbrCount = Topology_NeighbourCount( topology, elNum );
+	elNbrs = Memory_Alloc_Array( NeighbourIndex, nbrCount, "elNbrs" );
+	Topology_BuildNeighbours( topology, elNum, elNbrs );
+	printf( "\tElNbrs[0-%d] = {", nbrCount-1 );
+	for ( i=0; i < nbrCount; i++ ) {
+		printf( "%d", elNbrs[i] );
+		if ( elNbrs[i] == Topology_Invalid( topology ) ) {
+			printf( "(Inv)");
+		}
+		printf( ", ");
+	}
+	printf( "}\n" );
+	Memory_Free( elNbrs );
+}	
+
+
+void Test_TestTopologyOfSize( Dictionary* dictionary, Index sizeI, Index sizeJ, Index sizeK ) {	
+	IJK6Topology*	topology;
+	Index		i,j,k;
+	Index elNum;
+
+	Dictionary_Set( dictionary, "meshSizeI", Dictionary_Entry_Value_FromUnsignedInt( sizeI ) );
+	Dictionary_Set( dictionary, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( sizeJ ) );
+	Dictionary_Set( dictionary, "meshSizeK", Dictionary_Entry_Value_FromUnsignedInt( sizeK ) );
+
+	printf( "*** Construction test ***\n" );
+	topology = IJK6Topology_New( "topology", dictionary );
+	printf( "topology->size[0-2] = { " );
+	for ( i=0; i < 3; i++ ) {
+		printf( "%d, ", topology->size[i] );
+	}
+	printf( "}\n\n" );
+
+	printf( "*** Topology_NeighbourCount() and BuildNeighbour() tests. ***\n\n" );
+	for ( k=0; k < sizeK; k++ ) {
+		for ( j=0; j < sizeJ; j++ ) {
+			for ( i=0; i < sizeI; i++ ) {
+				IJK_3DTo1D_3( topology, i, j, k, &elNum );
+				printf( "Reference object, loc (%d,%d,%d) (%d)\n", 
+					i, j, k, elNum );
+				printf( "Dynamic:\n" );
+				Test_PrintNeighbours( topology, i, j, k, True );
+				printf( "Non-Dynamic\n" );
+				Test_PrintNeighbours( topology, i, j, k, False );
+				printf( "Non-Dynamic, Periodic\n" );
+				topology->isPeriodic[I_AXIS] = True;
+				topology->isPeriodic[J_AXIS] = True;
+				topology->isPeriodic[K_AXIS] = True;
+				Test_PrintNeighbours( topology, i, j, k, False );
+				topology->isPeriodic[I_AXIS] = False;
+				topology->isPeriodic[J_AXIS] = False;
+				topology->isPeriodic[K_AXIS] = False;
+				printf( "\n" );
+			}
+		}	
+	}
+
+	Stg_Class_Delete( topology );
+}	
+
+
+int main( int argc, char* argv[] ) {
+	Dictionary*	dictionary;
+	int		rank;
+	int		numProcessors;
+	MPI_Comm	CommWorld;
+	
+	/* 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 );
+	StgDomainGeometry_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	dictionary = Dictionary_New();
+	Dictionary_Add( dictionary, "meshSizeI", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+	Dictionary_Add( dictionary, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+	Dictionary_Add( dictionary, "meshSizeK", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+
+	printf( "+++ 1D Tests +++\n\n" );
+	Test_TestTopologyOfSize( dictionary, 3, 1, 1 );
+	printf( "+++ 2D Tests +++\n\n" );
+	Test_TestTopologyOfSize( dictionary, 3, 3, 1 );
+	printf( "+++ 3D Tests +++\n\n" );
+	Test_TestTopologyOfSize( dictionary, 3, 3, 3 );
+
+	Stg_Class_Delete( dictionary );
+		
+	StgDomainGeometry_Finalise();
+	StGermain_Finalise();
+	MPI_Finalize();
+	
+	return 0;
+}	
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testIrregGeometry.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testIrregGeometry.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,55 @@
+StGermain Framework. Copyright (C) 2003-2005 VPAC.
+Individual point test:
+	Point 0 : { 0.2, 0.9, 0.1 }
+	Point 1 : { 0.1, 0.7, 0 }
+	Point 2 : { 0.2, 0.5, 0.08 }
+	Point 3 : { 0.3, 0.3, 0.1 }
+	Point 4 : { 0.2, 0.1, 0.1 }
+	Point 5 : { 0.3, 0.9, 0.3 }
+	Point 6 : { 0.2, 0.7, 0.2 }
+	Point 7 : { 0.3, 0.5, 0.28 }
+	Point 8 : { 0.4, 0.3, 0.3 }
+	Point 9 : { 0.3, 0.1, 0.3 }
+	Point 10 : { 0.5, 0.9, 0.5 }
+	Point 11 : { 0.4, 0.7, 0.4 }
+	Point 12 : { 0.5, 0.5, 0.48 }
+	Point 13 : { 0.6, 0.3, 0.4 }
+	Point 14 : { 0.5, 0.1, 0.4 }
+	Point 15 : { 0.7, 0.9, 0.7 }
+	Point 16 : { 0.6, 0.7, 0.6 }
+	Point 17 : { 0.7, 0.5, 0.68 }
+	Point 18 : { 0.8, 0.3, 0.7 }
+	Point 19 : { 0.7, 0.1, 0.7 }
+	Point 20 : { 0.8, 0.9, 0.9 }
+	Point 21 : { 0.7, 0.7, 0.8 }
+	Point 22 : { 0.8, 0.5, 0.88 }
+	Point 23 : { 0.9, 0.3, 0.9 }
+	Point 24 : { 0.8, 0.1, 0.9 }
+
+Total point test:
+	Point 0 : { 0.2, 0.9, 0.1 }
+	Point 1 : { 0.1, 0.7, 0 }
+	Point 2 : { 0.2, 0.5, 0.08 }
+	Point 3 : { 0.3, 0.3, 0.1 }
+	Point 4 : { 0.2, 0.1, 0.1 }
+	Point 5 : { 0.3, 0.9, 0.3 }
+	Point 6 : { 0.2, 0.7, 0.2 }
+	Point 7 : { 0.3, 0.5, 0.28 }
+	Point 8 : { 0.4, 0.3, 0.3 }
+	Point 9 : { 0.3, 0.1, 0.3 }
+	Point 10 : { 0.5, 0.9, 0.5 }
+	Point 11 : { 0.4, 0.7, 0.4 }
+	Point 12 : { 0.5, 0.5, 0.48 }
+	Point 13 : { 0.6, 0.3, 0.4 }
+	Point 14 : { 0.5, 0.1, 0.4 }
+	Point 15 : { 0.7, 0.9, 0.7 }
+	Point 16 : { 0.6, 0.7, 0.6 }
+	Point 17 : { 0.7, 0.5, 0.68 }
+	Point 18 : { 0.8, 0.3, 0.7 }
+	Point 19 : { 0.7, 0.1, 0.7 }
+	Point 20 : { 0.8, 0.9, 0.9 }
+	Point 21 : { 0.7, 0.7, 0.8 }
+	Point 22 : { 0.8, 0.5, 0.88 }
+	Point 23 : { 0.9, 0.3, 0.9 }
+	Point 24 : { 0.8, 0.1, 0.9 }
+
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testIrregGeometry.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testIrregGeometry.0of1.sh	Wed Oct 10 07:21:38 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 "testIrregGeometry " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testIrregGeometry.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testIrregGeometry.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,94 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testIrregGeometry.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+
+int main( int argc, char* argv[] ) {
+	Dictionary*	dictionary;
+	Geometry*	geometry;
+	Coord_List	points;
+	Index		i;
+	XML_IO_Handler*	io_handler;
+	MPI_Comm	CommWorld;
+	int		rank;
+	int		numProcessors;
+	
+	/* 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 );
+	StgDomainGeometry_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	io_handler = XML_IO_Handler_New();
+	dictionary = Dictionary_New();
+	IO_Handler_ReadAllFromFile( io_handler, "data/points.xml", dictionary );
+	
+	geometry = (Geometry*)IrregGeometry_New( "irregGeometry", dictionary, "pointList");
+	
+	printf( "Individual point test:\n" );
+	for( i = 0; i < geometry->pointCount; i++ ) {
+		Coord point;
+		
+		printf( "\tPoint %u : ", i );
+		geometry->pointAt( geometry, i, point );
+		printf( "{ %g, %g, %g }\n", point[0], point[1], point[2] );
+	}
+	printf( "\n" );
+	
+	printf( "Total point test:\n" );
+	points = Memory_Alloc_Array( Coord, geometry->pointCount, "points" );
+	geometry->buildPoints( geometry, points );
+	for( i = 0; i < geometry->pointCount; i++ ) {
+		printf( "\tPoint %u : ", i );
+		geometry->pointAt( geometry, i, points[i] );
+		printf( "{ %g, %g, %g }\n", points[i][0], points[i][1], points[i][2] );
+	}
+	printf( "\n" );
+	if( points )
+		Memory_Free( points );
+	
+	Stg_Class_Delete( dictionary );
+	Stg_Class_Delete( io_handler );
+	
+	StgDomainGeometry_Finalise();
+	StGermain_Finalise();
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testLine.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testLine.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,9 @@
+StGermain Framework. Copyright (C) 2003-2005 VPAC.
+True
+True
+True
+False
+True
+True
+True
+True
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testLine.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testLine.0of1.sh	Wed Oct 10 07:21:38 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 "testLine " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testLine.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testLine.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,83 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testLine.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+
+
+int main( int argc, char* argv[] ) {
+	Coord		points[4] = { { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.5, 0.9, 0.5 }, { 1.2, 0.7, 0.8 } };
+	Coord		insidePoint = { 0.7, 0.3, 0.0 };
+	Coord		outsidePoint = { -0.2, 0.3, 0.0 };
+	Stg_Line		lines[4];
+	Index		i;
+	MPI_Comm	CommWorld;
+	int		rank;
+	int		numProcessors;
+	
+	/* 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 );
+	
+	StgDomainGeometry_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+	
+	/*
+	** When lines are to be used as boundaries (ie. determining whether other points lay
+	** to the left or right of the line), points must be specified from left to right, where
+	** the region in front of the line is considered the 'inside'.
+	*/
+	Stg_Line_CalcFromPoints( lines[0], points[0], points[1] );
+	Stg_Line_CalcFromPoints( lines[1], points[2], points[0] );
+	Stg_Line_CalcFromPoints( lines[2], points[1], points[3] );
+	Stg_Line_CalcFromPoints( lines[3], points[3], points[2] );
+	
+	for( i = 0; i < 4; i++ ) {
+		printf( "%s\n", Stg_Line_PointIsInside( lines[i], insidePoint ) ? "True" : "False" );
+		printf( "%s\n", Stg_Line_PointIsInside( lines[i], outsidePoint ) ? "True" : "False" );
+	}
+	
+	StgDomainGeometry_Finalise();
+	
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testParallelDelaunay.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testParallelDelaunay.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,55 @@
+StGermain Framework revision 3667. Copyright (C) 2003-2005 VPAC.
+
+Testing irregular parallel triangulation..
+
+
+	Running Parallel Triangulator on 100 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 400 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 900 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 1600 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+Testing regular parallel triangulation..
+
+
+	Running Parallel Triangulator on 100 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 400 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 900 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 1600 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testParallelDelaunay.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testParallelDelaunay.0of1.sh	Wed Oct 10 07:21:38 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 "testParallelDelaunay " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testParallelDelaunay.0of2.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testParallelDelaunay.0of2.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,55 @@
+StGermain Framework revision 3667. Copyright (C) 2003-2005 VPAC.
+
+Testing irregular parallel triangulation..
+
+
+	Running Parallel Triangulator on 100 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 400 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 900 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 1600 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+Testing regular parallel triangulation..
+
+
+	Running Parallel Triangulator on 100 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 400 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 900 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
+
+	Running Parallel Triangulator on 1600 nodes
+
+		Parallel Voronoi Area test: passed
+		Parallel Voronoi Sides test: passed
+		Parallel Triangle count test: passed
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testParallelDelaunay.0of2.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testParallelDelaunay.0of2.sh	Wed Oct 10 07:21:38 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 "testParallelDelaunay " "$0" "$@"
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testParallelDelaunay.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testParallelDelaunay.c	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,277 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: testEdge.c 3462 2006-02-19 06:53:24Z WalterLandry $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "StGermain/StGermain.h"
+
+#include "StgDomain/Geometry/Geometry.h"
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+
+typedef enum pointsType_t{
+	Irregular,
+	Regular,
+	Polygon
+}pointsType;
+
+#define PI 3.1415926535897932384626
+
+void generatePoints( CoordF *sites, int numSites, pointsType *p )
+{
+	int num, i, j;
+	
+	assert( sites );
+
+	num = numSites;
+	
+	if( *p == Irregular ){
+		for( i=0; i<num; i++ ){
+			sites[i][0] = drand48();
+			sites[i][1] = drand48();
+		}
+	}
+	else if (*p == Regular){
+		int count = 0;
+		num = sqrt((float)num);
+		for( i=0; i<num; i++ ){
+			for( j=0; j<num; j++ ){
+				sites[count][0] = ((float)i)*(1/((float)num));
+				sites[count][1] = ((float)j)*(1/((float)num));
+
+				count++;
+			}
+		}
+	}
+	else if( *p == Polygon ){
+		for( i=0; i<num-1; i++ ){
+			sites[i][0] = cos( ((float)i)*2.0*PI/((float)(num-1)) );
+			sites[i][1] = sin( ((float)i)*2.0*PI/((float)(num-1)) );
+		}
+	}
+}
+
+int compareFunction( const void *a, const void *b )
+{
+	int *p, *q;
+
+	p = (int*)a;
+	q = (int*)b;
+
+	if( *p > *q ){
+		return 1;
+	}
+	else if ( *p < *q ){
+		return -1;
+	}
+	else{
+		return 0;
+	}
+}
+
+#define MAX_NEIGH 100
+#define TOLERANCE 0.0001
+int main( int argc, char* argv[] ) {
+	MPI_Comm CommWorld;
+	int rank;
+	int numProcessors;
+	Delaunay *d = NULL;
+	ParallelDelaunay *pd = NULL;
+	DelaunayAttributes attr;
+	CoordF *sites;
+	int i = 0, j = 0, k = 0, m = 0;
+	pointsType p;
+	int numSites = 0;
+	int dNeighbours[MAX_NEIGH];
+	int pdNeighbours[MAX_NEIGH];
+	int numNeighboursTest = 0;
+	int voronoiSidesTest = 0;
+	int voronoiAreaTest = 0;
+	int triangleCountTest = 0;
+	int numSitesArray[4] = { 100, 400, 900, 1600 };
+
+	Dictionary *dictionary = NULL;
+	
+	attr.BuildBoundingTriangle = 0;
+	attr.BuildTriangleIndices = 1;
+	attr.BuildTriangleNeighbours= 1;
+	attr.CreateVoronoiVertices = 1;
+	attr.CalculateVoronoiSides = 1;
+	attr.CalculateVoronoiSurfaceArea = 1;
+	attr.FindNeighbours = 1;
+	
+	/* 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 );
+	
+	StgDomainGeometry_Init( &argc, &argv );
+	MPI_Barrier( CommWorld ); /* Ensures copyright info always come first in output */
+
+	dictionary = Dictionary_New();
+
+	/* Testing parallel triangulation on irregular poit sets first and then
+	 * on regular point sets */
+	
+	p = Irregular;
+	
+label:	numNeighboursTest = 1;
+	voronoiAreaTest = 1;
+	voronoiSidesTest = 1;
+	triangleCountTest = 1;
+	
+	if (rank == 0){
+		if( p == Irregular ){
+			printf( "\nTesting irregular parallel triangulation..\n\n" );
+		}
+		else if ( p == Regular ){
+			printf( "\nTesting regular parallel triangulation..\n\n" );
+		}
+	}
+	
+	for( i=0; i<4; i++ ){
+
+		numSites = numSitesArray[i];
+		
+		sites = NULL;
+		if( rank == 0 ){
+			sites = Memory_Alloc_Array(CoordF, numSites, "TestParallelDelauney_CoordF" );
+			memset( sites, 0, sizeof( CoordF ) * numSites );
+		
+			generatePoints( sites, numSites, &p );
+		}
+		
+		pd = ParallelDelaunay_New( "Delaunay", dictionary, sites, numSites, rank, numProcessors, &CommWorld, &attr );
+		Stg_Component_Build( pd, NULL, True );
+		Stg_Component_Execute( pd, NULL, True );
+
+		ParallelDelaunay_GatherTriangulation( pd );
+		MPI_Barrier( CommWorld );
+		
+		if( rank == 0 ){
+
+			d = Delaunay_New( "Delaunay", dictionary, sites, numSites, 0, &attr );
+			Stg_Component_Build( d, NULL, True );
+
+			for( j=0; j<numSites; j++ ){
+				
+				/* Checking for parity between voronoiArea generated by the serial and parallel
+				 * triangulations */
+
+				if( fabs(d->voronoiArea[j] - pd->voronoiArea[j]) > TOLERANCE ){
+					printf( "voronoi area %f of node %d not within tolerance\n", pd->voronoiArea[j], j );
+					voronoiAreaTest = 0;
+				}
+				
+				//assert( pd->numNeighbours[j] == d->numNeighbours[j] );
+				if( dNeighbours[k] != pdNeighbours[k] ) continue;
+			
+				memset( dNeighbours, 0, sizeof( dNeighbours ) );
+				memset( pdNeighbours, 0, sizeof( pdNeighbours ) );
+
+				memcpy( dNeighbours, d->neighbours[j], sizeof( int ) * d->numNeighbours[j] );
+				memcpy( pdNeighbours, pd->neighbours[j], sizeof( int ) * pd->numNeighbours[j] );
+				
+				/* The order of the neighbour nodes of each node in a serial triangulation is
+				 * different to that of in a parallel triangulation. Hence we need to sort the
+				 * neighbour nodes to check for parity */
+				
+				qsort( dNeighbours, d->numNeighbours[j], sizeof( int ), compareFunction );
+				qsort( pdNeighbours, pd->numNeighbours[j], sizeof( int ), compareFunction );
+	
+				
+				/* Checking for parity between the length of the voronoi sides generated by 
+				 * the serial and parallel triangulations */
+
+				for( k=0; k<d->numNeighbours[j]; k++ ){
+					//assert( dNeighbours[k] == pdNeighbours[k] );
+					if( dNeighbours[k] != pdNeighbours[k] ) continue;
+
+					for( m=0; m<d->numNeighbours[j]; m++ ){
+						if( d->neighbours[j][k] == pd->neighbours[j][m] ){
+							if( fabs(d->voronoiSides[j][k] - pd->voronoiSides[j][m]) > TOLERANCE ){
+								printf( "voronoi side %f of node %d not within tolerance\n", pd->voronoiSides[j][m], j );
+								voronoiSidesTest = 0;
+							}
+						}
+					}
+				}
+			}
+			
+			if( d->numTriangles != pd->numTriangles ){
+				triangleCountTest = 0;
+			}
+			
+			Stg_Class_Delete( d );
+		}
+
+		Stg_Class_Delete( pd );
+		
+		if( rank == 0 ){
+			Memory_Free( sites );
+		}
+		
+		if (rank == 0){
+
+			printf( "\n\tRunning Parallel Triangulator on %d nodes\n\n", numSites );
+	
+			if( voronoiAreaTest ){
+				printf( "\t\tParallel Voronoi Area test: passed\n" );
+			}
+	
+			if( voronoiSidesTest ){
+				printf( "\t\tParallel Voronoi Sides test: passed\n" );
+			}
+		
+			if( triangleCountTest ){
+				printf( "\t\tParallel Triangle count test: passed\n" );
+			}
+		}
+	}
+	
+	if(p == Irregular){
+		p = Regular;
+		goto label;
+	}
+	
+	Stg_Class_Delete( dictionary );
+	
+	StgDomainGeometry_Finalise();
+	
+	StGermain_Finalise();
+	
+	/* Close off MPI */
+	MPI_Finalize();
+	return 0;
+}
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testPlane.0of1.expected
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testPlane.0of1.expected	Wed Oct 10 07:21:38 2007 +0000
@@ -0,0 +1,5 @@
+StGermain Framework. Copyright (C) 2003-2005 VPAC.
+Plane: 0x + -0y + 1z = 2
+Distance to point: 4
+In front A: True
+In front B: False
diff -r 9f22ec4f42ee -r 5667007f4799 Geometry/tests/testPlane.0of1.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Geometry/tests/testPl