[cig-commits] r5035 - in long/3D/Gale/trunk/src/Gale: . Utils Utils/src libGale libGale/src plugins plugins/SurfaceProcess

walter at geodynamics.org walter at geodynamics.org
Sat Oct 14 13:15:16 PDT 2006


Author: walter
Date: 2006-10-14 13:15:15 -0700 (Sat, 14 Oct 2006)
New Revision: 5035

Added:
   long/3D/Gale/trunk/src/Gale/Utils/
   long/3D/Gale/trunk/src/Gale/Utils/makefile
   long/3D/Gale/trunk/src/Gale/Utils/src/
   long/3D/Gale/trunk/src/Gale/Utils/src/Finalise.c
   long/3D/Gale/trunk/src/Gale/Utils/src/Finalise.h
   long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.c
   long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.h
   long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.meta
   long/3D/Gale/trunk/src/Gale/Utils/src/Init.c
   long/3D/Gale/trunk/src/Gale/Utils/src/Init.h
   long/3D/Gale/trunk/src/Gale/Utils/src/Utils.h
   long/3D/Gale/trunk/src/Gale/Utils/src/makefile
   long/3D/Gale/trunk/src/Gale/Utils/src/types.h
   long/3D/Gale/trunk/src/Gale/libGale/
   long/3D/Gale/trunk/src/Gale/libGale/makefile
   long/3D/Gale/trunk/src/Gale/libGale/src/
   long/3D/Gale/trunk/src/Gale/libGale/src/Finalise.c
   long/3D/Gale/trunk/src/Gale/libGale/src/Finalise.h
   long/3D/Gale/trunk/src/Gale/libGale/src/Gale.h
   long/3D/Gale/trunk/src/Gale/libGale/src/Init.c
   long/3D/Gale/trunk/src/Gale/libGale/src/Init.h
   long/3D/Gale/trunk/src/Gale/libGale/src/makefile
   long/3D/Gale/trunk/src/Gale/plugins/
   long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/
   long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/Context.h
   long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c
   long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.h
   long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/makefile
   long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/types.h
   long/3D/Gale/trunk/src/Gale/plugins/makefile
Modified:
   long/3D/Gale/trunk/src/Gale/
Log:
 r45 at earth:  boo | 2006-10-14 13:14:58 -0700
  r44 at earth (orig r57):  LukeHodkinson | 2006-10-14 13:50:08 -0700
  Forgot to add all this new stuff to Gale.
  
 



Property changes on: long/3D/Gale/trunk/src/Gale
___________________________________________________________________
Name: svk:merge
   - 4e4aea6e-fd02-0410-981f-80ab108a5659:/trunk:56
8f887497-cf10-0410-afc2-df8ae19c7fb0:/cig:38
   + 4e4aea6e-fd02-0410-981f-80ab108a5659:/trunk:57
8f887497-cf10-0410-afc2-df8ae19c7fb0:/cig:45

Added: long/3D/Gale/trunk/src/Gale/Utils/makefile
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/makefile	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/makefile	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,9 @@
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := src
+
+include ${PROJ_ROOT}/Makefile.vmake

Added: long/3D/Gale/trunk/src/Gale/Utils/src/Finalise.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/Finalise.c	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/Finalise.c	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,55 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Finalise.c 2 2005-10-19 01:13:07Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include "Finalise.h"
+
+
+Bool Gale_Utils_Finalise( void ) {
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+
+	return True;
+}

Added: long/3D/Gale/trunk/src/Gale/Utils/src/Finalise.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/Finalise.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/Finalise.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,51 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Finalise.h 2 2005-10-19 01:13:07Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __Gale_Utils_Finalise_h__
+#define __Gale_Utils_Finalise_h__
+	
+	Bool Gale_Utils_Finalise( void );
+	
+#endif 

