File Mainloop.h
FileList > src > Mainloop.h
Go to the source code of this file
#include "General.h"
#include "Param.h"
#include "Arrays.h"
#include "Forcing.h"
#include "Mesh.h"
#include "Write_netcdf.h"
#include "InitialConditions.h"
#include "MemManagement.h"
#include "Boundary.h"
#include "FlowGPU.h"
#include "FlowCPU.h"
#include "Meanmax.h"
#include "Updateforcing.h"
#include "FlowMLGPU.h"
Public Functions
Type | Name |
---|---|
void | DebugLoop (Param & XParam, Forcing< float > XForcing, Model< T > & XModel, Model< T > & XModel_g) Debugging loop for the flood model. |
Loop< T > | InitLoop (Param & XParam, Model< T > & XModel) Initialize the simulation loop structure. |
void | MainLoop (Param & XParam, Forcing< float > XForcing, Model< T > & XModel, Model< T > & XModel_g) Main simulation loop for the flood model. |
__host__ double | initdt (Param XParam, Loop< T > XLoop, Model< T > XModel) Initialize the simulation time step. |
void | printstatus (T totaltime, T dt) Print the current simulation time and time step to the console. |
__global__ void | storeTSout (Param XParam, int noutnodes, int outnode, int istep, int blknode, int inode, int jnode, int * blkTS, EvolvingP< T > XEv, T * store) CUDA kernel to store time series output for specified nodes. |
Public Functions Documentation
function DebugLoop
Debugging loop for the flood model.
template<class T>
void DebugLoop (
Param & XParam,
Forcing < float > XForcing,
Model < T > & XModel,
Model < T > & XModel_g
)
Used to debug and wrap the debug flow engine. Runs a fixed number of steps and outputs diagnostic information. Handles both CPU and GPU execution paths.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXForcing
Forcing data (float)XModel
Model state (CPU)XModel_g
Model state (GPU)
function InitLoop
Initialize the simulation loop structure.
Sets up loop control variables, output buffers, and initial time step.
Template parameters:
T
Data type (float or double)
Parameters:
Returns:
Initialized loop control structure
function MainLoop
Main simulation loop for the flood model.
template<class T>
void MainLoop (
Param & XParam,
Forcing < float > XForcing,
Model < T > & XModel,
Model < T > & XModel_g
)
Advances the simulation in time, applying boundary conditions, forcing, core engine, output, and crash detection. Handles both CPU and GPU execution paths.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXForcing
Forcing data (float)XModel
Model state (CPU)XModel_g
Model state (GPU)
function initdt
Initialize the simulation time step.
Calculates the initial time step based on user input or model parameters. Uses either a user-specified value or computes a safe initial value based on water depth and cell resolution.
Template parameters:
T
Data type (float or double)
Parameters:
Returns:
Initial time step value
function printstatus
Print the current simulation time and time step to the console.
Displays the total simulation time and current time step in a formatted manner.
Template parameters:
T
Data type (float or double)
Parameters:
totaltime
Current simulation timedt
Current time step
function storeTSout
CUDA kernel to store time series output for specified nodes.
template<class T>
__global__ void storeTSout (
Param XParam,
int noutnodes,
int outnode,
int istep,
int blknode,
int inode,
int jnode,
int * blkTS,
EvolvingP < T > XEv,
T * store
)
Writes evolving variables for selected nodes and time steps to output storage array.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersnoutnodes
Number of output nodesoutnode
Output node indexistep
Time step indexblknode
Block indexinode
Node i-indexjnode
Node j-indexblkTS
Block time series mappingXEv
Evolving state variablesstore
Output storage array
The documentation for this class was generated from the following file src/Mainloop.h