3 #include "../../misc/universal_error.hpp" 4 #include "../../misc/utils.hpp" 6 Primitive::Primitive(
void):
13 Primitive::Primitive(
double density_i,
17 double sound_speed_i):
22 SoundSpeed(sound_speed_i) {}
53 Momentum(other.Momentum),
73 Density(other.Density),
74 Pressure(other.Pressure),
75 Velocity(other.Velocity),
77 SoundSpeed(other.SoundSpeed) {}
157 double operator()(
double const& x,
double const& y)
const 162 return binary_op_primitive(p1, p2, op);
171 double operator()(
double const& x,
double const& y)
const 177 return binary_op_primitive(p1,p2,op);
186 double operator()(
double const& x,
double const& y)
const 191 return primitive_scalar_op(p,c,op);
200 double operator()(
double const& x,
double const& y)
const 205 return primitive_scalar_op(p,s,op);
Set of conserved variables (extensive)
Vector2D Momentum
Momentum.
int GetVarNo(void) const
Returns the numbers of members.
double SoundSpeed
Speed of sound.
bool primitive_has_nan(Primitive const &p)
Checks if on of the fields of Primitive is a nan.
Conserved & operator-=(Conserved const &c)
subtraction of flux
Container for error reports.
BinaryOperation Binary operator.
Vector2D Velocity
Velocity.
double Energy
Total energy (kinetic + thermal)
double TotalEnergyDensity(Primitive const &p)
Calculates the total energy density.
double y
Component in the y direction.
Primitive & operator=(Primitive const &other)
Assigmnet operator.
Conserved Primitive2Conserved(Primitive const &p)
Converts primitive variables to conserved intensive.
Vector3D operator*(double d, Vector3D const &v)
Scalar product.
Conserved & operator+=(Conserved const &f)
Addition of flux.
Conserved Primitive2Flux(Primitive const &p, Vector2D const &n)
Converts primitive variables to flux.
double ScalarProd(Vector3D const &v1, Vector3D const &v2)
Scalar product of two vectors.
Conserved & operator=(Conserved const &other)
Assigmnet operator.
Vector3D operator/(Vector3D const &v, double d)
Scalar division.
Primitive & operator+=(Primitive const &p)
Operator for adding members of two primitives.
double Energy
Thermal energy per unit mass, entahalpy in relativistic case.
bool is_nan(double x)
Checks whether a number is a nan.
double abs(Vector3D const &v)
Norm of a vector.
Vector3D operator+(Vector3D const &v1, Vector3D const &v2)
Term by term addition.
double & operator[](int index)
Subscript operator.
Primitive hydrodynamic variables.
double x
Component in the x direction.
Vector3D operator-(Vector3D const &v1, Vector3D const &v2)
Term by term subtraction.
Conserved(void)
Null constructor (sets all members to zero)