[cig-commits] r5281 - in long/3D/Gale/trunk/src/StGermain: . Discretisation/Swarm/src

walter at geodynamics.org walter at geodynamics.org
Wed Nov 15 13:06:11 PST 2006


Author: walter
Date: 2006-11-15 13:06:11 -0800 (Wed, 15 Nov 2006)
New Revision: 5281

Added:
   long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.c
   long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.h
   long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.meta
Modified:
   long/3D/Gale/trunk/src/StGermain/
   long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/Init.c
   long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/Swarm.h
   long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/types.h
Log:
 r3178 at earth:  boo | 2006-11-15 13:05:09 -0800
  r3153 at earth (orig r3887):  LukeHodkinson | 2006-11-05 21:19:51 -0800
  Added a class to distribute particles in deformed
  elements. Uses the mesh to determine element deformation.
  
 



Property changes on: long/3D/Gale/trunk/src/StGermain
___________________________________________________________________
Name: svk:merge
   - 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3177
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3886
   + 1ef209d2-b310-0410-a72d-e20c9eb0015c:/cig:3178
afb6c753-b9d0-0310-b4e7-dbd8d91cdd35:/trunk/StGermain:3887

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/Init.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/Init.c	2006-11-15 21:06:08 UTC (rev 5280)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/Init.c	2006-11-15 21:06:11 UTC (rev 5281)
@@ -66,6 +66,8 @@
 #include "StandardParticle.h"
 #include "IntegrationPoint.h"
 
+#include "Swarm.h"
+
 #include <stdio.h>
 
 Stream* Swarm_VerboseConfig = NULL;
@@ -84,6 +86,7 @@
 	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), GaussParticleLayout_Type, "0", _GaussParticleLayout_DefaultNew );
 	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), TriGaussParticleLayout_Type, "0", _TriGaussParticleLayout_DefaultNew );
 	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), RandomParticleLayout_Type, "0", _RandomParticleLayout_DefaultNew );
+	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), MeshParticleLayout_Type, "0", _MeshParticleLayout_DefaultNew );
 	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), SpaceFillerParticleLayout_Type, "0", _SpaceFillerParticleLayout_DefaultNew );
 	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), UnionParticleLayout_Type, "0", _UnionParticleLayout_DefaultNew );
 	Stg_ComponentRegister_Add( Stg_ComponentRegister_Get_ComponentRegister(), WithinShapeParticleLayout_Type, "0", _WithinShapeParticleLayout_DefaultNew );
@@ -119,6 +122,7 @@
 	RegisterParent( PerCellParticleLayout_Type, ParticleLayout_Type );
 	RegisterParent( GaussParticleLayout_Type,   PerCellParticleLayout_Type );
 	RegisterParent( RandomParticleLayout_Type,   PerCellParticleLayout_Type );
