Tsunami Project Lab
Loading...
Searching...
No Matches
tsunami_lab::patches::WavePropagation1d< T > Class Template Reference

#include <WavePropagation1d.h>

Inheritance diagram for tsunami_lab::patches::WavePropagation1d< T >:
Collaboration diagram for tsunami_lab::patches::WavePropagation1d< T >:

Public Member Functions

 WavePropagation1d (t_idx i_nCells)
 
 ~WavePropagation1d ()
 
void timeStep (t_real i_scaling)
 
void setGhostBoundary (BoundaryCondition i_left, BoundaryCondition i_right, BoundaryCondition, BoundaryCondition)
 
void setGhostOutflow ()
 
void setGhostReflection ()
 
t_idx getStride ()
 
t_real const * getHeight ()
 
t_real const * getMomentumX ()
 
t_real const * getMomentumY ()
 
t_real const * getBathymetry ()
 
void setHeight (t_idx i_ix, t_idx, t_real i_h)
 
void setMomentumX (t_idx i_ix, t_idx, t_real i_hu)
 
void setMomentumY (t_idx, t_idx, t_real)
 
void setBathymetry (t_idx i_ix, t_idx, t_real i_b)
 
- Public Member Functions inherited from tsunami_lab::patches::WavePropagation< T >
 WavePropagation ()
 
virtual ~WavePropagation ()
 

Additional Inherited Members

- Protected Attributes inherited from tsunami_lab::patches::WavePropagation< T >
solver
 

Detailed Description

template<class T>
class tsunami_lab::patches::WavePropagation1d< T >

This file now also contains the full definition of the class, otherwise the template functions aren't possible. The alternative would declaring each needed version explcitly in a file e.g. template class tsunami_lab::patches::WavePropagation1d<tsunami_lab::solvers::Roe>;

Constructor & Destructor Documentation

◆ WavePropagation1d()

template<class T >
tsunami_lab::patches::WavePropagation1d< T >::WavePropagation1d ( t_idx i_nCells)
inline

Constructs the 1d wave propagation solver.

Parameters
i_nCellsnumber of cells.

◆ ~WavePropagation1d()

template<class T >
tsunami_lab::patches::WavePropagation1d< T >::~WavePropagation1d ( )
inline

Destructor which frees all allocated memory.

Member Function Documentation

◆ getBathymetry()

template<class T >
t_real const * tsunami_lab::patches::WavePropagation1d< T >::getBathymetry ( )
inlinevirtual

Gets the cells' bathymetry.

Returns
bathymetry.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ getHeight()

template<class T >
t_real const * tsunami_lab::patches::WavePropagation1d< T >::getHeight ( )
inlinevirtual

Gets cells' water heights.

Returns
water heights.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ getMomentumX()

template<class T >
t_real const * tsunami_lab::patches::WavePropagation1d< T >::getMomentumX ( )
inlinevirtual

Gets the cells' momenta in x-direction.

Returns
momenta in x-direction.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ getMomentumY()

template<class T >
t_real const * tsunami_lab::patches::WavePropagation1d< T >::getMomentumY ( )
inlinevirtual

Dummy function which returns a nullptr.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ getStride()

template<class T >
t_idx tsunami_lab::patches::WavePropagation1d< T >::getStride ( )
inlinevirtual

Gets the stride in y-direction. x-direction is stride-1.

Returns
stride in y-direction.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ setBathymetry()

template<class T >
void tsunami_lab::patches::WavePropagation1d< T >::setBathymetry ( t_idx i_ix,
t_idx ,
t_real i_b )
inlinevirtual

Sets the bathymetry to the given value.

Parameters
i_ixid of the cell in x-direction.
i_iynot supported for 1d wave propagation.
i_bbathymetry.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ setGhostBoundary()

template<class T >
void tsunami_lab::patches::WavePropagation1d< T >::setGhostBoundary ( BoundaryCondition i_left,
BoundaryCondition i_right,
BoundaryCondition ,
BoundaryCondition  )
inlinevirtual

Sets the ghost cells per side. Bathymetry and water height are always copied from the inner cell; the momentum is negated when the side is REFLECTING (3.2.1). The bottom/top arguments are ignored in 1d.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ setGhostOutflow()

template<class T >
void tsunami_lab::patches::WavePropagation1d< T >::setGhostOutflow ( )
inlinevirtual

Convenience: outflow on both sides.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ setGhostReflection()

template<class T >
void tsunami_lab::patches::WavePropagation1d< T >::setGhostReflection ( )
inlinevirtual

Convenience: reflecting on both sides (Spec 3.2.1).

Implements tsunami_lab::patches::WavePropagation< T >.

◆ setHeight()

template<class T >
void tsunami_lab::patches::WavePropagation1d< T >::setHeight ( t_idx i_ix,
t_idx ,
t_real i_h )
inlinevirtual

Sets the height of the cell to the given value.

Parameters
i_ixid of the cell in x-direction.
i_hwater height.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ setMomentumX()

template<class T >
void tsunami_lab::patches::WavePropagation1d< T >::setMomentumX ( t_idx i_ix,
t_idx ,
t_real i_hu )
inlinevirtual

Sets the momentum in x-direction to the given value.

Parameters
i_ixid of the cell in x-direction.
i_humomentum in x-direction.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ setMomentumY()

template<class T >
void tsunami_lab::patches::WavePropagation1d< T >::setMomentumY ( t_idx ,
t_idx ,
t_real  )
inlinevirtual

Dummy function since there is no y-momentum in the 1d solver.

Implements tsunami_lab::patches::WavePropagation< T >.

◆ timeStep()

template<class T >
void tsunami_lab::patches::WavePropagation1d< T >::timeStep ( t_real i_scaling)
inlinevirtual

Performs a time step.

Parameters
i_scalingscaling of the time step (dt / dx).

Implements tsunami_lab::patches::WavePropagation< T >.


The documentation for this class was generated from the following file: