Virtual Testbed
Ship dynamics simulator for extreme conditions
anlt_wind_solver.hh
1 #ifndef VTESTBED_CORE_ANLT_WIND_SOLVER_HH
2 #define VTESTBED_CORE_ANLT_WIND_SOLVER_HH
3 
4 #include <memory>
5 #include <vector>
6 
7 #include <vtestbed/core/types.hh>
8 #include <vtestbed/geometry/polyline.hh>
9 #include <vtestbed/geometry/ray.hh>
10 #include <vtestbed/geometry/types.hh>
11 
12 namespace vtb {
13 
14  namespace core {
15 
16  template <class T>
18 
19  public:
20  using array_type = Array<T,4>;
21  using vec3 = blitz::TinyVector<T,3>;
22  using wind_field_type = Array<vec3,3>;
23  using grid_type = Grid<T,3>;
28 
29  protected:
30  wind_field_type _wind_field;
31  ray_array _wind_field_boundary;
32  bool _on_the_boundary = true;
33  bool _near_the_boundary = false;
34  bool _stratification = false;
35 
36  public:
37 
38  ANLT_wind_solver() = default;
39  virtual ~ANLT_wind_solver() = default;
40 
41  inline wind_field_type& wind_field() { return this->_wind_field; }
42  inline const wind_field_type& wind_field() const { return this->_wind_field; }
43 
45  inline bool on_the_boundary() const { return this->_on_the_boundary; }
46  inline void on_the_boundary(bool rhs) { this->_on_the_boundary = rhs; }
47 
49  inline bool near_the_boundary() const { return this->_near_the_boundary; }
50  inline void near_the_boundary(bool rhs) { this->_near_the_boundary = rhs; }
51 
53  inline bool stratification() const { return this->_stratification; }
54  inline void stratification(bool rhs) { this->_stratification = rhs; }
55 
56  inline const ray_array&
57  wind_field_boundary() const {
58  return this->_wind_field_boundary;
59  }
60 
61  virtual void step(const grid_type& grid, panel_array& panels) = 0;
62  };
63 
64  template <class T, Policy P>
66  make_anlt_wind_solver();
67 
68  }
69 
70 }
71 
72 #endif // vim:filetype=cpp
bool on_the_boundary() const
Compute wind field on the boundary.
bool near_the_boundary() const
Compute wind field near the boundary.
Triangular ship hull panel (face).
bool stratification() const
Make wind speed increase with height.
Main namespace.
Definition: convert.hh:9