コード例 #1
0
ファイル: Sync.c プロジェクト: bmi-forum/bmi-pyre
void Sync_Init( Sync* self,
		Dictionary* dictionary, Name name )
{
	/* General info */
	self->type = Sync_Type;
	self->_sizeOfSelf = sizeof(Sync);
	self->_deleteSelf = False;
	self->dictionary = dictionary;
	
	/* Virtual info */
	self->_delete = _Sync_Delete;
	self->_print = _Sync_Print;
	self->_copy = NULL;
	self->_defaultConstructor = Sync_DefaultNew;
	self->_construct = _Sync_Construct;
	self->_build = _Sync_Build;
	self->_initialise = _Sync_Initialise;
	self->_execute = _Sync_Execute;
	self->_destroy = _Sync_Destroy;
	
	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
	_Stg_Component_Init( (Stg_Component*)self );
	
	/* Sync info */
	_Sync_Init( self );
}
コード例 #2
0
void RefinedRegionsGeometry_Init(
    RefinedRegionsGeometry*					self,
    Name						name,
    Dictionary*					dictionary )
{
    /* General info */
    self->type = RefinedRegionsGeometry_Type;
    self->_sizeOfSelf = sizeof(RefinedRegionsGeometry);
    self->_deleteSelf = False;
    self->dictionary = dictionary;

    /* Virtual info */
    self->_delete = _RefinedRegionsGeometry_Delete;
    self->_print = _RefinedRegionsGeometry_Print;
    self->_copy = _RefinedRegionsGeometry_Copy;
    self->_defaultConstructor = RefinedRegionsGeometry_DefaultNew;
    self->_construct = _RefinedRegionsGeometry_Construct;
    self->_build = _RefinedRegionsGeometry_Build;
    self->_initialise = _RefinedRegionsGeometry_Initialise;
    self->_execute = _RefinedRegionsGeometry_Execute;
    self->_destroy = _RefinedRegionsGeometry_Destroy;
    self->buildPoints = _RefinedRegionsGeometry_BuildPoints;
    self->pointAt = _RefinedRegionsGeometry_PointAt;

    _Stg_Class_Init( (Stg_Class*)self );
    _Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
    _Stg_Component_Init( (Stg_Component*)self );

    _Geometry_Init( (Geometry*)self );

    /* RefinedRegionsGeometry info */
    _RefinedRegionsGeometry_Init( self, NULL );
}
コード例 #3
0
ファイル: ObjectAdaptor.c プロジェクト: bmi-forum/bmi-pyre
void Stg_ObjectAdaptor_InitOfPointer( 
		Stg_ObjectAdaptor* 				self, 
		void*						dataPtr, 
		Name						name, 
		Bool						iOwn,
		Bool						isGlobal,
		Stg_ObjectAdaptor_DeletePointerFunction*	ptrDelete,
		Stg_ObjectAdaptor_PrintPointerFunction*		ptrPrint,
		Stg_ObjectAdaptor_CopyPointerFunction*		ptrCopy )
{
	/* General info */
	self->type = Stg_ObjectAdaptor_Type;
	self->_sizeOfSelf = sizeof(Stg_ObjectAdaptor);
	self->_deleteSelf = False;
	
	/* Virtual info */
	self->_delete = _Stg_ObjectAdaptor_Delete;
	self->_print = _Stg_ObjectAdaptor_Print;
	self->_copy = _Stg_ObjectAdaptor_Copy;
	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, GLOBAL );

	/* Stg_ObjectAdaptor info */
	_Stg_ObjectAdaptor_Init( self, dataPtr, iOwn, isGlobal, False, ptrDelete, ptrPrint, ptrCopy );
}
コード例 #4
0
ファイル: IJK6Topology.c プロジェクト: bmi-forum/bmi-pyre
void IJK6Topology_Init(
		IJK6Topology*					self,
		Name						name,
		Dictionary*					dictionary,
		IJK						size,
		Bool						isPeriodic[3] )
{
	/* General info */
	self->type = IJK6Topology_Type;
	self->_sizeOfSelf = sizeof(IJK6Topology);
	self->_deleteSelf = False;
	self->dictionary = dictionary;
	
	/* Virtual info */
	self->_delete = _IJK6Topology_Delete;
	self->_print = _IJK6Topology_Print;
	self->_copy = _IJKTopology_Copy;
	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)IJK6Topology_DefaultNew;
	self->_construct = _IJK6Topology_Construct;
	self->_build = _IJK6Topology_Build,
	self->_initialise = _IJK6Topology_Initialise;
	self->_execute = _IJK6Topology_Execute;
	self->_destroy = _IJK6Topology_Destroy;
	self->neighbourCount = _IJK6Topology_NeighbourCount;
	self->buildNeighbours = _IJK6Topology_BuildNeighbours;

	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
	_Stg_Component_Init( (Stg_Component*)self );
	
	/* IJK6Topology info */
	_Topology_Init( (Topology*)self );
	_IJKTopology_Init( (IJKTopology*)self, size, isPeriodic, False );
	_IJK6Topology_Init( self );
}
コード例 #5
0
ファイル: MeshLayout.c プロジェクト: bmi-forum/bmi-pyre
void MeshLayout_Init(
		MeshLayout*					self,
		Name						name,
		ElementLayout*				elementLayout,
		NodeLayout*					nodeLayout,
		MeshDecomp*					decomp )
{
	/* General info */
	self->type = MeshLayout_Type;
	self->_sizeOfSelf = sizeof(MeshLayout);
	self->_deleteSelf = False;
	
	/* Virtual info */
	self->_delete = _MeshLayout_Delete;
	self->_print = _MeshLayout_Print;
	self->_copy = _MeshLayout_Copy;
	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)MeshLayout_DefaultNew;
	self->_construct = _MeshLayout_Construct;
	self->_build = _MeshLayout_Build;
	self->_initialise = _MeshLayout_Initialise;
	self->_execute = _MeshLayout_Execute;
	self->_destroy = _MeshLayout_Destroy;
	
	/* MeshLayout info */

	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
	_Stg_Component_Init( (Stg_Component*)self );
	_MeshLayout_Init( self, elementLayout, nodeLayout, decomp );
}
コード例 #6
0
ファイル: ParallelDelaunay.c プロジェクト: bmi-forum/bmi-pyre
	/** Initialise a ParallelDelaunay */
