Skip to content

File Updateforcing.h

FileList > src > Updateforcing.h

Go to the source code of this file

  • #include "General.h"
  • #include "Param.h"
  • #include "Arrays.h"
  • #include "Forcing.h"
  • #include "InitialConditions.h"
  • #include "MemManagement.h"
  • #include "ReadForcing.h"
  • #include "GridManip.h"
  • #include "Util_CPU.h"

Public Functions

Type Name
__global__ void AddDeformGPU (Param XParam, BlockP< T > XBlock, deformmap< float > defmap, EvolvingP< T > XEv, T scale, T * zb)
Perform a deformation step on the model on the GPU. Applies deformation maps to the model based on the current simulation time and deformation parameters.
__host__ void AddPatmforcingCPU (Param XParam, BlockP< T > XBlock, DynForcingP< float > PAtm, Model< T > XModel)
Add atmospheric pressure forcing to the model on the CPU. Adds atmospheric pressure forcing to the model based on pressure data and current simulation time.
__global__ void AddPatmforcingGPU (Param XParam, BlockP< T > XBlock, DynForcingP< float > PAtm, Model< T > XModel)
Add atmospheric pressure forcing to the model on the GPU. Adds atmospheric pressure forcing to the model based on pressure data and current simulation time.
__host__ void AddRiverForcing (Param XParam, Loop< T > XLoop, std::vector< River > XRivers, Model< T > XModel)
Add river forcing to the model. Adds river discharge forcing to the model based on river data and current simulation time.
__host__ void AddinfiltrationImplicitCPU (Param XParam, Loop< T > XLoop, BlockP< T > XBlock, T * il, T * cl, EvolvingP< T > XEv, T * hgw)
Add infiltration forcing to the model implicitly on the CPU. Adds infiltration forcing to the model based on infiltration data and current water depth, updating water depth and surface elevation.
__global__ void AddinfiltrationImplicitGPU (Param XParam, Loop< T > XLoop, BlockP< T > XBlock, T * il, T * cl, EvolvingP< T > XEv, T * hgw)
Add infiltration forcing to the model implicitly on the GPU. Adds infiltration forcing to the model based on infiltration data and current water depth, updating water depth and surface elevation.
__host__ void AddrainforcingCPU (Param XParam, BlockP< T > XBlock, DynForcingP< float > Rain, AdvanceP< T > XAdv)
Add rainfall forcing to the model on the CPU. Adds rainfall forcing to the model based on rainfall data and current simulation time.
__global__ void AddrainforcingGPU (Param XParam, BlockP< T > XBlock, DynForcingP< float > Rain, AdvanceP< T > XAdv)
Add rainfall forcing to the model on the GPU. Adds rainfall forcing to the model based on rainfall data and current simulation time.
__host__ void AddrainforcingImplicitCPU (Param XParam, Loop< T > XLoop, BlockP< T > XBlock, DynForcingP< float > Rain, EvolvingP< T > XEv)
Add rainfall forcing to the model implicitly on the CPU. Adds rainfall forcing to the model based on rainfall data and current simulation time, updating water depth and surface elevation.
__global__ void AddrainforcingImplicitGPU (Param XParam, Loop< T > XLoop, BlockP< T > XBlock, DynForcingP< float > Rain, EvolvingP< T > XEv)
Add rainfall forcing to the model implicitly on the GPU. Adds rainfall forcing to the model based on rainfall data and current simulation time, updating water depth and surface elevation.
__host__ void AddwindforcingCPU (Param XParam, BlockP< T > XBlock, DynForcingP< float > Uwind, DynForcingP< float > Vwind, AdvanceP< T > XAdv)
Add wind forcing to the model on the CPU. Adds wind forcing to the model based on wind data and current simulation time.
__global__ void AddwindforcingGPU (Param XParam, BlockP< T > XBlock, DynForcingP< float > Uwind, DynForcingP< float > Vwind, AdvanceP< T > XAdv)
Add wind forcing to the model on the GPU. Adds wind forcing to the model based on wind data and current simulation time.
void Forcingthisstep (Param XParam, double totaltime, DynForcingP< float > & XDynForcing)
Update dynamic forcing for the current simulation step.
__global__ void InjectRiverGPU (Param XParam, River XRiver, T qnow, int * Riverblks, BlockP< T > XBlock, AdvanceP< T > XAdv)
Inject river discharge into the model grid on the GPU. Injects river discharge into the model grid based on river geometry and discharge rate.
void deformstep (Param XParam, Loop< T > XLoop, std::vector< deformmap< float > > deform, Model< T > XModel, Model< T > XModel_g)
Perform a deformation step on the model. Applies deformation maps to the model based on the current simulation time and deformation parameters. Overloaded function to handle both CPU and GPU models.
__device__ T interpDyn2BUQ (T x, T y, TexSetP Forcing)
Interpolate dynamic forcing data at given coordinates on the GPU. Interpolates dynamic forcing data at specified coordinates using bilinear interpolation.
void updateforcing (Param XParam, Loop< T > XLoop, Forcing< float > & XForcing)
Update dynamic forcings for the current simulation step. Updates the dynamic forcing data for the current simulation time step.

