Exemplo n.º 1
0
void _lucViewport_Print( void* viewport, Stream* stream )
{
   lucViewport*          self        = viewport;

   Journal_Printf( stream, "lucViewport: %s\n", self->name );

   Stream_Indent( stream );

   /* Print Parent */
   _Stg_Component_Print( self, stream );

   lucDrawingObject_Register_PrintAllObjects( self->drawingObject_Register, stream );

   Stg_Class_Print( self->camera, stream );

   Journal_PrintValue( stream, self->margin );
   Journal_PrintValue( stream, self->nearClipPlane );
   Journal_PrintValue( stream, self->farClipPlane );

   Journal_PrintString( stream, self->title );
   Journal_PrintBool( stream, self->timestep );
   Journal_PrintBool( stream, self->disabled );

   Stream_UnIndent( stream );
}
void _EntryPoint_Register_Print( void* entryPoint_Register, Stream* stream ) {
	EntryPoint_Register* self = (EntryPoint_Register*)entryPoint_Register;
	#ifdef DEBUG
		EntryPoint_Index entryPoint_I;
	#endif
	
	/* General info */
	Journal_Printf( (void*) stream, "EntryPoint_Register (ptr): %p\n", self );
	
	/* Print parent */
	_Stg_Class_Print( self, stream );
	
	/* Virtual info */
	
	/* EntryPoint_Register info */
	Journal_Printf( (void*) stream, "\tcount: %u\n", self->count );
	Journal_Printf( (void*) stream, "\t_size: %lu\n", self->_size );
	Journal_Printf( (void*) stream, "\t_delta: %lu\n", self->_delta );
	
	Journal_Printf( (void*) stream, "\tentryPoint (ptr): %p\n", self->entryPoint );
	Journal_Printf( (void*) stream, "\tentryPoint[0-%u]:\n", self->count );
	#ifdef DEBUG
		for( entryPoint_I = 0; entryPoint_I < self->count; entryPoint_I++ ) {
			Journal_Printf( (void*) stream, "entryPoint[%u]: ", entryPoint_I );
			Stg_Class_Print( self->entryPoint[entryPoint_I], stream);
		}
	#else
		Journal_Printf( (void*) stream, "...\n" );
	#endif
	Journal_Printf( (void*) stream, "\t]\n" );
}
void _Variable_Register_Print(void* variable_Register, Stream* stream)
{
	Variable_Register*	self = (Variable_Register*)variable_Register;
	
	/* Set the Journal for printing informations */
	Stream* variable_RegisterStream = Journal_Register( InfoStream_Type,	"Variable_RegisterStream");
	
	/* General info */
	Journal_Printf( variable_RegisterStream, "Variable_Register (ptr): %p\n", self);
	
	/* Virtual info */
	
	/* Stg_Class info */
	Journal_Printf( variable_RegisterStream, "\tcount: %u\n", self->count);
	Journal_Printf( variable_RegisterStream, "\t_size: %lu\n", self->_size);
	Journal_Printf( variable_RegisterStream, "\t_delta: %lu\n", self->_delta);
	Journal_Printf( variable_RegisterStream, "\t_variable (ptr): %p\n", self->_variable);
	if (self->_variable)
	{
		Variable_Index	var_I;
		
		for (var_I = 0; var_I < self->count; var_I++)
			Stg_Class_Print(self->_variable[var_I], stream);
	}
	
	/* Print parent */
	_Stg_Class_Print(self, variable_RegisterStream);
}
Exemplo n.º 4
0
void _EntryPoint_Print( void* entryPoint, Stream* stream ) {
   EntryPoint* self = (EntryPoint*)entryPoint;

   #if DEBUG
      assert( self );
      assert( stream );
   #endif   
   
   /* General info */
   Journal_Printf( (void*) stream, "EntryPoint (ptr) (%p):\n", self );
   
   /* Virtual info */
   Journal_Printf( (void*) stream, "\t_getRun (ptr): %p\n", self->_getRun );
   
   /* EntryPoint info */
   Journal_Printf( (void*) stream, "\tname: %s\n", self->name );
   Journal_Printf( (void*) stream, "\tcastType: %u\n", self->castType );
   Journal_Printf( (void*) stream, "\trun (ptr): %p\n", self->run );
   Journal_Printf( (void*) stream, "\thooks: \n" );
   Stg_Class_Print( self->hooks, stream );
   Journal_Printf( (void*) stream, "\n" );
   
   /* Print parent */
   _Stg_Class_Print( self, stream );
}
Exemplo n.º 5
0
void _Stokes_SLE_Print( void* sle, Stream* stream ) {
	Stokes_SLE* self = (Stokes_SLE*)sle;
	/* Set the Journal for printing informations */

	/* General info */
	Journal_Printf( stream, "Stokes_SLE (ptr): %p\n", self );
	_SystemLinearEquations_Print( self, stream );

	Journal_Printf( stream, "Name of discrete stress tensor (K) matrix = \"%s\" \n",self->kStiffMat->name );
	Journal_Printf( stream, "Name of discrete gradient (G) matrix = \"%s\" \n",self->gStiffMat->name );
	if (self->dStiffMat) {
		Journal_Printf( stream, "Name of discrete divergence (D) matrix = \"%s\" \n",self->dStiffMat->name );
	}
	else {
		Journal_Printf( stream, "No discrete divergence (D) matrix set up (Symmetric geometry).\n" );
	}
	if (self->cStiffMat) {
		Journal_Printf( stream, "Name of compressibility (C) matrix = \"%s\" \n",self->cStiffMat->name );
	}
	else {
		Journal_Printf( stream, "No compressibility (C) matrix set up (incompressible fluids)\n" );
	}
	Journal_Printf( stream, "Name of velocity (u) vector = \"%s\" \n",self->uSolnVec->name );
	Journal_Printf( stream, "Name of pressure (p) vector = \"%s\" \n",self->pSolnVec->name );

	Stg_Class_Print( self->solver, stream );
}
Exemplo n.º 6
0
void _Stg_ObjectAdaptor_Print( void* objectAdaptor, struct Stream* stream ) {
	Stg_ObjectAdaptor*	self = (Stg_ObjectAdaptor*)objectAdaptor;
	
	/* General info */
	Journal_Printf( stream, "Stg_ObjectAdaptor (ptr): %p\n", self );
	Stream_Indent( stream );
	
	_Stg_Object_Print( self, stream );
	
	Journal_Printf( stream, "iOwn: %s\n", self->iOwn ? "Yes" : "No" );
	Journal_Printf( stream, "isGlobal: %s\n", self->isGlobal ? "Yes" : "No" );
	Journal_Printf( stream, "isStgClass: %s\n", self->isStgClass ? "Yes" : "No" );
	
	if( self->isStgClass ) {
		Stg_Class_Print( self->dataPtr, stream );
	}
	else {
		if( self->ptrPrint ) {
			self->ptrPrint( self->dataPtr, stream );
		}
		else {
			Journal_Printf( stream, "Don't know how to print the pointer (it is not to a StGermain class)\n" );
		}
	}
	
	Stream_UnIndent( stream );
}
void _OneToOneMapper_Print( void* mapper, Stream* stream ) {
	OneToOneMapper* self = (OneToOneMapper*)mapper;
	
	_IntegrationPointMapper_Print( self, stream );
	Stream_Indent( stream );
	Stg_Class_Print( self->materialSwarm, stream );
	Stream_UnIndent( stream );
}
void Stg_ObjectList_PrintAllObjects( void* objectList, void* _stream ) {
   Stg_ObjectList* self = (Stg_ObjectList*) objectList;
   Stream*         stream = (Stream*)_stream;
   Index           objectIndex = 0;
   
   for ( objectIndex = 0; objectIndex < self->count; objectIndex++ ) {
      Stg_Class_Print( self->data[ objectIndex ], stream );
   }
}
Exemplo n.º 9
0
void _DomainContext_Print( void* context, Stream* stream ) {
   DomainContext* self = (DomainContext*)context;
   
   /* General info */
   Journal_Printf( (void*) stream, "DomainContext (ptr): %p\n", self );
   
   /* Print parent */
   _AbstractContext_Print( self, stream );

   Journal_Printf( (void*) stream, "\tfieldVariables (ptr): %p\n", self->fieldVariable_Register );
   Stg_Class_Print( self->fieldVariable_Register, stream );
}
Exemplo n.º 10
0
void _Energy_SLE_Print( void* sle, Stream* stream ) {
	Energy_SLE* self = (Energy_SLE*)sle;
	
	/* General info */
	Journal_Printf( stream, "Energy_SLE (ptr): %p\n", self );
	_SystemLinearEquations_Print( self, stream );

	Journal_PrintString( stream, self->stiffMat->name );
	Journal_PrintString( stream, self->solutionVec->name );
	Journal_PrintString( stream, self->fVector->name );

	Stg_Class_Print( self->solver, stream );
}
void _LiveComponentRegister_Print( void* liveComponentRegister, Stream* stream ) {
   LiveComponentRegister *self = (LiveComponentRegister *) liveComponentRegister;
   
   assert( self );
   
   /* General info */
   Journal_Printf( (void*)stream, "LiveComponentRegister (ptr): %p\n", self );
   
   /* Print parent class */
   _Stg_Class_Print( self, stream );
   
   Journal_Printf( (void*)stream, "componentList (ptr): %p\n", self->componentList );
   Stg_Class_Print( self->componentList, stream );
}
Exemplo n.º 12
0
void _Stg_ComponentFactory_Print( void* cf, Stream* stream )
{
   Stg_ComponentFactory *self = (Stg_ComponentFactory*) cf;

   assert( self );
   
   /* General info */
   Journal_Printf( (void*) stream, "Stg_ComponentFactory (ptr): %p\n", self );
   
   /* Print parent class */
   _Stg_Class_Print( self, stream );
   
   Journal_Printf( (void*) stream, "LiveComponentRegister (ptr): %p\n", self->LCRegister );
   Stg_Class_Print( self->LCRegister, stream );
}
void _NamedObject_Register_Print( void* namedObjectRegister, struct Stream* stream ) {
   NamedObject_Register* self = (NamedObject_Register*)namedObjectRegister;

   /* General info */
   Journal_Printf( stream, "NamedObject_Register (ptr): %p\n", self);
   Stream_Indent( stream );
   
   /* Use parent print */
   _Stg_Class_Print( self, stream );
   
   /* Print the list of registered objects */
   Stg_Class_Print( self->objects, stream );   
   
   Stream_UnIndent( stream );
}
Exemplo n.º 14
0
PyObject* Context_Python_Print( PyObject* self, PyObject* args ) {
	PyObject*	pyContext;
	Context*	context;
	Stream* stream = Journal_Register (Info_Type, "myString");
	
	/* Obtain arguements */
	if( !PyArg_ParseTuple( args, "O:", &pyContext ) ) {
		return NULL;
	}
	context = (Context*)( PyCObject_AsVoidPtr( pyContext ) );
	
	/* Run function */
	Stg_Class_Print( context, stream );
	
	/* Return */
	Py_INCREF( Py_None );
	return Py_None;
}
Exemplo n.º 15
0
void _TimeIntegrator_Print( void* timeIntegrator, Stream* stream ) {
	TimeIntegrator* self = (TimeIntegrator*)timeIntegrator;

	/* General info */
	Journal_DPrintf( self->debug, "TimeIntegrator - '%s'\n", self->name );
	Journal_PrintPointer( stream, self );
	Stream_Indent( stream );
	
	/* Print parent */
	_Stg_Component_Print( self, stream );
	
	/* Virtual info */

	/* Regular Info */
	Stg_Class_Print( self->integrandRegister, stream );
	
	Stream_UnIndent( stream );
}
Exemplo n.º 16
0
PyObject* Dictionary_Python_Print( PyObject* self, PyObject* args) {
	PyObject*	pyDictionary;
	Dictionary*	dictionary;
	Stream*		stream = Journal_Register (Info_Type, "myStream");
	
	/* Obtain arguements */
	if( !PyArg_ParseTuple( args, "O:", &pyDictionary ) ) {
		return NULL;
	}
	dictionary = (Dictionary*)( PyCObject_AsVoidPtr( pyDictionary ) );
	
	/* Run function */
	Stg_Class_Print( dictionary, stream );
	
	/* Return */
	Py_INCREF( Py_None );
	return Py_None;
}
void _SolutionVector_Print( void* solutionVector, Stream* stream ) {
	SolutionVector* self = (SolutionVector*)solutionVector;
	
	/* Set the Journal for printing informations */
	Stream* solutionVectorStream = stream;
	
	/* General info */
	Journal_Printf( solutionVectorStream, "SolutionVector (ptr): %p\n", self );
	
	/* Print parent */
	_Stg_Component_Print( self, solutionVectorStream );
	
	/* Virtual info */
	
	/* SolutionVector info */

	Stg_Class_Print( self->feVariable, solutionVectorStream );
	Journal_Printf( solutionVectorStream, "\tComm: %u\n", self->comm );
}
Exemplo n.º 18
0
int main( int argc, char *argv[] ) {
	int		rank;
	int		procCount;
	int		procToWatch;
	Stream*		stream;
	
	/* Initialise MPI, get world info */
	MPI_Init( &argc, &argv );
	MPI_Comm_size( MPI_COMM_WORLD, &procCount );
	MPI_Comm_rank( MPI_COMM_WORLD, &rank );
	
	BaseFoundation_Init( &argc, &argv );

	RegressionTest_Init( "Base/Automation/Stg_Component" );
	
	BaseIO_Init( &argc, &argv );
	BaseContainer_Init( &argc, &argv );
	BaseAutomation_Init( &argc, &argv );

	stream = Journal_Register( Info_Type, __FILE__ );
	
	if( argc >= 2 ) {
		procToWatch = atoi( argv[1] );
	}
	else {
		procToWatch = 0;
	}
	if( rank == procToWatch ) {
		Stg_ComponentMeta* metaTest;

		XML_IO_Handler* io;
		Dictionary* allDict;
		Dictionary* compDict;

		CompositeVC* vc;
		
		Journal_Printf( stream, "%s\n", Stg_Component_GetMetadata() );

		metaTest = Stg_Component_CreateMeta( "blah", Variable_Type );
		Stg_Class_Print( metaTest, stream );
		Stg_Class_Delete( metaTest );

		allDict = Dictionary_New();
		io = XML_IO_Handler_New();
		IO_Handler_ReadAllFromFile( io, "data/metatest.xml", allDict );
		compDict = Dictionary_GetDictionary( allDict, "components" );
		vc = CompositeVC_DefaultNew( "vc" );	
		
		metaTest = Stg_Component_Validate( vc, CompositeVC_Type, compDict );
		Stg_Class_Print( metaTest, stream );
		Stg_Class_Delete( metaTest );

		Stg_Class_Delete( io );
		Stg_Class_Delete( compDict );
	}

	
	BaseAutomation_Finalise();
	BaseContainer_Finalise();
	BaseIO_Finalise();

	RegressionTest_Finalise();
	
	BaseFoundation_Finalise();

	
	/* Close off MPI */
	MPI_Finalize();
	
	return 0; /* success */
}
Exemplo n.º 19
0
int main( int argc, char* argv[] ) {
	MPI_Comm			CommWorld;
	int				rank;
	int				numProcessors;
	int				procToWatch;
	int **keys;
	
	MaxHeap *heap;
	int i = 0;
	Stream *myStream = NULL;
	
	/* Initialise MPI, get world info */
	MPI_Init( &argc, &argv );
	MPI_Comm_dup( MPI_COMM_WORLD, &CommWorld );
	MPI_Comm_size( CommWorld, &numProcessors );
	MPI_Comm_rank( CommWorld, &rank );

	BaseFoundation_Init( &argc, &argv );
	BaseIO_Init( &argc, &argv );
	BaseContainer_Init( &argc, &argv );

	if( argc >= 2 ) {
		procToWatch = atoi( argv[1] );
	}
	else {
		procToWatch = 0;
	}
	
	if( rank == procToWatch ) {
		
		myStream = Journal_Register( InfoStream_Type, "LinkedListStream" );
		data = Memory_Alloc_Array_Unnamed( int, NUM_DATA );
		keys = Memory_Alloc_Array_Unnamed( int*, NUM_INITIAL_DATA );
		
		Journal_Printf( myStream, "\nCreating the Heap\n" );
		for(i=0; i<NUM_INITIAL_DATA; i++){
			data[i] = i;
			keys[i] = &(data[i]);
		}
		
		heap = MaxHeap_New(
					(void**)(keys), sizeof(int),
					NUM_INITIAL_DATA,
					keySwap,
					compareFunction,
					extendArray );

		Journal_Printf( myStream, "\nPrinting the Heap\n" );
		Stg_Class_Print( heap, myStream );
		
		Journal_Printf( myStream, "\nInserting more entries into the Heap\n" );
		for( i=50; i<NUM_DATA; i++ ){
			data[i] = i;
			MaxHeap_Insert( heap, &(data[i]) );
		}
		
		Journal_Printf( myStream, "\nPrinting the Heap\n" );
		Stg_Class_Print( heap, myStream );
		
		Journal_Printf( myStream, "\nExtracting all the entries in the Heap\n" );
		for( i=0; i<NUM_DATA; i++ ){
			printf( "Heap Max %d\n", *(int*)MaxHeap_Extract( (_Heap*)heap ) );
		}
		
		Journal_Printf( myStream, "\nPrinting the Heap\n" );
		Stg_Class_Print( heap, myStream );
	
		Journal_Printf( myStream, "\nDeleting the Heap\n" );
		Stg_Class_Delete( (void*)heap );
		
		Memory_Free( data );
	}