void ParallelDelaunay_Init(
	ParallelDelaunay*					self,
	Name						name,
	Dictionary*					dictionary,
	CoordF						*sites,
	int							numSites,
	int							rank,
	int							numProcs,
	MPI_Comm					*comm,
	DelaunayAttributes			*attr )
{
	self->type = ParallelDelaunay_Type;
	self->_sizeOfSelf = sizeof( ParallelDelaunay );
	self->_deleteSelf = False;
	self->dictionary = dictionary;

	self->_delete = _ParallelDelaunay_Delete;
	self->_print = _ParallelDelaunay_Print;
	self->_copy = _ParallelDelaunay_Copy;
	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)ParallelDelaunay_DefaultNew;
	self->_construct = _ParallelDelaunay_Construct;
	self->_build = _ParallelDelaunay_Build;
	self->_initialise = _ParallelDelaunay_Initialise;
	self->_execute = _ParallelDelaunay_Execute;
	self->_destroy = _ParallelDelaunay_Destroy;

	self->attributes = Memory_Alloc_Unnamed( DelaunayAttributes );
	memcpy( self->attributes, attr, sizeof( DelaunayAttributes ) );
	self->attributes->BuildBoundingTriangle = 0;
	
	self->dictionary = dictionary;
	self->numSites = numSites;
	self->numInputSites = numSites;
	self->points = sites;
	self->leftProc = 0;
	self->rightProc = 0;
	self->haloSites[0] = NULL;
	self->haloSites[1] = NULL;
	self->localTriangulation = NULL;
	self->rank = rank;
	self->numProcs = numProcs;
	self->comm = comm;
	
	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
	_Stg_Component_Init( (Stg_Component*)self );
	_ParallelDelaunay_Init( self );
}
コード例 #7
0
ファイル: ObjectAdaptor.c プロジェクト: bmi-forum/bmi-pyre
void Stg_ObjectAdaptor_InitOfClass( Stg_ObjectAdaptor* self, void* dataPtr, Name name, Bool iOwn, Bool isGlobal ) {
	/* General info */
	self->type = Stg_ObjectAdaptor_Type;
	self->_sizeOfSelf = sizeof(Stg_ObjectAdaptor);
	self->_deleteSelf = False;
	
	/* Virtual info */
	self->_delete = _Stg_ObjectAdaptor_Delete;
	self->_print = _Stg_ObjectAdaptor_Print;
	self->_copy = _Stg_ObjectAdaptor_Copy;
	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );

	/* Stg_ObjectAdaptor info */
	_Stg_ObjectAdaptor_Init( self, dataPtr, iOwn, isGlobal, True, NULL, NULL, NULL );
}
コード例 #8
0
ファイル: JournalFile.c プロジェクト: bmi-forum/bmi-pyre
void _JournalFile_Init(
	JournalFile*			self,
	JournalFile_OpenFunction*	_open,
	JournalFile_AppendFunction*	_append,
	JournalFile_CloseFunction*	_close,
	JournalFile_FlushFunction*	_flush )
{
	_Stg_Object_Init( (Stg_Object*)self, "", NON_GLOBAL );
	
	self->_open = _open;
	self->_append = _append;
	self->_close = _close;
	self->_flush = _flush;
	
	self->fileHandle = NULL;
	self->_opened = False;
}
コード例 #9
0
ファイル: ClassHook.c プロジェクト: bmi-forum/bmi-pyre
void ClassHook_Init( void* hook, Name name, Func_Ptr funcPtr, char* addedBy, void* reference ) {
	ClassHook* self = (ClassHook*)hook;

	/* General info */
	self->type = ClassHook_Type;
	self->_sizeOfSelf = sizeof(ClassHook);
	self->_deleteSelf = False;
	
	/* Virtual info */
	self->_delete = _ClassHook_Delete;
	self->_print = _ClassHook_Print;
	self->_copy = _ClassHook_Copy;
	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
	
	_ClassHook_Init( self, funcPtr, addedBy, reference );
}
コード例 #10
0
/** Initialise an existing entry point. See EntryPoint_New() for argument descriptions. */
void EntryPoint_Init( void* entryPoint, const Name name, unsigned int castType ) {
   EntryPoint* self = (EntryPoint*)entryPoint;

   /* General info */
   self->type = EntryPoint_Type;
   self->_sizeOfSelf = sizeof(EntryPoint);
   self->_deleteSelf = False;
   
   /* Virtual info */
   self->_delete = _EntryPoint_Delete;
   self->_print = _EntryPoint_Print;
   self->_copy = _EntryPoint_Copy;
   self->_getRun = _EntryPoint_GetRun;
   _Stg_Class_Init( (Stg_Class*)self );
   _Stg_Object_Init( (Stg_Object*)self, (Name) name, GLOBAL );
   
   /* EntryPoint info */
   _EntryPoint_Init( self, castType );
}
コード例 #11
0
ファイル: FrictionVC.c プロジェクト: bmi-forum/bmi-pyre
void FrictionVC_Init(
		FrictionVC*						self,
		Name						name,
		Name						_dictionaryEntryName, 
		Variable_Register*				variable_Register, 
		ConditionFunction_Register*			conFunc_Register, 
		Dictionary*					dictionary,
		void*						_mesh )
{
	/* General info */
	self->type = FrictionVC_Type;
	self->_sizeOfSelf = sizeof(FrictionVC);
	self->_deleteSelf = False;
	
	/* Virtual info */
	self->_delete = _FrictionVC_Delete;
	self->_print = _FrictionVC_Print;
	self->_copy = _FrictionVC_Copy;
	self->_defaultConstructor = (Stg_Component_DefaultConstructorFunction*)FrictionVC_DefaultNew;
	self->_construct = _FrictionVC_Construct;
	self->_build = _FrictionVC_Build;
	self->_initialise = _VariableCondition_Initialise;
	self->_execute = _VariableCondition_Execute;
	self->_destroy = _VariableCondition_Destroy;
	self->_buildSelf = _FrictionVC_BuildSelf;
	self->_printConcise = _FrictionVC_PrintConcise;
	self->_readDictionary = _FrictionVC_ReadDictionary;
	self->_getSet = _FrictionVC_GetSet;
	self->_getVariableCount = _FrictionVC_GetVariableCount;
	self->_getVariableIndex = _FrictionVC_GetVariableIndex;
	self->_getValueIndex = _FrictionVC_GetValueIndex;
	self->_getValueCount = _FrictionVC_GetValueCount;
	self->_getValue = _FrictionVC_GetValue;
	
	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
	_Stg_Component_Init( (Stg_Component*)self );
	_VariableCondition_Init( (VariableCondition*)self, variable_Register, conFunc_Register, dictionary );
	
	/* Stg_Class info */
	_FrictionVC_Init( self, _dictionaryEntryName, _mesh );
}
コード例 #12
0
void FeEntryPoint_Init( void* feEntryPoint, Name name, unsigned int castType ) {
	FeEntryPoint* self = (FeEntryPoint*)feEntryPoint;
	
	/* General info */
	self->type = FeEntryPoint_Type;
	self->_sizeOfSelf = sizeof(FeEntryPoint);
	self->_deleteSelf = False;
	
	/* Virtual info */
	self->_delete = _EntryPoint_Delete;
	self->_print = _EntryPoint_Print;
	self->_copy = _EntryPoint_Copy;
	self->_getRun = _FeEntryPoint_GetRun;
	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, GLOBAL );
	_EntryPoint_Init( (EntryPoint*)self, castType );
	
	/* FeEntryPoint info */
	_FeEntryPoint_Init( self );
}
コード例 #13
0
void _File_Init(
	File*			self,
	File_ReadFunction*	_read,
	File_WriteFunction*	_write,
	File_AppendFunction*	_append,
	File_CloseFunction*	_close,
	File_FlushFunction*	_flush )
{
	_Stg_Object_Init( (Stg_Object*)self, "", NON_GLOBAL );
	
	self->_read = _read;
	self->_write = _write;
	self->_append = _append;
	self->_close = _close;
	self->_flush = _flush;
	self->_lastOpenedAs = 0;
	
	self->fileHandle = NULL;
	self->_opened = False;
}
コード例 #14
0
void ContextEntryPoint_Init( void* contextEntryPoint, Name name, unsigned int castType ) {
	ContextEntryPoint* self = (ContextEntryPoint*)contextEntryPoint;
	
	/* General info */
	self->type = ContextEntryPoint_Type;
	self->_sizeOfSelf = sizeof(ContextEntryPoint);
	self->_deleteSelf = False;
	
	/* Virtual info */
	self->_delete = _EntryPoint_Delete;
	self->_print = _EntryPoint_Print;
	self->_copy = NULL;
	self->_getRun = _ContextEntryPoint_GetRun;
	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, GLOBAL );
	_EntryPoint_Init( (EntryPoint*)self, castType );
	
	/* ContextEntryPoint info */
	_ContextEntryPoint_Init( self );
}
コード例 #15
0
ファイル: SetVC.c プロジェクト: bmi-forum/bmi-pyre
void SetVC_Init(
		SetVC*						self,
		Name						name,
		Name						_dictionaryEntryName, 
		Variable_Register*				variable_Register, 
		ConditionFunction_Register*			conFunc_Register,
		Dictionary*					dictionary )
{
	/* General info */
	self->type = SetVC_Type;
	self->_sizeOfSelf = sizeof(SetVC);
	self->_deleteSelf = False;
	
	/* Virtual info */
	self->_delete = _SetVC_Delete;
	self->_print = _SetVC_Print;
	self->_copy = _SetVC_Copy;
	self->_build = _VariableCondition_Build;
	self->_initialise = _VariableCondition_Initialise;
	self->_execute = _VariableCondition_Execute;
	self->_buildSelf = NULL;
	self->_printConcise = _SetVC_PrintConcise;
	self->_readDictionary = _SetVC_ReadDictionary;
	self->_getSet = _SetVC_GetSet;
	self->_getVariableCount = _SetVC_GetVariableCount;
	self->_getVariableIndex = _SetVC_GetVariableIndex;
	self->_getValueIndex = _SetVC_GetValueIndex;
	self->_getValueCount = _SetVC_GetValueCount;
	self->_getValue = _SetVC_GetValue;
	
	_Stg_Class_Init( (Stg_Class*)self );
	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );
	_Stg_Component_Init( (Stg_Component*)self );
	_VariableCondition_Init( (VariableCondition*)self, variable_Register, conFunc_Register, dictionary );
	
	
	/* Stg_Class info */
	_SetVC_Init( self,  _dictionaryEntryName );
}
コード例 #16
0
void _ExtensionInfo_Init( ExtensionInfo* self, Name name, SizeT size, Index count ) {
	/* General and Virtual info should already be set */
	
	/* ExtensionInfo info */

	_Stg_Object_Init( (Stg_Object*)self, name, NON_GLOBAL );

	self->key = name;
	
	self->originalSize = size * count;
	self->size = ExtensionManager_Align( self->originalSize );
	self->isRegistered = False;
	self->itemSize = size;
	self->count = count;
	
	/* These are set via ExtensionInfo_Register (ie. after it is added to the ExtensionManager */
	self->offset = 0;
	self->extensionManager = NULL;
	self->handle = -1;

	self->data = NULL;
}