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

Catchment.c File Reference

#include <mpi.h>
#include <StGermain/StGermain.h>
#include <Cascade/cascade.h>
#include "types.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include <limits.h>
#include "Catchment.h"
#include "SurfaceMesh.h"
#include "Misc.h"

Include dependency graph for Catchment.c:

Go to the source code of this file.

Functions

CatchmentListCatchmentList_DefaultNew (Name name)
 Create CatchmentList and initialise.
CatchmentListCatchmentList_New (Name name, SurfaceMesh *mesh, int numProcs, Dictionary *dictionary)
CatchmentList_CatchmentList_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, SurfaceMesh *mesh, int numProcs, Dictionary *dictionary)
 Virtual Constructor.
void CatchmentList_Init (CatchmentList *self, Name name, SurfaceMesh *mesh, int numProcs, Dictionary *dictionary)
 Init Interface.
void _CatchmentList_Init (CatchmentList *self)
void _CatchmentList_Delete (void *cList)
 Stg_Class_Delete Implementation.
void _CatchmentList_Print (void *cList, Stream *stream)
 Print Implementation.
void _CatchmentList_Construct (void *cList, Stg_ComponentFactory *cf)
void _CatchmentList_Build (void *cList, void *data)
 Build Implementation.
void _CatchmentList_Initialise (void *cList, void *data)
 Initialisation implementation.
void _CatchmentList_Execute (void *cList, void *data)
 Execute Implementation.
void _CatchmentList_Destroy (void *cList, void *data)
void CatchmentList_InsertCatchments (CatchmentList *self)
void AssignCatchmentNumber (CatchmentList *self, int nodeId, int locMin)
void CalculateCatchmentCentres (CatchmentList *self)
void CalculateCatchmentCentreHelper (CatchmentList *self, int nodeId, vector *sum)

Variables

const Type CatchmentList_Type = "CatchmentList"


Function Documentation

void _CatchmentList_Build void *  cList,
void *  data
 

Build Implementation.

Definition at line 190 of file Catchment.c.

References CalculateCatchmentCentres(), catchmentCompareFunction(), CatchmentList_InsertCatchments(), catchmentPrintFunction(), and MASTER_PROC.

Referenced by CatchmentList_DefaultNew(), CatchmentList_Init(), and CatchmentList_New().

void _CatchmentList_Construct void *  cList,
Stg_ComponentFactory *  cf
 

Definition at line 185 of file Catchment.c.

Referenced by CatchmentList_DefaultNew(), CatchmentList_Init(), and CatchmentList_New().

void _CatchmentList_Delete void *  cList  ) 
 

Stg_Class_Delete Implementation.

Definition at line 154 of file Catchment.c.

Referenced by CatchmentList_DefaultNew(), CatchmentList_Init(), and CatchmentList_New().

void _CatchmentList_Destroy void *  cList,
void *  data
 

Definition at line 223 of file Catchment.c.

Referenced by CatchmentList_DefaultNew(), CatchmentList_Init(), and CatchmentList_New().

void _CatchmentList_Execute void *  cList,
void *  data
 

Execute Implementation.

Definition at line 218 of file Catchment.c.

Referenced by CatchmentList_DefaultNew(), CatchmentList_Init(), and CatchmentList_New().

void _CatchmentList_Init CatchmentList self  ) 
 

Definition at line 147 of file Catchment.c.

Referenced by _CatchmentList_New(), and CatchmentList_Init().

void _CatchmentList_Initialise void *  cList,
void *  data
 

Initialisation implementation.

Definition at line 213 of file Catchment.c.

Referenced by CatchmentList_DefaultNew(), CatchmentList_Init(), and CatchmentList_New().

CatchmentList* _CatchmentList_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,
SurfaceMesh mesh,
int  numProcs,
Dictionary *  dictionary
 

Virtual Constructor.

Definition at line 84 of file Catchment.c.

References _CatchmentList_Init(), and SurfaceMesh::dictionary.

