void _ThermalBuoyancyForceTerm_Print( void* forceTerm, Stream* stream ) { ThermalBuoyancyForceTerm* self = (ThermalBuoyancyForceTerm*)forceTerm; _ForceTerm_Print( self, stream ); /* General info */ Journal_PrintPointer( stream, self->temperatureField ); Journal_PrintDouble( stream, self->rayleighNumber ); }
int main( int argc, char* argv[] ) { MPI_Comm CommWorld; int rank; int numProcessors; int procToWatch; EntryPoint* entryPoint; Stream* stream; double result; /* 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 ); BaseAutomation_Init( &argc, &argv ); BaseExtensibility_Init( &argc, &argv ); if( argc >= 2 ) { procToWatch = atoi( argv[1] ); } else { procToWatch = 0; } /* creating a stream */ stream = Journal_Register( InfoStream_Type, "myStream" ); Stream_SetPrintingRank( stream, procToWatch ); Journal_Printf( stream, "Watching rank: %i\n", rank ); /* Get Maximum of Values */ entryPoint = EntryPoint_New( testEpName, EntryPoint_Maximum_VoidPtr_CastType ); EP_Append( entryPoint, Return1 ); EP_Append( entryPoint, Return89 ); EP_Append( entryPoint, ReturnNeg43 ); EP_Append( entryPoint, ReturnZero ); result = ((EntryPoint_Maximum_VoidPtr_CallCast*) entryPoint->run)( entryPoint, stream ); Journal_PrintDouble( stream, result ); Stg_Class_Delete( entryPoint ); /* Get Minimum of Values */ entryPoint = EntryPoint_New( testEpName, EntryPoint_Minimum_VoidPtr_CastType ); EP_Append( entryPoint, Return1 ); EP_Append( entryPoint, Return89 ); EP_Append( entryPoint, ReturnNeg43 ); EP_Append( entryPoint, ReturnZero ); result = ((EntryPoint_Minimum_VoidPtr_CallCast*) entryPoint->run)( entryPoint, stream ); Journal_PrintDouble( stream, result ); Stg_Class_Delete( entryPoint ); BaseExtensibility_Finalise(); BaseAutomation_Finalise(); BaseContainer_Finalise(); BaseIO_Finalise(); BaseFoundation_Finalise(); /* Close off MPI */ MPI_Finalize(); return 0; /* success */ }