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

SurfaceMesh.h File Reference

Role: Stores and manages the catchment mesh, including the node interconnectivity, and provider/receiver relationships between catchments. More...

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

Go to the source code of this file.

Classes

struct  SurfaceMeshHaloNodes
struct  SurfaceMeshForeignHaloNodes
struct  SurfaceMesh
 class that facilitates a mesh of catchments - see SurfaceMesh.h More...
struct  providerSyncStruct_t

Defines

#define __SurfaceMeshHaloNodes
 SurfaceMesh HaloNodes.
#define __SurfaceMeshForeignHaloNodes
#define __SurfaceMesh
 SurfaceMesh contents.

Typedefs

typedef providerSyncStruct_t providerSyncStruct

Functions

SurfaceMeshSurfaceMesh_DefaultNew (Name name)
 Create a new SurfaceMesh and initialise.
SurfaceMeshSurfaceMesh_New (Name name, int numProcs, int rank, void *extension_Register, Dictionary *dictionary)
SurfaceMesh_SurfaceMesh_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, int numProcs, int rank, void *extension_Register, Dictionary *dictionary)
 Creation implementation / Virtual constructor.
void _SurfaceMesh_Init (SurfaceMesh *self)
 Initialise implementation.
void _SurfaceMesh_Delete (void *surfaceMesh)
 Stg_Class_Delete a SurfaceMesh construct.
void _SurfaceMesh_Print (void *surfaceMesh, Stream *stream)
 Print the contents of an SurfaceMesh construct.
void _SurfaceMesh_Construct (void *surfaceMesh, Stg_ComponentFactory *cf)
 Build implementation.
void _SurfaceMesh_Build (void *surfaceMesh, void *data)
void _SurfaceMesh_Initialise (void *surfaceMesh, void *data)
 Stg_Component_Initialise() implementation.
void _SurfaceMesh_Execute (void *surfaceMesh, void *data)
 Execution implementation.
void _SurfaceMesh_Destroy (void *surfaceMesh, void *data)
void SurfaceMesh_FindHaloNode (SurfaceMesh *mesh, int nodeId, int *processor, int *index)
void _SurfaceMesh_FindNeighbours (SurfaceMesh *mesh)
void SurfaceMesh_AllocateMemoryForHaloNodes (SurfaceMesh *mesh)
void SurfaceMesh_ReleaseMemory (SurfaceMesh *mesh)
void _SurfaceMesh_DetermineFlows (SurfaceMesh *mesh, float *boundaryConditions)
 Determine the receiver and providers of each node.
void _SurfaceMesh_FindDonors (SurfaceMesh *mesh)
int getSize (SurfaceMesh *mesh, int nodeId)
void _SurfaceMesh_DetermineCatchmentSizes (SurfaceMesh *mesh)
void SurfaceMesh_BuildRiverNetwork (SurfaceMesh *self)
void SurfaceMesh_UpdateFlows (SurfaceMesh *mesh)
void SurfaceMesh_OrderNodes (SurfaceMesh *mesh)
void SurfaceMesh_BoundaryConditions (SurfaceMesh *surfaceMesh)

Variables

const Type SurfaceMesh_Type
const char * MESH_TYPE_AUTOGENERATED
const char * MESH_TYPE_FROM_TEXT_INPUT
const char * MESH_TYPE_FROM_ENVI_INPUT


Detailed Description

Role: Stores and manages the catchment mesh, including the node interconnectivity, and provider/receiver relationships between catchments.

Assumptions:

Comments: Once StGermain has an irregular mesh interface implemented, this class should change to inherit from the StGermain Mesh. Until then, we can adopt the Stg_Component architecture so the changeover isn't too painful when it comes.

