26 const Float v = 1._f / rho;
27 const Float T = 2._f * (u + a / v) / (3._f * R);
84 simulation.
run(storage);
86 std::cout <<
"Error in simulation: " << e.
what() << std::endl;
INLINE bool isReal(const AntisymmetricTensor &t)
#define SPH_ASSERT(x,...)
#define NOT_IMPLEMENTED
Helper macro marking missing implementation.
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
constexpr INLINE T max(const T &f1, const T &f2)
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
INLINE T sqrt(const T f)
Return a squared root of a value.
BasicVector< Float > Vector
Wrapper of pointer that deletes the resource from destructor.
virtual const char * what() const noexcept
Base class for equations of state.
Defines the interface for a run.
Statistics run(Storage &storage)
Runs the simulation.
Object for adding one or more bodies with given material into a Storage.
BodyView addMonolithicBody(Storage &storage, const BodySettings &body)
Creates a monolithic body by filling given domain with particles.
Settings & set(const TEnum idx, TValue &&value, std::enable_if_t<!std::is_enum< std::decay_t< TValue >>::value, int >=0)
Saves a value into the settings.
Spherical domain, defined by the center of sphere and its radius.
Array with fixed number of allocated elements.
Object holding various statistics about current run.
Container storing all quantities used within the simulations.
VanDerWaalsEos(const Float a, const Float b, const Float gamma)
virtual Float getInternalEnergy(const Float, const Float) const override
Inverted function; computes specific internal energy u from given density rho and pressure p.
virtual Pair< Float > evaluate(const Float rho, const Float u) const override
Computes pressure and local sound speed from given density rho and specific internal energy u.
virtual Float getDensity(const Float, const Float) const override
Inverted function; computes density from pressure p and internal energy u.
virtual void tearDown(const Storage &UNUSED(storage), const Statistics &UNUSED(stats)) override
virtual void setUp(SharedPtr< Storage > storage) override
Prepares the run, creates logger, output, ...
@ PRESSURE
Use force from pressure gradient in the solver.
@ PARTICLE_COUNT
Number of SPH particles in the body.
@ DENSITY
Density at zero pressure.
@ SPH_SOLVER_FORCES
List of forces to compute by the solver.
@ RUN_NAME
User-specified name of the run, used in some output files.
constexpr Float gasConstant