UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sim_fdm_snapshot.hpp
1 /* sim_fdm_snapshot.hpp */
2 /* $Id$ */
3 #ifndef __sim_fdm_snapshot_hpp
4 #define __sim_fdm_snapshot_hpp
5 
6 #include <vector>
7 #include <s2proc/sim_service.hpp>
8 #include <s2proc/sim_point_2d.hpp>
9 
13 namespace sim
14 {
18  namespace fdm
19  {
23  class Snapshot
24  {
25  public:
26 
30  class Area
31  {
32  public:
33 
35  Area() {/* nothing to do*/}
36 
42  Area(const Point2D &top_left_coords,
43  const std::vector<CoordT> &dx_vec,
44  const std::vector<CoordT> &dz_vec);
45 
51  Area(const Point2D &top_left_coords,
52  const Point2D &bottom_right_coords,
53  const Point2D &coord_steps);
54 
56  const Point2D& topLeftCoords() const {return m_top_left_coords;}
57 
60  const std::vector<CoordT>& stepVec(const CoordsMask &coord) const;
61 
62  protected:
63 
65  std::vector<CoordT> m_dx_vec;
66  std::vector<CoordT> m_dz_vec;
67  };
68 
70  Snapshot();
71 
75  Snapshot(const Area &area);
76 
77 
81  std::vector<AmplT>& operator()(const CoordsMask &coord);
82 
85  const std::vector<AmplT>& operator()(const CoordsMask &coord) const;
86 
87 
91  int id(const Point2D &coords) const;
92 
93 
100  AmplT* operator()(const size_t x_id,
101  const size_t z_id,
102  const CoordsMask &coord);
103 
110  const AmplT* operator()(const size_t x_id,
111  const size_t z_id,
112  const CoordsMask &coord) const;
113 
115  const Area& area() const {return m_area;}
116 
117 
118  static bool test_to_file(const Snapshot &snapshot, const std::string &fname);
119 
120  private:
121 
122  Area m_area;
123  std::vector<AmplT> m_u_snapshot;
124  std::vector<AmplT> m_w_snapshot;
125  };
126 
127  }; // finite differences modeling namespace
128 
129 }; // simulation namespace
130 
131 #endif /* sim_fdm_snapshot.hpp */
std::vector< AmplT > & operator()(const CoordsMask &coord)
Point2D m_top_left_coords
Definition: sim_fdm_snapshot.hpp:64
int id(const Point2D &coords) const
Definition: sim_fdm_snapshot.hpp:23
const Area & area() const
Definition: sim_fdm_snapshot.hpp:115
CoordsMask
Definition: sim_service.hpp:20
Area()
Definition: sim_fdm_snapshot.hpp:35
Definition: sim_fdm_snapshot.hpp:30
const std::vector< CoordT > & stepVec(const CoordsMask &coord) const
Definition: sim_point_2d.hpp:16
bool sim(size_t n, const Trace::AmplT *x, const Trace::AmplT *y, Trace::AmplT &s)
std::vector< CoordT > m_dx_vec
Definition: sim_fdm_snapshot.hpp:65
std::vector< CoordT > m_dz_vec
Definition: sim_fdm_snapshot.hpp:66
const Point2D & topLeftCoords() const
Definition: sim_fdm_snapshot.hpp:56