#include <Stations.h>
◆ Stations()
| tsunami_lab::io::Stations::Stations |
( |
std::string | i_xmlPath, |
|
|
t_real | i_dxy, |
|
|
t_idx | i_nx, |
|
|
t_idx | i_ny, |
|
|
t_idx | i_stride ) |
Parses the given XML config, pins each station to its containing cell, and opens one CSV per station in the current working directory (filename = <name>.csv). On any malformed config (missing root, missing frequency, station out of bounds, duplicate name, unwritable file) throws std::runtime_error with a message pointing at the offending element.
- Parameters
-
| i_xmlPath | path to the XML config (read from CWD). |
| i_dxy | uniform cell width/height (m). |
| i_nx | number of interior cells in x-direction. |
| i_ny | number of interior cells in y-direction. |
| i_stride | row stride of the data arrays passed to sample(). |
◆ cellIx()
| t_idx tsunami_lab::io::Stations::cellIx |
( |
t_idx | i | ) |
const |
|
inline |
Containing cell index of the i-th station (mainly for tests).
◆ cellIy()
| t_idx tsunami_lab::io::Stations::cellIy |
( |
t_idx | i | ) |
const |
|
inline |
◆ frequency()
| t_real tsunami_lab::io::Stations::frequency |
( |
| ) |
const |
|
inline |
Shared output frequency in seconds.
◆ name()
| std::string const & tsunami_lab::io::Stations::name |
( |
t_idx | i | ) |
const |
|
inline |
Read-only view on the i-th station's name (mainly for tests).
◆ sample()
Writes a row to every station file if the simulation has reached the next scheduled sample time. Safe to call every time step.
If the simulation advanced past several sample times in a single step (very small frequency), one row is emitted per missed target; each row records the actual simulation time of the call, so the recorded times are slightly after the scheduled targets.
For 1d wave-propagation patches i_hv may be nullptr; the column is then written as 0.
- Parameters
-
| i_simTime | current simulation time. |
| i_h | water heights (interior origin, length stride*ny). |
| i_hu | x-momenta (same layout). |
| i_hv | y-momenta (same layout) or nullptr in 1d. |
| i_bm | bathymetry or nullptr. |
◆ size()
| t_idx tsunami_lab::io::Stations::size |
( |
| ) |
const |
|
inline |
Number of stations parsed from the config (mainly for tests).
The documentation for this class was generated from the following files: