BG_Flood  0.8
Documentation (Work-in-progress)
Halo.h
Go to the documentation of this file.
1 
2 #ifndef HALO_H
3 #define HALO_H
4 
5 #include "General.h"
6 #include "Param.h"
7 #include "Write_txtlog.h"
8 #include "Util_CPU.h"
9 #include "Arrays.h"
10 #include "Mesh.h"
11 #include "MemManagement.h"
12 #include "Boundary.h"
13 #include "ConserveElevation.h"
14 
15 template <class T> void fillHaloC(Param XParam, BlockP<T> XBlock, T* z);
16 template <class T> void fillHaloF(Param XParam, bool doProlongation, BlockP<T> XBlock, T* z);
17 template <class T> void fillHaloGPU(Param XParam, BlockP<T> XBlock, cudaStream_t stream, T* z);
18 template <class T> void fillHaloGPUnew(Param XParam, BlockP<T> XBlock, cudaStream_t stream, T* z);
19 
20 template <class T> void fillHalo(Param XParam, BlockP<T> XBlock, EvolvingP<T> Xev,T*zb);
21 template <class T> void fillHalo(Param XParam, BlockP<T> XBlock, EvolvingP<T> Xev);
22 template <class T> void fillHaloGPU(Param XParam, BlockP<T> XBlock, EvolvingP<T> Xev);
23 template <class T> void fillHaloGPU(Param XParam, BlockP<T> XBlock, EvolvingP<T> Xev, T* zb);
24 
25 template <class T> void fillHalo(Param XParam, BlockP<T> XBlock, GradientsP<T> Grad);
26 template <class T> void fillHaloGPU(Param XParam, BlockP<T> XBlock, GradientsP<T> Grad);
27 
28 template <class T> void fillHalo(Param XParam, BlockP<T> XBlock, FluxP<T> Flux);
29 template <class T> void fillHaloGPU(Param XParam, BlockP<T> XBlock, FluxP<T> Flux);
30 
31 template <class T> void fillHaloTopRightC(Param XParam, BlockP<T> XBlock, T* z);
32 template <class T> void fillHaloTopRightGPU(Param XParam, bool doprolong, BlockP<T> XBlock, cudaStream_t stream, T* z);
33 
34 template <class T> void fillLeft(Param XParam, int ib, BlockP<T> XBlock, T*& z);
35 template <class T> void fillRight(Param XParam, int ib, BlockP<T> XBlock, T*& z);
36 template <class T> void fillBot(Param XParam, int ib, BlockP<T> XBlock, T*& z);
37 template <class T> void fillTop(Param XParam, int ib, BlockP<T> XBlock, T*& z);
38 
39 template <class T> void fillTopFlux(Param XParam, bool doProlongation, int ib, BlockP<T> XBlock, T*& z);
40 template <class T> void fillRightFlux(Param XParam, bool doProlongation, int ib, BlockP<T> XBlock, T*& z);
41 
42 template <class T> void fillCorners(Param XParam, int ib, BlockP<T> XBlock, T*& z);
43 
44 template <class T> void fillCorners(Param XParam, BlockP<T> XBlock, T*& z);
45 template <class T> void fillCorners(Param XParam, BlockP<T> XBlock, EvolvingP<T>& Xev);
46 
47 template <class T> void RecalculateZs(Param XParam, BlockP<T> XBlock, EvolvingP<T> Xev, T* zb);
48 template <class T> __global__ void RecalculateZsGPU(Param XParam, BlockP<T> XBlock, EvolvingP<T> Xev, T* zb);
49 
50 template <class T> void Recalculatehh(Param XParam, BlockP<T> XBlock, EvolvingP<T> Xev, T* zb);
51 
52 template <class T> void refine_linear(Param XParam, BlockP<T> XBlock, T* z, T* dzdx, T* dzdy);
53 template <class T> void refine_linearGPU(Param XParam, BlockP<T> XBlock, T* z, T* dzdx, T* dzdy);
54 
55 template <class T> void refine_linear_Left(Param XParam, int ib, BlockP<T> XBlock, T* z, T* dzdx, T* dzdy);
56 template <class T> void refine_linear_Top(Param XParam, int ib, BlockP<T> XBlock, T* z, T* dzdy);
57 template <class T> void refine_linear_Bot(Param XParam, int ib, BlockP<T> XBlock, T* z, T* dzdy);
58 template <class T> void refine_linear_Right(Param XParam, int ib, BlockP<T> XBlock, T* z, T* dzdx);
59 
60 // GPU versions
61 template <class T> __global__ void fillLeft(int halowidth, int* active, int* level, int* leftbot, int* lefttop, int* rightbot, int* botright, int* topright, T* a);
62 template <class T> __global__ void fillRight(int halowidth, int* active, int* level, int* rightbot, int* righttop, int* leftbot, int* botleft, int* topleft, T* a);
63 template <class T> __global__ void fillBot(int halowidth, int* active, int* level, int* botleft, int* botright, int* topleft, int* lefttop, int* righttop, T* a);
64 template <class T> __global__ void fillTop(int halowidth, int* active, int* level, int* topleft, int* topright, int* botleft, int* leftbot, int* rightbot, T* a);
65 
66 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);
67 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);
68 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);
69 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);
70 
71 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);
72 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);
73 
74 
75 template <class T> __global__ void HaloFluxGPULR(Param XParam, BlockP<T> XBlock, T* z);
76 template <class T> __global__ void HaloFluxGPUBT(Param XParam, BlockP<T> XBlock, T* z);
77 
78 // End of global definition
79 #endif
void refine_linearGPU(Param XParam, BlockP< T > XBlock, T *z, T *dzdx, T *dzdy)
Definition: Halo.cu:998
void refine_linear_Right(Param XParam, int ib, BlockP< T > XBlock, T *z, T *dzdx)
__global__ void HaloFluxGPUBT(Param XParam, BlockP< T > XBlock, T *z)
Definition: Halo.cu:1407
void fillRight(Param XParam, int ib, BlockP< T > XBlock, T *&z)
Definition: Halo.cu:2313
void fillHaloGPUnew(Param XParam, BlockP< T > XBlock, cudaStream_t stream, T *z)
Definition: Halo.cu:237
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.
Definition: Halo.cu:210
void fillRightFlux(Param XParam, bool doProlongation, int ib, BlockP< T > XBlock, T *&z)
Definition: Halo.cu:2874
__global__ void fillBotnew(int halowidth, int nblk, int *active, int *level, int *botleft, int *botright, int *topleft, int *lefttop, int *righttop, T *a)
Definition: Halo.cu:3491
void fillHalo(Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T *zb)
Definition: Halo.cu:439
void refine_linear_Bot(Param XParam, int ib, BlockP< T > XBlock, T *z, T *dzdy)
__global__ void RecalculateZsGPU(Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T *zb)
Definition: Halo.cu:150
void refine_linear_Left(Param XParam, int ib, BlockP< T > XBlock, T *z, T *dzdx, T *dzdy)
Definition: Halo.cu:756
void fillBot(Param XParam, int ib, BlockP< T > XBlock, T *&z)
Definition: Halo.cu:3123
__global__ void fillTopnew(int halowidth, int nblk, int *active, int *level, int *topleft, int *topright, int *botleft, int *leftbot, int *rightbot, T *a)
Definition: Halo.cu:4157
__global__ void HaloFluxGPULR(Param XParam, BlockP< T > XBlock, T *z)
Definition: Halo.cu:1105
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.
Definition: Halo.cu:186
void fillTopFlux(Param XParam, bool doProlongation, int ib, BlockP< T > XBlock, T *&z)
Definition: Halo.cu:4328
void Recalculatehh(Param XParam, BlockP< T > XBlock, EvolvingP< T > Xev, T *zb)
Definition: Halo.cu:98
void fillHaloTopRightGPU(Param XParam, bool doprolong, BlockP< T > XBlock, cudaStream_t stream, T *z)
void refine_linear(Param XParam, BlockP< T > XBlock, T *z, T *dzdx, T *dzdy)
Definition: Halo.cu:984
void fillCorners(Param XParam, int ib, BlockP< T > XBlock, T *&z)
Definition: Halo.cu:4599
void fillHaloC(Param XParam, BlockP< T > XBlock, T *z)
Wrapping function for calculating halos for each block of a single variable on CPU.
Definition: Halo.cu:36
__global__ void fillRightnew(int halowidth, int nblk, int *active, int *level, int *rightbot, int *righttop, int *leftbot, int *botleft, int *topleft, T *a)
Definition: Halo.cu:2694
void refine_linear_Top(Param XParam, int ib, BlockP< T > XBlock, T *z, T *dzdy)
void fillLeft(Param XParam, int ib, BlockP< T > XBlock, T *&z)
Definition: Halo.cu:1613
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.
Definition: Halo.cu:274
__global__ void fillLeftnew(int halowidth, int nblk, int *active, int *level, int *leftbot, int *lefttop, int *rightbot, int *botright, int *topright, T *a)
Definition: Halo.cu:2000
void fillTop(Param XParam, int ib, BlockP< T > XBlock, T *&z)
Definition: Halo.cu:3788
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.
Definition: Halo.cu:59
Definition: Param.h:10
Definition: Arrays.h:86
Definition: Arrays.h:29
Definition: Arrays.h:46
Definition: Arrays.h:11