Ogar's old ChangeLog: Dates updated : 23 June 2003 Added insertNeighbours() 24 June 2003 Use fix[] to set ridge nodes (nodes at first and last rows in the domain landscape) 26 June 2003 Store nodes in mesh->globalNodes array, created maxCatchmentList 27 June 2033 Determine depth and size of nodes (phase 1) 30 June 2003 Modify assignDepth requirements and deleteHoldNodeFromList() -> fix bugs -> phase 1 works perfectly 29 July 2003 Change neighbourList to array of ints (node IDs) instead of array of pointers to nodes Change providers to arrays of ints (node IDs) instead of linked list of nodes Change receiver to int (node ID) instead of pointer to node 07 Aug 2003 Called the Fortran functions initialize_nodal_geometry() and find_neighbours() - works well Removed the arrays nb[] and nn[][] and the variable nnode. Instead, use mesh->numNeigh[], mesh->nodeNeighbours[][], and mesh->nodeLocalCount respectively for consistency 12 Aug 2003 Added Fortran function initialize_general_parameters() but not called Initialize the time step and erosional properties 14 Aug 2003 Enable the second choice (read input from text file) - but it's strictly dependant on input file format Assign values of surface[] to the node structure 26 Aug 2003 Added assignCatchmentNumber() - assigning the catchment number of each node Added find_catchment() to determine lake nodes, which is required in fluvial_erosion()

Id
SurfaceMesh.h 264 2006-02-16 05:37:01Z RaquibulHassan

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

Definition in file SurfaceMesh.h.


Define Documentation

#define __SurfaceMesh
 

SurfaceMesh contents.

Definition at line 85 of file SurfaceMesh.h.

#define __SurfaceMeshForeignHaloNodes
 

Value:

int                     numForeignHaloNodes; \
        int                     *foreignHaloId;

Definition at line 78 of file SurfaceMesh.h.

#define __SurfaceMeshHaloNodes
 

Value:

int                     numHaloNodes; \
        int                     *haloId; \
        float                   *x; \
        float                   *y; \
        float                   *h; \
        int                     *receiver; \
        float                   *surface;
SurfaceMesh HaloNodes.

Definition at line 68 of file SurfaceMesh.h.


Typedef Documentation

typedef struct providerSyncStruct_t providerSyncStruct
 


Function Documentation

void _SurfaceMesh_Build void *  surfaceMesh,
void *  data
 

Definition at line 294 of file SurfaceMesh.c.

References _SurfaceMesh_FindNeighbours(), MASTER_PROC, SurfaceMesh_BuildRiverNetwork(), and SurfaceMeshLoader_LoadMesh().

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().

void _SurfaceMesh_Construct void *  surfaceMesh,
Stg_ComponentFactory *  cf
 

Build implementation.

Definition at line 232 of file SurfaceMesh.c.

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().

void _SurfaceMesh_Delete void *  surfaceMesh  ) 
 

Stg_Class_Delete a SurfaceMesh construct.

Definition at line 193 of file SurfaceMesh.c.

References SurfaceMesh_ReleaseMemory().

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().

void _SurfaceMesh_Destroy void *  surfaceMesh,
void *  data
 

Definition at line 443 of file SurfaceMesh.c.

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().

void _SurfaceMesh_DetermineCatchmentSizes SurfaceMesh mesh  ) 
 

Definition at line 772 of file SurfaceMesh.c.

References getSize(), heightCompareFunc(), SurfaceMesh::id, nodePrintFunction(), SurfaceMesh::rank, and SurfaceMesh::size.

Referenced by SurfaceMesh_BuildRiverNetwork().

void _SurfaceMesh_DetermineFlows SurfaceMesh mesh,
float *  boundaryConditions
 

Determine the receiver and providers of each node.

Definition at line 646 of file SurfaceMesh.c.

References SurfaceMesh::h, heightCompareFunc(), SurfaceMesh::highestNeighbour, SurfaceMesh::id, SurfaceMesh::nodeNeighbours, nodePrintFunction(), SurfaceMesh::nodeProviders, SurfaceMesh::rank, SurfaceMesh::receiver, SurfaceMesh::size, SurfaceMesh::x, and SurfaceMesh::y.

Referenced by SurfaceMesh_BuildRiverNetwork().

void _SurfaceMesh_Execute void *  surfaceMesh,
void *  data
 

