00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00090 #ifndef __SPModel_Context_h__
00091 #define __SPModel_Context_h__
00092
00093 typedef enum MemoryFlag_t{
00094 GLOBAL_EXTENSION,
00095 LOCAL_EXTENSION
00096 }MemoryFlag;
00097
00098 typedef enum FileFormat_t{
00099 TEXT,
00100 BINARY
00101 }FileFormat;
00102
00103
00104 extern const Type SPModel_Context_Type;
00105
00106
00107 extern const Name SPModel_EP_LoopNodesEnergy;
00108
00109
00110 #define __SPModel_Context \
00111 \
00112 struct { __AbstractContext }; \
00113 \
00114 \
00115 \
00116 \
00117 SurfaceMesh *globalMesh; \
00118 SurfaceMesh *localMesh; \
00119 SurfaceRegularMesh *regularMesh; \
00120 CatchmentList *catchmentList; \
00121 _SurfaceMeshDecomp *meshDecomp; \
00122 _Interpolator *interpolator; \
00123 SurfaceMeshSmoother *meshSmoother; \
00124 \
00125 double gravity; \
00126 ParameterTimeSeries *seaLevel; \
00127 _SurfaceMeshCyclicBC *cyclicBC; \
00128 float upliftRate; \
00129 float oroLength; \
00130 float oroRate; \
00131 float fluvialConstant; \
00132 float bedRockDiffusivity; \
00133 float sedimentDiffusivity; \
00134 float submarineBedRockDiffusivity; \
00135 float submarineSedimentDiffusivity; \
00136 float bedRockErosionLengthScale; \
00137 float sedimentErosionLengthScale; \
00138 float bedRockDensity; \
00139 float sedimentDensity; \
00140 float asthenosphereDensity; \
00141 float flexuralRigidity; \
00142 float elasticPlateLength; \
00143 \
00144 \
00145 FileFormat outputFormat; \
00146 int itopography; \
00147 int iwater; \
00148 int ierosion; \
00149 int iuplift; \
00150 int isedimentation; \
00151 int iisostacy; \
00152 int idaughterNodes; \
00153 \
00154 int itemsSent; \
00155 int itemsReceived; \
00156 \
00157 double dt; \
00158 double staticDt; \
00159 int flexureInterval; \
00160 int redistributeNodesFlag;
00161 struct SPModel_Context { __SPModel_Context };
00162
00163 typedef struct SPModelSimulationContextExtension_t{
00164 float *water;
00165 float *erosion;
00166 float *sediment;
00167 float *sedimentHistory;
00168 float *uplift;
00169 float *hiso;
00170 float *hisoPrev;
00171 float *hisotot;
00172
00173 float *globalWater;
00174 float *globalErosion;
00175 float *globalSedimentHistory;
00176 float *globalUplift;
00177 }SPModelSimulationContextExtension;
00178
00179
00180 SPModel_Context* SPModel_Context_DefaultNew( Name name );
00181
00182 SPModel_Context* SPModel_Context_New(
00183 Name name,
00184 double start,
00185 double stop,
00186 MPI_Comm communicator,
00187 Dictionary* dictionary );
00188
00189
00190 SPModel_Context* _SPModel_Context_New(
00191 SizeT _sizeOfSelf,
00192 Type type,
00193 Stg_Class_DeleteFunction* _delete,
00194 Stg_Class_PrintFunction* _print,
00195 Stg_Class_CopyFunction* _copy,
00196 Stg_Component_DefaultConstructorFunction* _defaultConstructor,
00197 Stg_Component_ConstructFunction* _construct,
00198 Stg_Component_BuildFunction* _build,
00199 Stg_Component_InitialiseFunction* _initialise,
00200 Stg_Component_ExecuteFunction* _execute,
00201 Stg_Component_DestroyFunction* _destroy,
00202 Name name,
00203 Bool initFlag,
00204 AbstractContext_SetDt* _setDt,
00205 double start,
00206 double stop,
00207 MPI_Comm communicator,
00208 Dictionary* dictionary );
00209
00210
00211 void _SPModel_Context_Init( SPModel_Context* self );
00212
00213
00214 void _SPModel_Context_Delete( void* context );
00215
00216
00217 void _SPModel_Context_Print( void* context, Stream* stream );
00218
00219 void _SPModel_Context_Build( void* context );
00220
00221
00222 void _SPModel_Context_Build( void* context );
00223
00224
00225 void _SPModel_Context_InitialConditions( void* context );
00226
00227
00228 double _SPModel_Context_Dt( void* context );
00229
00230
00231 void _SPModel_Context_SetDt( void* context, double dt );
00232
00233
00234 void _SPModel_Context_BoundaryConditions( void* context );
00235
00236
00237 void SPModel_Context_TimeStepZero( void* context );
00238
00239
00240 void _SPModel_Context_Solve( void* context );
00241
00242
00243 void _SPModel_Context_Sync( void* context );
00244
00245
00246 void DumpLoopInfo( void* context );
00247 void DumpCoord( SPModel_Context* self, Node_LocalIndex node_lI );
00248
00249 void _SPModel_Context_InitDump( SPModel_Context* self );
00250 void _SPModel_Context_Dump( SPModel_Context* self );
00251
00252
00253 void _SPModel_Context_ComponentConstruct( void* context, Stg_ComponentFactory* cf );
00254 void _SPModel_Context_ComponentBuild( void* context, void* data );
00255 void _SPModel_Context_ComponentInitialise( void* context, void* data );
00256 void _SPModel_Context_ComponentExecute( void* context, void* data );
00257 void _SPModel_Context_ComponentDestroy( void* context, void* data );
00258
00259 void _SPModel_SimulationContextExtension_AllocateMemory( void *context, MemoryFlag mf );
00260 void _SPModel_SimulationContextExtension_ReleaseMemory( void *context, MemoryFlag mf );
00261
00262 void _SPModel_Context_Gather( SPModel_Context* self );
00263 void _SPModel_Context_RedistributeNodes( SPModel_Context *context );
00264
00265 #endif