Esempio n. 1
0
void _FileParticleLayout_Init( void* particleLayout, Name filename )
{
	FileParticleLayout* self = (FileParticleLayout*) particleLayout;

	self->filename = StG_Strdup( filename );
	self->file        = NULL;
	self->errorStream = Journal_MyStream( Error_Type, self );
	_GlobalParticleLayout_Init( self, GlobalCoordSystem, False, 0, 0.0 );
}
Esempio n. 2
0
GlobalParticleLayout* _GlobalParticleLayout_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,
		GlobalParticleLayout_InitialiseParticleFunction*    _initialiseParticle,
		Name                                                name,
		Bool                                                initFlag,
		CoordSystem                                         coordSystem,
		Bool                                                weightsInitialisedAtStartup,
		Particle_Index                                      totalInitialParticles,
		double                                              averageInitialParticlesPerCell )
{
	GlobalParticleLayout*		self;
	
	assert( _sizeOfSelf >= sizeof(GlobalParticleLayout) );
	self = (GlobalParticleLayout*)_ParticleLayout_New( 
			_sizeOfSelf, 
			type, 
			_delete, 
			_print, 
			_copy, 
			_defaultConstructor,
			_construct, 
			_build, 
			_initialise, 
			_execute, 
			_destroy, 
			_setInitialCounts,
			_initialiseParticles, 
			name, 
			initFlag, 
			coordSystem,
			weightsInitialisedAtStartup );
	
	self->_initialiseParticle = _initialiseParticle;
	
	if( initFlag ){
		_GlobalParticleLayout_Init( 
				self, 
				coordSystem, 
				weightsInitialisedAtStartup, 
				totalInitialParticles, 
				averageInitialParticlesPerCell );
	}
	
	return self;
}
Esempio n. 3
0
void _UnionParticleLayout_Init( 
		void*                                            unionParticleLayout, 
		GlobalParticleLayout**                           particleLayoutList,
		Index                                            particleLayoutCount )
{
	UnionParticleLayout*	self = (UnionParticleLayout*) unionParticleLayout;
	self->isConstructed = True;
	
	self->particleLayoutList = particleLayoutList;
	self->particleLayoutCount = particleLayoutCount;

	_GlobalParticleLayout_Init( self, GlobalCoordSystem, False, 0, 0 );
}
ManualParticleLayout* ManualParticleLayout_New( Name name,
      AbstractContext* context, 
      CoordSystem      coordSystem,
      Bool             weightsInitialisedAtStartup,
      unsigned int     totalInitialParticles, 
      double           averageInitialParticlesPerCell,
      Dictionary*      dictionary ) 
{
	ManualParticleLayout* self = (ManualParticleLayout*) _ManualParticleLayout_DefaultNew( name );

   _ParticleLayout_Init( self, context, coordSystem, weightsInitialisedAtStartup );
   _GlobalParticleLayout_Init( self, totalInitialParticles, averageInitialParticlesPerCell );
	_ManualParticleLayout_Init( self, dictionary );
	return self;
}