1 #include "condition_action_sequence.hpp" 3 #include "../../misc/utils.hpp" 6 (
const vector<pair<const Condition*, const Action*> >& sequence) :
9 ConditionActionSequence::~ConditionActionSequence(
void)
11 for (
size_t i = 0; i < sequence_.size(); ++i) {
12 delete sequence_[i].first;
13 delete sequence_[i].second;
22 const vector<ComputationalCell>& cells,
25 const vector<pair<const ConditionActionSequence::Condition*, const ConditionActionSequence::Action*> >& sequence,
28 for (
size_t i = 0; i < sequence.size(); ++i) {
29 const pair<bool, bool> flag_aux = (*sequence[i].first)
30 (edge, tess, cells, tracerstickernames);
32 return (*sequence[i].second)
33 (edge, tess, edge_velocity, cells, eos, flag_aux.second, res, time, tracerstickernames);
39 vector<Extensive> ConditionActionSequence::operator()
41 const vector<Vector2D>& edge_velocities,
42 const vector<ComputationalCell>& cells,
43 const vector<Extensive>& extensives,
50 vector<Extensive> res(tess.
getAllEdges().size(), extensives[0]);
51 for (
size_t i = 0; i < tess.
getAllEdges().size(); ++i)
58 sequence_, res[i], time, tracerstickernames);
62 ConditionActionSequence::Condition::~Condition(
void) {}
64 ConditionActionSequence::Action::~Action(
void) {}
71 void conserved_to_extensive
79 for (
size_t i = 0; i < N; ++i)
84 void RegularFlux::operator()
88 const vector<ComputationalCell>& cells,
106 (cells.at(static_cast<size_t>(edge.
neighbors.first)), eos,tracerstickernames),
108 (cells.at(static_cast<size_t>(edge.
neighbors.second)), eos,tracerstickernames),
110 conserved_to_extensive
113 cells.at(static_cast<size_t>(edge.
neighbors.first)) :
114 cells.at(static_cast<size_t>(edge.
neighbors.second)), res);
122 pair<Primitive, Primitive> rigid_wall_states
130 return pair<Primitive, Primitive>(left, right);
135 return pair<Primitive, Primitive>(left, right);
140 void RigidWallFlux::operator()
144 const vector<ComputationalCell>& cells,
160 const pair<Primitive, Primitive> left_right =
166 eos,tracerstickernames),
173 conserved_to_extensive
175 cells.at(static_cast<size_t>(aux ? edge.
neighbors.first : edge.
neighbors.second)), res);
181 void FreeFlowFlux::operator()
185 const vector<ComputationalCell>& cells,
211 eos,tracerstickernames);
216 conserved_to_extensive
218 cells.at(static_cast<size_t>(aux ? edge.
neighbors.first : edge.
neighbors.second)), res);
221 IsBoundaryEdge::IsBoundaryEdge(
void) {}
223 pair<bool, bool> IsBoundaryEdge::operator()
229 return pair<bool, bool>(
false,
false);
233 return pair<bool, bool>(
true,
true);
235 return pair<bool, bool>(
true,
false);
239 IsBulkEdge::IsBulkEdge(
void) {}
241 pair<bool, bool> IsBulkEdge::operator()
246 return pair<bool, bool>
257 sticker_name_(sticker_name) {}
259 pair<bool, bool> RegularSpecialEdge::operator()
262 const vector<ComputationalCell>& cells,
TracerStickerNames const& tracerstickernames)
const 264 if (
safe_retrieve(cells.at(static_cast<size_t>(edge.
neighbors.first)).stickers,tracerstickernames.sticker_names,
266 if (
safe_retrieve(cells.at(static_cast<size_t>(edge.
neighbors.second)).stickers,tracerstickernames.sticker_names,
268 return pair<bool, bool>(
false,
false);
269 return pair<bool, bool>(
true,
false);
271 if (
safe_retrieve(cells.at(static_cast<size_t>(edge.
neighbors.second)).stickers,tracerstickernames.sticker_names,
273 return pair<bool, bool>(
true,
true);
274 return pair<bool, bool>(
false,
false);
Set of conserved variables (extensive)
Vector2D Momentum
Momentum.
FreeFlowFlux(const RiemannSolver &rs)
Class constructor.
Vector2D remove_parallel_component(const Vector2D &v, const Vector2D &p)
Remove parallel component of a vector.
Abstract class for tessellation.
virtual int GetPointNo(void) const =0
Get Total number of mesh generating points.
virtual int GetOriginalIndex(int point) const
Returns the original index of the duplicated point.
Vector2D momentum
momentum, in relativity it is = rho*h*gamma*v
Container for error reports.
Primitive convert_to_primitive(const ComputationalCell &cell, const EquationOfState &eos, TracerStickerNames const &tracerstickernames)
Converts computational cell to primitive variables.
double mass
rest mass times gamma
Interface between two cells.
virtual Vector2D GetMeshPoint(int index) const =0
Returns Position of mesh generating point.
double Energy
Total energy (kinetic + thermal)
double energy
energy, in relativity it is = rho*h*gamma^2-P-rho
tvector tracers
Tracers (can transfer from one cell to another)
RegularSpecialEdge(const string &sticker_name)
Class constructor.
Base class for Riemann solver.
Conserved rotate_solve_rotate_back(const RiemannSolver &rs, const Primitive &left, const Primitive &right, const double velocity, const Vector2D &n, const Vector2D &p)
Rotates, solve riemann problem and rotates results back.
double ScalarProd(Vector3D const &v1, Vector3D const &v2)
Scalar product of two vectors.
virtual const vector< Edge > & getAllEdges(void) const =0
Returns reference to the list of all edges.
Base class for equation of state.
std::pair< Vector2D, Vector2D > vertices
Points at the ends of the edge.
Primitive reflect(const Primitive &p, const Vector2D &axis)
Reflects velocity about axis.
Container for cache data.
vector< T >::const_reference safe_retrieve(vector< T > const &data, vector< S > const &keys, const S &key)
Checks for existence and retrieves entry from flat map.
Vector2D normalize(const Vector2D &v)
Normalized a vector.
RegularFlux(const RiemannSolver &rs)
Class constructor.
Class for keeping the names of the tracers and stickers.
std::pair< int, int > neighbors
Neighboring cells.
ConditionActionSequence(const vector< pair< const Condition *, const Action *> > &sequence)
Class constructor.
RigidWallFlux(const RiemannSolver &rs)
Class constructor.
Primitive hydrodynamic variables.