[cig-commits] commit: Rejigged IntegrationPointMapper and its children.

Mercurial hg at geodynamics.org
Mon Feb 1 15:30:50 PST 2010


changeset:   327:01b8e5dbf9a4
branch:      pcu_rejig
user:        JericoRevote
date:        Tue Nov 24 16:51:44 2009 +1100
files:       MaterialPoints/src/CoincidentMapper.c MaterialPoints/src/CoincidentMapper.h MaterialPoints/src/GaussCoincidentMapper.c MaterialPoints/src/GaussCoincidentMapper.h MaterialPoints/src/GaussMapper.c MaterialPoints/src/GaussMapper.h MaterialPoints/src/IntegrationPointMapper.c MaterialPoints/src/IntegrationPointMapper.h MaterialPoints/src/ManyToOneMapper.c MaterialPoints/src/ManyToOneMapper.h MaterialPoints/src/MaterialPointsSwarm.c MaterialPoints/src/OneToOneMapper.c MaterialPoints/src/OneToOneMapper.h Weights/tests/ConstantWeightsSuite.c
description:
Rejigged IntegrationPointMapper and its children.


diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/CoincidentMapper.c
--- a/MaterialPoints/src/CoincidentMapper.c	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/CoincidentMapper.c	Tue Nov 24 16:51:44 2009 +1100
@@ -66,247 +66,194 @@ const Type CoincidentMapper_Type = "Coin
 const Type CoincidentMapper_Type = "CoincidentMapper";
 
 CoincidentMapper* CoincidentMapper_New(
-    Name                       name,
-    IntegrationPointsSwarm*    integrationSwarm,
-    MaterialPointsSwarm*       materialSwarm
-    )
+	Name							name,
+	PICelleratorContext*		context,
+	IntegrationPointsSwarm*	integrationSwarm,
+	MaterialPointsSwarm*		materialSwarm )
 {
-    CoincidentMapper* self = (CoincidentMapper*) _CoincidentMapper_New(
-        sizeof(CoincidentMapper),
-        CoincidentMapper_Type,
-        _CoincidentMapper_Delete,
-        _CoincidentMapper_Print,
-        _CoincidentMapper_Copy,
-        _CoincidentMapper_DefaultNew,
-        _CoincidentMapper_AssignFromXML,
-        _CoincidentMapper_Build,
-        _CoincidentMapper_Initialise,
-        _CoincidentMapper_Execute,
-        _CoincidentMapper_Destroy,
-        _CoincidentMapper_Map,
-        _OneToOneMapper_GetMaterialPointsSwarms,
-        _OneToOneMapper_GetMaterialIndexOn,
-        _OneToOneMapper_GetExtensionOn,
-        name,
-        True, /* initFlag */
-        integrationSwarm,
-        materialSwarm
-        );
+	CoincidentMapper* self = _CoincidentMapper_DefaultNew( name );
 
-    return self;
+	self->isConstructed = True;
+	_IntegrationPointMapper_Init( self, context, integrationSwarm );
+	_OneToOneMapper_Init( self, materialSwarm );
+	_CoincidentMapper_Init( self );
+
+	return self;
 }
 
-
 void* _CoincidentMapper_DefaultNew( Name name ) {
-    return _CoincidentMapper_New(
-        sizeof(CoincidentMapper),
-        CoincidentMapper_Type,
-        _CoincidentMapper_Delete,
-        _CoincidentMapper_Print,
-        _CoincidentMapper_Copy,
-        _CoincidentMapper_DefaultNew,
-        _CoincidentMapper_AssignFromXML,
-        _CoincidentMapper_Build,
-        _CoincidentMapper_Initialise,
-        _CoincidentMapper_Execute,
-        _CoincidentMapper_Destroy,
-        _CoincidentMapper_Map,
-        _OneToOneMapper_GetMaterialPointsSwarms,
-        _OneToOneMapper_GetMaterialIndexOn,
-        _OneToOneMapper_GetExtensionOn,
-        name,
-        False,
-        NULL,
-        NULL );
+	return _CoincidentMapper_New(
+		sizeof(CoincidentMapper),
+		CoincidentMapper_Type,
+		_CoincidentMapper_Delete,
+		_CoincidentMapper_Print,
+		_CoincidentMapper_Copy,
+		_CoincidentMapper_DefaultNew,
+		_CoincidentMapper_AssignFromXML,
+		_CoincidentMapper_Build,
+		_CoincidentMapper_Initialise,
+		_CoincidentMapper_Execute,
+		_CoincidentMapper_Destroy,
+		name,
+		NON_GLOBAL,
+		_CoincidentMapper_Map,
+		_OneToOneMapper_GetMaterialPointsSwarms,
+		_OneToOneMapper_GetMaterialIndexOn,
+		_OneToOneMapper_GetExtensionOn,
+		NULL,
+		NULL );
 }
 
+CoincidentMapper* _CoincidentMapper_New( COINCIDENTMAPPER_DEFARGS ) {
+	CoincidentMapper* result;
 
-CoincidentMapper* _CoincidentMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm*                                            materialSwarm )
-{
-    CoincidentMapper* result;
+	result = (CoincidentMapper*)_OneToOneMapper_New( ONETOONEMAPPER_PASSARGS );
 
-    result = (CoincidentMapper*)_OneToOneMapper_New(
-        _sizeOfSelf,
-        type,
-        _delete,
-        _print,
-        _copy,
-        _defaultConstructor,
-        _construct,
-        _build,
-        _initialise,
-        _execute,
-        _destroy,
-        _map,
-        _getMaterialPointsSwarms,
-        _getMaterialIndexOn,
-        _getExtensionOn,
-        name,
-        initFlag,
-        integrationSwarm,
-        materialSwarm );
-
-    if (initFlag) {
-        _CoincidentMapper_Init( result );
-    }
-		
-    return result;
+	return result;
 }
 
 void _CoincidentMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-    _OneToOneMapper_AssignFromXML( mapper, cf, data );
+	_OneToOneMapper_AssignFromXML( mapper, cf, data );
 }
 
-void _CoincidentMapper_Init(
-    void*                   mapper )
-{
+void _CoincidentMapper_Init( void* mapper ) {
 }
 
 void _CoincidentMapper_Delete( void* mapper ) {
-    _IntegrationPointMapper_Delete( mapper );
+	CoincidentMapper* self = (CoincidentMapper*)mapper;
+
+	_OneToOneMapper_Delete( self );
 }
+
 void _CoincidentMapper_Print( void* mapper, Stream* stream ) {
-    _IntegrationPointMapper_Print( mapper, stream );
+	_IntegrationPointMapper_Print( mapper, stream );
 }
+
 void* _CoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    return _IntegrationPointMapper_Copy( mapper, dest, deep, nameExt, ptrMap );
+	return _IntegrationPointMapper_Copy( mapper, dest, deep, nameExt, ptrMap );
 }
 
 void _CoincidentMapper_Build( void* mapper, void* cf ) {
-    _OneToOneMapper_Build( mapper, cf );
+	CoincidentMapper* self = (CoincidentMapper*)mapper;
+
+	_OneToOneMapper_Build( self, cf );
 }
 
 void _CoincidentMapper_Initialise( void* mapper, void* cf ) {
-    _OneToOneMapper_Initialise( mapper, cf );
+	CoincidentMapper* self = (CoincidentMapper*)mapper;
+
+	_OneToOneMapper_Initialise( self, cf );
 }
 
 void _CoincidentMapper_Execute( void* mapper, void* data ) {
 }
 
 void _CoincidentMapper_Destroy( void* mapper, void* data ) {
+	CoincidentMapper* self = (CoincidentMapper*)mapper;
+
+	_OneToOneMapper_Destroy( self, data );
 }
 
 void _CoincidentMapper_Map( void* mapper ) {
-    CoincidentMapper*       self                   = (CoincidentMapper*)mapper;
-
-    IntegrationPointsSwarm* integrationSwarm       = self->integrationSwarm;
-    MaterialPointsSwarm*    materialSwarm          = self->materialSwarm;
-
-    IntegrationPoint*       integrationPoint;
-    MaterialPoint*          materialPoint;
-    MaterialPointRef*       ref;
-
-    FeMesh*     mesh                   = materialSwarm->mesh;
-
-    Particle_Index          particle_lI;
-    Cell_Index              cell_dI;
+	CoincidentMapper*			self = (CoincidentMapper*)mapper;
+	IntegrationPointsSwarm*	integrationSwarm = self->integrationSwarm;
+	MaterialPointsSwarm*		materialSwarm = self->materialSwarm;
+	IntegrationPoint*			integrationPoint;
+	MaterialPoint*				materialPoint;
+	MaterialPointRef*			ref;
+	FeMesh*						mesh = materialSwarm->mesh;
+	Particle_Index				particle_lI;
+	Cell_Index					cell_dI;
 
 #ifdef CAUTIOUS
-    Index			dim_I;
-    Stream*                 errorStream = Journal_Register( Error_Type, self->type );
+	Index							dim_I;
+	Stream*						errorStream = Journal_Register( Error_Type, self->type );
 #endif
-    Stream*                 debugStream = Swarm_Debug;
+	Stream*						debugStream = Swarm_Debug;
 	
+	Journal_DPrintfL( debugStream, 1, "In %s(): Re-creating a new set of integration points, exactly\n" 
+		"\tmapping to the current material points & their positions.\n", __func__ );
 
-    Journal_DPrintfL( debugStream, 1, "In %s(): Re-creating a new set of integration points, exactly\n" 
-                      "\tmapping to the current material points & their positions.\n",
-                      __func__ ) ;
-    Stream_IndentBranch( debugStream );
+	Stream_IndentBranch( debugStream );
 
-    Journal_DPrintfL( debugStream, 2, "Reallocating the integration points array from size of %u points "
-                      "to the \n\tcurrent material swarm particle count of %u\n", integrationSwarm->particleLocalCount,
-                      materialSwarm->particleLocalCount );
-    integrationSwarm->particleLocalCount = materialSwarm->particleLocalCount;
-    Swarm_Realloc( integrationSwarm );
+	Journal_DPrintfL( debugStream, 2, "Reallocating the integration points array from size of %u points "
+		"to the \n\tcurrent material swarm particle count of %u\n", integrationSwarm->particleLocalCount,
+		materialSwarm->particleLocalCount );
 
-    Journal_DPrintfL( debugStream, 2, "Clearing all the cell->particle ownership tables, "
-                      "ready to add new cell->particle\n\trelationships as new integration points are set up.\n" );
-    for( cell_dI = 0; cell_dI < integrationSwarm->cellDomainCount; cell_dI++ ) {
-        integrationSwarm->cellParticleCountTbl[cell_dI] = 0;
-        integrationSwarm->cellParticleSizeTbl[cell_dI] = 0;
-        if ( integrationSwarm->cellParticleTbl[cell_dI] ) {
-            Memory_Free( integrationSwarm->cellParticleTbl[cell_dI] );
-        }
-        integrationSwarm->cellParticleTbl[cell_dI] = NULL;
-    }
+	integrationSwarm->particleLocalCount = materialSwarm->particleLocalCount;
+	Swarm_Realloc( integrationSwarm );
 
-    Journal_DPrintfL( debugStream, 2, "For each material particle, setting up a corresponding integration "
+	Journal_DPrintfL( debugStream, 2, "Clearing all the cell->particle ownership tables, "
+		"ready to add new cell->particle\n\trelationships as new integration points are set up.\n" );
+
+	for( cell_dI = 0; cell_dI < integrationSwarm->cellDomainCount; cell_dI++ ) {
+		integrationSwarm->cellParticleCountTbl[cell_dI] = 0;
+		integrationSwarm->cellParticleSizeTbl[cell_dI] = 0;
+
+		if ( integrationSwarm->cellParticleTbl[cell_dI] ) {
+			Memory_Free( integrationSwarm->cellParticleTbl[cell_dI] );
+		}
+		integrationSwarm->cellParticleTbl[cell_dI] = NULL;
+	}
+
+	Journal_DPrintfL( debugStream, 2, "For each material particle, setting up a corresponding integration "
                       "point, and\n\tcalculating its element-local coord based on the material's global coord:\n" );
-    Stream_IndentBranch( debugStream );	
-    /* Map each point */
-    for ( particle_lI = 0; particle_lI < materialSwarm->particleLocalCount; particle_lI++ ) {
-        integrationPoint = (IntegrationPoint*)Swarm_ParticleAt( integrationSwarm, particle_lI );
-        materialPoint    = (MaterialPoint*)   Swarm_ParticleAt( materialSwarm, particle_lI );
+	Stream_IndentBranch( debugStream );	
 
-        cell_dI = materialPoint->owningCell;
+	/* Map each point */
+	for ( particle_lI = 0; particle_lI < materialSwarm->particleLocalCount; particle_lI++ ) {
+		integrationPoint = (IntegrationPoint*)Swarm_ParticleAt( integrationSwarm, particle_lI );
+		materialPoint = (MaterialPoint*)Swarm_ParticleAt( materialSwarm, particle_lI );
 
-        Journal_DPrintfL( debugStream, 3, "Referring to local material point %u, from material swarm cell %u:\n",
-                          particle_lI, cell_dI );
-        Stream_IndentBranch( debugStream );	
+		cell_dI = materialPoint->owningCell;
 
-        Journal_DPrintfL( debugStream, 3, "Adding new integration point %u to integration swarm cell %u\n",
-                          particle_lI, cell_dI );
+		Journal_DPrintfL( debugStream, 3, "Referring to local material point %u, from material swarm cell %u:\n", particle_lI, cell_dI );
+		Stream_IndentBranch( debugStream );	
 
-        Swarm_AddParticleToCell( integrationSwarm, cell_dI, particle_lI );
+		Journal_DPrintfL( debugStream, 3, "Adding new integration point %u to integration swarm cell %u\n", particle_lI, cell_dI );
 
-        /* Convert global to local coordinates */
-        ElementType_ConvertGlobalCoordToElLocal(
-            FeMesh_GetElementType( mesh, cell_dI ),
-            mesh, 
-            cell_dI, 
-            materialPoint->coord,
-            integrationPoint->xi );
+		Swarm_AddParticleToCell( integrationSwarm, cell_dI, particle_lI );
 
-        Journal_DPrintfL( debugStream, 3, "Based on material point's coord of (%.2f,%.2f,%.2f):\n"
-                          "calculated and set new integration point's local coord as (%.2f,%.2f,%.2f)\n",
-                          materialPoint->coord[0], materialPoint->coord[1], materialPoint->coord[2],
-                          integrationPoint->xi[0], integrationPoint->xi[1], integrationPoint->xi[2] );
+		/* Convert global to local coordinates */
+		ElementType_ConvertGlobalCoordToElLocal(
+			FeMesh_GetElementType( mesh, cell_dI ),
+			mesh, 
+			cell_dI, 
+			materialPoint->coord,
+			integrationPoint->xi );
+
+		Journal_DPrintfL( debugStream, 3, "Based on material point's coord of (%.2f,%.2f,%.2f):\n"
+			"calculated and set new integration point's local coord as (%.2f,%.2f,%.2f)\n",
+			materialPoint->coord[0], materialPoint->coord[1], materialPoint->coord[2],
+			integrationPoint->xi[0], integrationPoint->xi[1], integrationPoint->xi[2] );
+
 #ifdef CAUTIOUS
-        /* Check the result is between -1 to 1 in all dimensions : if not, something is stuffed */		
-        for ( dim_I= 0; dim_I < materialSwarm->dim; dim_I++ ) {
-            Journal_Firewall(
-                (integrationPoint->xi[dim_I] >= -1.001) && (integrationPoint->xi[dim_I] <= 1.001 ),
-                errorStream,
-                "Error - in %s(): unable to map material point %d in cell %d of swarm \"%s\" (type %s) "
-                "coord to a valid \"local\" coordinate (xi). Coord was (%.3f,%.3f,%.3f), swarm's "
-                "particle layout type was %s, Xi result was (%.4f,%.4f,%.4f).\n",
-                __func__, particle_lI, cell_dI, materialSwarm->name, materialSwarm->type,
-                materialPoint->coord[0], materialPoint->coord[1], materialPoint->coord[2],
-                materialSwarm->particleLayout->type, integrationPoint->xi[0],
-                integrationPoint->xi[1], integrationPoint->xi[2] );
-        }
+		/* Check the result is between -1 to 1 in all dimensions : if not, something is stuffed */		
+		for ( dim_I= 0; dim_I < materialSwarm->dim; dim_I++ ) {
+			Journal_Firewall(
+				(integrationPoint->xi[dim_I] >= -1.001) && (integrationPoint->xi[dim_I] <= 1.001 ),
+				errorStream,
+				"Error - in %s(): unable to map material point %d in cell %d of swarm \"%s\" (type %s) "
+				"coord to a valid \"local\" coordinate (xi). Coord was (%.3f,%.3f,%.3f), swarm's "
+				"particle layout type was %s, Xi result was (%.4f,%.4f,%.4f).\n",
+				__func__, particle_lI, cell_dI, materialSwarm->name, materialSwarm->type,
+				materialPoint->coord[0], materialPoint->coord[1], materialPoint->coord[2],
+				materialSwarm->particleLayout->type, integrationPoint->xi[0],
+				integrationPoint->xi[1], integrationPoint->xi[2] );
+		}
 #endif
 
-        ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
-        ref->swarm_I = materialSwarm->swarmReg_I;
-        ref->particle_I = particle_lI;
-        Journal_DPrintfL( debugStream, 3, "updated the coincident mapper's material reference for "
-                          "this integration point to map back to the material point.\n" );
-        Stream_UnIndentBranch( debugStream );	
-    }
+		ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
+		ref->swarm_I = materialSwarm->swarmReg_I;
+		ref->particle_I = particle_lI;
+		Journal_DPrintfL( debugStream, 3, "updated the coincident mapper's material reference for "
+			"this integration point to map back to the material point.\n" );
+		Stream_UnIndentBranch( debugStream );	
+	}
 
-    Stream_UnIndentBranch( debugStream );	
-    Journal_DPrintfL( debugStream, 2, "...finished updating local positions.\n" );
+	Stream_UnIndentBranch( debugStream );	
+	Journal_DPrintfL( debugStream, 2, "...finished updating local positions.\n" );
 
-    Stream_UnIndentBranch( debugStream );
-    Journal_DPrintfL( debugStream, 1, "...%s(): Done.\n", __func__ );
+	Stream_UnIndentBranch( debugStream );
+	Journal_DPrintfL( debugStream, 1, "...%s(): Done.\n", __func__ );
 }
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/CoincidentMapper.h
--- a/MaterialPoints/src/CoincidentMapper.h	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/CoincidentMapper.h	Tue Nov 24 16:51:44 2009 +1100
@@ -55,60 +55,53 @@
 #ifndef __PICellerator_MaterialPoints_CoincidentMapper_h__
 #define __PICellerator_MaterialPoints_CoincidentMapper_h__
 
-/* Textual name of this class */
-extern const Type CoincidentMapper_Type;
+	/* Textual name of this class */
+	extern const Type CoincidentMapper_Type;
 
-#define __CoincidentMapper                      \
-    __OneToOneMapper 
+	#define __CoincidentMapper \
+		__OneToOneMapper 
 
-struct CoincidentMapper { __CoincidentMapper };
+	struct CoincidentMapper { __CoincidentMapper };
 
-CoincidentMapper* CoincidentMapper_New(
-    Name                       name,
-    IntegrationPointsSwarm*    integrationSwarm,
-    MaterialPointsSwarm*       materialSwarm);	
+	#define COINCIDENTMAPPER_DEFARGS \
+		ONETOONEMAPPER_DEFARGS
+
+	#define COINCIDENTMAPPER_PASSARGS \
+		ONETOONEMAPPER_PASSARGS
+
+	CoincidentMapper* CoincidentMapper_New(
+		Name							name,
+		PICelleratorContext*		context,
+		IntegrationPointsSwarm*	integrationSwarm,
+		MaterialPointsSwarm*		materialSwarm);	
 	
-CoincidentMapper* _CoincidentMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm*                                            materialSwarm );
+	CoincidentMapper* _CoincidentMapper_New( COINCIDENTMAPPER_DEFARGS );
 
