Tsunami Project Lab
Loading...
Searching...
No Matches
Stations.h
Go to the documentation of this file.
1
16#ifndef TSUNAMI_LAB_IO_STATIONS_H
17#define TSUNAMI_LAB_IO_STATIONS_H
18
19#include "../constants.h"
20#include <fstream>
21#include <string>
22#include <vector>
23
24namespace tsunami_lab {
25 namespace io {
26 class Stations;
27 }
28}
29
31 private:
35 struct Station {
36 std::string name;
37 t_real x = 0;
38 t_real y = 0;
39 t_idx ix = 0;
40 t_idx iy = 0;
41 std::ofstream file;
42 };
43
45 std::vector<Station> m_stations;
46
48 t_real m_frequency = 0;
49
51 t_real m_nextSampleTime = 0;
52
54 t_idx m_stride = 0;
55
56 public:
71 Stations( std::string i_xmlPath,
72 t_real i_dxy,
73 t_idx i_nx,
74 t_idx i_ny,
75 t_idx i_stride );
76
95 void sample( t_real i_simTime,
96 t_real const * i_h,
97 t_real const * i_hu,
98 t_real const * i_hv,
99 t_real const * i_bm );
100
104 t_idx size() const { return m_stations.size(); }
105
109 std::string const & name( t_idx i ) const { return m_stations[i].name; }
110
114 t_idx cellIx( t_idx i ) const { return m_stations[i].ix; }
115 t_idx cellIy( t_idx i ) const { return m_stations[i].iy; }
116
120 t_real frequency() const { return m_frequency; }
121};
122
123#endif
Definition Stations.h:30
t_idx cellIx(t_idx i) const
Definition Stations.h:114
t_real frequency() const
Definition Stations.h:120
std::string const & name(t_idx i) const
Definition Stations.h:109
void sample(t_real i_simTime, t_real const *i_h, t_real const *i_hu, t_real const *i_hv, t_real const *i_bm)
Definition Stations.cpp:149
t_idx cellIy(t_idx i) const
Definition Stations.h:115
t_idx size() const
Definition Stations.h:104
Stations(std::string i_xmlPath, t_real i_dxy, t_idx i_nx, t_idx i_ny, t_idx i_stride)
Definition Stations.cpp:25
Definition constants.h:12
float t_real
floating point type
Definition constants.h:17
std::size_t t_idx
integral type for cell-ids, pointer arithmetic, etc.
Definition constants.h:14