condition_action_sequence.hpp
1 #ifndef CONDITION_ACTION_SEQUENCE_HPP
2 #define CONDITION_ACTION_SEQUENCE_HPP 1
3 
4 #include "flux_calculator_2d.hpp"
5 #include "../common/riemann_solver.hpp"
6 
9 {
10 public:
11 
13  class Condition
14  {
15  public:
16 
24  virtual pair<bool, bool> operator()(const Edge& edge,
25  const Tessellation& tess,
26  const vector<ComputationalCell>& cells,
27  TracerStickerNames const& tracerstickernames) const = 0;
28 
29  virtual ~Condition(void);
30  };
31 
33  class Action
34  {
35  public:
36 
48  virtual void operator()
49  (const Edge& edge,
50  const Tessellation& tess,
51  const Vector2D& edge_velocity,
52  const vector<ComputationalCell>& cells,
53  const EquationOfState& eos,
54  const bool aux,
55  Extensive &res, double time,
56  TracerStickerNames const& tracerstickernames) const = 0;
57 
58  virtual ~Action(void);
59  };
60 
65  (const vector<pair<const Condition*, const Action*> >& sequence);
66 
68 
69  vector<Extensive> operator()
70  (const Tessellation& tess,
71  const vector<Vector2D>& edge_velocities,
72  const vector<ComputationalCell>& cells,
73  const vector<Extensive>& extensives,
74  const CacheData& cd,
75  const EquationOfState& eos,
76  const double time,
77  const double dt,
78  TracerStickerNames const& tracerstickernames) const;
79 
80 private:
81  const vector<pair<const Condition*, const Action*> > sequence_;
82 };
83 
86 {
87 public:
88 
92  explicit RegularFlux(const RiemannSolver& rs);
93 
94  void operator()
95  (const Edge& edge,
96  const Tessellation& tess,
97  const Vector2D& edge_velocity,
98  const vector<ComputationalCell>& cells,
99  const EquationOfState& eos,
100  const bool aux,
101  Extensive &res, double time,
102  TracerStickerNames const& tracerstickernames) const;
103 
104 private:
105 
106  const RiemannSolver& rs_;
107 };
108 
111 {
112 public:
113 
117  explicit RigidWallFlux(const RiemannSolver& rs);
118 
119  void operator()
120  (const Edge& edge,
121  const Tessellation& tess,
122  const Vector2D& edge_velocity,
123  const vector<ComputationalCell>& cells,
124  const EquationOfState& eos,
125  const bool aux,
126  Extensive &res, double time,
127  TracerStickerNames const& tracerstickernames) const;
128 
129 private:
130  const RiemannSolver& rs_;
131 };
132 
135 {
136 public:
137 
141  explicit FreeFlowFlux(const RiemannSolver& rs);
142 
143  void operator()
144  (const Edge& edge,
145  const Tessellation& tess,
146  const Vector2D& edge_velocity,
147  const vector<ComputationalCell>& cells,
148  const EquationOfState& eos,
149  const bool aux,
150  Extensive &res, double time,
151  TracerStickerNames const& tracerstickernames) const;
152 
153 private:
154  const RiemannSolver& rs_;
155 };
156 
159 {
160 public:
161 
162  IsBoundaryEdge(void);
163 
164  pair<bool, bool> operator()
165  (const Edge& edge,
166  const Tessellation& tess,
167  const vector<ComputationalCell>& cells,
168  TracerStickerNames const& tracerstickernames) const;
169 };
170 
173 {
174 public:
175 
176  IsBulkEdge(void);
177 
178  pair<bool, bool> operator()
179  (const Edge& edge,
180  const Tessellation& tess,
181  const vector<ComputationalCell>& cells,
182  TracerStickerNames const& tracerstickernames) const;
183 };
184 
187 {
188 public:
189 
193  explicit RegularSpecialEdge(const string& sticker_name);
194 
195  pair<bool, bool> operator()
196  (const Edge& edge,
197  const Tessellation& tess,
198  const vector<ComputationalCell>& cells,
199  TracerStickerNames const& tracerstickernames) const;
200 
201 private:
202  const string sticker_name_;
203 };
204 
205 #endif // CONDITION_ACTION_SEQUENCE_HPP
Extensive variables.
Definition: extensive.hpp:18
Determines the kind of interface.
Abstract class for tessellation.
Action taken to calculate flux.
Base class for flux calculator.
Interface between two cells.
Definition: Edge.hpp:13
First order flux calculator based on a series of conditions and actions.
Base class for Riemann solver.
Calculates flux assuming rigid wall boundary conditions.
Base class for flux calculator.
Base class for equation of state.
Container for cache data.
Definition: cache_data.hpp:14
Estimate flux assuming free flow boundary conditions.
Class for keeping the names of the tracers and stickers.
Check if an interface is inside the domain.
virtual pair< bool, bool > operator()(const Edge &edge, const Tessellation &tess, const vector< ComputationalCell > &cells, TracerStickerNames const &tracerstickernames) const =0
Checks if an interface satisfies a condition.
Determines if the interface is between a regular and a special cell.
ConditionActionSequence(const vector< pair< const Condition *, const Action *> > &sequence)
Class constructor.
Calculates flux between two regular bulk cells.
2D Mathematical vector
Definition: geometry.hpp:15
Checks if a certain edge is a boundary edge.