-void _CoincidentMapper_Init(
-    void*                   mapper );
+	void _CoincidentMapper_Init( void* mapper );
 
+	void _CoincidentMapper_Delete( void* mapper );
 
-void _CoincidentMapper_Delete( void* mapper );
-void _CoincidentMapper_Print( void* mapper, Stream* stream );
-#define CoincidentMapper_Copy( self )                                   \
-    (CoincidentMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define CoincidentMapper_DeepCopy( self )                               \
-    (CoincidentMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _CoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void _CoincidentMapper_Print( void* mapper, Stream* stream );
+
+	#define CoincidentMapper_Copy( self ) \
+		(CoincidentMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define CoincidentMapper_DeepCopy( self ) \
+		(CoincidentMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+
+	void* _CoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-void* _CoincidentMapper_DefaultNew( Name name );
-void _CoincidentMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data ) ;
-void _CoincidentMapper_Build( void* mapper, void* data ) ;
-void _CoincidentMapper_Initialise( void* mapper, void* data ) ;
-void _CoincidentMapper_Execute( void* mapper, void* data );
-void _CoincidentMapper_Destroy( void* mapper, void* data ) ;
-	
+	void* _CoincidentMapper_DefaultNew( Name name );
 
-void _CoincidentMapper_Map( void* mapper );
+	void _CoincidentMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
+
+	void _CoincidentMapper_Build( void* mapper, void* data );
+
+	void _CoincidentMapper_Initialise( void* mapper, void* data );
+
+	void _CoincidentMapper_Execute( void* mapper, void* data );
+
+	void _CoincidentMapper_Destroy( void* mapper, void* data );
+
+	void _CoincidentMapper_Map( void* mapper );
 	
 #endif
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/GaussCoincidentMapper.c
--- a/MaterialPoints/src/GaussCoincidentMapper.c	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/GaussCoincidentMapper.c	Tue Nov 24 16:51:44 2009 +1100
@@ -66,233 +66,182 @@ const Type GaussCoincidentMapper_Type = 
 const Type GaussCoincidentMapper_Type = "GaussCoincidentMapper";
 
 GaussCoincidentMapper* GaussCoincidentMapper_New(
-    Name                       name,
-    IntegrationPointsSwarm*    integrationSwarm,
-    MaterialPointsSwarm*       materialSwarm
-    )
+	Name								name,
+	PICelleratorContext*			context,
+	IntegrationPointsSwarm*		integrationSwarm,
+	MaterialPointsSwarm*			materialSwarm )
 {
-    GaussCoincidentMapper* self = (GaussCoincidentMapper*) _GaussCoincidentMapper_New(
-        sizeof(GaussCoincidentMapper),
-        GaussCoincidentMapper_Type,
-        _GaussCoincidentMapper_Delete,
-        _GaussCoincidentMapper_Print,
-        _GaussCoincidentMapper_Copy,
-        _GaussCoincidentMapper_DefaultNew,
-        _GaussCoincidentMapper_AssignFromXML,
-        _GaussCoincidentMapper_Build,
-        _GaussCoincidentMapper_Initialise,
-        _GaussCoincidentMapper_Execute,
-        _GaussCoincidentMapper_Destroy,
-        _GaussCoincidentMapper_Map,
-        _OneToOneMapper_GetMaterialPointsSwarms,
-        _OneToOneMapper_GetMaterialIndexOn,
-        _OneToOneMapper_GetExtensionOn,
-        name,
-        True, /* initFlag */
-        integrationSwarm,
-        materialSwarm
-        );
+	GaussCoincidentMapper* self = _GaussCoincidentMapper_DefaultNew( name );
 
-    return self;
+	self->isConstructed = True;
+	_IntegrationPointMapper_Init( self, context, integrationSwarm );
+   _OneToOneMapper_Init( self, materialSwarm );
+	_GaussCoincidentMapper_Init( self );
+
+	return self;
 }
 
-
 void* _GaussCoincidentMapper_DefaultNew( Name name ) {
-    return _GaussCoincidentMapper_New(
-        sizeof(GaussCoincidentMapper),
-        GaussCoincidentMapper_Type,
-        _GaussCoincidentMapper_Delete,
-        _GaussCoincidentMapper_Print,
-        _GaussCoincidentMapper_Copy,
-        _GaussCoincidentMapper_DefaultNew,
-        _GaussCoincidentMapper_AssignFromXML,
-        _GaussCoincidentMapper_Build,
-        _GaussCoincidentMapper_Initialise,
-        _GaussCoincidentMapper_Execute,
-        _GaussCoincidentMapper_Destroy,
-        _GaussCoincidentMapper_Map,
-        _OneToOneMapper_GetMaterialPointsSwarms,
-        _OneToOneMapper_GetMaterialIndexOn,
-        _OneToOneMapper_GetExtensionOn,
-        name,
-        False,
-        NULL,
-        NULL );
+	return _GaussCoincidentMapper_New(
+		sizeof(GaussCoincidentMapper),
+		GaussCoincidentMapper_Type,
+		_GaussCoincidentMapper_Delete,
+		_GaussCoincidentMapper_Print,
+		_GaussCoincidentMapper_Copy,
+		_GaussCoincidentMapper_DefaultNew,
+		_GaussCoincidentMapper_AssignFromXML,
+		_GaussCoincidentMapper_Build,
+		_GaussCoincidentMapper_Initialise,
+		_GaussCoincidentMapper_Execute,
+		_GaussCoincidentMapper_Destroy,
+		name,
+		NON_GLOBAL,
+		_GaussCoincidentMapper_Map,
+		_OneToOneMapper_GetMaterialPointsSwarms,
+		_OneToOneMapper_GetMaterialIndexOn,
+		_OneToOneMapper_GetExtensionOn,
+		NULL,
+		NULL );
 }
 
+GaussCoincidentMapper* _GaussCoincidentMapper_New( GAUSSCOINCIDENTMAPPER_DEFARGS ) {
+	GaussCoincidentMapper* result;
 
-GaussCoincidentMapper* _GaussCoincidentMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm*                                            materialSwarm )
-{
-    GaussCoincidentMapper* result;
+	result = (GaussCoincidentMapper*)_OneToOneMapper_New( ONETOONEMAPPER_PASSARGS );
 
-    result = (GaussCoincidentMapper*)_OneToOneMapper_New(
-        _sizeOfSelf,
-        type,
-        _delete,
-        _print,
-        _copy,
-        _defaultConstructor,
-        _construct,
-        _build,
-        _initialise,
-        _execute,
-        _destroy,
-        _map,
-        _getMaterialPointsSwarms,
-        _getMaterialIndexOn,
-        _getExtensionOn,
-        name,
-        initFlag,
-        integrationSwarm,
-        materialSwarm );
-
-    if (initFlag) {
-        _GaussCoincidentMapper_Init( result );
-    }
-		
-    return result;
+	return result;
 }
 
 void _GaussCoincidentMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-    _OneToOneMapper_AssignFromXML( mapper, cf, data );
+	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
+
+	_OneToOneMapper_AssignFromXML( self, cf, data );
 }
 
-void _GaussCoincidentMapper_Init(
-    void*                   mapper ) 
-{
+void _GaussCoincidentMapper_Init( void* mapper ) {
 }
 
 void _GaussCoincidentMapper_Delete( void* mapper ) {
-    _IntegrationPointMapper_Delete( mapper );
+	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
+
+	_OneToOneMapper_Delete( self );
 }
+
 void _GaussCoincidentMapper_Print( void* mapper, Stream* stream ) {
-    _IntegrationPointMapper_Print( mapper, stream );
+	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
+
+	_IntegrationPointMapper_Print( self, stream );
 }
+
 void* _GaussCoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    return _IntegrationPointMapper_Copy( mapper, dest, deep, nameExt, ptrMap );
+	return _IntegrationPointMapper_Copy( mapper, dest, deep, nameExt, ptrMap );
 }
 
 void _GaussCoincidentMapper_Build( void* mapper, void* cf ) {
-    _OneToOneMapper_Build( mapper, cf );
+	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
+
+	_OneToOneMapper_Build( self, cf );
 }
 
 void _GaussCoincidentMapper_Initialise( void* mapper, void* cf ) {
-    _OneToOneMapper_Initialise( mapper, cf );
+	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
+
+	_OneToOneMapper_Initialise( self, cf );
 }
 
 void _GaussCoincidentMapper_Execute( void* mapper, void* data ) {
 }
 
 void _GaussCoincidentMapper_Destroy( void* mapper, void* data ) {
+	GaussCoincidentMapper* self = (GaussCoincidentMapper*)mapper;
+
+	_OneToOneMapper_Destroy( self, data );
 }
 
 void _GaussCoincidentMapper_Map( void* mapper ) {
-    GaussCoincidentMapper*       self                   = (GaussCoincidentMapper*)mapper;
-
-    IntegrationPointsSwarm* integrationSwarm       = self->integrationSwarm;
-    MaterialPointsSwarm*    materialSwarm          = self->materialSwarm;
-
-    IntegrationPoint*       integrationPoint;
-    MaterialPoint*          materialPoint;
-    MaterialPointRef*       ref;
-
-    FeMesh*     mesh                   = materialSwarm->mesh;
-
-    Particle_Index          particle_lI;
-    Cell_Index              cell_dI;
+	GaussCoincidentMapper*	self = (GaussCoincidentMapper*)mapper;
+	IntegrationPointsSwarm*	integrationSwarm = self->integrationSwarm;
+	MaterialPointsSwarm*    materialSwarm = self->materialSwarm;
+	IntegrationPoint*			integrationPoint;
+	MaterialPoint*				materialPoint;
+	MaterialPointRef*			ref;
+	FeMesh*						mesh = materialSwarm->mesh;
+	Particle_Index				particle_lI;
+	Cell_Index					cell_dI;
 
 #ifdef CAUTIOUS
-    Index			dim_I;
-    Stream*                 errorStream = Journal_Register( Error_Type, self->type );
+    Index						dim_I;
+    Stream*						errorStream = Journal_Register( Error_Type, self->type );
 #endif
-    Stream*                 debugStream = Swarm_Debug;
+    Stream*						debugStream = Swarm_Debug;
 	
 #if 0
-    Journal_DPrintfL( debugStream, 1, "In %s(): Re-creating a new set of integration points, exactly\n" 
-                      "\tmapping to the current material points & their positions.\n",
-                      __func__ ) ;
-    Stream_IndentBranch( debugStream );
+	Journal_DPrintfL( debugStream, 1, "In %s(): Re-creating a new set of integration points, exactly\n" 
+		"\tmapping to the current material points & their positions.\n", __func__ ) ;
+	Stream_IndentBranch( debugStream );
 
-    Journal_DPrintfL( debugStream, 2, "Reallocating the integration points array from size of %u points "
-                      "to the \n\tcurrent material swarm particle count of %u\n", integrationSwarm->particleLocalCount,
-                      materialSwarm->particleLocalCount );
-    materialSwarm->particleLocalCount = integrationSwarm->particleLocalCount;
-    Swarm_Realloc( materialSwarm );
+	Journal_DPrintfL( debugStream, 2, "Reallocating the integration points array from size of %u points "
+		"to the \n\tcurrent material swarm particle count of %u\n", integrationSwarm->particleLocalCount,
+		materialSwarm->particleLocalCount );
+	materialSwarm->particleLocalCount = integrationSwarm->particleLocalCount;
+	Swarm_Realloc( materialSwarm );
 
-    Journal_DPrintfL( debugStream, 2, "Clearing all the cell->particle ownership tables, "
-                      "ready to add new cell->particle\n\trelationships as new integration points are set up.\n" );
-    for( cell_dI = 0; cell_dI < materialSwarm->cellDomainCount; cell_dI++ ) {
-        materialSwarm->cellParticleCountTbl[cell_dI] = 0;
-        materialSwarm->cellParticleSizeTbl[cell_dI] = 0;
-        if ( materialSwarm->cellParticleTbl[cell_dI] ) {
-            Memory_Free( materialSwarm->cellParticleTbl[cell_dI] );
-        }
-        materialSwarm->cellParticleTbl[cell_dI] = NULL;
-    }
+	Journal_DPrintfL( debugStream, 2, "Clearing all the cell->particle ownership tables, "
+		"ready to add new cell->particle\n\trelationships as new integration points are set up.\n" );
 
-    Journal_DPrintfL( debugStream, 2, "For each material particle, setting up a corresponding integration "
-                      "point, and\n\tcalculating its element-local coord based on the material's global coord:\n" );
-    Stream_IndentBranch( debugStream );
+	for( cell_dI = 0; cell_dI < materialSwarm->cellDomainCount; cell_dI++ ) {
+		materialSwarm->cellParticleCountTbl[cell_dI] = 0;
+		materialSwarm->cellParticleSizeTbl[cell_dI] = 0;
+
+		if ( materialSwarm->cellParticleTbl[cell_dI] ) {
+			Memory_Free( materialSwarm->cellParticleTbl[cell_dI] );
+		}
+		materialSwarm->cellParticleTbl[cell_dI] = NULL;
+	}
+
+	Journal_DPrintfL( debugStream, 2, "For each material particle, setting up a corresponding integration "
+		"point, and\n\tcalculating its element-local coord based on the material's global coord:\n" );
+		Stream_IndentBranch( debugStream );
 #endif
 
-    /* Map each point */
-    for ( particle_lI = 0; particle_lI < integrationSwarm->particleLocalCount; particle_lI++ ) {
-        integrationPoint = (IntegrationPoint*)Swarm_ParticleAt( integrationSwarm, particle_lI );
-        materialPoint    = (MaterialPoint*)   Swarm_ParticleAt( materialSwarm, particle_lI );
+	/* Map each point */
+	for ( particle_lI = 0; particle_lI < integrationSwarm->particleLocalCount; particle_lI++ ) {
+		integrationPoint = (IntegrationPoint*)Swarm_ParticleAt( integrationSwarm, particle_lI );
+		materialPoint = (MaterialPoint*)Swarm_ParticleAt( materialSwarm, particle_lI );
 
 #if 0
-        cell_dI = integrationPoint->owningCell;
+		cell_dI = integrationPoint->owningCell;
 
-        Journal_DPrintfL( debugStream, 3, "Referring to local material point %u, from material swarm cell %u:\n",
-                          particle_lI, cell_dI );
-        Stream_IndentBranch( debugStream );
+		Journal_DPrintfL( debugStream, 3, "Referring to local material point %u, from material swarm cell %u:\n", particle_lI, cell_dI );
+		Stream_IndentBranch( debugStream );
 
-        Journal_DPrintfL( debugStream, 3, "Adding new integration point %u to integration swarm cell %u\n",
-                          particle_lI, cell_dI );
+		Journal_DPrintfL( debugStream, 3, "Adding new integration point %u to integration swarm cell %u\n", particle_lI, cell_dI );
 
-        Swarm_AddParticleToCell( materialSwarm, cell_dI, particle_lI );
+		Swarm_AddParticleToCell( materialSwarm, cell_dI, particle_lI );
 
-        /* Convert local to global coordinates */
-        FeMesh_CoordLocalToGlobal(mesh, cell_dI, integrationPoint->xi, materialPoint->coord);
+		/* Convert local to global coordinates */
+		FeMesh_CoordLocalToGlobal(mesh, cell_dI, integrationPoint->xi, materialPoint->coord);
 
-        Journal_DPrintfL( debugStream, 3, "Based on material point's coord of (%.2f,%.2f,%.2f):\n"
-                          "calculated and set new integration point's local coord as (%.2f,%.2f,%.2f)\n",
-                          materialPoint->coord[0], materialPoint->coord[1], materialPoint->coord[2],
-                          integrationPoint->xi[0], integrationPoint->xi[1], integrationPoint->xi[2] );
+		Journal_DPrintfL( debugStream, 3, "Based on material point's coord of (%.2f,%.2f,%.2f):\n"
+			"calculated and set new integration point's local coord as (%.2f,%.2f,%.2f)\n",
+			materialPoint->coord[0], materialPoint->coord[1], materialPoint->coord[2],
+			integrationPoint->xi[0], integrationPoint->xi[1], integrationPoint->xi[2] );
 #endif
 
-        ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
-        ref->swarm_I = materialSwarm->swarmReg_I;
-        ref->particle_I = particle_lI;
-        Journal_DPrintfL( debugStream, 3, "updated the coincident mapper's material reference for "
-                          "this integration point to map back to the material point.\n" );
-        Stream_UnIndentBranch( debugStream );	
-    }
+		ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
+		ref->swarm_I = materialSwarm->swarmReg_I;
+		ref->particle_I = particle_lI;
+		Journal_DPrintfL( debugStream, 3, "updated the coincident mapper's material reference for "
+			"this integration point to map back to the material point.\n" );
+		Stream_UnIndentBranch( debugStream );	
+	}
 
 #if 0
-    Stream_UnIndentBranch( debugStream );	
-    Journal_DPrintfL( debugStream, 2, "...finished updating local positions.\n" );
+	Stream_UnIndentBranch( debugStream );	
+	Journal_DPrintfL( debugStream, 2, "...finished updating local positions.\n" );
 
-    Stream_UnIndentBranch( debugStream );
-    Journal_DPrintfL( debugStream, 1, "...%s(): Done.\n", __func__ );
+	Stream_UnIndentBranch( debugStream );
+	Journal_DPrintfL( debugStream, 1, "...%s(): Done.\n", __func__ );
 #endif
+
 }
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/GaussCoincidentMapper.h
--- a/MaterialPoints/src/GaussCoincidentMapper.h	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/GaussCoincidentMapper.h	Tue Nov 24 16:51:44 2009 +1100
@@ -55,60 +55,53 @@
 #ifndef __PICellerator_MaterialPoints_GaussCoincidentMapper_h__
 #define __PICellerator_MaterialPoints_GaussCoincidentMapper_h__
 
-/* Textual name of this class */
-extern const Type GaussCoincidentMapper_Type;
+	/* Textual name of this class */
+	extern const Type GaussCoincidentMapper_Type;
 
-#define __GaussCoincidentMapper                 \
-    __OneToOneMapper 
+	#define __GaussCoincidentMapper \
+		__OneToOneMapper 
 
-struct GaussCoincidentMapper { __GaussCoincidentMapper };
+	struct GaussCoincidentMapper { __GaussCoincidentMapper };
 
-GaussCoincidentMapper* GaussCoincidentMapper_New(
-    Name                       name,
-    IntegrationPointsSwarm*    integrationSwarm,
-    MaterialPointsSwarm*       materialSwarm);	
+	#define GAUSSCOINCIDENTMAPPER_DEFARGS \
+		ONETOONEMAPPER_DEFARGS
+
+	#define GAUSSCOINCIDENTMAPPER_PASSARGS \
+		ONETOONEMAPPER_PASSARGS
+
+	GaussCoincidentMapper* GaussCoincidentMapper_New(
+		Name							name,
+		PICelleratorContext*		context,
+		IntegrationPointsSwarm*	integrationSwarm,
+		MaterialPointsSwarm*		materialSwarm);	
 	
-GaussCoincidentMapper* _GaussCoincidentMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm*                                            materialSwarm );
+	GaussCoincidentMapper* _GaussCoincidentMapper_New( GAUSSCOINCIDENTMAPPER_DEFARGS );
 
