BG_Flood  0.8
Documentation (Work-in-progress)
Halo.h File Reference
#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"
Include dependency graph for Halo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T >
void fillHaloC (Param XParam, BlockP< T > XBlock, T *z)
 Wrapping function for calculating halos for each block of a single variable on CPU. More...
 
template<class T >
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. More...
 
template<class T >
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. More...
 
template<class T >
void fillHaloGPUnew (Param XParam, BlockP< T > XBlock, cudaStream_t stream, T *z)
 
template<class T >
void fillHalo (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T *zb)
 
template<class T >
void fillHalo (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev)
 
template<class T >
void fillHaloGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev)
 
template<class T >
void fillHaloGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T *zb)
 
template<class T >
void fillHalo (Param XParam, BlockP< T > XBlock, GradientsP< T > Grad)
 
template<class T >
void fillHaloGPU (Param XParam, BlockP< T > XBlock, GradientsP< T > Grad)
 
template<class T >
void fillHalo (Param XParam, BlockP< T > XBlock, FluxP< T > Flux)
 
template<class T >
void fillHaloGPU (Param XParam, BlockP< T > XBlock, FluxP< T > Flux)
 
template<class T >
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. More...
 
template<class T >
void fillHaloTopRightGPU (Param XParam, bool doprolong, BlockP< T > XBlock, cudaStream_t stream, T *z)
 
template<class T >
void fillLeft (Param XParam, int ib, BlockP< T > XBlock, T *&z)
 
template<class T >
void fillRight (Param XParam, int ib, BlockP< T > XBlock, T *&z)
 
template<class T >
void fillBot (Param XParam, int ib, BlockP< T > XBlock, T *&z)
 
template<class T >
void fillTop (Param XParam, int ib, BlockP< T > XBlock, T *&z)
 
template<class T >
void fillTopFlux (Param XParam, bool doProlongation, int ib, BlockP< T > XBlock, T *&z)
 
template<class T >
void fillRightFlux (Param XParam, bool doProlongation, int ib, BlockP< T > XBlock, T *&z)
 
template<class T >
void fillCorners (Param XParam, int ib, BlockP< T > XBlock, T *&z)
 
template<class T >
void fillCorners (Param XParam, BlockP< T > XBlock, T *&z)
 
template<class T >
void fillCorners (Param XParam, BlockP< T > XBlock, EvolvingP< T > &Xev)
 
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 CPU. More...
 
template<class T >
__global__ void RecalculateZsGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T *zb)
 
template<class T >
void Recalculatehh (Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T *zb)
 
template<class T >
void refine_linear (Param XParam, BlockP< T > XBlock, T *z, T *dzdx, T *dzdy)
 
template<class T >
void refine_linearGPU (Param XParam, BlockP< T > XBlock, T *z, T *dzdx, T *dzdy)
 
template<class T >
void refine_linear_Left (Param XParam, int ib, BlockP< T > XBlock, T *z, T *dzdx, T *dzdy)
 
template<class T >
void refine_linear_Top (Param XParam, int ib, BlockP< T > XBlock, T *z, T *dzdy)
 
template<class T >
void refine_linear_Bot (Param XParam, int ib, BlockP< T > XBlock, T *z, T *dzdy)
 
template<class T >
void refine_linear_Right (Param XParam, int ib, BlockP< T > XBlock, T *z, T *dzdx)
 
template<class T >
__global__ void fillLeft (int halowidth, int *active, int *level, int *leftbot, int *lefttop, int *rightbot, int *botright, int *topright, T *a)
 
template<class T >
__global__ void fillRight (int halowidth, int *active, int *level, int *rightbot, int *righttop, int *leftbot, int *botleft, int *topleft, T *a)
 
template<class T >
__global__ void fillBot (int halowidth, int *active, int *level, int *botleft, int *botright, int *topleft, int *lefttop, int *righttop, T *a)
 
template<class T >
__global__ void fillTop (int halowidth, int *active, int *level, int *topleft, int *topright, int *botleft, int *leftbot, int *rightbot, T *a)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
template<class T >
__global__ void HaloFluxGPULR (Param XParam, BlockP< T > XBlock, T *z)
 
template<class T >
__global__ void HaloFluxGPUBT (Param XParam, BlockP< T > XBlock, T *z)
 

Function Documentation

◆ fillBot() [1/2]

template<class T >
__global__ void fillBot ( int  halowidth,
int *  active,
int *  level,
int *  botleft,
int *  botright,
int *  topleft,
int *  lefttop,
int *  righttop,
T *  a 
)

◆ fillBot() [2/2]

template<class T >
void fillBot ( Param  XParam,
int  ib,
BlockP< T >  XBlock,
T *&  z 
)

◆ fillBotnew()

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 
)

◆ fillCorners() [1/3]

template<class T >
void fillCorners ( Param  XParam,
BlockP< T >  XBlock,
EvolvingP< T > &  Xev 
)

◆ fillCorners() [2/3]

template<class T >
void fillCorners ( Param  XParam,
BlockP< T >  XBlock,
T *&  z 
)

◆ fillCorners() [3/3]

template<class T >
void fillCorners ( Param  XParam,
int  ib,
BlockP< T >  XBlock,
T *&  z 
)

◆ fillHalo() [1/4]

template<class T >
void fillHalo ( Param  XParam,
BlockP< T >  XBlock,
EvolvingP< T >  Xev 
)

◆ fillHalo() [2/4]

template<class T >
void fillHalo ( Param  XParam,
BlockP< T >  XBlock,
EvolvingP< T >  Xev,
T *  zb 
)

◆ fillHalo() [3/4]

template<class T >
void fillHalo ( Param  XParam,
BlockP< T >  XBlock,
FluxP< T >  Flux 
)

◆ fillHalo() [4/4]

template<class T >
void fillHalo ( Param  XParam,
BlockP< T >  XBlock,
GradientsP< T >  Grad 
)

◆ fillHaloC()

template<class T >
void fillHaloC ( Param  XParam,
BlockP< T >  XBlock,
T *  z 
)

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.

◆ fillHaloF()

template<class T >
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.

Depreciated

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

Description

◆ fillHaloGPU() [1/5]

template<class T >
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.

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

◆ fillHaloGPU() [2/5]

template<class T >
void fillHaloGPU ( Param  XParam,
BlockP< T >  XBlock,
EvolvingP< T >  Xev 
)

◆ fillHaloGPU() [3/5]

template<class T >
void fillHaloGPU ( Param  XParam,
BlockP< T >  XBlock,
EvolvingP< T >  Xev,
T *  zb 
)

◆ fillHaloGPU() [4/5]

template<class T >
void fillHaloGPU ( Param  XParam,
BlockP< T >  XBlock,
FluxP< T >  Flux 
)

◆ fillHaloGPU() [5/5]

template<class T >
void fillHaloGPU ( Param  XParam,
BlockP< T >  XBlock,
GradientsP< T >  Grad 
)

◆ fillHaloGPUnew()

template<class T >
void fillHaloGPUnew ( Param  XParam,
BlockP< T >  XBlock,
cudaStream_t  stream,
T *  z 
)

◆ fillHaloTopRightC()

template<class T >
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.

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

◆ fillHaloTopRightGPU()

template<class T >
void fillHaloTopRightGPU ( Param  XParam,
bool  doprolong,
BlockP< T >  XBlock,
cudaStream_t  stream,
T *  z 
)

◆ fillLeft() [1/2]

template<class T >
__global__ void fillLeft ( int  halowidth,
int *  active,
int *  level,
int *  leftbot,
int *  lefttop,
int *  rightbot,
int *  botright,
int *  topright,
T *  a 
)

◆ fillLeft() [2/2]

template<class T >
void fillLeft ( Param  XParam,
int  ib,
BlockP< T >  XBlock,
T *&  z 
)

◆ fillLeftnew()

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 
)

◆ fillRight() [1/2]

template<class T >
__global__ void fillRight ( int  halowidth,
int *  active,
int *  level,
int *  rightbot,
int *  righttop,
int *  leftbot,
int *  botleft,
int *  topleft,
T *  a 
)

◆ fillRight() [2/2]

template<class T >
void fillRight ( Param  XParam,
int  ib,
BlockP< T >  XBlock,
T *&  z 
)

◆ fillRightFlux() [1/2]

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 
)

◆ fillRightFlux() [2/2]

template<class T >
void fillRightFlux ( Param  XParam,
bool  doProlongation,
int  ib,
BlockP< T >  XBlock,
T *&  z 
)

◆ fillRightnew()

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 
)

◆ fillTop() [1/2]

template<class T >
__global__ void fillTop ( int  halowidth,
int *  active,
int *  level,
int *  topleft,
int *  topright,
int *  botleft,
int *  leftbot,
int *  rightbot,
T *  a 
)

◆ fillTop() [2/2]

template<class T >
void fillTop ( Param  XParam,
int  ib,
BlockP< T >  XBlock,
T *&  z 
)

◆ fillTopFlux() [1/2]

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 
)

◆ fillTopFlux() [2/2]

template<class T >
void fillTopFlux ( Param  XParam,
bool  doProlongation,
int  ib,
BlockP< T >  XBlock,
T *&  z 
)

◆ 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 
)

◆ HaloFluxGPUBT()

template<class T >
__global__ void HaloFluxGPUBT ( Param  XParam,
BlockP< T >  XBlock,
T *  z 
)

◆ HaloFluxGPULR()

template<class T >
__global__ void HaloFluxGPULR ( Param  XParam,
BlockP< T >  XBlock,
T *  z 
)

◆ Recalculatehh()

template<class T >
void Recalculatehh ( Param  XParam,
BlockP< T >  XBlock,
EvolvingP< T >  Xev,
T *  zb 
)

◆ RecalculateZs()

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 CPU.

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

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

◆ RecalculateZsGPU()

template<class T >
__global__ void RecalculateZsGPU ( Param  XParam,
BlockP< T >  XBlock,
EvolvingP< T >  Xev,
T *  zb 
)

◆ refine_linear()

template<class T >
void refine_linear ( Param  XParam,
BlockP< T >  XBlock,
T *  z,
T *  dzdx,
T *  dzdy 
)

◆ refine_linear_Bot()

template<class T >
void refine_linear_Bot ( Param  XParam,
int  ib,
BlockP< T >  XBlock,
T *  z,
T *  dzdy 
)

◆ refine_linear_Left()

template<class T >
void refine_linear_Left ( Param  XParam,
int  ib,
BlockP< T >  XBlock,
T *  z,
T *  dzdx,
T *  dzdy 
)

◆ refine_linear_Right()

template<class T >
void refine_linear_Right ( Param  XParam,
int  ib,
BlockP< T >  XBlock,
T *  z,
T *  dzdx 
)

◆ refine_linear_Top()

template<class T >
void refine_linear_Top ( Param  XParam,
int  ib,
BlockP< T >  XBlock,
T *  z,
T *  dzdy 
)

◆ refine_linearGPU()

template<class T >
void refine_linearGPU ( Param  XParam,
BlockP< T >  XBlock,
T *  z,
T *  dzdx,
T *  dzdy 
)