Execution implementation.

Definition at line 439 of file SurfaceMesh.c.

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().

void _SurfaceMesh_FindDonors SurfaceMesh mesh  ) 
 

Definition at line 715 of file SurfaceMesh.c.

References SurfaceMesh::h, SurfaceMesh::id, SurfaceMesh::length, SurfaceMesh::nLake, SurfaceMesh::rank, SurfaceMesh::receiver, SurfaceMesh::slope, SurfaceMesh::x, and SurfaceMesh::y.

Referenced by SurfaceMesh_BuildRiverNetwork().

void _SurfaceMesh_FindNeighbours SurfaceMesh mesh  ) 
 

Definition at line 449 of file SurfaceMesh.c.

References SurfaceMesh::elementGlobalCount, find_neighbours(), SurfaceMesh::maxNeighboursPerNode, SurfaceMesh::nodeNeighbours, SurfaceMesh::numNeigh, SurfaceMesh::numNodes, SurfaceMesh::sides, SurfaceMesh::surface, SurfaceMesh::surfScale, SurfaceMesh::vertices, SurfaceMesh::x, and SurfaceMesh::y.

Referenced by _SurfaceMesh_Build().

void _SurfaceMesh_Init SurfaceMesh self  ) 
 

Initialise implementation.

Definition at line 139 of file SurfaceMesh.c.

References SurfaceMesh::dictionary, MESH_TYPE_AUTOGENERATED, MESH_TYPE_FROM_ENVI_INPUT, MESH_TYPE_FROM_OUTPUT_FILES, MESH_TYPE_FROM_SPM_INPUT, MESH_TYPE_FROM_TEXT_INPUT, SurfaceMesh::surfaceMeshLoader, SurfaceMeshLoader_New(), and SurfaceMeshLoader_ScanMesh().

Referenced by _SurfaceMesh_New().

void _SurfaceMesh_Initialise void *  surfaceMesh,
void *  data
 

Stg_Component_Initialise() implementation.

Definition at line 342 of file SurfaceMesh.c.

References SurfaceMesh::arrayElements, SurfaceMesh::boundaryConditions, SurfaceMesh::foreignHaloNodes, SurfaceMesh::foreignProviderChanges, SurfaceMesh::h, SurfaceMesh::h0, SurfaceMesh::haloNodes, SurfaceMesh::hi, SurfaceMesh::highestNeighbour, SurfaceMesh::id, SurfaceMesh::length, SurfaceMesh::localProviderChanges, SurfaceMesh::mapGlobalToLocal, SurfaceMesh::maxNeighboursPerNode, SurfaceMesh::nCatch, SurfaceMesh::nLake, SurfaceMesh::nodeNeighbours, SurfaceMesh::nodeProviders, SurfaceMesh::nodeType, SurfaceMesh::numNeigh, SurfaceMesh::numNodes, SurfaceMesh::numProcs, SurfaceMesh::processor, providersCompareFunction(), providersDataCopyFunction(), providersDataPrintFunction(), providerSyncCompareFunction(), providerSyncDataCopyFunction(), providerSyncDataPrintFunction(), SurfaceMesh::receiver, SurfaceMesh::requestTable, SurfaceMesh::sides, SurfaceMesh::size, SurfaceMesh::slope, SurfaceMesh::sortedId, SurfaceMesh::statusTable, SurfaceMesh::surface, SurfaceMesh::vertices, SurfaceMesh::x, and SurfaceMesh::y.

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().

SurfaceMesh* _SurfaceMesh_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,
int  numProcs,
int  rank,
void *  extension_Register,
Dictionary *  dictionary
 

Creation implementation / Virtual constructor.

Definition at line 96 of file SurfaceMesh.c.

References _SurfaceMesh_Init().

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().

void _SurfaceMesh_Print void *  surfaceMesh,
Stream *  stream
 

Print the contents of an SurfaceMesh construct.

Definition at line 203 of file SurfaceMesh.c.

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().

int getSize SurfaceMesh mesh,
int  nodeId
 

Definition at line 749 of file SurfaceMesh.c.

References getSize(), SurfaceMesh::h, and SurfaceMesh::nodeProviders.

Referenced by _SurfaceMesh_DetermineCatchmentSizes(), and getSize().

void SurfaceMesh_AllocateMemoryForHaloNodes SurfaceMesh mesh  ) 
 

Definition at line 520 of file SurfaceMesh.c.

References SurfaceMeshForeignHaloNodes::foreignHaloId, SurfaceMesh::foreignHaloNodes, SurfaceMeshHaloNodes::h, SurfaceMeshHaloNodes::haloId, SurfaceMesh::haloNodes, SurfaceMeshForeignHaloNodes::numForeignHaloNodes, SurfaceMeshHaloNodes::numHaloNodes, SurfaceMesh::numProcs, SurfaceMeshHaloNodes::receiver, SurfaceMeshHaloNodes::surface, SurfaceMeshHaloNodes::x, and SurfaceMeshHaloNodes::y.

Referenced by _SurfaceMeshDecomp_Execute().

void SurfaceMesh_BoundaryConditions SurfaceMesh surfaceMesh  ) 
 

Definition at line 1032 of file SurfaceMesh.c.

Referenced by _SPModel_Context_BoundaryConditions().

void SurfaceMesh_BuildRiverNetwork SurfaceMesh self  ) 
 

Definition at line 320 of file SurfaceMesh.c.

References _SurfaceMesh_DetermineCatchmentSizes(), _SurfaceMesh_DetermineFlows(), _SurfaceMesh_FindDonors(), SurfaceMesh::boundaryConditions, and SurfaceMesh::nodeProviders.

Referenced by _SPModel_Context_RedistributeNodes(), and _SurfaceMesh_Build().

SurfaceMesh* SurfaceMesh_DefaultNew Name  name  ) 
 

Create a new SurfaceMesh and initialise.

Definition at line 47 of file SurfaceMesh.c.

References _SurfaceMesh_Build(), _SurfaceMesh_Construct(), _SurfaceMesh_Delete(), _SurfaceMesh_Destroy(), _SurfaceMesh_Execute(), _SurfaceMesh_Initialise(), _SurfaceMesh_New(), _SurfaceMesh_Print(), SurfaceMesh_DefaultNew(), and SurfaceMesh_Type.

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().

void SurfaceMesh_FindHaloNode SurfaceMesh mesh,
int  nodeId,
int *  processor,
int *  index
 

Definition at line 1012 of file SurfaceMesh.c.

References SurfaceMeshHaloNodes::haloId, SurfaceMesh::haloNodes, SurfaceMeshHaloNodes::numHaloNodes, and SurfaceMesh::numProcs.

Referenced by fluvial(), and SurfaceMesh_UpdateFlows().

SurfaceMesh* SurfaceMesh_New Name  name,
int  numProcs,
int  rank,
void *  extension_Register,
Dictionary *  dictionary
 

Definition at line 69 of file SurfaceMesh.c.

References _SurfaceMesh_Build(), _SurfaceMesh_Construct(), _SurfaceMesh_Delete(), _SurfaceMesh_Destroy(), _SurfaceMesh_Execute(), _SurfaceMesh_Initialise(), _SurfaceMesh_New(), _SurfaceMesh_Print(), SurfaceMesh_DefaultNew(), and SurfaceMesh_Type.

Referenced by _SPModel_Context_Init().

void SurfaceMesh_OrderNodes SurfaceMesh mesh  ) 
 

Definition at line 1004 of file SurfaceMesh.c.

References idCompareFunc(), SurfaceMesh::myLoad, and SurfaceMesh::sortedId.

Referenced by _SPModel_Context_Solve(), and SurfaceMesh_UpdateFlows().

void SurfaceMesh_ReleaseMemory SurfaceMesh mesh  ) 
 

Definition at line 555 of file SurfaceMesh.c.