-void _GaussCoincidentMapper_Init(
-    void*                   mapper );
+	void _GaussCoincidentMapper_Init( void* mapper );
 
+	void _GaussCoincidentMapper_Delete( void* mapper );
 
-void _GaussCoincidentMapper_Delete( void* mapper );
-void _GaussCoincidentMapper_Print( void* mapper, Stream* stream );
-#define GaussCoincidentMapper_Copy( self )                              \
-    (GaussCoincidentMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define GaussCoincidentMapper_DeepCopy( self )                          \
-    (GaussCoincidentMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _GaussCoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void _GaussCoincidentMapper_Print( void* mapper, Stream* stream );
+
+	#define GaussCoincidentMapper_Copy( self ) \
+		(GaussCoincidentMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define GaussCoincidentMapper_DeepCopy( self ) \
+		(GaussCoincidentMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+
+	void* _GaussCoincidentMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-void* _GaussCoincidentMapper_DefaultNew( Name name );
-void _GaussCoincidentMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data ) ;
-void _GaussCoincidentMapper_Build( void* mapper, void* data ) ;
-void _GaussCoincidentMapper_Initialise( void* mapper, void* data ) ;
-void _GaussCoincidentMapper_Execute( void* mapper, void* data );
-void _GaussCoincidentMapper_Destroy( void* mapper, void* data ) ;
-	
+	void* _GaussCoincidentMapper_DefaultNew( Name name );
 
-void _GaussCoincidentMapper_Map( void* mapper );
+	void _GaussCoincidentMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
+
+	void _GaussCoincidentMapper_Build( void* mapper, void* data );
+
+	void _GaussCoincidentMapper_Initialise( void* mapper, void* data );
+
+	void _GaussCoincidentMapper_Execute( void* mapper, void* data );
+
+	void _GaussCoincidentMapper_Destroy( void* mapper, void* data );
+		
+	void _GaussCoincidentMapper_Map( void* mapper );
 	
 #endif
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/GaussMapper.c
--- a/MaterialPoints/src/GaussMapper.c	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/GaussMapper.c	Tue Nov 24 16:51:44 2009 +1100
@@ -44,150 +44,121 @@
 
 const Type GaussMapper_Type = "GaussMapper";
 
-GaussMapper* _GaussMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm*                                            materialSwarm )
-{
-    GaussMapper* result;
+GaussMapper* _GaussMapper_New( GAUSSMAPPER_DEFARGS ) {
+	GaussMapper* result;
 
-    result = (GaussMapper*)_OneToOneMapper_New(
-        _sizeOfSelf,
-        type,
-        _delete,
-        _print,
-        _copy,
-        _defaultConstructor,
-        _construct,
-        _build,
-        _initialise,
-        _execute,
-        _destroy,
-        _map,
-        _getMaterialPointsSwarms,
-        _getMaterialIndexOn,
-        _getExtensionOn,
-        name,
-        initFlag,
-        integrationSwarm,
-        materialSwarm );
+	result = (GaussMapper*)_OneToOneMapper_New( ONETOONEMAPPER_PASSARGS );
 
-    if (initFlag) {
-        _GaussMapper_Init( result );
-    }
-
-    return result;
+	return result;
 }
 
-void _GaussMapper_Init(
-    void*                   mapper )
-{
+void* _GaussMapper_DefaultNew( Name name ) {
+	return _GaussMapper_New(
+		sizeof(GaussMapper),
+		GaussMapper_Type,
+		_GaussMapper_Delete,
+		_GaussMapper_Print,
+		_GaussMapper_Copy,
+		_GaussMapper_DefaultNew,
+		_GaussMapper_AssignFromXML,
+		_GaussMapper_Build,
+		_GaussMapper_Initialise,
+		_GaussMapper_Execute,
+		_GaussMapper_Destroy,
+		name,
+		NON_GLOBAL,
+		_GaussMapper_Map,
+		_OneToOneMapper_GetMaterialPointsSwarms,
+		_OneToOneMapper_GetMaterialIndexOn,
+		_OneToOneMapper_GetExtensionOn,
+		NULL,
+		NULL );
+}
+
+void _GaussMapper_Init( void* mapper ) {
+	GaussMapper* self = (GaussMapper*)mapper;
 }
 
 void _GaussMapper_Delete( void* mapper ) {
-    _IntegrationPointMapper_Delete( mapper );
-}
-void _GaussMapper_Print( void* mapper, Stream* stream ) {
-    _IntegrationPointMapper_Print( mapper, stream );
-}
-void* _GaussMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    return _IntegrationPointMapper_Copy( mapper, dest, deep, nameExt, ptrMap );
+	GaussMapper* self = (GaussMapper*)mapper;
+
+	_OneToOneMapper_Delete( self );
 }
 
-void* _GaussMapper_DefaultNew( Name name ) {
-    return _GaussMapper_New(
-        sizeof(GaussMapper),
-        GaussMapper_Type,
-        _GaussMapper_Delete,
-        _GaussMapper_Print,
-        _GaussMapper_Copy,
-        _GaussMapper_DefaultNew,
-        _GaussMapper_AssignFromXML,
-        _GaussMapper_Build,
-        _GaussMapper_Initialise,
-        _GaussMapper_Execute,
-        _GaussMapper_Destroy,
-        _GaussMapper_Map,
-        _OneToOneMapper_GetMaterialPointsSwarms,
-        _OneToOneMapper_GetMaterialIndexOn,
-        _OneToOneMapper_GetExtensionOn,
-        name,
-        False,
-        NULL,
-        NULL );
+void _GaussMapper_Print( void* mapper, Stream* stream ) {
+	GaussMapper* self = (GaussMapper*)mapper;
+
+	_OneToOneMapper_Print( self, stream );
+}
+
+void* _GaussMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	return _IntegrationPointMapper_Copy( mapper, dest, deep, nameExt, ptrMap );
 }
 
 void _GaussMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-    GaussMapper* self = (GaussMapper*)mapper;
+	GaussMapper* self = (GaussMapper*)mapper;
 	
-    _OneToOneMapper_AssignFromXML( mapper, cf, data );
+	_OneToOneMapper_AssignFromXML( mapper, cf, data );
 
-    /* Validate assumptions on the layouts the swarms use */
-	
-    Journal_Firewall(
-        Stg_Class_IsInstance( self->integrationSwarm->particleLayout, GaussParticleLayout_Type ) ||
-        Stg_Class_IsInstance( self->integrationSwarm->particleLayout, TriGaussParticleLayout_Type ),
-        Journal_MyStream( Error_Type, self ),
-        "In func %s, To use Gauss mapper, the integration point swarm %s must use a %s\n",
-        __func__,
-        self->integrationSwarm->name,
-        GaussParticleLayout_Type );
-    Journal_Firewall(
-        Stg_Class_IsInstance( self->materialSwarm->particleLayout, BackgroundParticleLayout_Type ),
-        Journal_MyStream( Error_Type, self ),
-        "In func %s, To use Gauss mapper, the material point swarm %s must use a %s\n",
-        __func__,
-        self->materialSwarm->particleLayout,
-        BackgroundParticleLayout_Type );
+	/* Validate assumptions on the layouts the swarms use */
+	Journal_Firewall(
+		Stg_Class_IsInstance( self->integrationSwarm->particleLayout, GaussParticleLayout_Type ) ||
+		Stg_Class_IsInstance( self->integrationSwarm->particleLayout, TriGaussParticleLayout_Type ),
+		Journal_MyStream( Error_Type, self ),
+		"In func %s, To use Gauss mapper, the integration point swarm %s must use a %s\n",
+		__func__,
+		self->integrationSwarm->name,
+		GaussParticleLayout_Type );
+
+	Journal_Firewall(
+		Stg_Class_IsInstance( self->materialSwarm->particleLayout, BackgroundParticleLayout_Type ),
+		Journal_MyStream( Error_Type, self ),
+		"In func %s, To use Gauss mapper, the material point swarm %s must use a %s\n",
+		__func__,
+		self->materialSwarm->particleLayout,
+		BackgroundParticleLayout_Type );
+
+	_GaussMapper_Init( self );
 }
 
 void _GaussMapper_Build( void* mapper, void* cf ) {
-    _OneToOneMapper_Build( mapper, cf );
+	GaussMapper* self = (GaussMapper*)mapper;
+
+	_OneToOneMapper_Build( self, cf );
 }
+
 void _GaussMapper_Initialise( void* mapper, void* cf ) {
-    _OneToOneMapper_Initialise( mapper, cf );
+	GaussMapper* self = (GaussMapper*)mapper;
+
+	_OneToOneMapper_Initialise( self, cf );
 }
+
 void _GaussMapper_Execute( void* mapper, void* data ) {
 }
+
 void _GaussMapper_Destroy( void* mapper, void* data ) {
+	GaussMapper* self = (GaussMapper*)mapper;
+
+	_OneToOneMapper_Destroy( self, data );
 }
 
 void _GaussMapper_Map( void* mapper ) {
-    GaussMapper*            self                   = (GaussMapper*)mapper;
+	GaussMapper*				self = (GaussMapper*)mapper;
+	IntegrationPointsSwarm*	integrationSwarm = self->integrationSwarm;
+	MaterialPointsSwarm*		materialSwarm = self->materialSwarm;
+	IntegrationPoint*			integrationPoint;
+	MaterialPoint*				materialPoint;
+	MaterialPointRef*			ref;
+	Particle_Index				point_I;
 
-    IntegrationPointsSwarm* integrationSwarm       = self->integrationSwarm;
-    MaterialPointsSwarm*    materialSwarm          = self->materialSwarm;
+	materialPoint = (MaterialPoint*)Swarm_ParticleAt( materialSwarm, 0 ); /* Get the first and only point */
+	
+	/* Map each point in integration to the single material point for its properties */
+	for ( point_I = 0; point_I < integrationSwarm->particleLocalCount; point_I++ ) {
+		integrationPoint = (IntegrationPoint*)Swarm_ParticleAt( integrationSwarm, point_I );
 
-    IntegrationPoint*       integrationPoint;
-    MaterialPoint*          materialPoint;
-    MaterialPointRef*       ref;
-
-    Particle_Index          point_I;
-
-    materialPoint = (MaterialPoint*)Swarm_ParticleAt( materialSwarm, 0 ); /* Get the first and only point */
-	
-    /* Map each point in integration to the single material point for its properties */
-    for ( point_I = 0; point_I < integrationSwarm->particleLocalCount; point_I++ ) {
-        integrationPoint = (IntegrationPoint*)Swarm_ParticleAt( integrationSwarm, point_I );
-
-        ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
-        ref->swarm_I = materialSwarm->swarmReg_I;
-        ref->particle_I = 0;
-    }
+		ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
+		ref->swarm_I = materialSwarm->swarmReg_I;
+		ref->particle_I = 0;
+	}
 }
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/GaussMapper.h
--- a/MaterialPoints/src/GaussMapper.h	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/GaussMapper.h	Tue Nov 24 16:51:44 2009 +1100
@@ -34,55 +34,47 @@
 #ifndef __PICellerator_MaterialPoints_GaussMapper_h__
 #define __PICellerator_MaterialPoints_GaussMapper_h__
 
-/* Textual name of this class */
-extern const Type GaussMapper_Type;
+	/* Textual name of this class */
+	extern const Type GaussMapper_Type;
 
-#define __GaussMapper                           \
-    __OneToOneMapper 
+	#define __GaussMapper \
+		__OneToOneMapper 
 
-struct GaussMapper { __GaussMapper };
+	struct GaussMapper { __GaussMapper };
+
+	#define GAUSSMAPPER_DEFARGS \
+		ONETOONEMAPPER_DEFARGS
 		
-GaussMapper* _GaussMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm*                                            materialSwarm );
+	#define GAUSSMAPPER_PASSARGS \
+		ONETOONEMAPPER_PASSARGS
 
-void _GaussMapper_Init(
-    void*                   mapper );
+	GaussMapper* _GaussMapper_New( GAUSSMAPPER_DEFARGS );
 
+	void _GaussMapper_Init( void* mapper );
 
-void _GaussMapper_Delete( void* mapper );
-void _GaussMapper_Print( void* mapper, Stream* stream );
-#define GaussMapper_Copy( self )                                        \
-    (GaussMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define GaussMapper_DeepCopy( self )                                    \
-    (GaussMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _GaussMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void _GaussMapper_Delete( void* mapper );
+
+	void _GaussMapper_Print( void* mapper, Stream* stream );
+
+	#define GaussMapper_Copy( self ) \
+		(GaussMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define GaussMapper_DeepCopy( self ) \
+		(GaussMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+
+	void* _GaussMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-void* _GaussMapper_DefaultNew( Name name );
-void _GaussMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data ) ;
-void _GaussMapper_Build( void* mapper, void* data ) ;
-void _GaussMapper_Initialise( void* mapper, void* data ) ;
-void _GaussMapper_Execute( void* mapper, void* data );
-void _GaussMapper_Destroy( void* mapper, void* data ) ;
+	void* _GaussMapper_DefaultNew( Name name );
+
+	void _GaussMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
+
+	void _GaussMapper_Build( void* mapper, void* data );
+
+	void _GaussMapper_Initialise( void* mapper, void* data );
+
+	void _GaussMapper_Execute( void* mapper, void* data );
+
+	void _GaussMapper_Destroy( void* mapper, void* data );
 	
-
-void _GaussMapper_Map( void* mapper );
+	void _GaussMapper_Map( void* mapper );
 	
 #endif
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/IntegrationPointMapper.c
--- a/MaterialPoints/src/IntegrationPointMapper.c	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/IntegrationPointMapper.c	Tue Nov 24 16:51:44 2009 +1100
@@ -58,106 +58,72 @@
 
 const Type IntegrationPointMapper_Type = "IntegrationPointMapper";
 
-IntegrationPointMapper* _IntegrationPointMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm )
-{
-    IntegrationPointMapper* self;
+IntegrationPointMapper* _IntegrationPointMapper_New( INTEGRATIONPOINTMAPPER_DEFARGS ) {
+	IntegrationPointMapper* self;
 
-    self = (IntegrationPointMapper*)_Stg_Component_New(
-        _sizeOfSelf,
-        type,
-        _delete,
-        _print,
-        _copy,
-        _defaultConstructor,
-        _construct,
-        _build,
-        _initialise,
-        _execute,
-        _destroy,
-        name,
-        NON_GLOBAL );
+	self = (IntegrationPointMapper*)_Stg_Component_New( STG_COMPONENT_PASSARGS );
 
-    self->_map                           = _map;
-    self->_getMaterialPointsSwarms       = _getMaterialPointsSwarms;
-    self->_getMaterialIndexOn            = _getMaterialIndexOn;
-    self->_getExtensionOn                = _getExtensionOn;
+	self->_map = _map;
+	self->_getMaterialPointsSwarms = _getMaterialPointsSwarms;
+	self->_getMaterialIndexOn = _getMaterialIndexOn;
+	self->_getExtensionOn = _getExtensionOn;
 
-    if (initFlag) {
-        self->isConstructed = True;
-        _IntegrationPointMapper_Init( self, integrationSwarm );
-    }
-
-    return self;
+	return self;
 }
 
-void _IntegrationPointMapper_Init( void* mapper, IntegrationPointsSwarm* integrationSwarm ) {
-    IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+void _IntegrationPointMapper_Init( void* mapper, PICelleratorContext* context, IntegrationPointsSwarm* integrationSwarm ) {
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
-    self->integrationSwarm = integrationSwarm;
+	self->context = context;
+	self->integrationSwarm = integrationSwarm;
 }
 
 void _IntegrationPointMapper_Delete( void* mapper ) {
-    IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
-    _Stg_Component_Delete( self );
+	_Stg_Component_Delete( self );
 }
+
 void _IntegrationPointMapper_Print( void* mapper, Stream* stream ) {
-    IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 	
-    Journal_Printf( stream, "IntegrationPointMapper (ptr): %s\n", (void*)self );
-    _Stg_Component_Print( self, stream );
+	Journal_Printf( stream, "IntegrationPointMapper (ptr): %s\n", (void*)self );
+	_Stg_Component_Print( self, stream );
 
-    Stream_Indent( stream );
+	Stream_Indent( stream );
 
-    Stg_Class_Print( self->integrationSwarm, stream );
+	Stg_Class_Print( self->integrationSwarm, stream );
 
-    Stream_UnIndent( stream );
+	Stream_UnIndent( stream );
 }
+
 void* _IntegrationPointMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
-    IntegrationPointMapper* newCopy = (IntegrationPointMapper*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+	IntegrationPointMapper* newCopy = (IntegrationPointMapper*)_Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
 
-    newCopy->integrationSwarm = Stg_Class_Copy( self->integrationSwarm, NULL, deep, nameExt, ptrMap );
+	newCopy->integrationSwarm = Stg_Class_Copy( self->integrationSwarm, NULL, deep, nameExt, ptrMap );
 
-    return newCopy;
+	return newCopy;
 }
 
 void _IntegrationPointMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-    IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+	IntegrationPointMapper*	self = (IntegrationPointMapper*)mapper;
+	IntegrationPointsSwarm*	integrationSwarm;
+	PICelleratorContext*		context;
 
-    IntegrationPointsSwarm* integrationSwarm;
+	context = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Context", PICelleratorContext, False, data );
+	if( !context ) 
+		context = Stg_ComponentFactory_ConstructByName( cf, "context", PICelleratorContext, True, data );
 
-    self->context = Stg_ComponentFactory_ConstructByKey( cf, self->name, "Context", PICelleratorContext, False, data );
-    if( !self->context ) 
-        self->context = Stg_ComponentFactory_ConstructByName( cf, "context", PICelleratorContext, True, data );
-
-    integrationSwarm = Stg_ComponentFactory_ConstructByKey( 
-        cf, 
-        self->name, 
-        IntegrationPointsSwarm_Type, 
-        IntegrationPointsSwarm,
-        True,
-        data  );
+	integrationSwarm = Stg_ComponentFactory_ConstructByKey( 
+		cf, 
+		self->name, 
+		IntegrationPointsSwarm_Type, 
+		IntegrationPointsSwarm,
+		True,
+		data );
 	
-    _IntegrationPointMapper_Init( self, integrationSwarm );
+	_IntegrationPointMapper_Init( self, context, integrationSwarm );
 }
 
 void _IntegrationPointMapper_Build( void* mapper, void* data ) {
@@ -170,56 +136,46 @@ void _IntegrationPointMapper_Execute( vo
 }
 
 void _IntegrationPointMapper_Destroy( void* mapper, void* data ) {
-   IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
-
-   Stg_Component_Destroy( self->integrationSwarm, data, False );
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 }
 
 void IntegrationPointMapper_Map( void* mapper ) {
-    IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
-    self->_map( self );
+	self->_map( self );
 }
 
 MaterialPointsSwarm** IntegrationPointMapper_GetMaterialPointsSwarms( void* mapper, Index* count ) {
-    IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
-    return self->_getMaterialPointsSwarms( mapper, count );
+	return self->_getMaterialPointsSwarms( mapper, count );
 }
 
 Material_Index IntegrationPointMapper_GetMaterialIndexOnFunc( void* mapper, void* point ) {
-    IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
-    return self->_getMaterialIndexOn( mapper, point );
+	return self->_getMaterialIndexOn( mapper, point );
 }
+
 void* IntegrationPointMapper_GetExtensionOnFunc( void* mapper, void* point, ExtensionInfo_Index extHandle ) {
-    IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
+	IntegrationPointMapper* self = (IntegrationPointMapper*)mapper;
 
-    return self->_getExtensionOn( mapper, point, extHandle );
+	return self->_getExtensionOn( mapper, point, extHandle );
 }
+
 Material_Index IntegrationPointMapper_GetMaterialIndexAtFunc( void* mapper, Index point_I ) {
-    IntegrationPointMapper* self  = (IntegrationPointMapper*)mapper;
-    void*                   point = Swarm_ParticleAt( self->integrationSwarm, point_I );
+	IntegrationPointMapper* self  = (IntegrationPointMapper*)mapper;
+	void*                   point = Swarm_ParticleAt( self->integrationSwarm, point_I );
 
-    Journal_Firewall(
-        point != NULL,
-        Journal_MyStream( Error_Type, self ),
-        "In func %s, no point in swarm of index %d\n",
-        __func__,
-        point_I );
+	Journal_Firewall( point != NULL, Journal_MyStream( Error_Type, self ), "In func %s, no point in swarm of index %d\n", __func__, point_I );
 
-    return IntegrationPointMapper_GetMaterialIndexOn( mapper, point );
+	return IntegrationPointMapper_GetMaterialIndexOn( mapper, point );
 }
 void* IntegrationPointMapper_GetExtensionAtFunc( void* mapper, Index point_I, ExtensionInfo_Index extHandle ) {
-    IntegrationPointMapper* self  = (IntegrationPointMapper*)mapper;
-    void*                   point = Swarm_ParticleAt( self->integrationSwarm, point_I );
+	IntegrationPointMapper* self  = (IntegrationPointMapper*)mapper;
+	void*                   point = Swarm_ParticleAt( self->integrationSwarm, point_I );
 
-    Journal_Firewall(
-        point != NULL,
-        Journal_MyStream( Error_Type, self ),
-        "In func %s, no point in swarm of index %d\n",
-        __func__,
-        point_I );
+	Journal_Firewall( point != NULL, Journal_MyStream( Error_Type, self ), "In func %s, no point in swarm of index %d\n", __func__, point_I );
 	
-    return IntegrationPointMapper_GetExtensionOn( mapper, point, extHandle );
+	return IntegrationPointMapper_GetExtensionOn( mapper, point, extHandle );
 }
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/IntegrationPointMapper.h
--- a/MaterialPoints/src/IntegrationPointMapper.h	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/IntegrationPointMapper.h	Tue Nov 24 16:51:44 2009 +1100
@@ -59,132 +59,134 @@
 #ifndef __PICellerator_MaterialPoints_IntegrationPointMapper_h__
 #define __PICellerator_MaterialPoints_IntegrationPointMapper_h__
 
-/* Textual name of this class */
-extern const Type IntegrationPointMapper_Type;
+	/* Textual name of this class */
+	extern const Type IntegrationPointMapper_Type;
 
-/** @see IntegrtaionPointMapper_Map */
-typedef void (IntegrationPointMapper_MapFunction) ( void* mapper );
+	/** @see IntegrtaionPointMapper_Map */
+	typedef void (IntegrationPointMapper_MapFunction) ( void* mapper );
 
-/** @see IntegrationPointMapper_GetMaterialPointsSwarmsFunction */
-typedef MaterialPointsSwarm** (IntegrationPointMapper_GetMaterialPointsSwarmsFunction) ( void* mapper, Index* count );
+	/** @see IntegrationPointMapper_GetMaterialPointsSwarmsFunction */
+	typedef MaterialPointsSwarm** (IntegrationPointMapper_GetMaterialPointsSwarmsFunction) ( void* mapper, Index* count );
 
-/** @see IntegrationPointMapper_GetMaterialIndexOn */
-typedef Material_Index (IntegrationPointMapper_GetMaterialIndexOnFunction) ( void* mapper, void* point );
+	/** @see IntegrationPointMapper_GetMaterialIndexOn */
+	typedef Material_Index (IntegrationPointMapper_GetMaterialIndexOnFunction) ( void* mapper, void* point );
 
-/** @see IntegrationPointMapper_GetExtensionOn */
-typedef void* (IntegrationPointMapper_GetExtensionOnFunction) ( 
-    void*                   mapper, 
-    void*                   points, 
-    ExtensionInfo_Index     extHandle );
+	/** @see IntegrationPointMapper_GetExtensionOn */
+	typedef void* (IntegrationPointMapper_GetExtensionOnFunction) ( void* mapper, void* points, ExtensionInfo_Index extHandle );
 	
-/* IntegrationPointMapper information */
-#define __IntegrationPointMapper                                        \
-    __Stg_Component                                                     \
-                                                                        \
-    PICelleratorContext*                                       context; \
-    /* Virtual functions */                                             \
-    IntegrationPointMapper_MapFunction*                        _map; \
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*    _getMaterialPointsSwarms; \
-    IntegrationPointMapper_GetMaterialIndexOnFunction*         _getMaterialIndexOn; \
-    IntegrationPointMapper_GetExtensionOnFunction*             _getExtensionOn; \
-                                                                       \
-    /* General info */                                                  \
-    IntegrationPointsSwarm*                                     integrationSwarm;
+	/* IntegrationPointMapper information */
+	#define __IntegrationPointMapper \
+		__Stg_Component \
+		\
+		PICelleratorContext*													context; \
+		/* Virtual functions */ \
+		IntegrationPointMapper_MapFunction*								_map; \
+		IntegrationPointMapper_GetMaterialPointsSwarmsFunction*	_getMaterialPointsSwarms; \
+		IntegrationPointMapper_GetMaterialIndexOnFunction*			_getMaterialIndexOn; \
+		IntegrationPointMapper_GetExtensionOnFunction*				_getExtensionOn; \
+		\
+		/* General info */ \
+		IntegrationPointsSwarm*												integrationSwarm;
 
-struct IntegrationPointMapper { __IntegrationPointMapper };
+	struct IntegrationPointMapper { __IntegrationPointMapper };
+
+	#define INTEGRATIONPOINTMAPPER_DEFARGS \
+		STG_COMPONENT_DEFARGS, \
+   	 	IntegrationPointMapper_MapFunction*								_map,  \
+   	 	IntegrationPointMapper_GetMaterialPointsSwarmsFunction*	_getMaterialPointsSwarms, \
+   	 	IntegrationPointMapper_GetMaterialIndexOnFunction*			_getMaterialIndexOn,  \
+   	 	IntegrationPointMapper_GetExtensionOnFunction*				_getExtensionOn, \
+			IntegrationPointsSwarm*												integrationSwarm 
+
+	#define INTEGRATIONPOINTMAPPER_PASSARGS \
+		STG_COMPONENT_PASSARGS, \
+    		_map,  \
+    		_getMaterialPointsSwarms, \
+    		_getMaterialIndexOn,  \
+    		_getExtensionOn, \
+			integrationSwarm  
 	
-/*---------------------------------------------------------------------------------------------------------------------
-** Constructors
-*/
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
 
-IntegrationPointMapper* _IntegrationPointMapper_New(
-    SizeT                                                           _sizeOfSelf, 
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy, 
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map, 
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn, 
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn, 
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm );
+	IntegrationPointMapper* _IntegrationPointMapper_New( INTEGRATIONPOINTMAPPER_DEFARGS );
 
-void _IntegrationPointMapper_Init( void* mapper, IntegrationPointsSwarm* integrationSwarm );
+	void _IntegrationPointMapper_Init( void* mapper, PICelleratorContext* context, IntegrationPointsSwarm* integrationSwarm );
 
-void _IntegrationPointMapper_Delete( void* mapper );
-void _IntegrationPointMapper_Print( void* mapper, Stream* stream );
-#define IntegrationPointMapper_Copy( self )                             \
-    (IntegrationPointMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define IntegrationPointMapper_DeepCopy( self )                         \
-    (IntegrationPointMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _IntegrationPointMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void _IntegrationPointMapper_Delete( void* mapper );
+
+	void _IntegrationPointMapper_Print( void* mapper, Stream* stream );
+
+	#define IntegrationPointMapper_Copy( self ) \
+		(IntegrationPointMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define IntegrationPointMapper_DeepCopy( self ) \
+		(IntegrationPointMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+
+	void* _IntegrationPointMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-void _IntegrationPointMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) ;
-void _IntegrationPointMapper_Build( void* mapper, void* data ) ;
-void _IntegrationPointMapper_Initialise( void* mapper, void* data ) ;
-void _IntegrationPointMapper_Execute( void* mapper, void* data );
-void _IntegrationPointMapper_Destroy( void* mapper, void* data ) ;
+	void _IntegrationPointMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data );
+
+	void _IntegrationPointMapper_Build( void* mapper, void* data );
+
+	void _IntegrationPointMapper_Initialise( void* mapper, void* data );
+
+	void _IntegrationPointMapper_Execute( void* mapper, void* data );
+
+	void _IntegrationPointMapper_Destroy( void* mapper, void* data );
 	
-/** Performs a mapping between the MaterialPointSwarms and IntegrationPointsSwarm */
-void IntegrationPointMapper_Map( void* mapper );
+	/** Performs a mapping between the MaterialPointSwarms and IntegrationPointsSwarm */
+	void IntegrationPointMapper_Map( void* mapper );
 
-/** Returns the MaterialPointsSwarm(s) involved in this mapping. Allocates memory so the result must be deleted.
- *     @param count Output parameter which stores the number of swarms returned */
-MaterialPointsSwarm** IntegrationPointMapper_GetMaterialPointsSwarms( void* mapper, Index* count );
+	/** Returns the MaterialPointsSwarm(s) involved in this mapping. Allocates memory so the result must be deleted.
+	 *		@param count Output parameter which stores the number of swarms returned */
+	MaterialPointsSwarm** IntegrationPointMapper_GetMaterialPointsSwarms( void* mapper, Index* count );
 	
-/** Returns the material index associated with this integration point by mapping to physical material swarm(s) */
-#ifdef MACRO_AS_FUNC
-#define IntegrationPointMapper_GetMaterialIndexOn IntegrationPointMapper_GetMaterialIndexOnFunc
-#else
-#define IntegrationPointMapper_GetMaterialIndexOn IntegrationPointMapper_GetMaterialIndexOnMacro
-#endif
-#define IntegrationPointMapper_GetMaterialIndexOnMacro( mapper, point ) \
-    ( (IntegrationPointMapper*)(mapper) )->_getMaterialIndexOn( (mapper), (point) ) 
-Material_Index IntegrationPointMapper_GetMaterialIndexOnFunc( void* mapper, void* point );
+	/** Returns the material index associated with this integration point by mapping to physical material swarm(s) */
+	#ifdef MACRO_AS_FUNC
+	#define IntegrationPointMapper_GetMaterialIndexOn IntegrationPointMapper_GetMaterialIndexOnFunc
+	#else
+	#define IntegrationPointMapper_GetMaterialIndexOn IntegrationPointMapper_GetMaterialIndexOnMacro
+	#endif
+	#define IntegrationPointMapper_GetMaterialIndexOnMacro( mapper, point ) \
+		( (IntegrationPointMapper*)(mapper) )->_getMaterialIndexOn( (mapper), (point) ) 
+	Material_Index IntegrationPointMapper_GetMaterialIndexOnFunc( void* mapper, void* point );
 
 	
-/** Returns an extension associated with this integration point by mapping to physical material swarm(s) */
-#ifdef MACRO_AS_FUNC
-#define IntegrationPointMapper_GetExtensionOn IntegrationPointMapper_GetExtensionOnFunc
-#else
-#define IntegrationPointMapper_GetExtensionOn IntegrationPointMapper_GetExtensionOnMacro
-#endif
-#define IntegrationPointMapper_GetExtensionOnMacro( mapper, point, extHandle ) \
-    ( (IntegrationPointMapper*)(mapper) )->_getExtensionOn( (mapper), (point), (extHandle) )
-void* IntegrationPointMapper_GetExtensionOnFunc( void* mapper, void* point, ExtensionInfo_Index extHandle );
+	/** Returns an extension associated with this integration point by mapping to physical material swarm(s) */
+	#ifdef MACRO_AS_FUNC
+	#define IntegrationPointMapper_GetExtensionOn IntegrationPointMapper_GetExtensionOnFunc
+	#else
+	#define IntegrationPointMapper_GetExtensionOn IntegrationPointMapper_GetExtensionOnMacro
+	#endif
+	#define IntegrationPointMapper_GetExtensionOnMacro( mapper, point, extHandle ) \
+		( (IntegrationPointMapper*)(mapper) )->_getExtensionOn( (mapper), (point), (extHandle) )
+	void* IntegrationPointMapper_GetExtensionOnFunc( void* mapper, void* point, ExtensionInfo_Index extHandle );
 
 
-/** Returns the material index associated with this integration point index by mapping to physical material swarm(s) */
-#ifdef MACRO_AS_FUNC
-#define IntegrationPointMapper_GetMaterialIndexAt IntegrationPointMapper_GetMaterialIndexAtFunc
-#else
-#define IntegrationPointMapper_GetMaterialIndexAt IntegrationPointMapper_GetMaterialIndexAtMacro
-#endif
-#define IntegrationPointMapper_GetMaterialIndexAtMacro( mapper, point_I ) \
-    IntegrationPointMapper_GetMaterialIndexOn(                          \
-        (mapper),                                                       \
+	/** Returns the material index associated with this integration point index by mapping to physical material swarm(s) */
+	#ifdef MACRO_AS_FUNC
+	#define IntegrationPointMapper_GetMaterialIndexAt IntegrationPointMapper_GetMaterialIndexAtFunc
+	#else
+	#define IntegrationPointMapper_GetMaterialIndexAt IntegrationPointMapper_GetMaterialIndexAtMacro
+	#endif
+	#define IntegrationPointMapper_GetMaterialIndexAtMacro( mapper, point_I ) \
+		IntegrationPointMapper_GetMaterialIndexOn( \
+        (mapper), \
         Swarm_ParticleAt( ((IntegrationPointMapper*)mapper)->integrationSwarm, point_I ) )
-Material_Index IntegrationPointMapper_GetMaterialIndexAtFunc( void* mapper, Index point_I );
+	Material_Index IntegrationPointMapper_GetMaterialIndexAtFunc( void* mapper, Index point_I );
 	
-/** Returns an extension associated with this integration point index by mapping to physical material swarm(s) */
-#ifdef MACRO_AS_FUNC
-#define IntegrationPointMapper_GetExtensionAt
-#else
-#define IntegrationPointMapper_GetExtensionAt
-#endif
-#define IntegrationPointMapper_GetExtensionAtMacro( mapper, point_I, extHandle ) \
-    IntegrationPointMapper_GetExtensionOn(                              \
-        (mapper),                                                       \
-        Swarm_ParticleAt( ((IntegrationPointMapper*)mapper)->integrationSwarm, point_I ), \
-        extHandle )
-void* IntegrationPointMapper_GetExtensionAtFunc( void* mapper, Index point_I, ExtensionInfo_Index extHandle );
+	/** Returns an extension associated with this integration point index by mapping to physical material swarm(s) */
+	#ifdef MACRO_AS_FUNC
+	#define IntegrationPointMapper_GetExtensionAt
+	#else
+	#define IntegrationPointMapper_GetExtensionAt
+	#endif
+	#define IntegrationPointMapper_GetExtensionAtMacro( mapper, point_I, extHandle ) \
+		IntegrationPointMapper_GetExtensionOn( \
+			(mapper), \
+			Swarm_ParticleAt( ((IntegrationPointMapper*)mapper)->integrationSwarm, point_I ), \
+			extHandle )
+	void* IntegrationPointMapper_GetExtensionAtFunc( void* mapper, Index point_I, ExtensionInfo_Index extHandle );
 
 #endif
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/ManyToOneMapper.c
--- a/MaterialPoints/src/ManyToOneMapper.c	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/ManyToOneMapper.c	Tue Nov 24 16:51:44 2009 +1100
@@ -58,188 +58,135 @@
 
 const Type ManyToOneMapper_Type = "ManyToOneMapper";
 
-ManyToOneMapper* _ManyToOneMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm**                                           materialSwarms,
-    Index                                                           materialSwarmCount ) 
-{
-    ManyToOneMapper* result;
+ManyToOneMapper* _ManyToOneMapper_New( MANYTOONEMAPPER_DEFARGS ) {
+	ManyToOneMapper* result;
 
-    result = (ManyToOneMapper*)_IntegrationPointMapper_New(
-        _sizeOfSelf,
-        type,
-        _delete,
-        _print,
-        _copy,
-        _defaultConstructor,
-        _construct,
-        _build,
-        _initialise,
-        _execute,
-        _destroy,
-        _map,
-        _getMaterialPointsSwarms,
-        _getMaterialIndexOn,
-        _getExtensionOn,
-        name,
-        initFlag,	
-        integrationSwarm );
+	result = (ManyToOneMapper*)_IntegrationPointMapper_New( INTEGRATIONPOINTMAPPER_PASSARGS );
 
-    if (initFlag) {
-        _ManyToOneMapper_Init( result, materialSwarms, materialSwarmCount );
-    }
-
-    return result;
+	return result;
 }
 
-void _ManyToOneMapper_Init( 
-    void*                   mapper,
-    MaterialPointsSwarm**   materialSwarms,
-    Index                   materialSwarmCount )
-{
-    ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+void _ManyToOneMapper_Init( void* mapper, MaterialPointsSwarm** materialSwarms, Index materialSwarmCount ) {
+	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
+	int					i;
 
-    self->materialSwarms = materialSwarms;
-    self->materialSwarmCount = materialSwarmCount;
+	self->materialSwarms = materialSwarms;
+	self->materialSwarmCount = materialSwarmCount;
+
+	/* Each integration point will have a reference to a material particle (one for each swarm) */
+	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, False );
+	for ( i = 0; i < self->materialSwarmCount; ++i ) {
+		ExtensionManager_Add( self->integrationSwarm->particleExtensionMgr, materialSwarms[i]->name, sizeof(MaterialPointRef) );
+	}
+	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, True );
 }
 
 void _ManyToOneMapper_Delete( void* mapper ) {
-    ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
 
-    int i;
+	_IntegrationPointMapper_Delete( self );
+}
 
-    if ( self->materialSwarms != NULL ) {
-        for ( i = 0; i < self->materialSwarmCount; ++i )  {
-            Stg_Class_Delete( self->materialSwarms[i] );
-        }
-        Memory_Free( self->materialSwarms );
-    }
+void _ManyToOneMapper_Print( void* mapper, Stream* stream ) {
+	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
+	int					i;
+
+	_IntegrationPointMapper_Print( self, stream );
+	if ( self->materialSwarms != NULL ) {
+		Stream_Indent( stream );
+		for ( i = 0; i < self->materialSwarmCount; ++i ) {
+			Stg_Class_Print( self->materialSwarms[i], stream );
+		}
+		Stream_UnIndent( stream );
+	}
+}
+
+void* _ManyToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	ManyToOneMapper* self = (ManyToOneMapper*)mapper;
+	ManyToOneMapper* newCopy;
 	
-    _IntegrationPointMapper_Delete( self );
-}
-void _ManyToOneMapper_Print( void* mapper, Stream* stream ) {
-    ManyToOneMapper* self = (ManyToOneMapper*)mapper;
-    int i;
+	newCopy = (ManyToOneMapper*)_IntegrationPointMapper_Copy( self, dest, deep, nameExt, ptrMap );
 
-    _IntegrationPointMapper_Print( self, stream );
-    if ( self->materialSwarms != NULL ) {
-        Stream_Indent( stream );
-        for ( i = 0; i < self->materialSwarmCount; ++i ) {
-            Stg_Class_Print( self->materialSwarms[i], stream );
-        }
-        Stream_UnIndent( stream );
-    }
-}
-void* _ManyToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    ManyToOneMapper* self = (ManyToOneMapper*)mapper;
-    ManyToOneMapper* newCopy;
-	
-    newCopy = (ManyToOneMapper*)_IntegrationPointMapper_Copy( self, dest, deep, nameExt, ptrMap );
+	if ( self->materialSwarms != NULL ) {
+		newCopy->materialSwarms = PtrMap_Find( ptrMap, self->materialSwarms );
 
-    if ( self->materialSwarms != NULL ) {
-        newCopy->materialSwarms = PtrMap_Find( ptrMap, self->materialSwarms );
-        if ( newCopy->materialSwarms == NULL ) {
-            newCopy->materialSwarms = Memory_Alloc_Array( MaterialPointsSwarm*, self->materialSwarmCount, "componentList" );
-            PtrMap_Append( ptrMap, self->materialSwarms, newCopy->materialSwarms );
-        }
-        newCopy->materialSwarmCount = self->materialSwarmCount;
-    }
-    else {
-        newCopy->materialSwarms = NULL;
-        newCopy->materialSwarmCount = 0;
-    }
-
-    return newCopy;
+		if ( newCopy->materialSwarms == NULL ) {
+			newCopy->materialSwarms = Memory_Alloc_Array( MaterialPointsSwarm*, self->materialSwarmCount, "componentList" );
+			PtrMap_Append( ptrMap, self->materialSwarms, newCopy->materialSwarms );
+		}
+		newCopy->materialSwarmCount = self->materialSwarmCount;
+	}
+	else {
+		newCopy->materialSwarms = NULL;
+		newCopy->materialSwarmCount = 0;
+	}
+	return newCopy;
 }
 
 void _ManyToOneMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-    ManyToOneMapper* self = (ManyToOneMapper*)mapper;
-    MaterialPointsSwarm** materialSwarms;
-    int i;
+	ManyToOneMapper*			self = (ManyToOneMapper*)mapper;
+	MaterialPointsSwarm**	materialSwarms;
 	
-    _IntegrationPointMapper_AssignFromXML( self, cf, data );
+	_IntegrationPointMapper_AssignFromXML( self, cf, data );
 
-    materialSwarms = (MaterialPointsSwarm**)Stg_ComponentFactory_ConstructByList( 
-        cf, 
-        self->name, 
-        IntegrationPointsSwarm_Type, 
-        Stg_ComponentFactory_Unlimited, 
-        IntegrationPointsSwarm,
-        True,
-        &(self->materialSwarmCount), data );
+	materialSwarms = (MaterialPointsSwarm**)Stg_ComponentFactory_ConstructByList( 
+		cf, 
+		self->name, 
+		IntegrationPointsSwarm_Type, 
+		Stg_ComponentFactory_Unlimited, 
+		IntegrationPointsSwarm,
+		True,
+		&(self->materialSwarmCount), data );
 
-    Journal_Firewall( 
-        self->materialSwarmCount < 1,
-        Journal_Register( Error_Type, self->type ),
-        "In func %s, there must be at least one swarm in the material swarm list!\n", __func__ );
+	Journal_Firewall( 
+		self->materialSwarmCount < 1,
+		Journal_Register( Error_Type, self->type ),
+		"In func %s, there must be at least one swarm in the material swarm list!\n", __func__ );
 
-    _ManyToOneMapper_Init( self, materialSwarms, self->materialSwarmCount );
-
-    /* Each integration point will have a reference to a material particle (one for each swarm) */
-    ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, False );
-    for ( i = 0; i < self->materialSwarmCount; ++i ) {
-        ExtensionManager_Add( 
-            self->integrationSwarm->particleExtensionMgr,
-            materialSwarms[i]->name, 
-            sizeof(MaterialPointRef) );
-    }
-    ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, True );
+	_ManyToOneMapper_Init( self, materialSwarms, self->materialSwarmCount );
 }
 
 void _ManyToOneMapper_Build( void* mapper, void* data ) {
-    ManyToOneMapper* self = (ManyToOneMapper*)mapper;
-    int i;
+	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
+	int					i;
 
-    _IntegrationPointMapper_Build( mapper, data );
+	_IntegrationPointMapper_Build( mapper, data );
 	
-    for ( i = 0 ; i < self->materialSwarmCount; ++i ) {
-        Stg_Component_Build( self->materialSwarms[i], data, False );
-    }
-	
+	for ( i = 0 ; i < self->materialSwarmCount; ++i ) {
+		Stg_Component_Build( self->materialSwarms[i], data, False );
+	}
 }
+
 void _ManyToOneMapper_Initialise( void* mapper, void* data ) {
-    ManyToOneMapper* self = (ManyToOneMapper*)mapper;
-    int i;
+	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
+	int					i;
 
-    _IntegrationPointMapper_Initialise( mapper, data );
-    for ( i = 0; i < self->materialSwarmCount; ++i ) {
-        Stg_Component_Initialise( self->materialSwarms[i], data, False );
-    }
+	_IntegrationPointMapper_Initialise( mapper, data );
+
+	for ( i = 0; i < self->materialSwarmCount; ++i ) {
+		Stg_Component_Initialise( self->materialSwarms[i], data, False );
+	}
 }
+
 void _ManyToOneMapper_Execute( void* mapper, void* data ) {
+}
 
-}
 void _ManyToOneMapper_Destroy( void* mapper, void* data ) {
+	ManyToOneMapper*	self = (ManyToOneMapper*)mapper;
 
+	_IntegrationPointMapper_Destroy( self, data );
 }
 
 MaterialPointsSwarm** ManyToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count ) {
-    ManyToOneMapper*       self   = (ManyToOneMapper*)mapper;
-    MaterialPointsSwarm** result = Memory_Alloc_Array( MaterialPointsSwarm*, self->materialSwarmCount, "Swarms" );
-    Index                  i;
+	ManyToOneMapper*			self = (ManyToOneMapper*)mapper;
+	MaterialPointsSwarm**	result = Memory_Alloc_Array( MaterialPointsSwarm*, self->materialSwarmCount, "Swarms" );
+	Index							i;
 	
-    *count = self->materialSwarmCount;
+	*count = self->materialSwarmCount;
 
-    for ( i = 0; i < self->materialSwarmCount; ++i ) {
-        result[i] = self->materialSwarms[i];
-    }
+	for ( i = 0; i < self->materialSwarmCount; ++i ) {
+		result[i] = self->materialSwarms[i];
+	}
 
-    return result;
+	return result;
 }
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/ManyToOneMapper.h
--- a/MaterialPoints/src/ManyToOneMapper.h	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/ManyToOneMapper.h	Tue Nov 24 16:51:44 2009 +1100
@@ -54,63 +54,58 @@
 #ifndef __PICellerator_MaterialPoints_ManyToOneMapper_h__
 #define __PICellerator_MaterialPoints_ManyToOneMapper_h__
 