Public Functions Documentation

function AddDeformGPU

Perform a deformation step on the model on the GPU. Applies deformation maps to the model based on the current simulation time and deformation parameters.

template<class T>
__global__ void AddDeformGPU (
    Param XParam,
    BlockP < T > XBlock,
    deformmap < float > defmap,
    EvolvingP < T > XEv,
    T scale,
    T * zb
) 

Parameters:

  • XParam Model parameters
  • XLoop Loop structure containing time information
  • deform Vector of deformation maps
  • XModel Model data structure for GPU

function AddPatmforcingCPU

Add atmospheric pressure forcing to the model on the CPU. Adds atmospheric pressure forcing to the model based on pressure data and current simulation time.

template<class T>
__host__ void AddPatmforcingCPU (
    Param XParam,
    BlockP < T > XBlock,
    DynForcingP < float > PAtm,
    Model < T > XModel
) 

Parameters:

  • XParam Model parameters
  • XBlock Block data structure
  • PAtm Atmospheric pressure dynamic forcing structure
  • XModel Model data structure

function AddPatmforcingGPU

Add atmospheric pressure forcing to the model on the GPU. Adds atmospheric pressure forcing to the model based on pressure data and current simulation time.

template<class T>
__global__ void AddPatmforcingGPU (
    Param XParam,
    BlockP < T > XBlock,
    DynForcingP < float > PAtm,
    Model < T > XModel
) 

Parameters:

  • XParam Model parameters
  • XBlock Block data structure
  • PAtm Atmospheric pressure dynamic forcing structure
  • XModel Model data structure

function AddRiverForcing

Add river forcing to the model. Adds river discharge forcing to the model based on river data and current simulation time.

template<class T>
__host__ void AddRiverForcing (
    Param XParam,
    Loop < T > XLoop,
    std::vector< River > XRivers,
    Model < T > XModel
) 

Parameters:

  • XParam Model parameters
  • XLoop Loop structure containing time information
  • XRivers Vector of river data structures
  • XModel Model data structure

function AddinfiltrationImplicitCPU

Add infiltration forcing to the model implicitly on the CPU. Adds infiltration forcing to the model based on infiltration data and current water depth, updating water depth and surface elevation.

template<class T>
__host__ void AddinfiltrationImplicitCPU (
    Param XParam,
    Loop < T > XLoop,
    BlockP < T > XBlock,
    T * il,
    T * cl,
    EvolvingP < T > XEv,
    T * hgw
) 

Parameters:

  • XParam Model parameters
  • XLoop Loop structure containing time information
  • XBlock Block data structure
  • il Initial infiltration rates array
  • cl Continuous infiltration rates array
  • XEv Evolving data structure
  • hgw Groundwater height array

function AddinfiltrationImplicitGPU

Add infiltration forcing to the model implicitly on the GPU. Adds infiltration forcing to the model based on infiltration data and current water depth, updating water depth and surface elevation.

template<class T>
__global__ void AddinfiltrationImplicitGPU (
    Param XParam,
    Loop < T > XLoop,
    BlockP < T > XBlock,
    T * il,
    T * cl,
    EvolvingP < T > XEv,
    T * hgw
) 

Parameters:

  • XParam Model parameters
  • XLoop Loop structure containing time information
  • XBlock Block data structure
  • il Initial infiltration rates array
  • cl Continuous infiltration rates array
  • XEv Evolving data structure
  • hgw Groundwater height array

function AddrainforcingCPU

Add rainfall forcing to the model on the CPU. Adds rainfall forcing to the model based on rainfall data and current simulation time.

template<class T>
__host__ void AddrainforcingCPU (
    Param XParam,
    BlockP < T > XBlock,
    DynForcingP < float > Rain,
    AdvanceP < T > XAdv
) 

Parameters:

  • XParam Model parameters
  • XBlock Block data structure
  • Rain Rainfall dynamic forcing structure
  • XAdv Advance data structure

function AddrainforcingGPU

Add rainfall forcing to the model on the GPU. Adds rainfall forcing to the model based on rainfall data and current simulation time.

template<class T>
__global__ void AddrainforcingGPU (
    Param XParam,
    BlockP < T > XBlock,
    DynForcingP < float > Rain,
    AdvanceP < T > XAdv
) 

