SPModel: libSPModel/src/Context.h File Reference
VPAC - Computational Software Development
Main | SPModel | StGermain FrameWork |
Main Page | Alphabetical List | Class List | Directories | File List | Class Members | File Members

Context.h File Reference

Role: Class faciliting how the Surface Process Model control is organised, and for holding the top-level objects needed by the application. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SPModel_Context
struct  SPModelSimulationContextExtension_t

Defines

#define __SPModel_Context

Typedefs

typedef enum MemoryFlag_t MemoryFlag
typedef enum FileFormat_t FileFormat
typedef SPModelSimulationContextExtension_t SPModelSimulationContextExtension

Enumerations

enum  MemoryFlag_t { GLOBAL_EXTENSION, LOCAL_EXTENSION }
enum  FileFormat_t { TEXT, BINARY }

Functions

SPModel_ContextSPModel_Context_DefaultNew (Name name)
SPModel_ContextSPModel_Context_New (Name name, double start, double stop, MPI_Comm communicator, Dictionary *dictionary)
SPModel_Context_SPModel_Context_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, Name name, Bool initFlag, AbstractContext_SetDt *_setDt, double start, double stop, MPI_Comm communicator, Dictionary *dictionary)
void _SPModel_Context_Init (SPModel_Context *self)
void _SPModel_Context_Delete (void *context)
void _SPModel_Context_Print (void *context, Stream *stream)
void _SPModel_Context_Build (void *context)
void _SPModel_Context_InitialConditions (void *context)
double _SPModel_Context_Dt (void *context)
void _SPModel_Context_SetDt (void *context, double dt)
void _SPModel_Context_BoundaryConditions (void *context)
void SPModel_Context_TimeStepZero (void *context)
void _SPModel_Context_Solve (void *context)
void _SPModel_Context_Sync (void *context)
void DumpLoopInfo (void *context)
void DumpCoord (SPModel_Context *self, Node_LocalIndex node_lI)
void _SPModel_Context_InitDump (SPModel_Context *self)
void _SPModel_Context_Dump (SPModel_Context *self)
void _SPModel_Context_ComponentConstruct (void *context, Stg_ComponentFactory *cf)
void _SPModel_Context_ComponentBuild (void *context, void *data)
void _SPModel_Context_ComponentInitialise (void *context, void *data)
void _SPModel_Context_ComponentExecute (void *context, void *data)
void _SPModel_Context_ComponentDestroy (void *context, void *data)
void _SPModel_SimulationContextExtension_AllocateMemory (void *context, MemoryFlag mf)
void _SPModel_SimulationContextExtension_ReleaseMemory (void *context, MemoryFlag mf)
void _SPModel_Context_Gather (SPModel_Context *self)
void _SPModel_Context_RedistributeNodes (SPModel_Context *context)

Variables

const Type SPModel_Context_Type
const Name SPModel_EP_LoopNodesEnergy


Detailed Description

Role: Class faciliting how the Surface Process Model control is organised, and for holding the top-level objects needed by the application.

Assumptions:

Comments: Ogar's old description: Description : Implement the Catch and Hold Algorithm for Parallel SPModel Phase 1 :