References SurfaceMesh::arrayElements, SurfaceMesh::boundaryConditions, SurfaceMeshForeignHaloNodes::foreignHaloId, SurfaceMesh::foreignHaloNodes, SurfaceMesh::foreignProviderChanges, SurfaceMeshHaloNodes::h, SurfaceMesh::h, SurfaceMesh::h0, SurfaceMeshHaloNodes::haloId, SurfaceMesh::haloNodes, SurfaceMesh::hi, SurfaceMesh::highestNeighbour, SurfaceMesh::id, SurfaceMesh::length, SurfaceMesh::localProviderChanges, SurfaceMesh::mapGlobalToLocal, SurfaceMesh::nCatch, SurfaceMesh::nLake, SurfaceMesh::nodeNeighbours, SurfaceMesh::nodeProviders, SurfaceMesh::nodeType, SurfaceMesh::numNeigh, SurfaceMesh::numProcs, SurfaceMesh::processor, SurfaceMeshHaloNodes::receiver, SurfaceMesh::receiver, SurfaceMesh::requestTable, SurfaceMesh::sides, SurfaceMesh::size, SurfaceMesh::slope, SurfaceMesh::sortedId, SurfaceMesh::statusTable, SurfaceMeshHaloNodes::surface, SurfaceMesh::surface, SurfaceMesh::vertices, SurfaceMeshHaloNodes::x, SurfaceMesh::x, SurfaceMeshHaloNodes::y, and SurfaceMesh::y.

Referenced by _SPModel_Context_RedistributeNodes(), and _SurfaceMesh_Delete().

void SurfaceMesh_UpdateFlows SurfaceMesh mesh  ) 
 

Definition at line 806 of file SurfaceMesh.c.

References SurfaceMesh::boundaryConditions, SurfaceMesh::foreignProviderChanges, SurfaceMesh::h, SurfaceMeshHaloNodes::h, SurfaceMesh::haloNodes, SurfaceMesh::highestNeighbour, SurfaceMesh::id, SurfaceMesh::length, SurfaceMesh::localProviderChanges, SurfaceMesh::mapGlobalToLocal, SurfaceMesh::myLoad, providerSyncStruct_t::nodeId, SurfaceMesh::nodeNeighbours, SurfaceMesh::nodeProviders, NonBlockingReceive_LinkedList(), NonBlockingSend_LinkedList(), SurfaceMesh::numNeigh, SurfaceMesh::numProcs, providerSyncStruct_t::provider, PROVIDERS_SYNC_TAG, SurfaceMesh::rank, SurfaceMesh::receiver, SurfaceMesh::requestTable, SurfaceMesh::slope, SurfaceMesh::statusTable, SurfaceMesh_FindHaloNode(), SurfaceMesh_OrderNodes(), SurfaceMesh::x, SurfaceMeshHaloNodes::x, SurfaceMesh::y, and SurfaceMeshHaloNodes::y.

Referenced by _SPModel_Context_Sync().


Variable Documentation

const char* MESH_TYPE_AUTOGENERATED
 

Definition at line 51 of file SurfaceMeshLoader.c.

Referenced by _SurfaceMesh_Init(), _SurfaceMeshLoader_Init(), SurfaceMeshLoader_LoadMesh(), and SurfaceMeshLoader_ScanMesh().

const char* MESH_TYPE_FROM_ENVI_INPUT
 

Definition at line 53 of file SurfaceMeshLoader.c.

Referenced by _SurfaceMesh_Init(), _SurfaceMeshLoader_Init(), SurfaceMeshLoader_LoadMesh(), and SurfaceMeshLoader_ScanMesh().

const char* MESH_TYPE_FROM_TEXT_INPUT
 

Definition at line 52 of file SurfaceMeshLoader.c.

Referenced by _SurfaceMesh_Init(), _SurfaceMeshLoader_Init(), SurfaceMeshLoader_LoadMesh(), and SurfaceMeshLoader_ScanMesh().

const Type SurfaceMesh_Type
 

Definition at line 43 of file SurfaceMesh.c.

Referenced by SurfaceMesh_DefaultNew(), and SurfaceMesh_New().