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:
TData type (float or double)
Parameters:
XParamModel parametersXLoopLoop control structureXModelModel state (CPU)XModel_gModel 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:
TData type (float or double)
Parameters:
XParamModel parametersXLoopLoop control structureXModelModel state (CPU)XModel_gModel 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:
TData type (float or double)
Parameters:
XParamModel parametersXBlockBlock datahWater depth arrayuU-velocity arrayvV-velocity arrayUOutput velocity magnitude arrayhUOutput 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:
TData type (float or double)
Parameters:
XParamModel parametersXBlockBlock dataVarmeanMean variable arrayVarSource 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:
TData type (float or double)
Parameters:
XParamModel parametersXBlockBlock datawettWet duration arrayhWater depth arraythresoldWet threshold valuetimeTime 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:
TData type (float or double)
Parameters:
XParamModel parametersXBlockBlock datantdivNumber of time stepsVarmeanMean 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:
TData type (float or double)
Parameters:
XParamModel parametersXBlockBlock dataVarmaxMax variable arrayVar1U-velocity arrayVar2V-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:
TData type (float or double)
Parameters:
XParamModel parametersXBlockBlock dataVarmaxMax variable arrayhWater depth arrayuU-velocity arrayvV-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:
TData type (float or double)
Parameters:
XParamModel parametersXBlockBlock dataVarmaxMax variable arrayVarSource 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:
TData type (float or double)
Parameters:
XParamModel parametersXLoopLoop control structureXModelModel state (CPU)XModel_gModel 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:
TData type (float or double)
Parameters:
XParamModel parametersXBlockBlock datavarVariable array to resetvalValue to set
The documentation for this class was generated from the following file src/Meanmax.h