SPH
|
Material holding equation of state. More...
#include <Materials.h>
Public Member Functions | |
EosMaterial (const BodySettings &body, AutoPtr< IEos > &&eos) | |
Creates the material by specifying an equation of state. More... | |
EosMaterial (const BodySettings &body) | |
Creates the material. More... | |
Pair< Float > | evaluate (const Float rho, const Float u) const |
const IEos & | getEos () const |
Returns the equation of state. More... | |
virtual void | create (Storage &storage, const MaterialInitialContext &context) override |
Create all quantities needed by the material. More... | |
virtual void | initialize (IScheduler &scheduler, Storage &storage, const IndexSequence sequence) override |
Initialize all quantities and material parameters. More... | |
virtual void | finalize (IScheduler &UNUSED(scheduler), Storage &UNUSED(storage), const IndexSequence UNUSED(sequence)) override |
Public Member Functions inherited from IMaterial | |
IMaterial (const BodySettings &settings) | |
template<typename TValue > | |
INLINE IMaterial & | setParam (const BodySettingsId paramIdx, TValue &&value) |
template<typename TValue > | |
INLINE TValue | getParam (const BodySettingsId paramIdx) const |
Returns a parameter associated with given particle. More... | |
INLINE const BodySettings & | getParams () const |
Returns settings containing material parameters. More... | |
void | setRange (const QuantityId id, const Interval &range, const Float minimal) |
Sets the timestepping parameters of given quantity. More... | |
INLINE void | setRange (const QuantityId id, const BodySettingsId rangeId, const BodySettingsId minimalId) |
Sets the timestepping parameters of given quantity. More... | |
INLINE Float | minimal (const QuantityId id) const |
Returns the scale value of the quantity. More... | |
INLINE const Interval | range (const QuantityId id) const |
Returns the range of allowed quantity values. More... | |
virtual void | finalize (IScheduler &scheduler, Storage &storage, const IndexSequence sequence)=0 |
Finalizes the material for the time step. More... | |
Public Member Functions inherited from Polymorphic | |
virtual | ~Polymorphic () |
Additional Inherited Members | |
Protected Attributes inherited from IMaterial | |
BodySettings | params |
Per-material parameters. More... | |
FlatMap< QuantityId, Float > | minimals |
Minimal values used in timestepping, do not affect values of quantities themselves. More... | |
FlatMap< QuantityId, Interval > | ranges |
Allowed range of quantities. More... | |
Static Protected Attributes inherited from IMaterial | |
static const Interval | DEFAULT_RANGE = Interval::unbounded() |
Default values. More... | |
static const Float | DEFAULT_MINIMAL = 0._f |
Material holding equation of state.
Pressure and sound speed are computed in initialize function, so the EoS does not have to be evaluated manually. If this is necessary for some reason (when setting pressure-dependent initial conditions or checking if we selected correct EoS, for example), functions evaluate and getEos can be used. This is not part of the IMaterial interface, so dynamic_cast have to be used to access it.
Definition at line 21 of file Materials.h.
NAMESPACE_SPH_BEGIN EosMaterial::EosMaterial | ( | const BodySettings & | body, |
AutoPtr< IEos > && | eos | ||
) |
Creates the material by specifying an equation of state.
Equation of state must not be nullptr.
Definition at line 13 of file Materials.cpp.
|
explicit |
Creates the material.
Equation of state is constructed from parameters in settings.
Definition at line 19 of file Materials.cpp.
|
overridevirtual |
Create all quantities needed by the material.
Implements IMaterial.
Reimplemented in SolidMaterial.
Definition at line 30 of file Materials.cpp.
Evaluate held equation of state.
rho | Density of particle in code units. |
u | Specific energy of particle in code units |
Definition at line 22 of file Materials.cpp.
|
inlineoverridevirtual |
Definition at line 49 of file Materials.h.
const IEos & EosMaterial::getEos | ( | ) | const |
Returns the equation of state.
Definition at line 26 of file Materials.cpp.
|
overridevirtual |
Initialize all quantities and material parameters.
Called once every step before loop.
scheduler | Scheduler potentially used for parallelization |
storage | Storage containing the particles and materials |
sequence | Index sequence of the particles with this material |
Implements IMaterial.
Reimplemented in SolidMaterial.
Definition at line 50 of file Materials.cpp.