Setups
-
namespace setups
-
class ArtificialTsunami2d : public tsunami_lab::setups::Setup
- #include <ArtificialTsunami2d.h>
2d dam break setup.
Public Functions
-
ArtificialTsunami2d()
Constructor.
- Author
Luca-Philipp Grumbach
- Author
Richard Hofmann
Description
Two-dimensional artificial tsunami
-
t_real computeD(t_real i_x, t_real i_y) const
compute the displacement
- Parameters:
i_x – postion in x direction
i_y – postion in y direction
- Returns:
displacement
-
t_real computeF(t_real i_x) const
compute equation for f
- Parameters:
i_x – postion in x direction
- Returns:
value for f
-
t_real computeG(t_real i_y) const
compute equation for g
- Parameters:
i_y – postion in y direction
- Returns:
value for g
-
virtual t_real getHeight(t_real i_x, t_real i_y) const
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
i_y – y-coordinate of the queried point.
- Returns:
water height at the given point.
-
virtual t_real getMomentumX(t_real, t_real) const
Gets the momentum in x-direction.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real i_y) const
Gets the bathymetry.
- Parameters:
i_x – x-coordinate of the queried point.
i_y – y-coordinate of the queried point.
- Returns:
bathymetry.
Private Static Attributes
-
static t_real constexpr m_pi = 3.1415926
-
ArtificialTsunami2d()
-
class CircularDamBreak2d : public tsunami_lab::setups::Setup
- #include <CircularDamBreak2d.h>
2d dam break setup.
Public Functions
-
CircularDamBreak2d(tsunami_lab::t_real i_height, tsunami_lab::t_real i_baseHeight, tsunami_lab::t_real i_diameter)
Constructor.
- Author
Luca-Philipp Grumbach
- Author
Richard Hofmann
Description
Two-dimensional circular dam break problem.
- Parameters:
i_height – height of the water
i_diameter – diameter of the circular wave
-
virtual t_real getHeight(t_real i_x, t_real i_y) const
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
i_y – y-coordinate of the queried point.
- Returns:
height at the given point.
-
virtual t_real getMomentumX(t_real, t_real) const
Gets the momentum in x-direction.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real, t_real) const
Gets the bathymetry
- Returns:
bathymetry.
-
CircularDamBreak2d(tsunami_lab::t_real i_height, tsunami_lab::t_real i_baseHeight, tsunami_lab::t_real i_diameter)
-
class DamBreak1d : public tsunami_lab::setups::Setup
- #include <DamBreak1d.h>
1d dam break setup.
Public Functions
-
DamBreak1d(t_real i_heightLeft, t_real i_heightRight, t_real i_locationDam)
Constructor.
- Author
Luca-Philipp Grumbach
- Author
Richard Hofmann
Description
One-dimensional dam break problem.
- Parameters:
i_heightLeft – water height on the left side of the dam.
i_heightRight – water height on the right side of the dam.
i_locationDam – location (x-coordinate) of the dam.
-
virtual t_real getHeight(t_real i_x, t_real) const
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
height at the given point.
-
virtual t_real getMomentumX(t_real, t_real) const
Gets the momentum in x-direction.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real) const
Gets the bathymetry
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
bathymetry.
-
DamBreak1d(t_real i_heightLeft, t_real i_heightRight, t_real i_locationDam)
-
class GeneralDiscontinuity1d : public tsunami_lab::setups::Setup
- #include <GeneralDiscontinuity1d.h>
Public Functions
-
GeneralDiscontinuity1d(t_real i_hL, t_real i_hR, t_real i_huL, t_real i_huR, t_real i_xdis)
Constructor.
- Author
Luca-Philipp Grumbach
- Author
Richard Hofmann
Description
one-dimensional discontinuity problem
- Parameters:
i_hL – water height on the left side
i_hR – water height on the right side
i_huL – water momentum on the left side
i_huR – water momentum on the right side
i_xdis – position of discontinuity
-
virtual t_real getHeight(t_real i_x, t_real) const
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
height at the given point.
-
virtual t_real getMomentumX(t_real i_x, t_real) const
Gets the momentum in x-direction.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real) const
Gets the bathymetry
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
bathymetry.
-
GeneralDiscontinuity1d(t_real i_hL, t_real i_hR, t_real i_huL, t_real i_huR, t_real i_xdis)
-
class RareRare1d : public tsunami_lab::setups::Setup
- #include <RareRare1d.h>
Public Functions
-
RareRare1d(t_real i_h, t_real i_huL, t_real i_xdis)
Constructor.
- Author
Luca-Philipp Grumbach
- Author
Richard Hofmann
Description
Implementation of One-dimensional rare-rare Riemann problems
- Parameters:
i_h – water height of both sides
i_huL – water momentum on the left side
i_xdis – discontinuity location
-
virtual t_real getHeight(t_real i_x, t_real) const
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
height at the given point.
-
virtual t_real getMomentumX(t_real, t_real) const
Gets the momentum in x-direction.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real) const
Gets the bathymetry
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
bathymetry.
-
RareRare1d(t_real i_h, t_real i_huL, t_real i_xdis)
-
class Setup
- #include <Setup.h>
Base setup.
Subclassed by tsunami_lab::setups::ArtificialTsunami2d, tsunami_lab::setups::CircularDamBreak2d, tsunami_lab::setups::DamBreak1d, tsunami_lab::setups::GeneralDiscontinuity1d, tsunami_lab::setups::RareRare1d, tsunami_lab::setups::ShockShock1d, tsunami_lab::setups::Subcritical1d, tsunami_lab::setups::Supercritical1d, tsunami_lab::setups::TsunamiEvent1d, tsunami_lab::setups::TsunamiEvent2d
Public Functions
-
inline virtual ~Setup()
Virtual destructor for base class.
-
virtual t_real getHeight(t_real i_x, t_real i_y) const = 0
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
i_y – y-coordinate of the queried point.
- Returns:
water height at the given point.
-
virtual t_real getMomentumX(t_real i_x, t_real i_y) const = 0
Gets the momentum in x-direction.
- Parameters:
i_x – x-coordinate of the queried point.
i_y – y-coordinate of the queried point.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real i_x, t_real i_y) const = 0
Gets the momentum in y-direction.
- Parameters:
i_x – x-coordinate of the queried point.
i_y – y-coordinate of the queried point.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real i_y) const = 0
Gets the bathymetry.
- Parameters:
i_x – x-coordinate of the queried point.
i_y – y-coordinate of the queried point.
- Returns:
bathymetry.
-
inline virtual ~Setup()
-
class ShockShock1d : public tsunami_lab::setups::Setup
- #include <ShockShock1d.h>
Public Functions
-
ShockShock1d(t_real i_h, t_real i_huL, t_real i_xdis)
Constructor.
- Author
Luca-Philipp Grumbach
- Author
Richard Hofmann
Description
Implementation of shock-shock Riemann problems
- Parameters:
i_h – water height of both sides
i_huL – water momentum on the left side
i_xdis – discontinuity location
-
virtual t_real getHeight(t_real i_x, t_real) const
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
height at the given point.
-
virtual t_real getMomentumX(t_real, t_real) const
Gets the momentum in x-direction.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real) const
Gets the bathymetry
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
bathymetry.
-
ShockShock1d(t_real i_h, t_real i_huL, t_real i_xdis)
-
class Subcritical1d : public tsunami_lab::setups::Setup
- #include <Subcritical1d.h>
Public Functions
-
Subcritical1d(t_real i_h, t_real i_hu)
Constructor.
- Author
Luca-Philipp Grumbach
- Author
Richard Hofmann
Description
one-dimensional subcritical problem
- Parameters:
i_h – water height
i_hu – water momentum
-
virtual t_real getHeight(t_real i_x, t_real) const
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
height at the given point.
-
virtual t_real getMomentumX(t_real i_x, t_real) const
Gets the momentum in x-direction.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real) const
Gets the bathymetry
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
bathymetry.
-
Subcritical1d(t_real i_h, t_real i_hu)
-
class Supercritical1d : public tsunami_lab::setups::Setup
- #include <Supercritical1d.h>
Public Functions
-
Supercritical1d(t_real i_h, t_real i_hu)
Constructor.
- Author
Luca-Philipp Grumbach
- Author
Richard Hofmann
Description
one-dimensional supercritical problem
- Parameters:
i_h – water height
i_hu – water momentum
-
virtual t_real getHeight(t_real i_x, t_real) const
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
height at the given point.
-
virtual t_real getMomentumX(t_real i_x, t_real) const
Gets the momentum in x-direction.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real) const
Gets the bathymetry
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
bathymetry.
-
Supercritical1d(t_real i_h, t_real i_hu)
-
class TsunamiEvent1d : public tsunami_lab::setups::Setup
- #include <TsunamiEvent1d.h>
Public Functions
-
TsunamiEvent1d(const std::string &i_file)
Constructor
- Author
Luca-Philipp Grumbach
- Author
Richard Hofmann
Description
Implementation of One-dimensional Tsunami event
- Parameters:
i_file – csv file path containing bathymetry data.
-
~TsunamiEvent1d()
Destructor which frees all allocated memory.
-
virtual t_real getHeight(t_real, t_real) const
Gets the water height at a given point.
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
height at the given point.
-
virtual t_real getMomentumX(t_real, t_real) const
Gets the momentum in x-direction.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real) const
Gets the bathymetry
- Parameters:
i_x – x-coordinate of the queried point.
- Returns:
bathymetry.
-
t_real computeD(t_real i_x, t_real) const
computes vertical displacement
- Returns:
vertical displacement
-
TsunamiEvent1d(const std::string &i_file)
-
class TsunamiEvent2d : public tsunami_lab::setups::Setup
- #include <TsunamiEvent2d.h>
2d dam break setup.
Public Functions
-
TsunamiEvent2d(const char *i_bathymetryPath, const char *i_displacementPath, t_real &o_domainSizeX, t_real &o_domainSizeY, t_real &o_offsetX, t_real &o_offsetY)
Constructor.
- Parameters:
i_bathymetryPath – path to file containing bathymetry data
i_displacementPath – path to file containing bathymetry data
o_domainSizeX – size of the domain in x-direction
o_domainSizeY – size of the domain in y-direction
o_offsetX – offset of the domain in x-direction
o_offsetY – offset of the domain in y-direction
-
~TsunamiEvent2d()
Destructor.
-
virtual t_real getHeight(t_real i_x, t_real i_y) const
Gets the water height at a given point.
- Parameters:
i_x – x position
i_y – y position
- Returns:
height at the given point.
-
virtual t_real getMomentumX(t_real, t_real) const
Gets the momentum in x-direction.
- Returns:
momentum in x-direction.
-
virtual t_real getMomentumY(t_real, t_real) const
Gets the momentum in y-direction.
- Returns:
momentum in y-direction.
-
virtual t_real getBathymetry(t_real i_x, t_real i_y) const
Gets the bathymetry
- Parameters:
i_x – x position
i_y – y position
- Returns:
bathymetry.
Private Functions
-
t_real getBathymetryFromArray(t_real i_x, t_real i_y) const
gets the value for bathymetry at a point
- Parameters:
i_x – x position
i_y – y position
- Returns:
bathymetry value
-
t_real getDisplacementFromArray(t_real i_x, t_real i_y) const
gets the value for displacement at a point
- Parameters:
i_x – x position
i_y – y position
- Returns:
displacment value
Private Members
-
t_real m_delta = 20
value for delta
-
const char *m_bathymetryPath
bathymetry file path
-
const char *m_displacementPath
displacement file path
-
t_real m_bathymetryOffsetX = 0
offset of the bathymetry domain in x-direction
-
t_real m_bathymetryOffsetY = 0
offset of the displacement domain in y-direction
-
t_real m_displacementOffsetX = 0
offset of the displacement domain in x-direction
-
t_real m_displacementOffsetY = 0
offset of the displacement domain in y-direction
-
t_real m_bathymetrySampleDistanceX = 0
distance between to bathymetry samples in x-direction
-
t_real m_bathymetrySampleDistanceXInverse = 0
inverse distance between to bathymetry samples in x-direction
-
t_real m_bathymetrySampleDistanceY = 0
distance between to bathymetry samples in y-direction
-
t_real m_bathymetrySampleDistanceYInverse = 0
inverse distance between to bathymetry samples in y-direction
-
t_real m_displacementSampleDistanceX = 0
distance between to displacement samples in x-direction
-
t_real m_displacementSampleDistanceXInverse = 0
inverse distance between to displacement samples in x-direction
-
t_real m_displacementSampleDistanceY = 0
distance between to displacement samples in y-direction
-
t_real m_displacementSampleDistanceYInverse = 0
inverse distance between to displacement samples in y-direction
-
t_idx m_nxB = 0
amount of cells bathymetry
-
t_idx m_nyB = 0
-
t_real *m_xDataB = nullptr
bathymetry data x
-
t_real *m_yDataB = nullptr
bathymetry data y
-
t_real *m_b = nullptr
bathymetry
-
t_idx m_nxD = 0
amount of cells displacement
-
t_idx m_nyD = 0
-
t_real *m_xDataD = nullptr
displacement data x
-
t_real *m_yDataD = nullptr
displacement data x
-
t_real *m_d = nullptr
displacement
-
TsunamiEvent2d(const char *i_bathymetryPath, const char *i_displacementPath, t_real &o_domainSizeX, t_real &o_domainSizeY, t_real &o_offsetX, t_real &o_offsetY)
-
class ArtificialTsunami2d : public tsunami_lab::setups::Setup