Parameters:

  • XParam Model parameters
  • XBlock Block data structure
  • Rain Rainfall dynamic forcing structure
  • XAdv Advance data structure

function AddrainforcingImplicitCPU

Add rainfall forcing to the model implicitly on the CPU. Adds rainfall forcing to the model based on rainfall data and current simulation time, updating water depth and surface elevation.

template<class T>
__host__ void AddrainforcingImplicitCPU (
    Param XParam,
    Loop < T > XLoop,
    BlockP < T > XBlock,
    DynForcingP < float > Rain,
    EvolvingP < T > XEv
) 

Parameters:

  • XParam Model parameters
  • XLoop Loop structure containing time information
  • XBlock Block data structure
  • Rain Rainfall dynamic forcing structure
  • XEv Evolving data structure

function AddrainforcingImplicitGPU

Add rainfall forcing to the model implicitly on the GPU. Adds rainfall forcing to the model based on rainfall data and current simulation time, updating water depth and surface elevation.

template<class T>
__global__ void AddrainforcingImplicitGPU (
    Param XParam,
    Loop < T > XLoop,
    BlockP < T > XBlock,
    DynForcingP < float > Rain,
    EvolvingP < T > XEv
) 

Parameters:

  • XParam Model parameters
  • XLoop Loop structure containing time information
  • XBlock Block data structure
  • Rain Rainfall dynamic forcing structure
  • XEv Evolving data structure

function AddwindforcingCPU

Add wind forcing to the model on the CPU. Adds wind forcing to the model based on wind data and current simulation time.

template<class T>
__host__ void AddwindforcingCPU (
    Param XParam,
    BlockP < T > XBlock,
    DynForcingP < float > Uwind,
    DynForcingP < float > Vwind,
    AdvanceP < T > XAdv
) 

Parameters:

  • XParam Model parameters
  • XBlock Block data structure
  • Uwind U-component of wind dynamic forcing structure
  • Vwind V-component of wind dynamic forcing structure
  • XAdv Advance data structure

function AddwindforcingGPU

Add wind forcing to the model on the GPU. Adds wind forcing to the model based on wind data and current simulation time.

template<class T>
__global__ void AddwindforcingGPU (
    Param XParam,
    BlockP < T > XBlock,
    DynForcingP < float > Uwind,
    DynForcingP < float > Vwind,
    AdvanceP < T > XAdv
) 

Parameters:

  • XParam Model parameters
  • XBlock Block data structure
  • Uwind U-component of wind dynamic forcing structure
  • Vwind V-component of wind dynamic forcing structure
  • XAdv Advance data structure

function Forcingthisstep

Update dynamic forcing for the current simulation step.

void Forcingthisstep (
    Param XParam,
    double totaltime,
    DynForcingP < float > & XDynForcing
) 

Updates the dynamic forcing data for the current simulation time step, handling uniform and non-uniform cases.

Parameters:

  • XParam Model parameters
  • totaltime Current simulation time
  • XDynForcing Dynamic forcing structure to update

function InjectRiverGPU

Inject river discharge into the model grid on the GPU. Injects river discharge into the model grid based on river geometry and discharge rate.

template<class T>
__global__ void InjectRiverGPU (
    Param XParam,
    River XRiver,
    T qnow,
    int * Riverblks,
    BlockP < T > XBlock,
    AdvanceP < T > XAdv
) 

Parameters:

  • XParam Model parameters
  • XRiver River data structure
  • qnow Current river discharge rate
  • Riverblks Array of blocks affected by the river
  • XBlock Block data structure
  • XAdv Advance data structure

function deformstep

Perform a deformation step on the model. Applies deformation maps to the model based on the current simulation time and deformation parameters. Overloaded function to handle both CPU and GPU models.

template<class T>
void deformstep (
    Param XParam,
    Loop < T > XLoop,
    std::vector< deformmap < float > > deform,
    Model < T > XModel,
    Model < T > XModel_g
) 

Parameters:

  • XParam Model parameters
  • XLoop Loop structure containing time information
  • deform Vector of deformation maps
  • XModel Model data structure
  • XModel_g Model data structure for GPU

function interpDyn2BUQ

Interpolate dynamic forcing data at given coordinates on the GPU. Interpolates dynamic forcing data at specified coordinates using bilinear interpolation.

template<class T>
__device__ T interpDyn2BUQ (
    T x,
    T y,
    TexSetP Forcing
) 

Parameters:

  • x X-coordinate
  • y Y-coordinate
  • Forcing Dynamic forcing data structure

function updateforcing

Update dynamic forcings for the current simulation step. Updates the dynamic forcing data for the current simulation time step.

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

Parameters:

  • XParam Model parameters
  • XLoop Loop structure containing time information
  • XForcing Forcing data structure to update


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