-/* Textual name of this class */
-extern const Type ManyToOneMapper_Type;
+	/* Textual name of this class */
+	extern const Type ManyToOneMapper_Type;
 
-/* ManyToOneMapper information */
-#define __ManyToOneMapper                       \
-    __IntegrationPointMapper                    \
-                                                \
-    MaterialPointsSwarm**   materialSwarms;     \
-    Index                   materialSwarmCount;
+	/* ManyToOneMapper information */
+	#define __ManyToOneMapper \
+		__IntegrationPointMapper \
+		\
+		MaterialPointsSwarm**	materialSwarms; \
+		Index							materialSwarmCount;
 
-struct ManyToOneMapper { __ManyToOneMapper };
+	struct ManyToOneMapper { __ManyToOneMapper };
 	
+	#define MANYTOONEMAPPER_DEFARGS \
+		INTEGRATIONPOINTMAPPER_DEFARGS, \
+			MaterialPointsSwarm**	materialSwarms, \
+			Index							materialSwarmCount 
+
+	#define MANYTOONEMAPPER_PASSARGS \
+		INTEGRATIONPOINTMAPPER_PASSARGS, \
+			materialSwarms, \
+			materialSwarmCount 
+
+	/*---------------------------------------------------------------------------------------------------------------------
+	** Constructors
+	*/
+	ManyToOneMapper* _ManyToOneMapper_New( MANYTOONEMAPPER_DEFARGS );
+
+	void _ManyToOneMapper_Init( void* mapper, MaterialPointsSwarm** materialSwarms, Index materialSwarmCount );
+
+	void _ManyToOneMapper_Delete( void* mapper );
+
+	void _ManyToOneMapper_Print( void* mapper, Stream* stream );
+
+	#define ManyToOneMapper_Copy( self ) \
+		(ManyToOneMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define ManyToOneMapper_DeepCopy( self ) \
+		(ManyToOneMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+
+	void* _ManyToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-/*---------------------------------------------------------------------------------------------------------------------
-** Constructors
-*/
-ManyToOneMapper* _ManyToOneMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm**                                           materialSwarms,
-    Index                                                           materialSwarmCount );
+	void* _ManyToOneMapper_DefaultNew( Name name );
 
-void _ManyToOneMapper_Init( 
-    void*                   mapper, 
-    MaterialPointsSwarm**   materialSwarms, 
-    Index                   materialSwarmCount );
+	void _ManyToOneMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
 
-void _ManyToOneMapper_Delete( void* mapper );
-void _ManyToOneMapper_Print( void* mapper, Stream* stream );
-#define ManyToOneMapper_Copy( self )                                    \
-    (ManyToOneMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define ManyToOneMapper_DeepCopy( self )                                \
-    (ManyToOneMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _ManyToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
-	
-void* _ManyToOneMapper_DefaultNew( Name name );
-void _ManyToOneMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data ) ;
-void _ManyToOneMapper_Build( void* mapper, void* data ) ;
-void _ManyToOneMapper_Initialise( void* mapper, void* data ) ;
-void _ManyToOneMapper_Execute( void* mapper, void* data );
-void _ManyToOneMapper_Destroy( void* mapper, void* data ) ;
+	void _ManyToOneMapper_Build( void* mapper, void* data );
 
-MaterialPointsSwarm** ManyToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count );
+	void _ManyToOneMapper_Initialise( void* mapper, void* data );
+
+	void _ManyToOneMapper_Execute( void* mapper, void* data );
+
+	void _ManyToOneMapper_Destroy( void* mapper, void* data );
+
+	MaterialPointsSwarm** ManyToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count );
+
 #endif
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/MaterialPointsSwarm.c
--- a/MaterialPoints/src/MaterialPointsSwarm.c	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/MaterialPointsSwarm.c	Tue Nov 24 16:51:44 2009 +1100
@@ -243,8 +243,6 @@ void _MaterialPointsSwarm_Print( void* s
 	
 	_Swarm_Print( self, stream );
 }