Added: long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.c	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.c	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,195 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Context.c 225 2006-06-28 06:07:03Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StG_FEM/StG_FEM.h>
+#include <PICellerator/PICellerator.h>
+#include <Underworld/Underworld.h>
+
+#include "types.h"
+#include "GaleContext.h"
+
+
+/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
+const Type GaleContext_Type = "GaleContext";
+
+
+/* Constructors ------------------------------------------------------------------------------------------------*/
+void* GaleContext_DefaultNew( Name name ) {
+	return (void*) _GaleContext_New(
+		sizeof(GaleContext),
+		GaleContext_Type,
+		_GaleContext_Delete,
+		_GaleContext_Print,
+		NULL, 
+		GaleContext_DefaultNew,
+		_AbstractContext_Construct,
+		_AbstractContext_Build,
+		_AbstractContext_Initialise,
+		_AbstractContext_Execute,
+		_AbstractContext_Destroy,
+		_UnderworldContext_SetDt,
+		name,
+		False,
+		0,
+		0,
+		0,
+		NULL );
+}
+
+GaleContext* GaleContext_New( 
+		Name                        name,
+		double						start,
+		double						stop,
+		MPI_Comm					communicator,
+		Dictionary*					dictionary )
+{
+	return _GaleContext_New(
+		sizeof(GaleContext),
+		GaleContext_Type,
+		_GaleContext_Delete,
+		_GaleContext_Print,
+		NULL, 
+		GaleContext_DefaultNew,
+		_AbstractContext_Construct,
+		_AbstractContext_Build,
+		_AbstractContext_Initialise,
+		_AbstractContext_Execute,
+		_AbstractContext_Destroy,
+		_UnderworldContext_SetDt,
+		name,
+		True,
+		start,
+		stop,
+		communicator,
+		dictionary );
+}	
+
+GaleContext* _GaleContext_New( 
+		SizeT                                  sizeOfSelf,
+		Type                                   type,
+		Stg_Class_DeleteFunction*              _delete,
+		Stg_Class_PrintFunction*               _print,
+		Stg_Class_CopyFunction*                _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*       _construct,
+		Stg_Component_BuildFunction*           _build,
+		Stg_Component_InitialiseFunction*      _initialise,
+		Stg_Component_ExecuteFunction*         _execute,
+		Stg_Component_DestroyFunction*         _destroy,
+		AbstractContext_SetDt*                 _setDt,
+		Name                                   name,
+		Bool                                   initFlag,
+		double                                 start,
+		double                                 stop,
+		MPI_Comm                               communicator,
+		Dictionary*                            dictionary )		
+{
+	GaleContext* self;
+	
+	/* Call private constructor of parent - this will set virtual functions of parent and continue up the hierarchy tree. At the beginning of the tree it will allocate memory of the size of object and initialise all the memory to zero. */
+	self = (GaleContext*)_UnderworldContext_New( 
+		sizeOfSelf, 
+		type, 
+		_delete, 
+		_print, 
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,
+		_setDt, 
+		name,
+		initFlag,
+		start, 
+		stop, 
+		communicator, 
+		dictionary );
+	
+	/* General info */
+	
+	/* Function pointers for this class that are not on the parent class should be set here */
+	
+	if( initFlag ){
+		_GaleContext_Init( self );
+	}
+	
+	return self;
+}
+
+
+void _GaleContext_Init( GaleContext* self ) {
+	self->isConstructed = True;
+}
+
+
+/* Virtual Functions -------------------------------------------------------------------------------------------------------------*/
+
+void _GaleContext_Delete( void* context ) {
+	GaleContext* self = (GaleContext*)context;
+	
+	Journal_DPrintf( self->debug, "In: %s()\n", __func__ );
+
+	/* Stg_Class_Delete parent */
+	_UnderworldContext_Delete( self );
+}
+
+void _GaleContext_Print( void* context, Stream* stream ) {
+	GaleContext* self = (GaleContext*)context;
+	
+	/* General info */
+	Journal_Printf( (void*) stream, "GaleContext (ptr): %p\n", self );
+	
+	/* Print parent */
+	_UnderworldContext_Print( self, stream );
+}
+
+
+/* Public Functions ----------------------------------------------------------------------------------------------------*/
+
+
+/* EntryPoint Hooks ----------------------------------------------------------------------------------------------------*/

Added: long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,108 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: GaleContext.h 225 2006-06-28 06:07:03Z SteveQuenette $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __Gale_Utils_GaleContext_h__
+#define __Gale_Utils_GaleContext_h__
+
+	/* Textual name of this class */
+	extern const Type GaleContext_Type;
+
+	#define __GaleContext				\
+		__UnderworldContext			\
+							\
+		/* Virtual functions go here */		\
+							\
+		/* GaleContext info */
+
+	struct GaleContext { __GaleContext };
+
+	/* Constructors ----------------------------------------------------------------------------------------------------*/
+
+	void* GaleContext_DefaultNew();
+
+	GaleContext* GaleContext_New( 
+		Name						name,
+		double                      start,
+		double                      stop,
+		MPI_Comm                    communicator,
+		Dictionary*                 dictionary );
+
+	GaleContext* _GaleContext_New( 
+		SizeT                                  sizeOfSelf,
+		Type                                   type,
+		Stg_Class_DeleteFunction*              _delete,
+		Stg_Class_PrintFunction*               _print,
+		Stg_Class_CopyFunction*                _copy, 
+		Stg_Component_DefaultConstructorFunction*  _defaultConstructor,
+		Stg_Component_ConstructFunction*       _construct,
+		Stg_Component_BuildFunction*           _build,
+		Stg_Component_InitialiseFunction*      _initialise,
+		Stg_Component_ExecuteFunction*         _execute,
+		Stg_Component_DestroyFunction*         _destroy,
+		AbstractContext_SetDt*                 _setDt,
+		Name                                   name,
+		Bool                                   initFlag,
+		double                                 start,
+		double                                 stop,
+		MPI_Comm                               communicator,
+		Dictionary*                            dictionary );
+	
+	/** Initialisation implementation */
+	void _GaleContext_Init( GaleContext* self );
+
+	/* Virtual Functions -----------------------------------------------------------------------------------------------*/
+	
+	/* Stg_Class_Delete implementation */
+	void _GaleContext_Delete( void* context );
+	
+	/* Print implementation */
+	void _GaleContext_Print( void* context, Stream* stream );
+
+	/* Public functions -----------------------------------------------------------------------------------------------*/
+	#define GaleContext_AssignPointers UnderworldContext_AssignPointers
+	
+	#define GaleContext_ComponentConstruct _UnderworldContext_ComponentConstruct
+
+#endif /* __Gale_Utils_GaleContext_h__ */

Added: long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.meta
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.meta	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/GaleContext.meta	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">GaleContext</param>
+<param name="Organisation">CIG</param>
+<param name="Project">Gale</param>
+<param name="Location">./Gale/Utils/src/</param>
+<param name="Project Web"></param>
+<param name="Copyright"></param>
+<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
+<param name="Parent">UnderworldContext</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>

Added: long/3D/Gale/trunk/src/Gale/Utils/src/Init.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/Init.c	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/Init.c	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,64 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Init.c 230 2006-06-30 04:01:50Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StG_FEM/StG_FEM.h>
+#include <PICellerator/PICellerator.h>
+#include <Underworld/Underworld.h>
+
+#include "Utils.h"
+
+
+Bool Gale_Utils_Init( int* argc, char** argv[] ) {
+	Stg_ComponentRegister* componentRegister = Stg_ComponentRegister_Get_ComponentRegister();
+
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+
+	Stg_ComponentRegister_Add( componentRegister, GaleContext_Type, "0", GaleContext_DefaultNew );
+	RegisterParent( GaleContext_Type, UnderworldContext_Type );
+
+	return True;
+}

Added: long/3D/Gale/trunk/src/Gale/Utils/src/Init.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/Init.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/Init.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,51 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Init.h 2 2005-10-19 01:13:07Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __Gale_Utils_Init_h__
+#define __Gale_Utils_Init_h__
+	
+	Bool Gale_Utils_Init( int* argc, char** argv[] );
+	
+#endif 

Added: long/3D/Gale/trunk/src/Gale/Utils/src/Utils.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/Utils.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/Utils.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,54 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Utils.h 230 2006-06-30 04:01:50Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __Gale_Utils_h__
+#define __Gale_Utils_h__
+
+	#include "types.h"
+	#include "GaleContext.h"
+	#include "Init.h"
+	#include "Finalise.h"
+	
+#endif 

Added: long/3D/Gale/trunk/src/Gale/Utils/src/makefile
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/makefile	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/makefile	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,21 @@
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Source Code and Header files
+SRCS := $(wildcard *.c)
+HDRS := $(wildcard *.h)
+
+# External Libraries and Headers
+packages = UNDERWORLD PICELLERATOR STG_FEM STGERMAIN PETSC MPI XML PYTHON
+
+# Work out name to call library
+lib = ${PROJECT}$(shell basename `pwd | sed s/src//g`)
+libdynamic = yes
+libstatic = yes
+
+# Name of directory to place header files
+includes := ${PROJECT}/$(shell basename `pwd | sed s/src//g`)
+
+include ${PROJ_ROOT}/Makefile.vmake

Added: long/3D/Gale/trunk/src/Gale/Utils/src/types.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/Utils/src/types.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/Utils/src/types.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,51 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: types.h 230 2006-06-30 04:01:50Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __Gale_Utils_types_h__
+#define __Gale_Utils_types_h__
+	
+	typedef struct GaleContext             GaleContext;
+
+#endif

Added: long/3D/Gale/trunk/src/Gale/libGale/makefile
===================================================================
--- long/3D/Gale/trunk/src/Gale/libGale/makefile	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/libGale/makefile	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,9 @@
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := src 
+
+include ${PROJ_ROOT}/Makefile.vmake

Added: long/3D/Gale/trunk/src/Gale/libGale/src/Finalise.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/libGale/src/Finalise.c	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/libGale/src/Finalise.c	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,63 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Finalise.c 2 2005-10-19 01:13:07Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StG_FEM/StG_FEM.h>
+#include <PICellerator/PICellerator.h>
+#include <Underworld/Underworld.h>
+
+#include <Gale/Utils/Utils.h>
+
+#include "Finalise.h"
+
+
+Bool Gale_Finalise( void ) {
+	Gale_Utils_Finalise();
+	
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+
+	return True;
+}

Added: long/3D/Gale/trunk/src/Gale/libGale/src/Finalise.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/libGale/src/Finalise.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/libGale/src/Finalise.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,51 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Finalise.h 2 2005-10-19 01:13:07Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __Gale_Finalise_h__
+#define __Gale_Finalise_h__
+	
+	Bool Gale_Finalise( void );
+	
+#endif 

Added: long/3D/Gale/trunk/src/Gale/libGale/src/Gale.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/libGale/src/Gale.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/libGale/src/Gale.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,54 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Gale.h 2 2005-10-19 01:13:07Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __Gale_h__
+#define __Gale_h__
+	
+	#include "Utils/Utils.h"
+
+	#include "Init.h"
+	#include "Finalise.h"
+
+#endif /* __Gale_h__ */

Added: long/3D/Gale/trunk/src/Gale/libGale/src/Init.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/libGale/src/Init.c	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/libGale/src/Init.c	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,127 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Init.c 262 2006-07-18 00:30:53Z KathleenHumble $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StG_FEM/StG_FEM.h>
+#include <PICellerator/PICellerator.h>
+#include <Underworld/Underworld.h>
+#include "Gale/Utils/Utils.h"
+
+#include "Init.h"
+
+
+/** Initialises this package, then any init for this package
+such as streams etc */
+
+Stream* Gale_Debug = NULL;
+Stream* Gale_Info = NULL;
+Stream* Gale_Error = NULL;
+
+Bool Gale_Init( int* argc, char** argv[] ) {
+	char* argString;
+	int arg_I;
+	int tmp;
+	Bool useSignalHandler = True;
+
+	for ( arg_I = 0; arg_I < *argc; arg_I++ ) {
+		argString = (*argv)[arg_I];
+		/* Leverage from PETSC's no signal flag */
+		if ( strcmp( argString, "-no_signal_handler" ) == 0 ) {
+			useSignalHandler = False;
+		}
+	}
+
+	if ( useSignalHandler ) {
+		signal( SIGSEGV, Gale_SignalHandler );
+		signal( SIGTERM, Gale_SignalHandler );
+	}
+
+	Gale_Utils_Init( argc, argv );
+	
+	Journal_Printf( Journal_Register( DebugStream_Type, "Context" ), "In: %s\n", __func__ ); /* DO NOT CHANGE OR REMOVE */
+	tmp = Stream_GetPrintingRank( Journal_Register( InfoStream_Type, "Context" ) );
+	Stream_SetPrintingRank( Journal_Register( InfoStream_Type, "Context" ), 0 );
+	Journal_Printf( /* DO NOT CHANGE OR REMOVE */
+		Journal_Register( InfoStream_Type, "Context" ), 
+		"Gale (Geodynamics framework) revision %s. Copyright (C) 2005 Monash Cluster Computing.\n", VERSION );
+	Stream_Flush( Journal_Register( InfoStream_Type, "Context" ) );
+	Stream_SetPrintingRank( Journal_Register( InfoStream_Type, "Context" ), tmp );
+
+	/* Create Streams */
+	Gale_Debug  = Journal_Register( Debug_Type, "Context" );
+	Gale_Info   = Journal_Register( Info_Type,  "Context" );
+	Gale_Error  = Journal_Register( Error_Type, "Context" );
+
+	return True;
+}
+
+
+void Gale_SignalHandler( int signal ) {
+	fprintf( stderr, 
+			"\n\n=====================================================================================\n"
+			"Error running Gale (revision %s) - Signal %d ",
+			VERSION, signal );
+
+	switch ( signal ) {
+		case SIGSEGV:
+			fprintf( stderr, 
+					"'SIGSEGV' (Segmentation Fault).\n" 
+					"This is probably caused by an illegal access of memory.\n"
+					"We recommend running the code in a debugger to work out where the problem is (e.g. 'gdb')\n"
+					"and also to contact the developers.\n" );
+			break;
+		case SIGTERM:
+			fprintf( stderr, 
+					"'SIGTERM' (Termination Request).\n" 
+					"This is caused by an external call to terminate the code.\n"
+					"This could have happened by a queueing system (e.g. if the code has run longer than allowed),\n"
+					"the code might have been killed on another processor or it may have been killed by the user.\n" );
+			break;
+	}
+	exit(EXIT_FAILURE);
+}

Added: long/3D/Gale/trunk/src/Gale/libGale/src/Init.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/libGale/src/Init.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/libGale/src/Init.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,56 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+** Copyright (c) 2005, Monash Cluster Computing 
+** All rights reserved.
+** Redistribution and use in source and binary forms, with or without modification,
+** are permitted provided that the following conditions are met:
+**
+** 		* Redistributions of source code must retain the above copyright notice, 
+** 			this list of conditions and the following disclaimer.
+** 		* Redistributions in binary form must reproduce the above copyright 
+**			notice, this list of conditions and the following disclaimer in the 
+**			documentation and/or other materials provided with the distribution.
+** 		* Neither the name of the Monash University nor the names of its contributors 
+**			may be used to endorse or promote products derived from this software 
+**			without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 
+** BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
+** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
+** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
+** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+**
+** Contact:
+*%		Louis Moresi - Louis.Moresi at sci.monash.edu.au
+*%
+** Contributors:
+*+		Robert Turnbull
+*+		Vincent Lemiale
+*+		Louis Moresi
+*+		David May
+*+		David Stegman
+*+		Mirko Velic
+*+		Patrick Sunter
+*+		Julian Giordani
+*+
+** $Id: Init.h 64 2005-11-24 05:55:27Z RobertTurnbull $
+** 
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+
+#ifndef __Gale_Init_h__
+#define __Gale_Init_h__
+	
+	extern Stream* Gale_Debug;
+	extern Stream* Gale_Info;
+	extern Stream* Gale_Error;
+
+	void Gale_SignalHandler( int signal ) ;
+	Bool Gale_Init( int* argc, char** argv[] );
+	
+#endif /* __Gale_Init_h__ */

Added: long/3D/Gale/trunk/src/Gale/libGale/src/makefile
===================================================================
--- long/3D/Gale/trunk/src/Gale/libGale/src/makefile	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/libGale/src/makefile	2006-10-14 20:15:15 UTC (rev 5035)
@@ -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 file may be distributed under the terms of the VPAC Public License
+## as defined by VPAC of Australia and appearing in the file
+## LICENSE.VPL included in the packaging of this file.
+##
+## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+##
+## $Id: Makefile.rules 2746 2005-03-06 00:29:00Z SteveQuenette $
+##
+##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+lib = ${PROJECT}
+libstatic = yes
+libdynamic = yes
+includes = ${PROJECT}
+
+SRCS = $(wildcard *.c)
+
+HDRS = $(wildcard *.h)
+
+PROJ_OBJLISTS = GaleUtils
+EXTERNAL_LIBS = -L${LIB_DIR} 
+
+EXTERNAL_INCLUDES = -I${INC_DIR}/${PROJECT} -I${PICELLERATOR_INCDIR}
+
+packages = STGERMAIN STG_FEM MPI XML MATH
+
+include ${PROJ_ROOT}/Makefile.vmake