Ogar's old ChangeLog: Date created : 18 June 2003 Dates updated : 26 June 2003 Store nodes in globalNodes array, created maxCatchmentList 30 June 2003 Modify assignDepth requirements and delete() function -> bugs fixed -> Phase 1 works perfectly Create a seperate function buildWaterNetwork() which contains the Phase 1 codes 01 July 2003 Modify maxCatchmentList into a linked list instead of array of Catchments (since we do not know how many they are and also easier to sort) Added assignCatchments() and successfully sorted the maxCatchmentList (descending order) 04 July 2003 Written computeHaloNodes() - tested and working fine Put numNeigh[] as global 07 July 2003 Fix the bug - processorNodes[][add], pass address of "add" instead of the value Send myLoad to each processor 11 July 2003 Broken up main.c into main.c, phase1.c, and phase2.c and same for the header files Move some contents of main.c (global variables & structs) into declaration.h, which is included in phase1.h and phase2.h too 29 July 2003 Make globalNodes[] to be global variable 30 July 2003 Starting Phase 3 : send nodes to their processors - tested successfully for one proc only 31 July 2003 Successfully sent the nodes to their processors - tested on 5 processors & received correctly Declare and initialize numHaloNodes in main() and pass it as parameter to computeHaloNodes() Sent the number of halo nodes to every processor Re-arrangements : determine and send all the processor nodes first then the halo nodes afterwards Successfully sent the Halo Nodes to each processor, and received correctly - tested on 5 procs 04 Aug 2003 Determined ForeignHaloNodes, ForeignOutflowHaloNodes, InflowHaloNodes and sent them to processors 08 Aug 2003 Create receiveNodes() separate from main() and later need to put it in a seperate file called phase3.c Put the node arrays as global variables in the declaration.h 11 Aug 2003 Written function propagateDepthChanges() - compiled but not yet tested 13 Aug 2003 Added the XML input variables 14 Aug 2003 Sorted myNodes by depth Added surface and boundary variables to node structure 15 Aug 2003 Added h0 and hi arrays Send data from other processors to processor 0 to determine the timestep (ensure a single value of dt for all procs) 19 Aug 2003 Call fluvial_erosion() - working with single or multiple processors now (tested on single time step) Need extra handling when the receiver node is on other processor (not just update myHaloNodes, but also myNodes of the OTHER processor) 20 Aug 2003 fluvial_erosion() is working fine, but there might be a problem if processors are waiting for each other Create a file phase3.c and its header phase3.h which contains receiveNodes(), fluvial_erosions(), and propagateDepthChanges() 26 Aug 2003 Added slope, length, and nlake into node structure 28 Aug 2003 Written codes to update bedrock and update time step 02 Sept 2003 Written updateFlows() and put it in phase3.c 04 Sept 2003 Update the state of HaloNodes and send them across processors Proc 0 sends delta to all other processors 05 Sept 2003 When sending HaloNodes, send only the necessary data as required (may need to change later) 08 Sept 2003 Need to re-order MyNodes[] by depth in every iteration (since the node depths may change due to changes in receiver/providers) Need to define the global to local mapping array in each iteration since the order of nodes in MyNodes may change after re-ordering 09 Sept 2003 Declare iadapt, sidex, sidey here instead of inside buildWaterNetwork(), then pass them as parameters to it 11 Sept 2003 I found out that we need to include Node.receiver in the HaloNodes, foreignHaloNodes, foreignOutflowHaloNodes, and inflowHaloNodes

Id
Context.h 285 2006-03-20 07:26:25Z RaquibulHassan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Definition in file Context.h.


Define Documentation

#define __SPModel_Context
 

Definition at line 110 of file Context.h.


Typedef Documentation

typedef enum FileFormat_t FileFormat
 

typedef enum MemoryFlag_t MemoryFlag
 

typedef struct SPModelSimulationContextExtension_t SPModelSimulationContextExtension
 


Enumeration Type Documentation

enum FileFormat_t
 

Enumerator:
TEXT 
BINARY 

Definition at line 98 of file Context.h.

enum MemoryFlag_t
 

Enumerator:
GLOBAL_EXTENSION 
LOCAL_EXTENSION 

Definition at line 93 of file Context.h.


Function Documentation

void _SPModel_Context_BoundaryConditions void *  context  ) 
 

Definition at line 426 of file Context.c.

References SPModel_Context::localMesh, and SurfaceMesh_BoundaryConditions().

Referenced by _SPModel_Context_Init().

void _SPModel_Context_Build void *  context  ) 
 

Definition at line 356 of file Context.c.

References _SPModel_SimulationContextExtension_AllocateMemory(), GLOBAL_EXTENSION, and MASTER_PROC.

Referenced by _SPModel_Context_Init().

void _SPModel_Context_ComponentBuild void *  context,
void *  data
 

Definition at line 723 of file Context.c.

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

void _SPModel_Context_ComponentConstruct void *  context,
Stg_ComponentFactory *  cf
 

Definition at line 719 of file Context.c.

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

void _SPModel_Context_ComponentDestroy void *  context,
void *  data
 

Definition at line 735 of file Context.c.

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

void _SPModel_Context_ComponentExecute void *  context,
void *  data
 

Definition at line 731 of file Context.c.

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

void _SPModel_Context_ComponentInitialise void *  context,
void *  data
 

Definition at line 727 of file Context.c.

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

void _SPModel_Context_Delete void *  context  ) 
 

Definition at line 238 of file Context.c.

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

double _SPModel_Context_Dt void *  context  ) 
 

Definition at line 409 of file Context.c.

Referenced by _SPModel_Context_Init().

void _SPModel_Context_Dump SPModel_Context self  ) 
 

Definition at line 593 of file Context.c.

References _SPModel_Context_Gather(), BINARY, SurfaceMesh::boundaryConditions, SurfaceMesh::h, SurfaceMesh::id, MASTER_PROC, SurfaceMesh::numNodes, SurfaceMesh::receiver, TEXT, SurfaceMesh::x, and SurfaceMesh::y.

Referenced by _SPModel_Context_Init().

void _SPModel_Context_Gather SPModel_Context self  ) 
 

Definition at line 482 of file Context.c.

References globalMesh, SurfaceMesh::h, SurfaceMesh::id, localMesh, MASTER_PROC, SPModel_Context::meshDecomp, SurfaceMesh::myLoad, PACKAGE_TAG, _SurfaceMeshDecomp::processorLoad, and SurfaceMesh::receiver.

Referenced by _SPModel_Context_Dump(), _SPModel_Context_RedistributeNodes(), and SPModelFlowHierarchyViewer_UpdateView().

void _SPModel_Context_Init SPModel_Context self  ) 
 

Definition at line 119 of file Context.c.

References _SPModel_Context_BoundaryConditions(), _SPModel_Context_Build(), _SPModel_Context_Dt(), _SPModel_Context_Dump(), _SPModel_Context_InitialConditions(), _SPModel_Context_Solve(), _SPModel_Context_Sync(), BINARY, SPModel_Context::catchmentList, CatchmentList_New(), SPModel_Context::globalMesh, LinearInterpolator_New(), SPModel_Context::localMesh, ParameterTimeSeries_New(), SPModel_Context::regularMesh, SplineInterpolator_New(), SPModel_Context_Type, SPModel_Simulation_ContextExtHandle, SurfaceMesh_New(), SurfaceMeshIrregularDecomp_New(), SurfaceMeshRectangularCyclicBC_New(), SurfaceMeshSmoother_New(), SurfaceRegularMesh_New(), and TEXT.

Referenced by _SPModel_Context_New().

void _SPModel_Context_InitDump SPModel_Context self  ) 
 

void _SPModel_Context_InitialConditions void *  context  ) 
 

Definition at line 402 of file Context.c.

Referenced by _SPModel_Context_Init().

SPModel_Context* _SPModel_Context_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,
Name  name,
Bool  initFlag,
AbstractContext_SetDt *  _setDt,
double  start,
double  stop,
MPI_Comm  communicator,
Dictionary *  dictionary
 

Definition at line 79 of file Context.c.

References _SPModel_Context_Init().

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

void _SPModel_Context_Print void *  context,
Stream *  stream
 

Definition at line 265 of file Context.c.

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

void _SPModel_Context_RedistributeNodes SPModel_Context context  ) 
 

Definition at line 538 of file Context.c.

References _SPModel_Context_Gather(), _SPModel_SimulationContextExtension_AllocateMemory(), _SPModel_SimulationContextExtension_ReleaseMemory(), SPModel_Context::catchmentList, CatchmentList_New(), SPModel_Context::globalMesh, SPModel_Context::interpolator, LinearInterpolator_New(), LOCAL_EXTENSION, SPModel_Context::localMesh, MASTER_PROC, SPModel_Context::meshDecomp, SPModel_Context::regularMesh, SPModelSimulationContextExtension_Gather(), SPModelSimulationContextExtension_Scatter(), SurfaceMesh_BuildRiverNetwork(), SurfaceMesh_ReleaseMemory(), and SurfaceMeshIrregularDecomp_New().

void _SPModel_Context_SetDt void *  context,
double  dt
 

Definition at line 417 of file Context.c.

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

void _SPModel_Context_Solve void *  context  ) 
 

Definition at line 437 of file Context.c.

