hdsim2d.hpp
Go to the documentation of this file.
1 
6 #ifndef HDSIM_HPP
7 #define HDSIM_HPP 1
8 
9 #include "computational_cell_2d.hpp"
10 #include "../common/equation_of_state.hpp"
12 #include "../common/riemann_solver.hpp"
13 #include "point_motion.hpp"
15 #include "../../tessellation/tessellation.hpp"
16 #include "../common/hydrodynamics.hpp"
17 #include "SourceTerm.hpp"
18 #include "../../tessellation/HilbertOrder.hpp"
19 #include "OuterBoundary.hpp"
20 #include "../../misc/utils.hpp"
21 #include "../../misc/cached_lazy_list.hpp"
22 #include "../../misc/lazy_list.hpp"
23 #include "../../misc/universal_error.hpp"
24 #include "extensive.hpp"
25 #include "RefineStrategy.hpp"
26 #include "RemovalStrategy.hpp"
27 #include "../../misc/utils.hpp"
28 #include "ResetDump.hpp"
29 #include "physical_geometry.hpp"
30 #include "simple_cfl.hpp"
31 #include "flux_calculator_2d.hpp"
32 #include "cell_updater_2d.hpp"
33 #include "extensive_updater.hpp"
34 #include "cache_data.hpp"
35 #include "edge_velocity_calculator.hpp"
36 #include <boost/container/small_vector.hpp>
37 #include "computational_cell_2d.hpp"
38 #ifdef RICH_MPI
39 #include "../../mpi/ProcessorUpdate.hpp"
40 #endif
41 
43 class hdsim
44 {
45 private:
46 #ifdef RICH_MPI
47  Tessellation& proctess_;
48 #endif
49 
50  Tessellation& tess_;
51 
52  const OuterBoundary& obc_;
53 
54  const EquationOfState& eos_;
55 
56  vector<ComputationalCell> cells_;
57 
58  vector<Extensive> extensives_;
59 
60  const PointMotion& point_motion_;
61 
62  const EdgeVelocityCalculator& edge_velocity_calculator_;
63 
64  const SourceTerm& source_;
65 
66  double time_;
67 
68  int cycle_;
69 
70  const PhysicalGeometry& pg_;
71 
72  const TimeStepFunction& tsf_;
73 
74  const FluxCalculator& fc_;
75 
76  const ExtensiveUpdater& eu_;
77 
78  const CellUpdater& cu_;
79 
80  TracerStickerNames tracer_sticker_names_;
81 
82  const CacheData cache_data_;
83 
84 #ifdef RICH_MPI
85  const ProcessorUpdate* proc_update_;
86 #endif
87 
88  // The purpose of these declarations is to disable copying
89  hdsim(const hdsim& origin);
90 
91  hdsim& operator=(const hdsim& origin);
92 
93 public:
94 
98  const vector<ComputationalCell>& getAllCells(void) const;
99 
103  vector<ComputationalCell>& getAllCells(void);
104 
106  void recalculatePrimitives(void);
107 
110  void recalculateExtensives(void);
111 
115  const PhysicalGeometry& getPhysicalGeometry(void) const;
116 
120  const Tessellation& getTessellation(void) const;
121 
126 
127 #ifdef RICH_MPI
128 
131  const Tessellation & GetProcTessellation(void)const;
132 #endif
133 
151 #ifdef RICH_MPI
152 #endif // RICH_MPI
155  hdsim
156  (
157 #ifdef RICH_MPI
158  Tessellation& proctess,
159 #endif
160  Tessellation& tess,
161  const OuterBoundary& obc,
162  const PhysicalGeometry& pg,
163  const vector<ComputationalCell>& init_cond,
164  const EquationOfState& eos,
165  const PointMotion& pointmotion,
166  const EdgeVelocityCalculator& evc,
167  const SourceTerm& external_force,
168  const TimeStepFunction& tsf,
169  const FluxCalculator& fc,
170  const ExtensiveUpdater& eu,
171  const CellUpdater& cu,
172  TracerStickerNames tracer_sticker_names = TracerStickerNames(),
173  bool relativistic = false
174 #ifdef RICH_MPI
175  ,const ProcessorUpdate* proc_update=0
176 #endif
177  );
178 
182  void load(const ResetDump& checkpoint);
183 
187  void makeCheckpoint(ResetDump& checkpoint) const;
188 
192  ~hdsim(void);
193 
195  void TimeAdvance(void);
196 
198  void TimeAdvanceClip(void);
199 
201  void TimeAdvance2Heun(void);
202 
204  void TimeAdvance2MidPointClip(void);
206  void TimeAdvance2MidPoint(void);
207 
212 
216  void setStartTime(double t_start);
217 
221  void setCycle(int cycle);
222 
223  // Diagnostics
224 
228  double getTime(void) const;
229 
234  double getCellVolume(size_t index) const;
235 
239  int getCycle(void) const;
240 
245 
249  const EquationOfState& getEos(void) const;
250 
254  const OuterBoundary& getOuterBoundary(void) const;
255 
259  const vector<Extensive>& getAllExtensives(void) const;
260 
264  vector<Extensive>& getAllExtensives(void);
265 
269  const CacheData& getCacheData(void) const;
270 
275  TracerStickerNames const& GetTracerStickerNames(void)const;
276 };
277 
278 #endif
void makeCheckpoint(ResetDump &checkpoint) const
Dumps simulation data.
const Tessellation & GetProcTessellation(void) const
Returns the processor tessellation.
Definition: hdsim2d.cpp:819
Outer Boundary Conditions.
Base class for extensive update scheme.
Abstract class for tessellation.
Base class for extensive updater scheme.
Newtonian hydrodynamic simulation.
Definition: hdsim2d.hpp:43
Extensive variables.
double getTime(void) const
Returns the time.
Definition: hdsim2d.cpp:729
Base class for flux calculator.
void recalculatePrimitives(void)
Recalculates the primitives from the extensive variables.
Definition: hdsim2d.cpp:749
Base class for a scheme to calculate the velocity on the edges.
Abstract class for motion of mesh generating points.
void load(const ResetDump &checkpoint)
Loads reset data into simulation.
const Tessellation & getTessellation(void) const
Returns the tessellation.
Definition: hdsim2d.cpp:722
void recalculateExtensives(void)
Recalculates extensives (in case computational cells were changed manually)
Definition: hdsim2d.cpp:759
void setCycle(int cycle)
Sets the cycle.
Definition: hdsim2d.cpp:777
Time step based on CFL criterion.
TracerStickerNames const & GetTracerStickerNames(void) const
Returns the TracerStickerNames.
Definition: hdsim2d.cpp:172
Abstract class for external forces.
Definition: SourceTerm.hpp:17
int getCycle(void) const
Returns the number cycles.
Definition: hdsim2d.cpp:734
const PhysicalGeometry & getPhysicalGeometry(void) const
Access to physical geometry.
Definition: hdsim2d.cpp:712
void changePhysicalGeometry(const PhysicalGeometry *pg)
Change the physical geometry.
const CacheData & getCacheData(void) const
Returns reference to the cached data.
Definition: hdsim2d.cpp:813
Updates the positions of the processes.
Base class for flux calculator.
Base class for equation of state.
Abstract class for source terms.
Base class for cell update scheme.
Container for cache data.
Definition: cache_data.hpp:14
Abstract class for refinement scheme.
const EquationOfState & getEos(void) const
Access to the equation of state.
Definition: hdsim2d.cpp:787
Abstract class for motion of the mesh generating points.
Base class for cell update scheme.
Class for keeping the names of the tracers and stickers.
void TimeAdvance2MidPointClip(void)
Second order time advance, mid point method with area fix.
Definition: hdsim2d.cpp:546
void TimeAdvance2MidPoint(void)
Second order time advance, mid point method.
Definition: hdsim2d.cpp:617
void TimeAdvance(void)
Advances the simulation in time.
Definition: hdsim2d.cpp:177
Data needed to restart a simulation.
Abstract class for time step function.
Physical geometry of the grid.
Abstract class for coarsening scheme.
~hdsim(void)
Class destructor.
Definition: hdsim2d.cpp:170
Abstract class for interpolation of the hydrodynamic variables.
Abstract class for geometric boundary conditions for the tessellation.
const vector< ComputationalCell > & getAllCells(void) const
Returns a list of all computational cells.
Definition: hdsim2d.cpp:739
Geometrical cache data for optimisation.
Spatial distribution for initial conditions.
void TimeAdvanceClip(void)
Advances the simulation in time with area fix.
Definition: hdsim2d.cpp:271
void setStartTime(double t_start)
Sets the start time.
Definition: hdsim2d.cpp:782
void TimeAdvance2Heun(void)
Second order time advance.
Definition: hdsim2d.cpp:351
Base class for physical geometry.
double getCellVolume(size_t index) const
Returns the volume of a certain cell.
Definition: hdsim2d.cpp:807
const OuterBoundary & getOuterBoundary(void) const
Access to the geometric outer boundary.
Definition: hdsim2d.cpp:792
void setTimeStepFunction(TimeStepFunction &tsf)
Change the time step function.
Contains data required to restart a simulation run.
Definition: ResetDump.hpp:32
const vector< Extensive > & getAllExtensives(void) const
Returns a list of extensive variables.
Definition: hdsim2d.cpp:797