-
-
 
 void* _MaterialPointsSwarm_Copy( void* swarm, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
 	MaterialPointsSwarm*	self = (MaterialPointsSwarm*)swarm;
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/OneToOneMapper.c
--- a/MaterialPoints/src/OneToOneMapper.c	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/OneToOneMapper.c	Tue Nov 24 16:51:44 2009 +1100
@@ -58,197 +58,142 @@
 
 const Type OneToOneMapper_Type = "OneToOneMapper";
 
-OneToOneMapper* _OneToOneMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm*                                            materialSwarm )
-{
-    OneToOneMapper* result;
+OneToOneMapper* _OneToOneMapper_New( ONETOONEMAPPER_DEFARGS ) {
+	OneToOneMapper* result;
 
-    result = (OneToOneMapper*)_IntegrationPointMapper_New(
-        _sizeOfSelf,
-        type,
-        _delete,
-        _print,
-        _copy,
-        _defaultConstructor,
-        _construct,
-        _build,
-        _initialise,
-        _execute,
-        _destroy,
-        _map,
-        _getMaterialPointsSwarms,
-        _getMaterialIndexOn,
-        _getExtensionOn,
-        name,
-        initFlag,
-        integrationSwarm );
+	result = (OneToOneMapper*)_IntegrationPointMapper_New( INTEGRATIONPOINTMAPPER_PASSARGS );
 
-    if (initFlag) {
-        _OneToOneMapper_Init( result, materialSwarm );
-    }
-		
-    return result;
+	return result;
 }
 
 void _OneToOneMapper_Init( void* mapper, MaterialPointsSwarm* materialSwarm ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
 	
-    self->errorStream = Journal_MyStream( Error_Type, self );
-    self->materialSwarm = materialSwarm;
+	self->errorStream = Journal_MyStream( Error_Type, self );
+	self->materialSwarm = materialSwarm;
 
-    ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, False );
-    self->materialRefHandle = ExtensionManager_Add( 
-        self->integrationSwarm->particleExtensionMgr,
-        materialSwarm->name, 
-        sizeof(MaterialPointRef) );
-    ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, True );
+	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, False );
+	self->materialRefHandle = ExtensionManager_Add( self->integrationSwarm->particleExtensionMgr, materialSwarm->name, sizeof(MaterialPointRef) );
+	ExtensionManager_SetLockDown( self->integrationSwarm->particleExtensionMgr, True );
 }
 
 void _OneToOneMapper_Delete( void* mapper ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
 
-    Stg_Class_Delete( self->materialSwarm );
+	_IntegrationPointMapper_Delete( self );
+}
+
+void _OneToOneMapper_Print( void* mapper, Stream* stream ) {
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
 	
-    _IntegrationPointMapper_Delete( self );
+	_IntegrationPointMapper_Print( self, stream );
+	Stream_Indent( stream );
+	Stg_Class_Print( self->materialSwarm, stream );
+	Stream_UnIndent( stream );
 }
