Tsunami Project Lab
Loading...
Searching...
No Matches
WavePropagation.h
Go to the documentation of this file.
1
7#ifndef TSUNAMI_LAB_PATCHES_WAVE_PROPAGATION
8#define TSUNAMI_LAB_PATCHES_WAVE_PROPAGATION
9
10#include "../constants.h"
11#include "../solvers/Solver.h"
12#include <type_traits>
13
14namespace tsunami_lab {
15 namespace patches {
19 enum class BoundaryCondition {
20 OUTFLOW,
24 };
25 template <class T>
26 class WavePropagation;
27 }
28}
29
30template <class T>
32 protected: T solver;
33 public:
34
36 static_assert(std::is_base_of<solvers::Solver, T>::value, "T not derived from Solver");
37
38 solver = T();
39 }
40
44 virtual ~WavePropagation(){}
45
51 virtual void timeStep( t_real i_scaling ) = 0;
52
61 virtual void setGhostBoundary( BoundaryCondition i_left,
62 BoundaryCondition i_right,
63 BoundaryCondition i_bottom,
64 BoundaryCondition i_top ) = 0;
65
69 virtual void setGhostOutflow() = 0;
70
74 virtual void setGhostReflection() = 0;
75
81 virtual t_idx getStride() = 0;
82
88 virtual t_real const * getHeight() = 0;
89
95 virtual t_real const * getMomentumX() = 0;
96
102 virtual t_real const * getMomentumY() = 0;
103
109 virtual t_real const *getBathymetry() = 0;
110
118 virtual void setHeight( t_idx i_ix,
119 t_idx i_iy,
120 t_real i_h ) = 0;
121
129 virtual void setMomentumX( t_idx i_ix,
130 t_idx i_iy,
131 t_real i_hu ) = 0;
132
140 virtual void setMomentumY( t_idx i_ix,
141 t_idx i_iy,
142 t_real i_hv ) = 0;
143
144
152 virtual void setBathymetry( t_idx i_ix,
153 t_idx i_iy,
154 t_real i_b) = 0;
155};
156
157#endif
Definition WavePropagation.h:31
T solver
Definition WavePropagation.h:32
virtual t_real const * getHeight()=0
virtual void setGhostBoundary(BoundaryCondition i_left, BoundaryCondition i_right, BoundaryCondition i_bottom, BoundaryCondition i_top)=0
WavePropagation()
Definition WavePropagation.h:35
virtual void setMomentumY(t_idx i_ix, t_idx i_iy, t_real i_hv)=0
virtual void setMomentumX(t_idx i_ix, t_idx i_iy, t_real i_hu)=0
virtual ~WavePropagation()
Definition WavePropagation.h:44
virtual void setHeight(t_idx i_ix, t_idx i_iy, t_real i_h)=0
virtual void timeStep(t_real i_scaling)=0
virtual t_real const * getMomentumX()=0
virtual t_real const * getMomentumY()=0
virtual void setBathymetry(t_idx i_ix, t_idx i_iy, t_real i_b)=0
virtual t_real const * getBathymetry()=0
BoundaryCondition
Definition WavePropagation.h:19
@ OUTFLOW
zero-gradient: copy the inner cell into the ghost cell
Definition constants.h:12
float t_real
floating point type
Definition constants.h:17
std::size_t t_idx
integral type for cell-ids, pointer arithmetic, etc.
Definition constants.h:14