|
Tsunami Project Lab
|
#include <WavePropagation2d.h>


Public Member Functions | |
| WavePropagation2d (t_idx i_nx, t_idx i_ny) | |
| ~WavePropagation2d () | |
| void | timeStep (t_real i_scaling) |
| void | setGhostBoundary (BoundaryCondition i_left, BoundaryCondition i_right, BoundaryCondition i_bottom, BoundaryCondition i_top) |
| 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 i_iy, t_real i_h) |
| void | setMomentumX (t_idx i_ix, t_idx i_iy, t_real i_hu) |
| void | setMomentumY (t_idx i_ix, t_idx i_iy, t_real i_hv) |
| void | setBathymetry (t_idx i_ix, t_idx i_iy, 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 > | |
| T | solver |
|
inline |
Constructs the 2d wave propagation solver.
| i_nx | number of cells in x-direction (interior, no ghosts). |
| i_ny | number of cells in y-direction (interior, no ghosts). |
|
inline |
Destructor which frees all allocated memory.
|
inlinevirtual |
Gets the cells' bathymetry.
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Gets cells' water heights. The pointer addresses interior cell (0, 0); access cell (ix, iy) via ptr[ix + iy * getStride()].
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Gets the cells' momenta in x-direction.
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Gets the cells' momenta in y-direction.
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Gets the stride in y-direction. x-direction is stride-1.
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Sets the bathymetry of the interior cell.
| i_ix | id of the cell in x-direction. |
| i_iy | id of the cell in y-direction. |
| i_b | bathymetry value. |
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Sets the ghost cells per side. Bathymetry and water height are always copied from the inner cell. At reflecting walls only the normal momentum component is negated (Spec 3.2.1):
Corner ghost cells (i ∈ {0, m_nx+1} ∧ j ∈ {0, m_ny+1}) are irrelevant for the unsplit method (no Riemann problem references them) and are left untouched here.
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Convenience: outflow on all four sides.
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Convenience: reflecting on all four sides (Spec 3.2.1).
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Sets the height of the interior cell to the given value.
| i_ix | id of the cell in x-direction (0-based, interior). |
| i_iy | id of the cell in y-direction (0-based, interior). |
| i_h | water height. |
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Sets the momentum in x-direction to the given value.
| i_ix | id of the cell in x-direction. |
| i_iy | id of the cell in y-direction. |
| i_hu | momentum in x-direction. |
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Sets the momentum in y-direction to the given value.
| i_ix | id of the cell in x-direction. |
| i_iy | id of the cell in y-direction. |
| i_hv | momentum in y-direction. |
Implements tsunami_lab::patches::WavePropagation< T >.
|
inlinevirtual |
Performs a time step using the unsplit donor-cell method.
Q^{n+1}_{i,j} = Q^n_{i,j}
Both sweeps read from Q^n exclusively and accumulate their contributions into Q^{n+1} (which starts as a copy of Q^n). x-edges feed (h, hu, b) to the 1d Riemann solver and update h,hu on each side; y-edges feed (h, hv, b) and update h,hv. The tangential momentum is left untouched by each 1d solve.
Wet/dry edges follow the same convention as the 1d patch (Spec 3.2): a dry side is mirrored from its wet partner with the normal momentum negated, and updates are only applied to wet cells so dry cells stay dry.
Assumes a uniform grid (Δx = Δy) so a single scaling factor suffices; assignment 4 scenarios are all on square domains.
| i_scaling | scaling Δt/Δxy of the time step. |
Implements tsunami_lab::patches::WavePropagation< T >.