Added: long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/Context.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/Context.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/Context.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,37 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Victorian Partnership for Advanced Computing (VPAC) Ltd, Australia
+** (C) 2003-2005 All Rights Reserved
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	David May, PhD Student Monash University, VPAC. (david.may at sci.maths.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**
+** Role:
+**	Defines any header info, such as new structures, needed by this plugin
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Gale_plugins_SurfaceProcess_Context_h__
+#define __Gale_plugins_SurfaceProcess_Context_h__
+
+	struct Gale_SurfaceProcess_Context {
+		Mesh*		mesh;
+		Mesh*		surface;
+		DecompTransfer*	sendOp;
+		DecompTransfer*	recvOp;
+		double*		heights;
+	};
+
+#endif

Added: long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.c	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,424 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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)
+**	David May, PhD Student Monash University, VPAC. (david.may at sci.maths.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  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: LevelSetPlg.c 200 2005-07-08 08:24:41Z LukeHodkinson $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include <mpi.h>
+#include <StGermain/StGermain.h>
+#include <StG_FEM/StG_FEM.h>
+#include <PICellerator/PICellerator.h>
+#include <Underworld/Underworld.h>
+#include <Gale/Gale.h>
+
+#include "types.h"
+#include "Context.h"
+#include "SurfaceProcess.h"
+
+
+const Type		Gale_SurfaceProcess_Type = "SurfaceProcess";
+ExtensionInfo_Index	Gale_SurfaceProcess_ContextHandle;
+
+
+void Gale_SurfaceProcess_Execute( TimeIntegratee* crdAdvector, GaleContext* galeCtx ) {
+	Gale_SurfaceProcess_Context*	spCtx;
+	Mesh*				surface;
+	double*				heights;
+	double				dt;
+
+	assert( galeCtx );
+
+	/* Get the surface process context. */
+	spCtx = ExtensionManager_Get( galeCtx->extensionMgr, galeCtx, Gale_SurfaceProcess_ContextHandle );
+
+	/* Extract information from contexts. */
+	surface = spCtx->surface;
+	heights = spCtx->heights;
+	dt = galeCtx->dt;
+
+	/* Transfer information to the surface. */
+	Gale_SurfaceProcess_Send( spCtx );
+
+	/*
+	** SURFACE PROCESS CODE GOES HERE, SHOULD MODIFY THE HEIGHTS ONLY.
+	*/
+#if 0
+	{
+		for( n_i = 0; n_i < surface->nodeDomainCount; n_i++ ) {
+			if( surface->topo->nDims == 1 ) {
+				if( n_i > 0 && n_i < self->nodeDomainCount - 1 ) {
+					double	dx = surface->nodeCoord[n_i][0] - surface->nodeCoord[n_i - 1][0];
+
+					newVal = (surface->heights[n_i - 1] - 2.0 * surface->heights[n_i] + surface->heights[n_i + 1]) / 
+						(dx * dx);
+				}
+			}
+			else {
+				abort();
+			}
+
+			surface->heights[n_i] += newVal / dt;
+		}
+	}
+#endif
+	/*
+	** END SURFACE PROCESS CODE.
+	*/
+
+	/* Transfer information back to the mesh. */
+	Gale_SurfaceProcess_Recv( spCtx );
+}
+
+Index _Gale_SurfaceProcess_Register( PluginsManager* pluginsMgr ) {
+	return PluginsManager_Submit( pluginsMgr, 
+				      Gale_SurfaceProcess_Type, 
+				      "0", 
+				      _Gale_SurfaceProcess_DefaultNew );
+}
+
+void* _Gale_SurfaceProcess_DefaultNew( Name name ) {
+	return _Codelet_New( sizeof(Codelet), 
+			     Gale_SurfaceProcess_Type, 
+			     _Codelet_Delete, 
+			     _Codelet_Print, 
+			     _Codelet_Copy, 
+			     _Gale_SurfaceProcess_DefaultNew, 
+			     _Gale_SurfaceProcess_Construct, 
+			     _Gale_SurfaceProcess_Build, 
+			     _Codelet_Initialise, 
+			     _Codelet_Execute, 
+			     _Gale_SurfaceProcess_Destroy, 
+			     name );
+}
+
+void _Gale_SurfaceProcess_Construct( void* codelet, Stg_ComponentFactory* cf, void* data ) {
+	GaleContext*			galeCtx;
+	Gale_SurfaceProcess_Context*	spCtx;
+	Dictionary*			spDict;
+	char*				meshName;
+
+	assert( codelet );
+	assert( cf );
+
+	Journal_DPrintf( Gale_Debug, "In: %s( void* )\n", __func__ );
+
+	/* Retrieve context. */
+	galeCtx = (GaleContext*)Stg_ComponentFactory_ConstructByName( cf, "context", GaleContext, True, NULL );
+
+	/* Create new context. */
+	Gale_SurfaceProcess_ContextHandle = ExtensionManager_Add( galeCtx->extensionMgr, 
+								  Gale_SurfaceProcess_Type, 
+								  sizeof(Gale_SurfaceProcess_Context) );
+
+	spCtx = ExtensionManager_Get( galeCtx->extensionMgr, galeCtx, Gale_SurfaceProcess_ContextHandle );
+	memset( spCtx, 0, sizeof(Gale_SurfaceProcess_Context) );
+
+	/*
+	** Extract information from the dictionary.
+	*/
+
+	/* Get the dictionary. */
+	spDict = Dictionary_GetDictionary( galeCtx->dictionary, "SurfaceProcess" );
+	if( !spDict )
+		return;
+
+	/* Read the mesh we're using. */
+	meshName = Dictionary_GetString( spDict, "mesh" );
+	assert( meshName && strcmp( meshName, "" ) );
+	spCtx->mesh = Stg_ComponentFactory_ConstructByName( cf, meshName, Mesh, True, NULL );
+}
+
+void _Gale_SurfaceProcess_Build( void* codelet, void* data ) {
+	GaleContext*			galeCtx = (GaleContext*)data;
+	Gale_SurfaceProcess_Context*	spCtx;
+	unsigned			nDims;
+	unsigned*			gSize;
+	double*				min;
+	double*				max;
+	unsigned*			surfaceSize;
+	double*				surfaceMin;
+	double*				surfaceMax;
+	unsigned			curDim;
+	Topology*			nTopology;
+	ElementLayout*			eLayout;
+	NodeLayout*			nLayout;
+	MeshDecomp*			decomp;
+	MeshLayout*			layout;
+	Grid*				surfaceGrid;
+	IndexSet*			topSet;
+	unsigned			nTopVerts;
+	unsigned*			topVerts;
+	UIntMap*			map;
+	Dictionary*			dict;
+	unsigned			d_i, v_i;
+
+	assert( codelet );
+	assert( galeCtx );
+
+	/* Get the context. */
+	spCtx = ExtensionManager_Get( galeCtx->extensionMgr, galeCtx, Gale_SurfaceProcess_ContextHandle );
+
+	if( !spCtx->mesh )
+		return;
+
+	/*
+	** Create a mesh to represent the top-surface of the existing problem.
+	*/
+
+	/* Get the dimensions of the surface. */
+	nDims = spCtx->mesh->topo->nDims - 1;
+	gSize = (unsigned*)ExtensionManager_Get( spCtx->mesh->info, spCtx->mesh, 
+						 ExtensionManager_GetHandle( spCtx->mesh->info, "cartesianGlobalSize" ) );
+	min = (double*)ExtensionManager_Get( spCtx->mesh->info, spCtx->mesh, 
+					     ExtensionManager_GetHandle( spCtx->mesh->info, "cartesianMinCoord" ) );
+	max = (double*)ExtensionManager_Get( spCtx->mesh->info, spCtx->mesh, 
+					     ExtensionManager_GetHandle( spCtx->mesh->info, "cartesianMaxCoord" ) );
+	surfaceSize = Memory_Alloc_Array_Unnamed( unsigned, nDims );
+	surfaceMin = Memory_Alloc_Array_Unnamed( double, nDims );
+	surfaceMax = Memory_Alloc_Array_Unnamed( double, nDims );
+	curDim = 0;
+	for( d_i = 0; d_i < spCtx->mesh->topo->nDims; d_i++ ) {
+		if( d_i == 1 )
+			continue;
+
+		surfaceSize[curDim] = gSize[d_i];
+		surfaceMin[curDim] = min[d_i];
+		surfaceMax[curDim++] = max[d_i];
+	}
+
+	/* Create the surface mesh. */
+	dict = Dictionary_New();
+	Dictionary_Add( dict, "meshSizeI", Dictionary_Entry_Value_FromUnsignedInt( surfaceSize[0] + 1 ) );
+	if( nDims == 2 )
+		Dictionary_Add( dict, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( surfaceSize[1] + 1 ) );
+	else
+		Dictionary_Add( dict, "meshSizeJ", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+	Dictionary_Add( dict, "meshSizeK", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+	Dictionary_Add( dict, "shadowDepth", Dictionary_Entry_Value_FromUnsignedInt( 1 ) );
+	Dictionary_Add( dict, "allowUnbalancing", Dictionary_Entry_Value_FromBool( True ) );
+	nTopology = (Topology*)IJK6Topology_New( "", dict );
+	eLayout = (ElementLayout*)ParallelPipedHexaEL_New( "", nDims, dict );
+	nLayout = (NodeLayout*)CornerNL_New( "", dict, eLayout, nTopology );
+	decomp = (MeshDecomp*)HexaMD_New( "", dict, MPI_COMM_WORLD, eLayout, nLayout );
+	layout = MeshLayout_New( "", eLayout, nLayout, decomp );
+	spCtx->surface = Mesh_New( "", layout, 0, 0, spCtx->mesh->extensionMgr_Register, dict );
+	spCtx->surface->generator = (MeshGenerator*)CartesianGenerator_New( "" );
+	MeshGenerator_AddMesh( spCtx->surface->generator, spCtx->surface );
+	CartesianGenerator_SetTopologyParams( spCtx->surface->generator, nDims, surfaceSize, 0, NULL, NULL );
+	CartesianGenerator_SetGeometryParams( spCtx->surface->generator, surfaceMin, surfaceMax );
+	Build( spCtx->surface, NULL, False );
+
+	surfaceGrid = Grid_New();
+	Grid_SetNDims( surfaceGrid, nDims );
+	for( d_i = 0; d_i < nDims; d_i++ )
+		surfaceSize[d_i]++;
+	Grid_SetSizes( surfaceGrid, surfaceSize );
+	for( d_i = 0; d_i < nDims; d_i++ )
+		surfaceSize[d_i]--;
+
+	FreeArray( surfaceSize );
+	FreeArray( surfaceMin );
+	FreeArray( surfaceMax );
+
+	/*
+	** Create two transfer operators to move information bewtween the meshes.
+	*/
+
+	/* Build the 'send' inter mesh map. */
+	topSet = RegularMeshUtils_CreateGlobalTopSet( spCtx->mesh );
+	IndexSet_GetMembers( topSet, &nTopVerts, &topVerts );
+	FreeObject( topSet );
+	map = UIntMap_New();
+	for( v_i = 0; v_i < nTopVerts; v_i++ ) {
+		unsigned	vDomain;
+		unsigned	vGlobal;
+		IJK		ijk;
+		unsigned	surfaceInd;
+
+		vDomain = topVerts[v_i];
+		if( vDomain >= spCtx->mesh->nodeLocalCount )
+			continue;
+
+		vGlobal = Mesh_NodeMapDomainToGlobal( spCtx->mesh, v_i );
+		RegularMeshUtils_Node_1DTo3D( (HexaMD*)spCtx->mesh->layout->decomp, vGlobal, 
+					      &ijk[0], &ijk[1], &ijk[2] );
+		surfaceInd = Grid_Project( surfaceGrid, ijk );
+		UIntMap_Insert( map, topVerts[v_i], surfaceInd );
+	}
+
+	/* Create the transfer operator. */
+	spCtx->sendOp = DecompTransfer_New( "" );
+	DecompTransfer_SetDecomps( spCtx->sendOp, 
+				   spCtx->mesh->topo->domains[MT_VERTEX]->decomp, 
+				   spCtx->surface->topo->domains[MT_VERTEX]->decomp, 
+				   map );
+
+	/* Build the 'recv' inter mesh map. */
+	UIntMap_Clear( map );
+	for( v_i = 0; v_i < spCtx->surface->topo->domains[MT_VERTEX]->decomp->nLocals; v_i++ ) {
+		unsigned	vGlobal;
+		IJK		ijk;
+
+		vGlobal = MeshTopology_DomainToGlobal( spCtx->surface->topo, MT_VERTEX, v_i );
+		RegularMeshUtils_Node_1DTo3D( (HexaMD*)spCtx->surface->layout->decomp, vGlobal, 
+					      &ijk[0], &ijk[1], &ijk[2] );
+		ijk[2] = ijk[1];
+		ijk[1] = gSize[1];
+		vGlobal = RegularMeshUtils_Node_Global3DToGlobal1D( (HexaMD*)spCtx->mesh->layout->decomp, 
+								    ijk[0], ijk[1], ijk[2] );
+		UIntMap_Insert( map, v_i, vGlobal );
+	}
+
+	/* Create the transfer operator. */
+	spCtx->recvOp = DecompTransfer_New( "" );
+	DecompTransfer_SetDecomps( spCtx->recvOp, 
+				   spCtx->surface->topo->domains[MT_VERTEX]->decomp, 
+				   spCtx->mesh->topo->domains[MT_VERTEX]->decomp, 
+				   map );
+
+	FreeObject( map );
+
+	/*
+	** Add variables to the operators.
+	*/
+
+	/* Coordinates. */
+	DecompTransfer_AddArray( spCtx->sendOp, 
+				 &spCtx->mesh->nodeCoord[0][0], &spCtx->surface->nodeCoord[0][0], 
+				 3 * sizeof(double), 3 * sizeof(double), 
+				 sizeof(double) );
+	DecompTransfer_AddArray( spCtx->recvOp, 
+				 &spCtx->surface->nodeCoord[0][0], &spCtx->mesh->nodeCoord[0][0], 
+				 3 * sizeof(double), 3 * sizeof(double), 
+				 sizeof(double) );
+	if( nDims == 3 ) {
+		DecompTransfer_AddArray( spCtx->sendOp, 
+					 &spCtx->mesh->nodeCoord[0][2], &spCtx->surface->nodeCoord[0][2], 
+					 3 * sizeof(double), 3 * sizeof(double), 
+					 sizeof(double) );
+		DecompTransfer_AddArray( spCtx->recvOp, 
+					 &spCtx->surface->nodeCoord[0][2], &spCtx->mesh->nodeCoord[0][2], 
+					 3 * sizeof(double), 3 * sizeof(double), 
+					 sizeof(double) );
+	}
+
+	/* Height values. */
+	spCtx->heights = Memory_Alloc_Array( double, spCtx->surface->nodeDomainCount, "Gale_SurfaceProcess::heights" );
+	DecompTransfer_AddArray( spCtx->sendOp, 
+				 &spCtx->mesh->nodeCoord[0][1], spCtx->heights, 
+				 3 * sizeof(double), sizeof(double), 
+				 sizeof(double) );
+	DecompTransfer_AddArray( spCtx->recvOp, 
+				 spCtx->heights, &spCtx->mesh->nodeCoord[0][1], 
+				 sizeof(double), 3 * sizeof(double), 
+				 sizeof(double) );
+
+	/*
+	** Add the height to the surface's syncronisation.
+	*/
+
+	Decomp_Sync_AddArray( spCtx->surface->topo->domains[MT_VERTEX], 
+			      spCtx->heights, spCtx->heights + spCtx->surface->topo->domains[MT_VERTEX]->decomp->nLocals, 
+			      sizeof(double), sizeof(double), 
+			      sizeof(double) );
+
+	/*
+	** Insert the operations into the appropriate entry points.
+	*/
+
+	/* Prepend to the list of time integratee finish routines. */
+	TimeIntegrator_PrependFinishEP( galeCtx->timeIntegrator, 
+					"Gale_SurfaceProcess_Execute", 
+					Gale_SurfaceProcess_Execute, 
+					"SurfaceProcess", 
+					galeCtx );
+}
+
+void _Gale_SurfaceProcess_Destroy( void* codelet, void* data ) {
+	GaleContext*	galeCtx = (GaleContext*)data;
+
+	assert( codelet );
+	assert( galeCtx );
+
+	/* Clear the lot. */
+	/* TODO */
+}
+
+void Gale_SurfaceProcess_Send( Gale_SurfaceProcess_Context* spCtx ) {
+	double*		tmpHeights;
+	unsigned	n_i;
+
+	assert( spCtx );
+
+	/* Transfer. */
+	DecompTransfer_Transfer( spCtx->sendOp );
+	Mesh_Sync( spCtx->surface );
+
+	/* Remap the heights to match old mesh ordering. */
+	tmpHeights = Memory_Alloc_Array_Unnamed( double, spCtx->surface->nodeDomainCount );
+	for( n_i = 0; n_i < spCtx->surface->nodeDomainCount; n_i++ ) {
+		unsigned	global;
+		unsigned	domain;
+
+		global = MeshTopology_DomainToGlobal( spCtx->surface->topo, MT_VERTEX, n_i );
+		domain = Mesh_NodeMapGlobalToDomain( spCtx->surface, global );
+
+		tmpHeights[domain] = spCtx->heights[n_i];
+	}
+	memcpy( spCtx->heights, tmpHeights, spCtx->surface->nodeDomainCount * sizeof(double) );
+	FreeArray( tmpHeights );
+}
+
+void Gale_SurfaceProcess_Recv( Gale_SurfaceProcess_Context* spCtx ) {
+	double*		tmpHeights;
+	unsigned	n_i;
+
+	assert( spCtx );
+
+	/* Remap the heights back to the new mesh's scheme. */
+	tmpHeights = Memory_Alloc_Array_Unnamed( double, spCtx->surface->nodeDomainCount );
+	for( n_i = 0; n_i < spCtx->surface->nodeDomainCount; n_i++ ) {
+		unsigned	global;
+		unsigned	domain;
+
+		global = MeshTopology_DomainToGlobal( spCtx->surface->topo, MT_VERTEX, n_i );
+		domain = Mesh_NodeMapGlobalToDomain( spCtx->surface, global );
+
+		tmpHeights[n_i] = spCtx->heights[domain];
+	}
+	memcpy( spCtx->heights, tmpHeights, spCtx->surface->nodeDomainCount * sizeof(double) );
+	FreeArray( tmpHeights );
+
+	/* Transfer. */
+	DecompTransfer_Transfer( spCtx->recvOp );
+	Mesh_Sync( spCtx->mesh );
+}

Added: long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/SurfaceProcess.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,43 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Victorian Partnership for Advanced Computing (VPAC) Ltd, Australia
+** (C) 2003-2005 All Rights Reserved
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	David May, PhD Student Monash University, VPAC. (david.may at sci.maths.monash.edu.au)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**
+** Role:
+**	Defines any header info, such as new structures, needed by this plugin
+**
+** Assumptions:
+**
+** Comments:
+**
+** $Id $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Gale_plugins_SurfaceProcess_SurfaceProcess_h__
+#define __Gale_plugins_SurfaceProcess_SurfaceProcess_h__
+
+	Index _Gale_SurfaceProcess_Register( PluginsManager* pluginsMgr );
+
+	void* _Gale_SurfaceProcess_DefaultNew( Name name );
+
+	void _Gale_SurfaceProcess_Construct( void* codelet, Stg_ComponentFactory* cf, void* data );
+
+	void _Gale_SurfaceProcess_Build( void* codelet, void* data );
+
+	void _Gale_SurfaceProcess_Destroy( void* codelet, void* data );
+
+	void Gale_SurfaceProcess_Send( Gale_SurfaceProcess_Context* spCtx );
+
+	void Gale_SurfaceProcess_Recv( Gale_SurfaceProcess_Context* spCtx );
+
+#endif /* __Gale_plugins_SurfaceProcess_SurfaceProcess_h__ */

Added: long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/makefile
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/makefile	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/makefile	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,17 @@
+SHELL := $(shell which bash)
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+
+include ${PROJ_ROOT}/Makefile.system
+
+modName := $(shell basename `pwd` )
+modName := $(shell echo ${modName} | cut -c 1 | tr '[:lower:]' '[:upper:]' )$(shell echo ${modName} | cut -c 2- ) 
+
+mod = ${PROJECT}_${modName}
+includes = ${PROJECT}/${modName}
+
+SRCS = $(wildcard *.c)
+HDRS = $(wildcard *.h)
+
+packages = UNDERWORLD PICELLERATOR STG_FEM STGERMAIN PETSC MPI XML
+
+include ${PROJ_ROOT}/Makefile.vmake

Added: long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/types.h
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/types.h	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/plugins/SurfaceProcess/types.h	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,48 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** 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 3376 2005-12-16 05:49:46Z RobertTurnbull $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Underworld_plugins_EulerDeform_types_h__
+#define __Underworld_plugins_EulerDeform_types_h__
+
+	/* Structures. */
+	typedef struct Gale_SurfaceProcess_Context	Gale_SurfaceProcess_Context;
+
+#endif

Added: long/3D/Gale/trunk/src/Gale/plugins/makefile
===================================================================
--- long/3D/Gale/trunk/src/Gale/plugins/makefile	2006-10-14 20:04:18 UTC (rev 5034)
+++ long/3D/Gale/trunk/src/Gale/plugins/makefile	2006-10-14 20:15:15 UTC (rev 5035)
@@ -0,0 +1,9 @@
+#Finds the Absolute path to the Project Root directory
+SHELL := /bin/bash
+PROJ_ROOT := $(shell until test -r ./Makefile.system ; do cd .. ; done ; echo `pwd`)
+include ${PROJ_ROOT}/Makefile.system
+
+# Subdirectories
+subdirs := $(shell find * -type d -follow -prune ! -name .svn )
+
+include ${PROJ_ROOT}/Makefile.vmake



More information about the cig-commits mailing list