SPH
|
Material settings and functions specific for one material. More...
#include <IMaterial.h>
Public Member Functions | |
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 | create (Storage &storage, const MaterialInitialContext &context)=0 |
Create all quantities needed by the material. More... | |
virtual void | initialize (IScheduler &scheduler, Storage &storage, const IndexSequence sequence)=0 |
Initialize all quantities and material parameters. 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 () |
Protected Attributes | |
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 | |
static const Interval | DEFAULT_RANGE = Interval::unbounded() |
Default values. More... | |
static const Float | DEFAULT_MINIMAL = 0._f |
Material settings and functions specific for one material.
Contains all parameters needed during runtime that can differ for individual materials.
Definition at line 110 of file IMaterial.h.
|
inlineexplicit |
Definition at line 126 of file IMaterial.h.
|
pure virtual |
Create all quantities needed by the material.
Implemented in SolidMaterial, and EosMaterial.
|
pure virtual |
Finalizes the material for the time step.
Called after derivatives are computed.
scheduler | Scheduler potentially used for parallelization |
storage | Storage containing the particles and materials |
sequence | Index sequence of the particles with this material |
Implemented in SolidMaterial.
|
inline |
Returns a parameter associated with given particle.
Definition at line 137 of file IMaterial.h.
|
inline |
Returns settings containing material parameters.
Definition at line 142 of file IMaterial.h.
|
pure virtual |
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 |
Implemented in SolidMaterial, and EosMaterial.
|
inline |
Returns the scale value of the quantity.
This value is used by timestepping algorithms to determine the time step. The value can be specified by setRange; if no value is specified, the fuction defaults to 0.
Definition at line 163 of file IMaterial.h.
|
inline |
Returns the range of allowed quantity values.
This range is enforced by timestetting algorithms, i.e. quantities do not have to be clamped by the solver or elsewhere. The range can be specified by setRange; if no range is specified, the function defaults to unbounded interval.
Definition at line 172 of file IMaterial.h.
|
inline |
Definition at line 130 of file IMaterial.h.
|
inline |
Sets the timestepping parameters of given quantity.
Syntactic sugar, using BodySettingsIds to retrieve the values from body settings of the material.
Definition at line 155 of file IMaterial.h.
void IMaterial::setRange | ( | const QuantityId | id, |
const Interval & | range, | ||
const Float | minimal | ||
) |
Sets the timestepping parameters of given quantity.
Note that the function is not thread-safe and has to be synchronized when used in parallel context.
Definition at line 17 of file IMaterial.cpp.
|
staticprotected |
Definition at line 123 of file IMaterial.h.
|
staticprotected |
Default values.
Definition at line 122 of file IMaterial.h.
|
protected |
Minimal values used in timestepping, do not affect values of quantities themselves.
Definition at line 116 of file IMaterial.h.
|
protected |
Per-material parameters.
Definition at line 113 of file IMaterial.h.
|
protected |
Allowed range of quantities.
Definition at line 119 of file IMaterial.h.