|
Tsunami Project Lab
|
#include <NetCdf.h>
Public Member Functions | |
| bool | inBounds (t_real i_x, t_real i_y) const |
| t_real | sampleNearest (t_real i_x, t_real i_y) const |
Public Attributes | |
| t_idx | nx = 0 |
| number of x-coordinates | |
| t_idx | ny = 0 |
| number of y-coordinates | |
| std::vector< t_real > | x |
| monotonically ascending x (size nx) | |
| std::vector< t_real > | y |
| monotonically ascending y (size ny) | |
| std::vector< t_real > | z |
| 2d field in (y, x) order (size nx * ny) | |
Regular 2d grid loaded from a netCDF input file: monotonically increasing coordinates x and y plus a 2d field z stored in row-major (y, x) order, i.e. z[iy * nx + ix]. Used for the bathymetry and earthquake-displacement inputs of TsunamiEvent2d.
True if the query point lies inside the inclusive bounding box spanned by the cell-centre coordinates. Callers that want "zero outside" semantics (e.g. earthquake displacement that only covers part of the simulation domain) check this first.
| tsunami_lab::t_real tsunami_lab::io::NetCdf::Grid::sampleNearest | ( | t_real | i_x, |
| t_real | i_y ) const |
Nearest-neighbor sample at (i_x, i_y). Always returns the value at the closest grid cell — clamps to the boundary when (i_x, i_y) lies outside the bbox, so callers wanting strict out-of-bbox handling must guard with inBounds().
Assumes the grid is uniformly spaced (the regular-grid assumption from the spec); the index is computed in O(1) from the spacing of the coordinate variables.
| t_idx tsunami_lab::io::NetCdf::Grid::nx = 0 |
number of x-coordinates
| t_idx tsunami_lab::io::NetCdf::Grid::ny = 0 |
number of y-coordinates
| std::vector<t_real> tsunami_lab::io::NetCdf::Grid::x |
monotonically ascending x (size nx)
| std::vector<t_real> tsunami_lab::io::NetCdf::Grid::y |
monotonically ascending y (size ny)
| std::vector<t_real> tsunami_lab::io::NetCdf::Grid::z |
2d field in (y, x) order (size nx * ny)