-void _OneToOneMapper_Print( void* mapper, Stream* stream ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
+
+void* _OneToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
+	OneToOneMapper* newCopy;
 	
-    _IntegrationPointMapper_Print( self, stream );
-    Stream_Indent( stream );
-    Stg_Class_Print( self->materialSwarm, stream );
-    Stream_UnIndent( stream );
-}
-void* _OneToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
-    OneToOneMapper* newCopy;
-	
-    newCopy = (OneToOneMapper*)_IntegrationPointMapper_Copy( self, dest, deep, nameExt, ptrMap );
-    newCopy->materialSwarm = (MaterialPointsSwarm*)Stg_Class_Copy( self->materialSwarm, NULL, deep, nameExt, ptrMap );
+	newCopy = (OneToOneMapper*)_IntegrationPointMapper_Copy( self, dest, deep, nameExt, ptrMap );
+	newCopy->materialSwarm = (MaterialPointsSwarm*)Stg_Class_Copy( self->materialSwarm, NULL, deep, nameExt, ptrMap );
 
-    return newCopy;
+	return newCopy;
 }
 
 void _OneToOneMapper_AssignFromXML( void* mapper, Stg_ComponentFactory* cf, void* data ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
-    MaterialPointsSwarm* materialSwarm;
+	OneToOneMapper*		self = (OneToOneMapper*)mapper;
+	MaterialPointsSwarm*	materialSwarm;
 
-    _IntegrationPointMapper_AssignFromXML( self, cf, data );
+	_IntegrationPointMapper_AssignFromXML( self, cf, data );
 
-    materialSwarm = Stg_ComponentFactory_ConstructByKey( 
-        cf, 
-        self->name, 
-        MaterialPointsSwarm_Type, 
-        MaterialPointsSwarm,  
-        True,
-        data  );
+	materialSwarm = Stg_ComponentFactory_ConstructByKey( cf, self->name, MaterialPointsSwarm_Type, MaterialPointsSwarm, True, data );
 
-    _OneToOneMapper_Init( self, materialSwarm );
-
+	_OneToOneMapper_Init( self, materialSwarm );
 }
 
 void _OneToOneMapper_Build( void* mapper, void* data ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
 
-    _IntegrationPointMapper_Build( mapper, data );
-    Stg_Component_Build( self->materialSwarm, data, False );
-	
+	_IntegrationPointMapper_Build( mapper, data );
+	Stg_Component_Build( self->materialSwarm, data, False );
 }
+
 void _OneToOneMapper_Initialise( void* mapper, void* data ) {
     OneToOneMapper* self = (OneToOneMapper*)mapper;
 
     _IntegrationPointMapper_Initialise( mapper, data );
     Stg_Component_Initialise( self->materialSwarm, data, False );
 }
+
 void _OneToOneMapper_Execute( void* mapper, void* data ) {}
-void _OneToOneMapper_Destroy( void* mapper, void* data ) {}
+
+void _OneToOneMapper_Destroy( void* mapper, void* data ) {
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
+
+	_IntegrationPointMapper_Destroy( self, data );
+}
 
 MaterialPointRef* OneToOneMapper_GetMaterialRef( void* mapper, void* integrationPoint ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
+	OneToOneMapper* self = (OneToOneMapper*)mapper;
 
-    return (MaterialPointRef*)ExtensionManager_Get( 
-        self->integrationSwarm->particleExtensionMgr, 
-        integrationPoint, 
-        self->materialRefHandle );
+	return (MaterialPointRef*)ExtensionManager_Get( self->integrationSwarm->particleExtensionMgr, integrationPoint, self->materialRefHandle );
 }
 
 MaterialPoint* OneToOneMapper_GetMaterialPoint( void* mapper, void* integrationPoint, MaterialPointsSwarm** materialSwarm ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
-    MaterialPointRef*       ref;
-    MaterialPointsSwarm*    swarm;
-    MaterialPoint*          materialPoint; /* Assumes that material swarm holds Material particle or derivative */
+	OneToOneMapper*		self = (OneToOneMapper*)mapper;
+	MaterialPointRef*		ref;
+	MaterialPointsSwarm*	swarm;
+	MaterialPoint*			materialPoint; /* Assumes that material swarm holds Material particle or derivative */
 
-    ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
-    Journal_Firewall(
-        ref != NULL,
-        self->errorStream, 
-        "In func %s, no MaterialPointRef found on point\n",
-        __func__ );
+	ref = OneToOneMapper_GetMaterialRef( self, integrationPoint );
+	Journal_Firewall( ref != NULL, self->errorStream, "In func %s, no MaterialPointRef found on point\n", __func__ );
 
-    swarm = (MaterialPointsSwarm*)Swarm_Register_At( Swarm_Register_GetSwarm_Register(), ref->swarm_I );
-    Journal_Firewall(
-        swarm != NULL,
-        self->errorStream, 
-        "In func %s, no swarm found on for index %d\n",
-        __func__,
-        ref->swarm_I );
-    if ( materialSwarm != NULL ) {
-        *materialSwarm = swarm;
-    }
+	swarm = (MaterialPointsSwarm*)Swarm_Register_At( Swarm_Register_GetSwarm_Register(), ref->swarm_I );
+	Journal_Firewall( swarm != NULL, self->errorStream, "In func %s, no swarm found on for index %d\n", __func__, ref->swarm_I );
 
-    materialPoint = (MaterialPoint*)Swarm_ParticleAt( swarm, ref->particle_I );
-    Journal_Firewall(
-        materialPoint != NULL,
-        self->errorStream, 
-        "In func %s, no MaterialPoint found for swarm index %d, point index %d\n",
-        __func__,
-        ref->swarm_I,
-        ref->particle_I );
+	if ( materialSwarm != NULL ) {
+		*materialSwarm = swarm;
+	}
 
-    return materialPoint;
+	materialPoint = (MaterialPoint*)Swarm_ParticleAt( swarm, ref->particle_I );
+	Journal_Firewall(
+		materialPoint != NULL,
+		self->errorStream, 
+		"In func %s, no MaterialPoint found for swarm index %d, point index %d\n",
+		__func__,
+		ref->swarm_I,
+		ref->particle_I );
+
+	return materialPoint;
 }
 
 MaterialPointsSwarm** _OneToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count ) {
-    OneToOneMapper* self = (OneToOneMapper*)mapper;
-    MaterialPointsSwarm** result = Memory_Alloc_Array( MaterialPointsSwarm*, 1,  "Swarms" );
-    result[0] = self->materialSwarm;
-    *count = 1;
+	OneToOneMapper*			self = (OneToOneMapper*)mapper;
+	MaterialPointsSwarm**	result = Memory_Alloc_Array( MaterialPointsSwarm*, 1,  "Swarms" );
 
-    return result;
+	result[0] = self->materialSwarm;
+	*count = 1;
+
+	return result;
 }
 
 Material_Index _OneToOneMapper_GetMaterialIndexOn( void* mapper, void* point ) {
-    OneToOneMapper*         self           = (OneToOneMapper*)mapper;
-    MaterialPoint*          materialPoint; /* Assumes that material swarm holds Material particle or derivative */
+	OneToOneMapper*	self = (OneToOneMapper*)mapper;
+	MaterialPoint*		materialPoint; /* Assumes that material swarm holds Material particle or derivative */
 	
-    materialPoint = OneToOneMapper_GetMaterialPoint( self, point, NULL );
+	materialPoint = OneToOneMapper_GetMaterialPoint( self, point, NULL );
 
-    return materialPoint->materialIndex;
+	return materialPoint->materialIndex;
 }
