simple_cell_updater.hpp
Go to the documentation of this file.
1 
6 #ifndef SIMPLE_CELL_UPDATER_HPP
7 #define SIMPLE_CELL_UPDATER_HPP 1
8 
9 #include "cell_updater_2d.hpp"
10 #include "../../misc/utils.hpp"
11 
12 using std::vector;
13 
16 {
17 public:
18 
20  class Condition
21  {
22  public:
23 
24  virtual ~Condition(void);
25 
37  virtual bool operator()
38  (const Tessellation& tess,
39  const PhysicalGeometry& pg,
40  const EquationOfState& eos,
41  const vector<Extensive>& extensives,
42  const vector<ComputationalCell>& cells,
43  const CacheData& cd,
44  const size_t index,
45  TracerStickerNames const& tracerstickernames) const = 0;
46  };
47 
49  class Action
50  {
51  public:
52 
53  virtual ~Action(void);
54 
66  virtual ComputationalCell operator()
67  (const Tessellation& tess,
68  const PhysicalGeometry& pg,
69  const EquationOfState& eos,
70  const vector<Extensive>& extensives,
71  const vector<ComputationalCell>& cells,
72  const CacheData& cd,
73  const size_t index,
74  TracerStickerNames const& tracerstickernames,
75  double time)const = 0;
76  };
77 
83  explicit SimpleCellUpdater
84  (const vector<pair<const SimpleCellUpdater::Condition*, const SimpleCellUpdater::Action*> > sequence =
85  vector<pair<const SimpleCellUpdater::Condition*, const SimpleCellUpdater::Action*> >(),bool SR = false,double G = 0);
86 
87  vector<ComputationalCell> operator()
88  (const Tessellation& tess,
89  const PhysicalGeometry& pg,
90  const EquationOfState& eos,
91  vector<Extensive>& extensives,
92  const vector<ComputationalCell>& old,
93  const CacheData& cd,
94  const TracerStickerNames& tracerstickernames,
95  double time) const;
96 
97  ~SimpleCellUpdater(void);
98 
99 private:
100  const vector<pair<const SimpleCellUpdater::Condition*, const SimpleCellUpdater::Action*> > sequence_;
101  const bool SR_;
102  const double G_;
103  const string entropy_;
104 };
105 
108 {
109 public:
110 
114  explicit HasSticker(const string& sticker_name);
115 
116  bool operator()
117  (const Tessellation& tess,
118  const PhysicalGeometry& pg,
119  const EquationOfState& eos,
120  const vector<Extensive>& extensives,
121  const vector<ComputationalCell>& cells,
122  const CacheData& cd,
123  const size_t index,
124  TracerStickerNames const& tracerstickernames) const;
125 
126 private:
127  const string sticker_name_;
128 };
129 
132 {
133 public:
134 
135  SkipUpdate(void);
136 
137  ComputationalCell operator()
138  (const Tessellation& tess,
139  const PhysicalGeometry& pg,
140  const EquationOfState& eos,
141  const vector<Extensive>& extensives,
142  const vector<ComputationalCell>& cells,
143  const CacheData& cd,
144  const size_t index,
145  TracerStickerNames const& tracerstickernames,
146  double time) const;
147 };
148 
149 #endif // SIMPLE_CELL_UPDATER_HPP
Abstract class for tessellation.
Prevents certain cells from being updated.
Abstract class to determine cell type.
Action taken to calculate cell.
Base class for equation of state.
Base class for cell update scheme.
Container for cache data.
Definition: cache_data.hpp:14
SimpleCellUpdater(const vector< pair< const SimpleCellUpdater::Condition *, const SimpleCellUpdater::Action *> > sequence=vector< pair< const SimpleCellUpdater::Condition *, const SimpleCellUpdater::Action *> >(), bool SR=false, double G=0)
Class constructor.
Base class for cell update scheme.
Class for keeping the names of the tracers and stickers.
Checks if a cell contains a certain sticker.
Simple cell updater.
Base class for physical geometry.
Computational cell.