+	RegisterParent( MeshParticleLayout_Type,   PerCellParticleLayout_Type );
 	RegisterParent( TriGaussParticleLayout_Type,   PerCellParticleLayout_Type );
 	
 	

Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.c
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.c	2006-11-15 21:06:08 UTC (rev 5280)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.c	2006-11-15 21:06:11 UTC (rev 5281)
@@ -0,0 +1,291 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+** $Id: MeshParticleLayout.c 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#include <mpi.h>
+#include "Base/Base.h"
+
+#include "Discretisation/Geometry/Geometry.h"
+#include "Discretisation/Shape/Shape.h"
+#include "Discretisation/Mesh/Mesh.h"
+#include "Discretisation/Utils/Utils.h"
+
+#include "types.h"
+#include "shortcuts.h"
+#include "ParticleLayout.h"
+#include "PerCellParticleLayout.h"
+#include "MeshParticleLayout.h"
+
+#include "SwarmClass.h"
+#include "Random.h"
+#include "StandardParticle.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+const Type MeshParticleLayout_Type = "MeshParticleLayout";
+
+
+MeshParticleLayout* MeshParticleLayout_New( 
+		Name                 name, 
+		Particle_InCellIndex cellParticleCount, 
+		unsigned int         seed ) 
+{
+	MeshParticleLayout* self = (MeshParticleLayout*) _MeshParticleLayout_DefaultNew( name );
+	_MeshParticleLayout_Init( self, cellParticleCount, seed );
+
+	return self;
+}
+
+MeshParticleLayout* _MeshParticleLayout_New( 
+		SizeT                                                       _sizeOfSelf,
+		Type                                                        type,
+		Stg_Class_DeleteFunction*                                   _delete,
+		Stg_Class_PrintFunction*                                    _print,
+		Stg_Class_CopyFunction*                                     _copy,
+		Stg_Component_DefaultConstructorFunction*                   _defaultConstructor,
+		Stg_Component_ConstructFunction*                            _construct,
+		Stg_Component_BuildFunction*                                _build,
+		Stg_Component_InitialiseFunction*                           _initialise,
+		Stg_Component_ExecuteFunction*                              _execute,
+		Stg_Component_DestroyFunction*                              _destroy,
+		ParticleLayout_SetInitialCountsFunction*                    _setInitialCounts,
+		ParticleLayout_InitialiseParticlesFunction*                 _initialiseParticles,
+		PerCellParticleLayout_InitialCountFunction*                 _initialCount,
+		PerCellParticleLayout_InitialiseParticlesOfCellFunction*    _initialiseParticlesOfCell,
+		Name                                                        name,
+		Bool                                                         initFlag,
+		Particle_InCellIndex                                        cellParticleCount,
+		unsigned int                                                seed )
+{
+	MeshParticleLayout* self;
+	
+	/* Allocate memory */
+	self = (MeshParticleLayout*)_PerCellParticleLayout_New( 
+		_sizeOfSelf, 
+		type,
+		_delete,
+		_print,
+		_copy,
+		_defaultConstructor,
+		_construct,
+		_build,
+		_initialise,
+		_execute,
+		_destroy,
+		_setInitialCounts,
+		_initialiseParticles,
+		_initialCount,
+		_initialiseParticlesOfCell,
+		name,
+		initFlag,
+		GlobalCoordSystem,
+		False );
+
+	if ( initFlag ) {
+		_MeshParticleLayout_Init( self, cellParticleCount, seed );
+	}
+	
+	return self;
+}
+
+void _MeshParticleLayout_Init( void* meshParticleLayout, Particle_InCellIndex cellParticleCount, unsigned int seed ) {
+	MeshParticleLayout* self = (MeshParticleLayout*)meshParticleLayout;
+
+	self->mesh = NULL;
+	self->isConstructed     = True;
+	self->cellParticleCount = cellParticleCount;
+	self->seed              = seed;
+	
+	Swarm_Random_Seed( self->seed );
+
+	_PerCellParticleLayout_Init( meshParticleLayout, GlobalCoordSystem, False );
+}
+
+
+void _MeshParticleLayout_Delete( void* meshParticleLayout ) {
+	MeshParticleLayout* self = (MeshParticleLayout*)meshParticleLayout;
+	
+	/* Stg_Class_Delete parent class */
+	_PerCellParticleLayout_Delete( self );
+}
+
+void _MeshParticleLayout_Print( void* meshParticleLayout, Stream* stream ) {
+	MeshParticleLayout* self = (MeshParticleLayout*)meshParticleLayout;
+	
+	/* Set the Journal for printing informations */
+	Stream* meshParticleLayoutStream = stream;
+	
+	/* General info */
+	Journal_Printf( meshParticleLayoutStream, "MeshParticleLayout (ptr): %p:\n", self );
+	
+	/* Parent class info */
+	_PerCellParticleLayout_Print( self, stream );
+	
+	/* MeshParticleLayout */
+	Journal_Printf( meshParticleLayoutStream, "\tcellParticleCount: %u\n", self->cellParticleCount );
+	Journal_Printf( meshParticleLayoutStream, "\tseed: %u\n", self->seed );
+}
+
+
+void* _MeshParticleLayout_Copy( void* meshParticleLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap ) {
+	MeshParticleLayout*		self = (MeshParticleLayout*)meshParticleLayout;
+	MeshParticleLayout*		newMeshParticleLayout;
+	
+	newMeshParticleLayout = (MeshParticleLayout*)_PerCellParticleLayout_Copy( self, dest, deep, nameExt, ptrMap );
+	
+	newMeshParticleLayout->cellParticleCount = self->cellParticleCount;
+	newMeshParticleLayout->seed = self->seed;
+	
+	return (void*)newMeshParticleLayout;
+}
+
+
+void* _MeshParticleLayout_DefaultNew( Name name ) {
+	return (void*)_MeshParticleLayout_New( 
+			sizeof(MeshParticleLayout),
+			MeshParticleLayout_Type,
+			_MeshParticleLayout_Delete,
+			_MeshParticleLayout_Print, 
+			_MeshParticleLayout_Copy,
+			_MeshParticleLayout_DefaultNew,
+			_MeshParticleLayout_Construct,
+			_MeshParticleLayout_Build,
+			_MeshParticleLayout_Initialise,
+			_MeshParticleLayout_Execute,
+			_MeshParticleLayout_Destroy,
+			_PerCellParticleLayout_SetInitialCounts,
+			_PerCellParticleLayout_InitialiseParticles,
+			_MeshParticleLayout_InitialCount,
+			_MeshParticleLayout_InitialiseParticlesOfCell, 
+			name,
+			False,
+			0, /* cellParticleCount */
+			0  /* seed */ );
+}
+
+void _MeshParticleLayout_Construct( void* meshParticleLayout, Stg_ComponentFactory* cf, void* data ) {
+	MeshParticleLayout*       self = (MeshParticleLayout*)meshParticleLayout;
+	Particle_InCellIndex        cellParticleCount;
+	unsigned int                seed;
+
+	cellParticleCount = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "cellParticleCount", 0 );
+	seed = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "seed", 13 );
+	
+	_MeshParticleLayout_Init( self, cellParticleCount, seed );
+
+	self->mesh = Stg_ComponentFactory_ConstructByKey( cf, self->name, "mesh", Mesh, True, data );
+}
+	
+void _MeshParticleLayout_Build( void* meshParticleLayout, void* data ) {
+	MeshParticleLayout*       self = (MeshParticleLayout*)meshParticleLayout;
+
+	assert( self );
+
+	Stg_Component_Build( self->mesh, NULL, False );
+}
+	
+void _MeshParticleLayout_Initialise( void* meshParticleLayout, void* data ) {
+	MeshParticleLayout*       self = (MeshParticleLayout*)meshParticleLayout;
+
+	assert( self );
+
+	Stg_Component_Initialise( self->mesh, NULL, False );
+}
+	
+void _MeshParticleLayout_Execute( void* meshParticleLayout, void* data ) {
+	
+}
+	
+void _MeshParticleLayout_Destroy( void* meshParticleLayout, void* data ) {
+	
+}
+
+
+Particle_InCellIndex _MeshParticleLayout_InitialCount( void* meshParticleLayout, void* celllayout, Cell_Index cell_I ) {
+	MeshParticleLayout* self = (MeshParticleLayout*)meshParticleLayout;
+	return self->cellParticleCount;
+}
+
+void _MeshParticleLayout_InitialiseParticlesOfCell( void* meshParticleLayout, void* _swarm, Cell_Index cell_I ) {
+	MeshParticleLayout*	self = (MeshParticleLayout*)meshParticleLayout;
+	Swarm*              	swarm = (Swarm*)_swarm;
+	Coord               	min = {-1.0, -1.0, -1.0};
+	Coord               	max = {1.0, 1.0, 1.0};
+	Coord			localCoord;
+	double			basis[8];
+	unsigned		nDims = self->mesh->nSpaceDims;
+	Coord*			nodeCoords = self->mesh->nodeCoord;
+	unsigned		nNodes, *incNodes;
+	Particle_InCellIndex	particlesThisCell = swarm->cellParticleCountTbl[cell_I];
+	Particle_InCellIndex	cParticle_I = 0;
+	GlobalParticle*	        particle = NULL;
+	unsigned		d_i, n_i;
+
+	assert( nDims == 2 || nDims == 3 );
+
+	nNodes = self->mesh->elementNodeCountTbl[cell_I];
+	incNodes = self->mesh->elementNodeTbl[cell_I];
+
+	for ( cParticle_I = 0; cParticle_I < particlesThisCell; cParticle_I++ ) {	
+		particle = (GlobalParticle*)Swarm_ParticleInCellAt( swarm, cell_I, cParticle_I );
+		particle->owningCell = cell_I;
+		
+		for ( d_i = 0; d_i < nDims; d_i++ ) {
+			localCoord[d_i] = Swarm_Random_Random_WithMinMax( min[d_i], max[d_i] );
+		}
+
+		/* Convert the coordinate to global. Assumes quad or hex mesh. */
+		if( nDims == 2 ) {
+			basis[0] = 0.25 * (1.0 - localCoord[0]) * (1.0 - localCoord[1]);
+			basis[1] = 0.25 * (1.0 + localCoord[0]) * (1.0 - localCoord[1]);
+			basis[3] = 0.25 * (1.0 - localCoord[0]) * (1.0 + localCoord[1]);
+			basis[2] = 0.25 * (1.0 + localCoord[0]) * (1.0 + localCoord[1]);
+		}
+		else {
+			basis[0] = 0.125 * (1.0 - localCoord[0]) * (1.0 - localCoord[1]) * (1.0 - localCoord[2]);
+			basis[1] = 0.125 * (1.0 + localCoord[0]) * (1.0 - localCoord[1]) * (1.0 - localCoord[2]);
+			basis[3] = 0.125 * (1.0 - localCoord[0]) * (1.0 + localCoord[1]) * (1.0 - localCoord[2]);
+			basis[2] = 0.125 * (1.0 + localCoord[0]) * (1.0 + localCoord[1]) * (1.0 - localCoord[2]);
+			basis[4] = 0.125 * (1.0 - localCoord[0]) * (1.0 - localCoord[1]) * (1.0 + localCoord[2]);
+			basis[5] = 0.125 * (1.0 + localCoord[0]) * (1.0 - localCoord[1]) * (1.0 + localCoord[2]);
+			basis[7] = 0.125 * (1.0 - localCoord[0]) * (1.0 + localCoord[1]) * (1.0 + localCoord[2]);
+			basis[6] = 0.125 * (1.0 + localCoord[0]) * (1.0 + localCoord[1]) * (1.0 + localCoord[2]);
+		}
+
+		memset( particle->coord, 0, sizeof(double) * nDims );
+		for( d_i = 0; d_i < nDims; d_i++ ) {
+			for( n_i = 0; n_i < nNodes; n_i++ ) {
+				particle->coord[d_i] += basis[n_i] * nodeCoords[incNodes[n_i]][d_i];
+			}
+		}
+	}
+}

Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.h	2006-11-15 21:06:08 UTC (rev 5280)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.h	2006-11-15 21:06:11 UTC (rev 5281)
@@ -0,0 +1,112 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+**
+** Copyright (C), 2003, Victorian Partnership for Advanced Computing (VPAC) Ltd, 110 Victoria Street, Melbourne, 3053, Australia.
+**
+** Authors:
+**	Stevan M. Quenette, Senior Software Engineer, VPAC. (steve at vpac.org)
+**	Patrick D. Sunter, Software Engineer, VPAC. (pds at vpac.org)
+**	Luke J. Hodkinson, Computational Engineer, VPAC. (lhodkins at vpac.org)
+**	Siew-Ching Tan, Software Engineer, VPAC. (siew at vpac.org)
+**	Alan H. Lo, Computational Engineer, VPAC. (alan at vpac.org)
+**	Raquibul Hassan, Computational Engineer, VPAC. (raq at vpac.org)
+**
+**  This library is free software; you can redistribute it and/or
+**  modify it under the terms of the GNU Lesser General Public
+**  License as published by the Free Software Foundation; either
+**  version 2.1 of the License, or (at your option) any later version.
+**
+**  This library is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+**  Lesser General Public License for more details.
+**
+**  You should have received a copy of the GNU Lesser General Public
+**  License along with this library; if not, write to the Free Software
+**  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+**
+*/
+/** \file
+**  Role:
+**	Instantiates the ParticleLayout abstract class to a randomly distributed particle layout within each cell.
+**
+** Assumptions:
+**	Cell is a right-angled cuboid.
+**
+** Comments:
+**
+** $Id: MeshParticleLayout.h 3851 2006-10-12 08:57:22Z SteveQuenette $
+**
+**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+
+#ifndef __Discretisation_Swarm_MeshParticleLayout_h__
+#define __Discretisation_Swarm_MeshParticleLayout_h__
+	
+
+	/* Textual name of this class */
+	extern const Type MeshParticleLayout_Type;
+	
+	/* MeshParticleLayout information */
+	#define __MeshParticleLayout \
+		__PerCellParticleLayout \
+		\
+		Mesh*			     mesh; \
+		Particle_InCellIndex         cellParticleCount; /**< Number of particles in each cell to create initially */ \
+		unsigned int                 seed;              /**< The random seed used to generate positions. */
+
+	struct MeshParticleLayout { __MeshParticleLayout };
+	
+	/* Create a new MeshParticleLayout and initialise */
+	MeshParticleLayout* MeshParticleLayout_New( Name name, Particle_InCellIndex cellParticleCount, unsigned int seed ) ;
+	
+	/* Creation implementation / Virtual constructor */
+	MeshParticleLayout* _MeshParticleLayout_New( 
+                SizeT                                                       _sizeOfSelf,
+                Type                                                        type,
+                Stg_Class_DeleteFunction*                                   _delete,
+                Stg_Class_PrintFunction*                                    _print,
+                Stg_Class_CopyFunction*                                     _copy,
+                Stg_Component_DefaultConstructorFunction*                   _defaultConstructor,
+                Stg_Component_ConstructFunction*                            _construct,
+                Stg_Component_BuildFunction*                                _build,
+                Stg_Component_InitialiseFunction*                           _initialise,
+                Stg_Component_ExecuteFunction*                              _execute,
+                Stg_Component_DestroyFunction*                              _destroy,
+                ParticleLayout_SetInitialCountsFunction*                    _setInitialCounts,
+                ParticleLayout_InitialiseParticlesFunction*                 _initialiseParticles,
+                PerCellParticleLayout_InitialCountFunction*                 _initialCount,
+                PerCellParticleLayout_InitialiseParticlesOfCellFunction*    _initialiseParticlesOfCell,
+                Name                                                        name,
+		Bool                                                        initFlag,
+		Particle_InCellIndex                                        cellParticleCount,
+		unsigned int                                                seed );
+
+	void _MeshParticleLayout_Init( 
+			void*                meshParticleLayout, 
+			Particle_InCellIndex cellParticleCount, 
+			unsigned int         seed);
+
+	/* 'Class' Stuff */
+	void _MeshParticleLayout_Delete( void* meshParticleLayout );
+	void _MeshParticleLayout_Print( void* meshParticleLayout, Stream* stream );
+	
+	#define MeshParticleLayout_Copy( self ) \
+		(MeshParticleLayout*)Stg_Class_Copy( self, NULL, False, NULL, NULL )
+	#define MeshParticleLayout_DeepCopy( self ) \
+		(MeshParticleLayout*)Stg_Class_Copy( self, NULL, True, NULL, NULL )
+	void* _MeshParticleLayout_Copy( void* meshParticleLayout, void* dest, Bool deep, Name nameExt, PtrMap* ptrMap );
+	
+	/* 'Stg_Component' Stuff */
+	void* _MeshParticleLayout_DefaultNew( Name name ) ;
+	void _MeshParticleLayout_Construct( void* meshParticleLayout, Stg_ComponentFactory* cf, void* data );
+	void _MeshParticleLayout_Build( void* meshParticleLayout, void* data );
+	void _MeshParticleLayout_Initialise( void* meshParticleLayout, void* data );
+	void _MeshParticleLayout_Execute( void* meshParticleLayout, void* data );
+	void _MeshParticleLayout_Destroy( void* meshParticleLayout, void* data );
+	
+	Particle_InCellIndex _MeshParticleLayout_InitialCount( void* meshParticleLayout, void* celllayout,  Cell_Index cell_I );
+	
+	void _MeshParticleLayout_InitialiseParticlesOfCell( void* meshParticleLayout, void* _swarm, Cell_Index cell_I );
+
+
+	
+#endif /* __Discretisation_Swarm_MeshParticleLayout_h__ */

Added: long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.meta
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.meta	2006-11-15 21:06:08 UTC (rev 5280)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/MeshParticleLayout.meta	2006-11-15 21:06:11 UTC (rev 5281)
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!DOCTYPE StGermainData SYSTEM "stgermain.dtd">
+<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
+
+<param name="Name">MeshParticleLayout</param>
+<param name="Organisation">VPAC</param>
+<param name="Project">StGermain</param>
+<param name="Location">./StGermain/Discretisation/Swarm/src/</param>
+<param name="Project Web">https://csd.vpac.org/twiki/bin/view/Stgermain/WebHome</param>
+<param name="Copyright">StGermain Framework. Copyright (C) 2003-2005 VPAC.</param>
+<param name="License">The Gnu Lesser General Public License http://www.gnu.org/licenses/lgpl.html</param>
+<param name="Parent">PerCellParticleLayout</param>
+<param name="Description">Randomly distributes particles within cells.</param>
+
+<!--Now the interesting stuff-->
+
+
+<list name="Params">
+	<struct>
+		<param name="Name">cellParticleCount</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">0</param>
+		<param name="Description">The number of particles you want in each cell.</param>
+	</struct>
+	<struct>
+		<param name="Name">seed</param>
+		<param name="Type">UnsignedInt</param>
+		<param name="Default">13</param>
+		<param name="Description">The seed that you want to give the random number generator. The same seed will always give the same particle positions.</param>
+	</struct>
+
+</list>
+
+<list name="Dependencies">
+
+</list>
+<!-- Add an exmaple XML if possible -->
+<param name="Example">
+	<struct name="particleLayoutExample1">
+		<param name="Type">RandomParticleLayout</param>
+		<param name="cellParticleLayout">20</param>
+		<param name="seed">2</param>
+	</struct>
+</param>
+
+</StGermainData>

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/Swarm.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/Swarm.h	2006-11-15 21:06:08 UTC (rev 5280)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/Swarm.h	2006-11-15 21:06:11 UTC (rev 5281)
@@ -59,6 +59,7 @@
 	#include "Random.h"
 	#include "PerCellParticleLayout.h"
 	#include "RandomParticleLayout.h"
+	#include "MeshParticleLayout.h"
 	#include "GaussParticleLayout.h"
 	#include "TriGaussParticleLayout.h"
 	#include "GlobalParticleLayout.h"

Modified: long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/types.h
===================================================================
--- long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/types.h	2006-11-15 21:06:08 UTC (rev 5280)
+++ long/3D/Gale/trunk/src/StGermain/Discretisation/Swarm/src/types.h	2006-11-15 21:06:11 UTC (rev 5281)
@@ -78,6 +78,7 @@
 	typedef struct ParticleLayout			ParticleLayout;
 	typedef struct PerCellParticleLayout		PerCellParticleLayout;
 	typedef struct RandomParticleLayout		RandomParticleLayout;
+	typedef struct MeshParticleLayout		MeshParticleLayout;
 	typedef struct GaussParticleLayout		GaussParticleLayout;
 	typedef struct TriGaussParticleLayout		TriGaussParticleLayout;
 	typedef struct GlobalParticleLayout		GlobalParticleLayout;



More information about the cig-commits mailing list