示例#1
0
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 );
}
TriGaussParticleLayout* TriGaussParticleLayout_New( 
   Name name, 
   AbstractContext* context,
   CoordSystem      coordSystem,
   Bool             weightsInitialisedAtStartup,
   unsigned int dim, unsigned int particlesPerCell ) 
{
	TriGaussParticleLayout* self = (TriGaussParticleLayout*)_TriGaussParticleLayout_DefaultNew( name );

   _ParticleLayout_Init( self, context, coordSystem, weightsInitialisedAtStartup );
   _PerCellParticleLayout_Init( self );
	_TriGaussParticleLayout_Init( self, dim, particlesPerCell );

	return self;
}
MeshParticleLayout* MeshParticleLayout_New( 
   Name                 name, 
   AbstractContext* context,
   CoordSystem      coordSystem,
   Bool             weightsInitialisedAtStartup,
   Mesh*            mesh,
   Particle_InCellIndex cellParticleCount, 
   unsigned int         seed,
   unsigned int         filltype )
{
	MeshParticleLayout* self = (MeshParticleLayout*) _MeshParticleLayout_DefaultNew( name );

   _ParticleLayout_Init( self, context, coordSystem, weightsInitialisedAtStartup );
   _PerCellParticleLayout_Init( self );
	_MeshParticleLayout_Init( self, mesh, cellParticleCount, seed, filltype );

	return self;
}