File Meanmax.h
Go to the source code of this file
#include "General.h"
#include "Param.h"
#include "Arrays.h"
#include "Forcing.h"
#include "MemManagement.h"
#include "FlowGPU.h"
Public Functions
Type | Name |
---|---|
void | Calcmeanmax (Param XParam, Loop< T > & XLoop, Model< T > XModel, Model< T > XModel_g) Calculate mean and/or max of requested variables on GPU/CPU. |
void | Initmeanmax (Param XParam, Loop< T > XLoop, Model< T > XModel, Model< T > XModel_g) Initialize mean and max statistics at the start of the simulation. |
__global__ void | addUandhU_GPU (Param XParam, BlockP< T > XBlock, T * h, T * u, T * v, T * U, T * hU) CUDA kernel to compute velocity magnitude and hU product. |
__global__ void | addavg_varGPU (Param XParam, BlockP< T > XBlock, T * Varmean, T * Var) CUDA kernel to accumulate mean values for a variable. |
__global__ void | addwettime_GPU (Param XParam, BlockP< T > XBlock, T * wett, T * h, T thresold, T time) CUDA kernel to accumulate wet duration for each cell. |
__global__ void | divavg_varGPU (Param XParam, BlockP< T > XBlock, T ntdiv, T * Varmean) CUDA kernel to divide mean values by the number of steps. |
__global__ void | max_Norm_GPU (Param XParam, BlockP< T > XBlock, T * Varmax, T * Var1, T * Var2) CUDA kernel to compute max velocity magnitude. |
__global__ void | max_hU_GPU (Param XParam, BlockP< T > XBlock, T * Varmax, T * Var1, T * Var2, T * Var3) CUDA kernel to compute max hU value. |
__global__ void | max_varGPU (Param XParam, BlockP< T > XBlock, T * Varmax, T * Var) CUDA kernel to compute max value for a variable. |
void | resetmeanmax (Param XParam, Loop< T > & XLoop, Model< T > XModel, Model< T > XModel_g) Reset mean and/or max statistics at output steps. |
void | resetvalGPU (Param XParam, BlockP< T > XBlock, T *& var, T val) Reset a variable array to a specified value on the GPU. |
Public Functions Documentation
function Calcmeanmax
Calculate mean and/or max of requested variables on GPU/CPU.
template<class T>
void Calcmeanmax (
Param XParam,
Loop < T > & XLoop,
Model < T > XModel,
Model < T > XModel_g
)
Computes mean, max, and wet duration statistics for evolving variables, handling both CPU and GPU execution paths.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXLoop
Loop control structureXModel
Model state (CPU)XModel_g
Model state (GPU)
function Initmeanmax
Initialize mean and max statistics at the start of the simulation.
template<class T>
void Initmeanmax (
Param XParam,
Loop < T > XLoop,
Model < T > XModel,
Model < T > XModel_g
)
Sets up/reset statistics arrays for the initial simulation step.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXLoop
Loop control structureXModel
Model state (CPU)XModel_g
Model state (GPU)
function addUandhU_GPU
CUDA kernel to compute velocity magnitude and hU product.
template<class T>
__global__ void addUandhU_GPU (
Param XParam,
BlockP < T > XBlock,
T * h,
T * u,
T * v,
T * U,
T * hU
)
Calculates the velocity magnitude and its product with water depth for each cell on the GPU.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXBlock
Block datah
Water depth arrayu
U-velocity arrayv
V-velocity arrayU
Output velocity magnitude arrayhU
Output hU product array
function addavg_varGPU
CUDA kernel to accumulate mean values for a variable.
template<class T>
__global__ void addavg_varGPU (
Param XParam,
BlockP < T > XBlock,
T * Varmean,
T * Var
)
Adds the current value to the running mean for each cell on the GPU.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXBlock
Block dataVarmean
Mean variable arrayVar
Source variable array
function addwettime_GPU
CUDA kernel to accumulate wet duration for each cell.
template<class T>
__global__ void addwettime_GPU (
Param XParam,
BlockP < T > XBlock,
T * wett,
T * h,
T thresold,
T time
)
Adds time to the wet duration for cells where water depth exceeds a threshold on the GPU.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXBlock
Block datawett
Wet duration arrayh
Water depth arraythresold
Wet threshold valuetime
Time increment
function divavg_varGPU
CUDA kernel to divide mean values by the number of steps.
template<class T>
__global__ void divavg_varGPU (
Param XParam,
BlockP < T > XBlock,
T ntdiv,
T * Varmean
)
Finalizes the mean calculation by dividing accumulated values by the number of time steps on the GPU.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXBlock
Block datantdiv
Number of time stepsVarmean
Mean variable array
function max_Norm_GPU
CUDA kernel to compute max velocity magnitude.
template<class T>
__global__ void max_Norm_GPU (
Param XParam,
BlockP < T > XBlock,
T * Varmax,
T * Var1,
T * Var2
)
Updates the max velocity magnitude for each cell by comparing with the current value on the GPU.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXBlock
Block dataVarmax
Max variable arrayVar1
U-velocity arrayVar2
V-velocity array
function max_hU_GPU
CUDA kernel to compute max hU value.
template<class T>
__global__ void max_hU_GPU (
Param XParam,
BlockP < T > XBlock,
T * Varmax,
T * Var1,
T * Var2,
T * Var3
)
Updates the max hU value for each cell by comparing with the current value on the GPU.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXBlock
Block dataVarmax
Max variable arrayh
Water depth arrayu
U-velocity arrayv
V-velocity array
function max_varGPU
CUDA kernel to compute max value for a variable.
template<class T>
__global__ void max_varGPU (
Param XParam,
BlockP < T > XBlock,
T * Varmax,
T * Var
)
Updates the max value for each cell by comparing with the current value on the GPU.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXBlock
Block dataVarmax
Max variable arrayVar
Source variable array
function resetmeanmax
Reset mean and/or max statistics at output steps.
template<class T>
void resetmeanmax (
Param XParam,
Loop < T > & XLoop,
Model < T > XModel,
Model < T > XModel_g
)
Resets mean, max, and wet duration arrays after output is produced, handling both CPU and GPU paths.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXLoop
Loop control structureXModel
Model state (CPU)XModel_g
Model state (GPU)
function resetvalGPU
Reset a variable array to a specified value on the GPU.
Sets all elements of the array to the given value using a CUDA kernel.
Template parameters:
T
Data type (float or double)
Parameters:
XParam
Model parametersXBlock
Block datavar
Variable array to resetval
Value to set
The documentation for this class was generated from the following file src/Meanmax.h