Skip to content

File FlowGPU.h

FileList > src > FlowGPU.h

Go to the source code of this file

  • #include "General.h"
  • #include "Param.h"
  • #include "Arrays.h"
  • #include "Forcing.h"
  • #include "Util_CPU.h"
  • #include "MemManagement.h"
  • #include "Gradients.h"
  • #include "Kurganov.h"
  • #include "Advection.h"
  • #include "Friction.h"
  • #include "Updateforcing.h"
  • #include "Reimann.h"
  • #include "Boundary.h"

Public Functions

Type Name
void FlowGPU (Param XParam, Loop< T > & XLoop, Forcing< float > XForcing, Model< T > XModel)
Main GPU flow solver for the flood model.
void HalfStepGPU (Param XParam, Loop< T > & XLoop, Forcing< float > XForcing, Model< T > XModel)
Debugging GPU flow step for the flood model.
__global__ void reset_var (int halowidth, int * active, T resetval, T * Var)
CUDA kernel to reset a variable array for all active blocks.

Public Functions Documentation

function FlowGPU

Main GPU flow solver for the flood model.

template<class T>
void FlowGPU (
    Param XParam,
    Loop < T > & XLoop,
    Forcing < float > XForcing,
    Model < T > XModel
) 

Executes predictor and corrector steps, applies atmospheric, wind, and river forcing, updates advection and friction terms, and manages halo and gradient reconstruction for all blocks using CUDA kernels and streams.

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XLoop Loop control and time stepping
  • XForcing Forcing data (atmospheric, wind, river, rain)
  • XModel Model data structure

function HalfStepGPU

Debugging GPU flow step for the flood model.

template<class T>
void HalfStepGPU (
    Param XParam,
    Loop < T > & XLoop,
    Forcing < float > XForcing,
    Model < T > XModel
) 

Runs a simplified flow step for debugging the main engine, including forcing, advection, friction, and halo/gradient reconstruction using CUDA kernels and streams.

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XLoop Loop control and time stepping
  • XForcing Forcing data (atmospheric, wind, river, rain)
  • XModel Model data structure

function reset_var

CUDA kernel to reset a variable array for all active blocks.

template<class T>
__global__ void reset_var (
    int halowidth,
    int * active,
    T resetval,
    T * Var
) 

Sets all values in the variable array to the specified reset value for each block and cell.

Template parameters:

  • T Data type (float or double)

Parameters:

  • halowidth Halo width
  • active Array of active block indices
  • resetval Value to set
  • Var Variable array to reset


The documentation for this class was generated from the following file src/FlowGPU.h