3 #include "spdlog/spdlog.h" 5 CellUpdater1D::~CellUpdater1D(
void) {}
11 double calc_cell_volume
13 const vector<double>& vertices,
24 const double density = extensive.
mass/volume;
26 const double kinetic_specific_energy = 0.5*pow(
abs(velocity),2);
27 const double total_specific_energy = extensive.
energy/extensive.
mass;
28 const double thermal_specific_energy =
29 total_specific_energy - kinetic_specific_energy;
30 const double pressure = eos.
de2p 31 (density, thermal_specific_energy);
38 for(
size_t i=0;i<res.
tracers.size();++i)
44 (
const vector<Extensive>& extensives,
47 assert(extensives.at(0).tracers.size()==
48 old.
getCells().at(0).tracers.size());
52 vector<ComputationalCell> SimpleCellUpdater1D::operator()
54 const vector<Extensive>& extensives,
58 validate_input(extensives, old);
59 vector<ComputationalCell> res(extensives.size());
60 for(
size_t i=0;i<res.size();++i){
62 res.at(i) = retrieve_single_cell
63 (calc_cell_volume(pg,old.getVertices(),i),
68 spdlog::critical(
"error found in cell {0}, position {1}, mass {2}, momentum {3} and energy {4}",
70 old.getVertices().at(i),
71 extensives.at(i).mass,
72 extensives.at(i).momentum.x,
73 extensives.at(i).energy);
80 SimpleCellUpdater1D::~SimpleCellUpdater1D(
void) {}
virtual double de2p(double d, double e, tvector const &tracers=tvector(), vector< string > const &tracernames=vector< string >()) const =0
Calculates the pressure.
Vector2D momentum
momentum, in relativity it is = rho*h*gamma*v
double mass
rest mass times gamma
Base class for physical geometry.
Base class for cell update schemes.
double energy
energy, in relativity it is = rho*h*gamma^2-P-rho
tvector tracers
Tracers (can transfer from one cell to another)
const vector< ComputationalCell > & getCells(void) const
Access to hydro cells.
Base class for equation of state.
virtual double calcVolume(double radius) const =0
Calculates the volume.
double abs(Vector3D const &v)
Norm of a vector.
SimpleCellUpdater1D(void)
Class constructor.
Vector2D velocity
Velocity.
Package for computational domain and hydro cells.