References ParameterTimeSeries_Interpolate, and SurfaceMesh_OrderNodes().

Referenced by _SPModel_Context_Init().

void _SPModel_Context_Sync void *  context  ) 
 

Definition at line 464 of file Context.c.

References SurfaceMesh_UpdateFlows(), and _SurfaceMeshDecomp::syncMesh.

Referenced by _SPModel_Context_Init().

void _SPModel_SimulationContextExtension_AllocateMemory void *  context,
MemoryFlag  mf
 

Definition at line 280 of file Context.c.

References SPModelSimulationContextExtension_t::erosion, GLOBAL_EXTENSION, SPModelSimulationContextExtension_t::globalErosion, SPModelSimulationContextExtension_t::globalSedimentHistory, SPModelSimulationContextExtension_t::globalUplift, SPModelSimulationContextExtension_t::globalWater, SPModelSimulationContextExtension_t::hiso, SPModelSimulationContextExtension_t::hisoPrev, SPModelSimulationContextExtension_t::hisotot, MASTER_PROC, SPModelSimulationContextExtension_t::sediment, SPModelSimulationContextExtension_t::sedimentHistory, simulationExt, SPModel_Simulation_ContextExtHandle, SPModelSimulationContextExtension_t::uplift, and SPModelSimulationContextExtension_t::water.

Referenced by _SPModel_Context_Build(), and _SPModel_Context_RedistributeNodes().

void _SPModel_SimulationContextExtension_ReleaseMemory void *  context,
MemoryFlag  mf
 

Definition at line 328 of file Context.c.

References SPModelSimulationContextExtension_t::erosion, GLOBAL_EXTENSION, SPModelSimulationContextExtension_t::globalErosion, SPModelSimulationContextExtension_t::globalSedimentHistory, SPModelSimulationContextExtension_t::globalUplift, SPModelSimulationContextExtension_t::globalWater, SPModelSimulationContextExtension_t::hiso, SPModelSimulationContextExtension_t::hisoPrev, SPModelSimulationContextExtension_t::hisotot, MASTER_PROC, SPModelSimulationContextExtension_t::sediment, SPModelSimulationContextExtension_t::sedimentHistory, simulationExt, SPModel_Simulation_ContextExtHandle, SPModelSimulationContextExtension_t::uplift, and SPModelSimulationContextExtension_t::water.

Referenced by _SPModel_Context_RedistributeNodes().

void DumpCoord SPModel_Context self,
Node_LocalIndex  node_lI
 

void DumpLoopInfo void *  context  ) 
 

SPModel_Context* SPModel_Context_DefaultNew Name  name  ) 
 

Definition at line 55 of file Context.c.

References _SPModel_Context_ComponentBuild(), _SPModel_Context_ComponentConstruct(), _SPModel_Context_ComponentDestroy(), _SPModel_Context_ComponentExecute(), _SPModel_Context_ComponentInitialise(), _SPModel_Context_Delete(), _SPModel_Context_New(), _SPModel_Context_Print(), _SPModel_Context_SetDt(), SPModel_Context_DefaultNew(), and SPModel_Context_Type.

Referenced by SPModel_Context_DefaultNew(), and SPModel_Context_New().

SPModel_Context* SPModel_Context_New Name  name,
double  start,
double  stop,
MPI_Comm  communicator,
Dictionary *  dictionary
 

Definition at line 64 of file Context.c.

References _SPModel_Context_ComponentBuild(), _SPModel_Context_ComponentConstruct(), _SPModel_Context_ComponentDestroy(), _SPModel_Context_ComponentExecute(), _SPModel_Context_ComponentInitialise(), _SPModel_Context_Delete(), _SPModel_Context_New(), _SPModel_Context_Print(), _SPModel_Context_SetDt(), SPModel_Context_DefaultNew(), and SPModel_Context_Type.

Referenced by main().

void SPModel_Context_TimeStepZero void *  context  ) 
 


Variable Documentation

const Type SPModel_Context_Type
 

Definition at line 51 of file Context.c.

Referenced by _SPModel_Context_Init(), SPModel_Context_DefaultNew(), and SPModel_Context_New().

const Name SPModel_EP_LoopNodesEnergy