+
 void* _OneToOneMapper_GetExtensionOn( void* mapper, void* point, ExtensionInfo_Index extHandle ) {
-    OneToOneMapper*         self = (OneToOneMapper*)mapper;
-    MaterialPointsSwarm*    swarm;
-    MaterialPoint*          materialPoint; /* Assumes that material swarm holds Material particle or derivative */
+	OneToOneMapper*		self = (OneToOneMapper*)mapper;
+	MaterialPointsSwarm*	swarm;
+	MaterialPoint*			materialPoint; /* Assumes that material swarm holds Material particle or derivative */
 
-    materialPoint = OneToOneMapper_GetMaterialPoint( self, point, &swarm );
+	materialPoint = OneToOneMapper_GetMaterialPoint( self, point, &swarm );
 
-    return ExtensionManager_Get( swarm->particleExtensionMgr, materialPoint, extHandle );
+	return ExtensionManager_Get( swarm->particleExtensionMgr, materialPoint, extHandle );
 }
diff -r a077add145be -r 01b8e5dbf9a4 MaterialPoints/src/OneToOneMapper.h
--- a/MaterialPoints/src/OneToOneMapper.h	Mon Nov 23 18:07:54 2009 +1100
+++ b/MaterialPoints/src/OneToOneMapper.h	Tue Nov 24 16:51:44 2009 +1100
@@ -59,63 +59,59 @@
 #ifndef __PICellerator_MaterialPoints_OneToOneMapper_h__
 #define __PICellerator_MaterialPoints_OneToOneMapper_h__
 
-extern const Type OneToOneMapper_Type;
+	extern const Type OneToOneMapper_Type;
 
-/* OneToOneMapper information */
-#define __OneToOneMapper                                                \
-    __IntegrationPointMapper                                            \
-                                                                        \
-    Stream*				errorStream;                    \
-    MaterialPointsSwarm*		materialSwarm;                  \
-    Index                           materialRefHandle; /**< Extension handle to reference struct of material points */
+	/* OneToOneMapper information */
+	#define __OneToOneMapper \
+		__IntegrationPointMapper \
+		\
+		Stream*					errorStream; \
+		MaterialPointsSwarm*	materialSwarm; \
+		Index						materialRefHandle; /**< Extension handle to reference struct of material points */
 
-struct OneToOneMapper { __OneToOneMapper };
+	struct OneToOneMapper { __OneToOneMapper };
+
+	#define ONETOONEMAPPER_DEFARGS \
+		INTEGRATIONPOINTMAPPER_DEFARGS, \
+			MaterialPointsSwarm* materialSwarm 
+
+	#define ONETOONEMAPPER_PASSARGS \
+		INTEGRATIONPOINTMAPPER_PASSARGS, \
+			materialSwarm 
 	
-OneToOneMapper* _OneToOneMapper_New(
-    SizeT                                                           _sizeOfSelf,
-    Type                                                            type,
-    Stg_Class_DeleteFunction*                                       _delete,
-    Stg_Class_PrintFunction*                                        _print,
-    Stg_Class_CopyFunction*                                         _copy,
-    Stg_Component_DefaultConstructorFunction*                       _defaultConstructor,
-    Stg_Component_ConstructFunction*                                _construct,
-    Stg_Component_BuildFunction*                                    _build,
-    Stg_Component_InitialiseFunction*                               _initialise,
-    Stg_Component_ExecuteFunction*                                  _execute,
-    Stg_Component_DestroyFunction*                                  _destroy,
-    IntegrationPointMapper_MapFunction*                             _map,
-    IntegrationPointMapper_GetMaterialPointsSwarmsFunction*         _getMaterialPointsSwarms,
-    IntegrationPointMapper_GetMaterialIndexOnFunction*              _getMaterialIndexOn,
-    IntegrationPointMapper_GetExtensionOnFunction*                  _getExtensionOn,
-    Name                                                            name,
-    Bool                                                            initFlag,
-    IntegrationPointsSwarm*                                         integrationSwarm,
-    MaterialPointsSwarm*                                            materialSwarm );
+	OneToOneMapper* _OneToOneMapper_New( ONETOONEMAPPER_DEFARGS );
 
-void _OneToOneMapper_Init( 
-    void*                   mapper, 
-    MaterialPointsSwarm*    materialSwarm );
+	void _OneToOneMapper_Init( void* mapper, MaterialPointsSwarm* materialSwarm );
 
-void _OneToOneMapper_Delete( void* mapper );
-void _OneToOneMapper_Print( void* mapper, Stream* stream );
-#define OneToOneMapper_Copy( self )                                     \
-    (OneToOneMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
-#define OneToOneMapper_DeepCopy( self )                                 \
-    (OneToOneMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
-void* _OneToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	void _OneToOneMapper_Delete( void* mapper );
+
+	void _OneToOneMapper_Print( void* mapper, Stream* stream );
+
+	#define OneToOneMapper_Copy( self ) \
+		(OneToOneMapper*) Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define OneToOneMapper_DeepCopy( self ) \
+		(OneToOneMapper*) Stg_Class_Copy( self, NULL, True, NULL, NULL )
+
+	void* _OneToOneMapper_Copy( void* mapper, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
 	
-void _OneToOneMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
-void _OneToOneMapper_Build( void* mapper, void* data ) ;
-void _OneToOneMapper_Initialise( void* mapper, void* data );
-void _OneToOneMapper_Execute( void* mapper, void* data );
-void _OneToOneMapper_Destroy( void* mapper, void* data );
+	void _OneToOneMapper_AssignFromXML( void* shape, Stg_ComponentFactory* cf, void* data );
 
-MaterialPointsSwarm** _OneToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count );	
-Material_Index _OneToOneMapper_GetMaterialIndexOn( void* mapper, void* point );
-void* _OneToOneMapper_GetExtensionOn( void* mapper, void* point, ExtensionInfo_Index extHandle );
+	void _OneToOneMapper_Build( void* mapper, void* data );
 
-MaterialPointRef* OneToOneMapper_GetMaterialRef( void* mapper, void* integrationPoint );
-MaterialPoint* OneToOneMapper_GetMaterialPoint( void* mapper, void* integrationPoint, MaterialPointsSwarm** materialSwarm );
-	
+	void _OneToOneMapper_Initialise( void* mapper, void* data );
+
+	void _OneToOneMapper_Execute( void* mapper, void* data );
+
+	void _OneToOneMapper_Destroy( void* mapper, void* data );
+
+	MaterialPointsSwarm** _OneToOneMapper_GetMaterialPointsSwarms( void* mapper, Index* count );	
+
+	Material_Index _OneToOneMapper_GetMaterialIndexOn( void* mapper, void* point );
+
+	void* _OneToOneMapper_GetExtensionOn( void* mapper, void* point, ExtensionInfo_Index extHandle );
+
+	MaterialPointRef* OneToOneMapper_GetMaterialRef( void* mapper, void* integrationPoint );
+
+	MaterialPoint* OneToOneMapper_GetMaterialPoint( void* mapper, void* integrationPoint, MaterialPointsSwarm** materialSwarm );
 	
 #endif
diff -r a077add145be -r 01b8e5dbf9a4 Weights/tests/ConstantWeightsSuite.c
--- a/Weights/tests/ConstantWeightsSuite.c	Mon Nov 23 18:07:54 2009 +1100
+++ b/Weights/tests/ConstantWeightsSuite.c	Tue Nov 24 16:51:44 2009 +1100
@@ -205,13 +205,13 @@ void ConstantWeightsSuite_Setup( Constan
    pcu_filename_input( "testConstantWeights.xml", xmlInputFilename );
    data->cf = stgMainInitFromXML( xmlInputFilename, MPI_COMM_WORLD, NULL );
    data->context = (PICelleratorContext*)LiveComponentRegister_Get( data->cf->LCRegister, "context" );
-//   Stg_ComponentFactory_BuildComponents( data->cf, NULL );
+	// Stg_ComponentFactory_BuildComponents( data->cf, NULL );
    
    stgMainBuildAndInitialise( data->cf );
 }
 
 void ConstantWeightsSuite_Teardown( ConstantWeightsSuiteData* data ) {
-  stgMainDestroy( data->cf );
+	stgMainDestroy( data->cf );
 }
 
 void ConstantWeightsSuite_TestConstantFunction( ConstantWeightsSuiteData* data ) {



More information about the CIG-COMMITS mailing list