Referenced by CatchmentList_DefaultNew(), and CatchmentList_New().

void _CatchmentList_Print void *  cList,
Stream *  stream
 

Print Implementation.

Definition at line 171 of file Catchment.c.

Referenced by CatchmentList_DefaultNew(), CatchmentList_Init(), and CatchmentList_New().

void AssignCatchmentNumber CatchmentList self,
int  nodeId,
int  locMin
 

Definition at line 260 of file Catchment.c.

References AssignCatchmentNumber(), SurfaceMesh::id, SurfaceMesh::nCatch, and SurfaceMesh::nodeProviders.

Referenced by AssignCatchmentNumber(), and CatchmentList_InsertCatchments().

void CalculateCatchmentCentreHelper CatchmentList self,
int  nodeId,
vector sum
 

Definition at line 305 of file Catchment.c.

References CalculateCatchmentCentreHelper(), vector_t::h, SurfaceMesh::h, SurfaceMesh::id, SurfaceMesh::nodeProviders, vector_t::x, SurfaceMesh::x, vector_t::y, and SurfaceMesh::y.

Referenced by CalculateCatchmentCentreHelper(), and CalculateCatchmentCentres().

void CalculateCatchmentCentres CatchmentList self  ) 
 

Definition at line 281 of file Catchment.c.

References CalculateCatchmentCentreHelper(), Catchment::catchmentCentre, CatchmentList::catchments, vector_t::h, Catchment::localMinimum, Catchment::netSize, vector_t::x, and vector_t::y.

Referenced by _CatchmentList_Build().

CatchmentList* CatchmentList_DefaultNew Name  name  ) 
 

Create CatchmentList and initialise.

Definition at line 44 of file Catchment.c.

References _CatchmentList_Build(), _CatchmentList_Construct(), _CatchmentList_Delete(), _CatchmentList_Destroy(), _CatchmentList_Execute(), _CatchmentList_Initialise(), _CatchmentList_New(), _CatchmentList_Print(), CatchmentList_DefaultNew(), and CatchmentList_Type.

Referenced by CatchmentList_DefaultNew(), CatchmentList_Init(), and CatchmentList_New().

void CatchmentList_Init CatchmentList self,
Name  name,
SurfaceMesh mesh,
int  numProcs,
Dictionary *  dictionary
 

Init Interface.

Definition at line 119 of file Catchment.c.

References _CatchmentList_Build(), _CatchmentList_Construct(), _CatchmentList_Delete(), _CatchmentList_Destroy(), _CatchmentList_Execute(), _CatchmentList_Init(), _CatchmentList_Initialise(), _CatchmentList_Print(), CatchmentList_DefaultNew(), and CatchmentList_Type.

void CatchmentList_InsertCatchments CatchmentList self  ) 
 

Definition at line 228 of file Catchment.c.

References AssignCatchmentNumber(), CatchmentList::catchments, SurfaceMesh::id, Catchment::localMinimum, Catchment::netSize, SurfaceMesh::numNodes, SurfaceMesh::receiver, SurfaceMesh::size, and Catchment::subCatchments.

Referenced by _CatchmentList_Build().

CatchmentList* CatchmentList_New Name  name,
SurfaceMesh mesh,
int  numProcs,
Dictionary *  dictionary
 

Definition at line 64 of file Catchment.c.

References _CatchmentList_Build(), _CatchmentList_Construct(), _CatchmentList_Delete(), _CatchmentList_Destroy(), _CatchmentList_Execute(), _CatchmentList_Initialise(), _CatchmentList_New(), _CatchmentList_Print(), CatchmentList_DefaultNew(), and CatchmentList_Type.

Referenced by _SPModel_Context_Init(), and _SPModel_Context_RedistributeNodes().


Variable Documentation

const Type CatchmentList_Type = "CatchmentList"
 

Definition at line 42 of file Catchment.c.

Referenced by CatchmentList_DefaultNew(), CatchmentList_Init(), and CatchmentList_New().