File Halo.h
Go to the source code of this file
#include "General.h"#include "Param.h"#include "Write_txtlog.h"#include "Util_CPU.h"#include "Arrays.h"#include "Mesh.h"#include "MemManagement.h"#include "Boundary.h"#include "ConserveElevation.h"
Public Functions
| Type | Name |
|---|---|
| __global__ void | HaloFluxGPUBT (Param XParam, BlockP< T > XBlock, T * z) GPU kernel for applying halo flux correction on the top and bottom boundaries of all active blocks. |
| __global__ void | HaloFluxGPUBTnew (Param XParam, BlockP< T > XBlock, T * z) GPU kernel for applying halo flux correction on the top and bottom boundaries of all active blocks. |
| __global__ void | HaloFluxGPULR (Param XParam, BlockP< T > XBlock, T * z) Wrapping function for applying halo flux correction on the left and right boundaries of all active blocks. |
| __global__ void | HaloFluxGPULRnew (Param XParam, BlockP< T > XBlock, T * z) GPU kernel for applying halo flux correction on the left and right boundaries of all active blocks. |
| void | RecalculateZs (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T * zb) Recalculate water surface after recalculating the values on the halo on the CPU. |
| __global__ void | RecalculateZsGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T * zb) |
| void | Recalculatehh (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T * zb) Recalculate water depth after recalculating the values on the halo on the CPU. |
| void | bndmaskGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, FluxP< T > Flux) Wrapping function for applying boundary masks to flux variables on GPU. |
| void | fillBot (Param XParam, int ib, BlockP< T > XBlock, T *& z) Function to fill the bottom halo region of a block, handling various neighbor configurations. |
| __global__ void | fillBot (int halowidth, int * active, int * level, int * botleft, int * botright, int * topleft, int * lefttop, int * righttop, T * a) CUDA kernel to fill the bottom halo region of blocks in parallel, handling various neighbor configurations. |
| __global__ void | fillBotnew (int halowidth, int nblk, int * active, int * level, int * botleft, int * botright, int * topleft, int * lefttop, int * righttop, T * a) CUDA kernel to fill the bottom halo region of blocks in parallel for new refinement, handling various neighbor configurations, new version. |
| void | fillCorners (Param XParam, int ib, BlockP< T > XBlock, T *& z) Function to fill the corner halo regions for a specific block, handling various neighbor configurations. |
| void | fillCorners (Param XParam, BlockP< T > XBlock, T *& z) Function to fill the corner halo regions for all active blocks. |
| void | fillCorners (Param XParam, BlockP< T > XBlock, EvolvingP< T > & Xev) Function to fill the corner halo regions for all active blocks and all evolving variables. |
| __global__ void | fillCornersGPU (Param XParam, BlockP< T > XBlock, T * z) CUDA kernel to fill the corner halo regions for all active blocks in parallel, handling various neighbor configurations. |
| void | fillHalo (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T * zb) Wrapping function for calculating halos for each block and each variable on CPU. |
| void | fillHalo (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev) Wrapping function for calculating halos for each block and each variable on CPU. |
| void | fillHalo (Param XParam, BlockP< T > XBlock, GradientsP< T > Grad) Wrapping function for calculating halos for each block and each variable on CPU. |
| void | fillHalo (Param XParam, BlockP< T > XBlock, FluxP< T > Flux) Wrapping function for calculating flux halos for each block and each variable on CPU. |
| void | fillHaloC (Param XParam, BlockP< T > XBlock, T * z) Wrapping function for calculating halos for each block of a single variable on CPU. |
| void | fillHaloF (Param XParam, bool doProlongation, BlockP< T > XBlock, T * z) Wrapping function for calculating flux in the halos for a block and a single variable on CPU. |
| void | fillHaloGPU (Param XParam, BlockP< T > XBlock, cudaStream_t stream, T * z) Wrapping function for calculating halos for each block of a single variable on GPU. |
| void | fillHaloGPU (Param XParam, BlockP< T > XBlock, T * z) Wrapping function for calculating halos for each block of a single variable on GPU. |
| void | fillHaloGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev) Wrapping function for calculating halos for each block and each variable on GPU. |
| void | fillHaloGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T * zb) Wrapping function for calculating halos for each block and each variable on GPU. |
| void | fillHaloGPU (Param XParam, BlockP< T > XBlock, GradientsP< T > Grad) Wrapping function for calculating halos for each block and each variable on GPU. |
| void | fillHaloGPU (Param XParam, BlockP< T > XBlock, FluxP< T > Flux) Wrapping function for calculating flux halos for each block and each variable on GPU. |
| void | fillHaloGPUnew (Param XParam, BlockP< T > XBlock, cudaStream_t stream, T * z) Wrapping function for calculating halos for each block of a single variable on GPU. New version. |
| void | fillHaloTopRightC (Param XParam, BlockP< T > XBlock, T * z) Wrapping function for calculating flux for halos for each block of a single variable on GPU. |
| void | fillHaloTopRightGPU (Param XParam, bool doprolong, BlockP< T > XBlock, cudaStream_t stream, T * z) |
| void | fillLeft (Param XParam, int ib, BlockP< T > XBlock, T *& z) Applying halo flux correction on the left boundaries of all active blocks on GPU. |
| __global__ void | fillLeft (int halowidth, int * active, int * level, int * leftbot, int * lefttop, int * rightbot, int * botright, int * topright, T * a) GPU kernel for applying halo flux correction on the left boundaries of all active blocks. |
| __global__ void | fillLeftnew (int halowidth, int nblk, int * active, int * level, int * leftbot, int * lefttop, int * rightbot, int * botright, int * topright, T * a) New way of filling the left halo 2 blocks at a time to maximize GPU occupancy. |
| void | fillRight (Param XParam, int ib, BlockP< T > XBlock, T *& z) Fills the right halo region of a block. |
| __global__ void | fillRight (int halowidth, int * active, int * level, int * rightbot, int * righttop, int * leftbot, int * botleft, int * topleft, T * a) CUDA kernel to fill the right halo region of blocks in parallel. |
| void | fillRightFlux (Param XParam, bool doProlongation, int ib, BlockP< T > XBlock, T *& z) Function to fill the right halo region of a block, handling various neighbor configurations. |
| __global__ void | fillRightFlux (int halowidth, bool doProlongation, int * active, int * level, int * rightbot, int * righttop, int * leftbot, int * botleft, int * topleft, T * a) CUDA kernel to fill the right halo region of blocks in parallel for flux variables, handling various neighbor configurations. |
| __global__ void | fillRightnew (int halowidth, int nblk, int * active, int * level, int * rightbot, int * righttop, int * leftbot, int * botleft, int * topleft, T * a) CUDA kernel to fill the right halo region of blocks in parallel (new version). |
| void | fillTop (Param XParam, int ib, BlockP< T > XBlock, T *& z) Fills the top halo region of a block, handling various neighbor configurations. |
| __global__ void | fillTop (int halowidth, int * active, int * level, int * topleft, int * topright, int * botleft, int * leftbot, int * rightbot, T * a) CUDA kernel to fill the top halo region of blocks in parallel for new refinement, handling various neighbor configurations, new version. |
| void | fillTopFlux (Param XParam, bool doProlongation, int ib, BlockP< T > XBlock, T *& z) Function to fill the top halo region of a block for new refinement, handling various neighbor configurations. |
| __global__ void | fillTopFlux (int halowidth, bool doProlongation, int * active, int * level, int * topleft, int * topright, int * botleft, int * leftbot, int * rightbot, T * a) CUDA kernel to fill the top halo region of blocks in parallel for new refinement, handling various neighbor configurations, new version. |
| __global__ void | fillTopnew (int halowidth, int nblk, int * active, int * level, int * topleft, int * topright, int * botleft, int * leftbot, int * rightbot, T * a) |
| void | refine_linear (Param XParam, BlockP< T > XBlock, T * z, T * dzdx, T * dzdy) Wrapping function for refining all sides of active blocks using linear reconstruction. |
| void | refine_linearGPU (Param XParam, BlockP< T > XBlock, T * z, T * dzdx, T * dzdy) Wrapping function for refining all sides of active blocks using linear reconstruction on GPU. |
| void | refine_linear_Bot (Param XParam, int ib, BlockP< T > XBlock, T * z, T * dzdy) |
| void | refine_linear_Left (Param XParam, int ib, BlockP< T > XBlock, T * z, T * dzdx, T * dzdy) Refine a block on the left side using linear reconstruction. |
| void | refine_linear_Right (Param XParam, int ib, BlockP< T > XBlock, T * z, T * dzdx) |
| void | refine_linear_Top (Param XParam, int ib, BlockP< T > XBlock, T * z, T * dzdy) |
Public Functions Documentation
function HaloFluxGPUBT
GPU kernel for applying halo flux correction on the top and bottom boundaries of all active blocks.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationzThe variable to be refined
Template parameters:
TThe data type (float or double)
function HaloFluxGPUBTnew
GPU kernel for applying halo flux correction on the top and bottom boundaries of all active blocks.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationzThe variable to be refined
Template parameters:
TThe data type (float or double)
function HaloFluxGPULR
Wrapping function for applying halo flux correction on the left and right boundaries of all active blocks.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationzThe variable to be refined
Template parameters:
TThe data type (float or double)
function HaloFluxGPULRnew
GPU kernel for applying halo flux correction on the left and right boundaries of all active blocks.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationzThe variable to be refined
Template parameters:
TThe data type (float or double)
function RecalculateZs
Recalculate water surface after recalculating the values on the halo on the CPU.
template<class T>
void RecalculateZs (
Param XParam,
BlockP < T > XBlock,
EvolvingP < T > Xev,
T * zb
)
Recalculate water surface after recalculating the values on the halo on the GPU.
!
Description
Recalculate water surface after recalculating the values on the halo on the CPU. zb (bottom elevation) on each halo is calculated at the start of the loop or as part of the initial condition. When conserve-elevation is not required, only h is recalculated on the halo at ever 1/2 steps. zs then needs to be recalculated to obtain a mass-conservative solution (if zs is conserved then mass conservation is not garanteed)
Warning:
This function calculate zs everywhere in the block... this is a bit unecessary. Instead it should recalculate only where there is a prolongation or a restiction
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationXevThe evolving structure containing the evolving variableszbThe bottom elevation variable
Template parameters:
TThe data type (float or double)
!
Description
Recalculate water surface after recalculating the values on the halo on the CPU. zb (bottom elevation) on each halo is calculated at the start of the loop or as part of the initial condition. When conserve-elevation is not required, only h is recalculated on the halo at ever 1/2 steps. zs then needs to be recalculated to obtain a mass-conservative solution (if zs is conserved then mass conservation is not garanteed)
Warning:
This function calculate zs everywhere in the block... this is a bit unecessary. Instead it should recalculate only where there is a prolongation or a restiction
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationXevThe evolving structure containing the evolving variableszbThe bottom elevation variable
Template parameters:
TThe data type (float or double)
function RecalculateZsGPU
template<class T>
__global__ void RecalculateZsGPU (
Param XParam,
BlockP < T > XBlock,
EvolvingP < T > Xev,
T * zb
)
function Recalculatehh
Recalculate water depth after recalculating the values on the halo on the CPU.
template<class T>
void Recalculatehh (
Param XParam,
BlockP < T > XBlock,
EvolvingP < T > Xev,
T * zb
)
Description
Recalculate water depth after recalculating the values on the halo on the CPU. zb (bottom elevation) on each halo is calculated at the start of the loop or as part of the initial condition. When conserve-elevation is not required, only h is recalculated on the halo at ever 1/2 steps. zs then needs to be recalculated to obtain a mass-conservative solution (if zs is conserved then mass conservation is not garanteed)
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationXevThe evolving structure containing the evolving variableszbThe bottom elevation variable
Template parameters:
TThe data type (float or double)
function bndmaskGPU
Wrapping function for applying boundary masks to flux variables on GPU.
template<class T>
void bndmaskGPU (
Param XParam,
BlockP < T > XBlock,
EvolvingP < T > Xev,
FluxP < T > Flux
)
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationXevThe evolving structure containing the evolving variablesFluxThe flux structure containing the flux variables
Template parameters:
TThe data type (float or double)
function fillBot
Function to fill the bottom halo region of a block, handling various neighbor configurations.
Parameters:
XParamThe parameters of the grid and blocksibThe index of the current blockXBlockThe block structure containing neighbor informationzThe variable to be refinedTThe data type of the variable (e.g., float, double)
function fillBot
CUDA kernel to fill the bottom halo region of blocks in parallel, handling various neighbor configurations.
template<class T>
__global__ void fillBot (
int halowidth,
int * active,
int * level,
int * botleft,
int * botright,
int * topleft,
int * lefttop,
int * righttop,
T * a
)
Parameters:
halowidthThe width of the halo regionactiveThe array of active block indiceslevelThe array of block levelsbotleftThe array of bottom left neighbor block indicesbotrightThe array of bottom right neighbor block indicestopleftThe array of top left neighbor block indiceslefttopThe array of left top neighbor block indicesrighttopThe array of right top neighbor block indicesaThe variable to be refinedTThe data type of the variable (e.g., float, double)
function fillBotnew
CUDA kernel to fill the bottom halo region of blocks in parallel for new refinement, handling various neighbor configurations, new version.
template<class T>
__global__ void fillBotnew (
int halowidth,
int nblk,
int * active,
int * level,
int * botleft,
int * botright,
int * topleft,
int * lefttop,
int * righttop,
T * a
)
Parameters:
halowidthThe width of the halo regionnblkThe number of active blocksactiveThe array of active block indiceslevelThe array of block levelsbotleftThe array of bottom left neighbor block indicesbotrightThe array of bottom right neighbor block indicestopleftThe array of top left neighbor block indiceslefttopThe array of left top neighbor block indicesrighttopThe array of right top neighbor block indicesaThe variable to be refinedTThe data type of the variable (e.g., float, double)
function fillCorners
Function to fill the corner halo regions for a specific block, handling various neighbor configurations.
Parameters:
XParamThe parameters of the grid and blocksibThe index of the block to be processedXBlockThe structure containing block neighbor informationzThe variable to be processedTThe data type of the variable (e.g., float, double)
function fillCorners
Function to fill the corner halo regions for all active blocks.
Parameters:
XParamThe parameters of the grid and blocksXBlockThe structure containing block neighbor informationzThe variable to be processed
Template parameters:
TThe data type of the variable (e.g., float, double)
function fillCorners
Function to fill the corner halo regions for all active blocks and all evolving variables.
Parameters:
XParamThe parameters of the grid and blocksXBlockThe structure containing block neighbor informationXevThe structure containing evolving variables
Template parameters:
TThe data type of the variables (e.g., float, double)
function fillCornersGPU
CUDA kernel to fill the corner halo regions for all active blocks in parallel, handling various neighbor configurations.
Parameters:
XParamThe parameters of the grid and blocksXBlockThe structure containing block neighbor informationzThe variable to be processedTThe data type of the variable (e.g., float, double)
function fillHalo
Wrapping function for calculating halos for each block and each variable on CPU.
Description
This function is a wraping fuction of the halo functions on CPU. It is called from the main Halo function. It uses multithreading to calculate the halos of the 4 variables in parallel.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationXevThe evolving structure containing the evolving variableszbThe bottom elevation variable
Template parameters:
TThe data type (float or double)
function fillHalo
Wrapping function for calculating halos for each block and each variable on CPU.
Description
This function is a wraping fuction of the halo functions on CPU. It is called from the main Halo function. It uses multithreading to calculate the halos of the 4 variables in parallel.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationXevThe evolving structure containing the evolving variables
Template parameters:
TThe data type (float or double)
function fillHalo
Wrapping function for calculating halos for each block and each variable on CPU.
Description
This function is a wrapping function of the halo functions on CPU. It is called from the main Halo function. It uses multithreading to calculate the halos of the 4 variables in parallel.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationGradThe gradients structure containing the gradients
Template parameters:
TThe data type (float or double)
function fillHalo
Wrapping function for calculating flux halos for each block and each variable on CPU.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationFluxThe flux structure containing the flux variables
Template parameters:
TThe data type (float or double)
function fillHaloC
Wrapping function for calculating halos for each block of a single variable on CPU.
!
Description
This function is a wraping fuction of the halo functions on CPU. It is called from the main Halo CPU function. This is layer 2 of 3 wrap so the candy doesn't stick too much.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationzThe variable to work on
function fillHaloF
Wrapping function for calculating flux in the halos for a block and a single variable on CPU.
!
Deprecated
This function is was never sucessful and will never be used. It is fundamentally flawed because is doesn't preserve the balance of fluxes on the restiction interface. It should be deleted soon.
function fillHaloGPU
Wrapping function for calculating halos for each block of a single variable on GPU.
template<class T>
void fillHaloGPU (
Param XParam,
BlockP < T > XBlock,
cudaStream_t stream,
T * z
)
!
Description
This function is a wraping fuction of the halo functions on GPU. It is called from the main Halo GPU function. The present imnplementation is naive and slow one that calls the rather complex fillLeft type functions
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationstreamThe cuda stream to usezThe variable to work on
function fillHaloGPU
Wrapping function for calculating halos for each block of a single variable on GPU.
Deprecated
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationstreamThe cuda stream to usezThe variable to work on
function fillHaloGPU
Wrapping function for calculating halos for each block and each variable on GPU.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationXevThe evolving structure containing the evolving variables
Template parameters:
TThe data type (float or double)
function fillHaloGPU
Wrapping function for calculating halos for each block and each variable on GPU.
template<class T>
void fillHaloGPU (
Param XParam,
BlockP < T > XBlock,
EvolvingP < T > Xev,
T * zb
)
Description
This function is a wraping fuction of the halo functions on GPU. It is called from the main Halo GPU function. It uses multiple cuda streams to calculate the halos of the 4 variables in parallel. After filling the halos, it applies either the elevation conservation or wet-dry fix if enabled in parameters. Finally, it recalculates the surface elevation zs based on the updated water depth h and bottom elevation zb.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationXevThe evolving structure containing the evolving variableszbThe bottom elevation variable
Template parameters:
TThe data type (float or double)
function fillHaloGPU
Wrapping function for calculating halos for each block and each variable on GPU.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationGradThe gradients structure containing the gradients
Template parameters:
TThe data type (float or double)
function fillHaloGPU
Wrapping function for calculating flux halos for each block and each variable on GPU.
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationFluxThe flux structure containing the flux variables
Template parameters:
TThe data type (float or double)
function fillHaloGPUnew
Wrapping function for calculating halos for each block of a single variable on GPU. New version.
template<class T>
void fillHaloGPUnew (
Param XParam,
BlockP < T > XBlock,
cudaStream_t stream,
T * z
)
!
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationstreamThe cuda stream to usezThe variable to work on
function fillHaloTopRightC
Wrapping function for calculating flux for halos for each block of a single variable on GPU.
Description
This function is a wraping function of the halo flux functions on GPU. It is called from the main Halo GPU function. The present imnplementation is naive and slow one that calls the rather complex fillLeft type functions
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationzThe variable to work on
Note:
For flux term and actually most terms, only top and right neighbours are needed!
function fillHaloTopRightGPU
template<class T>
void fillHaloTopRightGPU (
Param XParam,
bool doprolong,
BlockP < T > XBlock,
cudaStream_t stream,
T * z
)
function fillLeft
Applying halo flux correction on the left boundaries of all active blocks on GPU.
Parameters:
XParamThe model parametersibThe block indexXBlockThe block structure containing the block informationzThe variable to be refined
Template parameters:
TThe data type (float or double)
function fillLeft
GPU kernel for applying halo flux correction on the left boundaries of all active blocks.
template<class T>
__global__ void fillLeft (
int halowidth,
int * active,
int * level,
int * leftbot,
int * lefttop,
int * rightbot,
int * botright,
int * topright,
T * a
)
Parameters:
halowidthThe width of the halo regionactiveThe array of active block indiceslevelThe array of block levelsleftbotThe array of left bottom neighbor block indiceslefttopThe array of left top neighbor block indicesrightbotThe array of right bottom neighbor block indicesbotrightThe array of bottom right neighbor block indicestoprightThe array of top right neighbor block indicesaThe variable to be refinedTThe data type (float or double)
function fillLeftnew
New way of filling the left halo 2 blocks at a time to maximize GPU occupancy.
template<class T>
__global__ void fillLeftnew (
int halowidth,
int nblk,
int * active,
int * level,
int * leftbot,
int * lefttop,
int * rightbot,
int * botright,
int * topright,
T * a
)
Description
This fuction is a wraping fuction of the halo functions for CPU. It is called from another wraping function to keep things clean. In a sense this is the third (and last) layer of wrapping
Parameters:
halowidthThe width of the halo regionnblkThe number of active blocksactiveThe array of active block indiceslevelThe array of block levelsleftbotThe array of left bottom neighbor block indiceslefttopThe array of left top neighbor block indicesrightbotThe array of right bottom neighbor block indicesbotrightThe array of bottom right neighbor block indicestoprightThe array of top right neighbor block indicesaThe variable to be refined
function fillRight
Fills the right halo region of a block.
Parameters:
XParamThe simulation parametersibThe index of the block to processXBlockThe block structure containing neighbor informationzThe variable to be refined
function fillRight
CUDA kernel to fill the right halo region of blocks in parallel.
template<class T>
__global__ void fillRight (
int halowidth,
int * active,
int * level,
int * rightbot,
int * righttop,
int * leftbot,
int * botleft,
int * topleft,
T * a
)
Parameters:
halowidthThe width of the halo regionactiveThe array of active block indiceslevelThe array of block levelsrightbotThe array of right bottom neighbor block indicesrighttopThe array of right top neighbor block indicesleftbotThe array of left bottom neighbor block indicesbotleftThe array of bottom left neighbor block indicestopleftThe array of top left neighbor block indicesaThe variable to be refined
Template parameters:
TThe data type of the variable (e.g., float, double)
function fillRightFlux
Function to fill the right halo region of a block, handling various neighbor configurations.
template<class T>
void fillRightFlux (
Param XParam,
bool doProlongation,
int ib,
BlockP < T > XBlock,
T *& z
)
Parameters:
XParamThe parameters of the grid and blocksdoProlongationFlag indicating whether to perform prolongationibThe index of the current blockXBlockThe block structure containing neighbor informationzThe variable to be refined
Template parameters:
TThe data type of the variable (e.g., float, double)
function fillRightFlux
CUDA kernel to fill the right halo region of blocks in parallel for flux variables, handling various neighbor configurations.
template<class T>
__global__ void fillRightFlux (
int halowidth,
bool doProlongation,
int * active,
int * level,
int * rightbot,
int * righttop,
int * leftbot,
int * botleft,
int * topleft,
T * a
)
Parameters:
halowidthThe width of the halo regiondoProlongationFlag indicating whether to perform prolongationactiveThe array of active block indiceslevelThe array of block levelsrightbotThe array of right bottom neighbor block indicesrighttopThe array of right top neighbor block indicesleftbotThe array of left bottom neighbor block indicesbotleftThe array of bottom left neighbor block indicestopleftThe array of top left neighbor block indicesaThe variable to be refinedTThe data type of the variable (e.g., float, double)
function fillRightnew
CUDA kernel to fill the right halo region of blocks in parallel (new version).
template<class T>
__global__ void fillRightnew (
int halowidth,
int nblk,
int * active,
int * level,
int * rightbot,
int * righttop,
int * leftbot,
int * botleft,
int * topleft,
T * a
)
Parameters:
halowidthThe width of the halo regionnblkThe number of active blocksactiveThe array of active block indiceslevelThe array of block levelsrightbotThe array of right bottom neighbor block indicesrighttopThe array of right top neighbor block indicesleftbotThe array of left bottom neighbor block indicesbotleftThe array of bottom left neighbor block indicestopleftThe array of top left neighbor block indicesaThe variable to be refined
Template parameters:
TThe data type of the variable (e.g., float, double)
function fillTop
Fills the top halo region of a block, handling various neighbor configurations.
Parameters:
XParamThe parameters of the grid/block structureibThe index of the current blockXBlockThe block structure containing neighbor informationzThe variable to be refinedTThe data type of the variable (e.g., float, double)
function fillTop
CUDA kernel to fill the top halo region of blocks in parallel for new refinement, handling various neighbor configurations, new version.
template<class T>
__global__ void fillTop (
int halowidth,
int * active,
int * level,
int * topleft,
int * topright,
int * botleft,
int * leftbot,
int * rightbot,
T * a
)
Parameters:
halowidthThe width of the halo regionactiveThe array of active block indiceslevelThe array of block levelstopleftThe array of top left neighbor block indicestoprightThe array of top right neighbor block indicesbotleftThe array of bottom left neighbor block indicesleftbotThe array of left bottom neighbor block indicesrightbotThe array of right bottom neighbor block indicesaThe variable to be refinedTThe data type of the variable (e.g., float, double)
function fillTopFlux
Function to fill the top halo region of a block for new refinement, handling various neighbor configurations.
template<class T>
void fillTopFlux (
Param XParam,
bool doProlongation,
int ib,
BlockP < T > XBlock,
T *& z
)
Parameters:
XParamThe parameters of the grid and blocksdoProlongationFlag indicating whether to perform prolongationibThe index of the block to be processedXBlockThe structure containing block neighbor informationzThe variable to be refined
Template parameters:
TThe data type of the variable (e.g., float, double)
function fillTopFlux
CUDA kernel to fill the top halo region of blocks in parallel for new refinement, handling various neighbor configurations, new version.
template<class T>
__global__ void fillTopFlux (
int halowidth,
bool doProlongation,
int * active,
int * level,
int * topleft,
int * topright,
int * botleft,
int * leftbot,
int * rightbot,
T * a
)
Parameters:
halowidthThe width of the halo regiondoProlongationFlag indicating whether to perform prolongationactiveThe array of active block indiceslevelThe array of block levelstopleftThe array of top left neighbor block indicestoprightThe array of top right neighbor block indicesbotleftThe array of bottom left neighbor block indicesleftbotThe array of left bottom neighbor block indicesrightbotThe array of right bottom neighbor block indicesaThe variable to be refinedTThe data type of the variable (e.g., float, double)
function fillTopnew
template<class T>
__global__ void fillTopnew (
int halowidth,
int nblk,
int * active,
int * level,
int * topleft,
int * topright,
int * botleft,
int * leftbot,
int * rightbot,
T * a
)
function refine_linear
Wrapping function for refining all sides of active blocks using linear reconstruction.
template<class T>
void refine_linear (
Param XParam,
BlockP < T > XBlock,
T * z,
T * dzdx,
T * dzdy
)
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationzThe variable to be refineddzdxThe gradient of z in the x directiondzdyThe gradient of z in the y direction
Template parameters:
TThe data type (float or double)
function refine_linearGPU
Wrapping function for refining all sides of active blocks using linear reconstruction on GPU.
template<class T>
void refine_linearGPU (
Param XParam,
BlockP < T > XBlock,
T * z,
T * dzdx,
T * dzdy
)
Parameters:
XParamThe model parametersXBlockThe block structure containing the block informationzThe variable to be refineddzdxThe gradient of z in the x directiondzdyThe gradient of z in the y direction
Template parameters:
TThe data type (float or double)
function refine_linear_Bot
template<class T>
void refine_linear_Bot (
Param XParam,
int ib,
BlockP < T > XBlock,
T * z,
T * dzdy
)
function refine_linear_Left
Refine a block on the left side using linear reconstruction.
template<class T>
void refine_linear_Left (
Param XParam,
int ib,
BlockP < T > XBlock,
T * z,
T * dzdx,
T * dzdy
)
Description
This function refines a block on the left side using linear reconstruction. It checks if the neighboring block on the left is at a coarser level. If so, it calculates the new values for the left boundary of the current block using the gradients in the x and y directions. The new values are computed based on the distance to the neighboring block and the gradients, ensuring a smooth transition between different resolution levels.
Parameters:
XParamThe model parametersibThe index of the current blockXBlockThe block structure containing the block informationzThe variable to be refineddzdxThe gradient of z in the x directiondzdyThe gradient of z in the y direction
Template parameters:
TThe data type (float or double)
function refine_linear_Right
template<class T>
void refine_linear_Right (
Param XParam,
int ib,
BlockP < T > XBlock,
T * z,
T * dzdx
)
function refine_linear_Top
template<class T>
void refine_linear_Top (
Param XParam,
int ib,
BlockP < T > XBlock,
T * z,
T * dzdy
)
The documentation for this class was generated from the following file src/Halo.h