15 , eos(
std::move(eos)) {
43 for (
Size i = 0; i < n; ++i) {
65 , rheology(
std::move(rheology)) {}
74 rheology->
create(storage, *
this, context);
#define SPH_ASSERT(x,...)
#define NOT_IMPLEMENTED
Helper macro marking missing implementation.
Helper functions to check the internal consistency of the code.
@ NO_THROW
Function cannot throw exceptions.
#define CHECK_FUNCTION(flags)
uint32_t Size
Integral type used to index arrays (by default).
double Float
Precision used withing the code. Use Float instead of float or double where precision is important.
Logging routines of the run.
#define VERBOSE_LOG
Helper macro, creating.
AutoPtr< IMaterial > getMaterial(const MaterialEnum type)
SPH-specific implementation of particle materials.
MaterialEnum
Basic materials available in the code.
#define NAMESPACE_SPH_END
@ PRESSURE
Pressure, affected by yielding and fragmentation model, always a scalar quantity.
@ ENERGY
Specific internal energy, always a scalar quantity.
@ DENSITY
Density, always a scalar quantity.
@ SOUND_SPEED
Sound speed, always a scalar quantity.
Holder of quantity values and their temporal derivatives.
@ ZERO
Quantity without derivatives, or "zero order" of quantity.
Interface for executing tasks (potentially) asynchronously.
INLINE void parallelFor(IScheduler &scheduler, const Size from, const Size to, TFunctor &&functor)
Executes a functor concurrently from all available threads.
StaticArray< T0 &, sizeof...(TArgs)+1 > tie(T0 &t0, TArgs &... rest)
Creates a static array from a list of l-value references.
Container for storing particle quantities and materials.
Material holding equation of state.
virtual void finalize(IScheduler &UNUSED(scheduler), Storage &UNUSED(storage), const IndexSequence UNUSED(sequence)) override
virtual void initialize(IScheduler &scheduler, Storage &storage, const IndexSequence sequence) override
Initialize all quantities and material parameters.
const IEos & getEos() const
Returns the equation of state.
EosMaterial(const BodySettings &body, AutoPtr< IEos > &&eos)
Creates the material by specifying an equation of state.
Pair< Float > evaluate(const Float rho, const Float u) const
virtual void create(Storage &storage, const MaterialInitialContext &context) override
Create all quantities needed by the material.
Base class for equations of state.
virtual Pair< Float > evaluate(const Float rho, const Float u) const =0
Computes pressure and local sound speed from given density rho and specific internal energy u.
Material settings and functions specific for one material.
virtual void create(Storage &storage, IMaterial &material, const MaterialInitialContext &context) const =0
Creates all the necessary quantities and material parameters needed by the rheology.
virtual void integrate(IScheduler &scheduler, Storage &storage, const MaterialView material)=0
Computes derivatives of the time-dependent quantities of the rheological model.
virtual void initialize(IScheduler &scheduler, Storage &storage, const MaterialView material)=0
Evaluates the stress tensor reduction factors.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Non-owning wrapper of a material and particles with this material.
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.
Generalization of material with equation of state.
virtual void initialize(IScheduler &scheduler, Storage &storage, const IndexSequence sequence) override
Initialize all quantities and material parameters.
virtual void create(Storage &storage, const MaterialInitialContext &context) override
Create all quantities needed by the material.
virtual void finalize(IScheduler &scheduler, Storage &storage, const IndexSequence sequence) override
Finalizes the material for the time step.
SolidMaterial(const BodySettings &body, AutoPtr< IEos > &&eos, AutoPtr< IRheology > &&rheology)
Array with fixed number of allocated elements.
Container storing all quantities used within the simulations.
Quantity & insert(const QuantityId key, const OrderEnum order, const TValue &defaultValue)
Creates a quantity in the storage, given its key, value type and order.
Size getParticleCnt() const
Returns the number of particles.
auto getValues(const QuantityId first, const QuantityId second, const TArgs... others)
Retrieves an array of quantities from the key.
Array< TValue > & getValue(const QuantityId key)
Retrieves a quantity values from the storage, given its key and value type.
Creating code components based on values from settings.
@ TILLOTSON_NONLINEAR_B
Coefficient B of the nonlinear compressive term in Tillotson equation.
@ TILLOTSON_ALPHA
Alpha coefficient in expanded phase of Tillotson equation.
@ TILLOTSON_ENERGY_CV
Specific energy of complete vaporization.
@ TILLOTSON_SMALL_B
"Small b" coefficient in Tillotson equation
@ TILLOTSON_BETA
Beta coefficient in expanded phase of Tillotson equation.
@ ENERGY
Initial specific internal energy.
@ BULK_MODULUS
Bulk modulus of the material.
@ DENSITY
Density at zero pressure.
@ HEAT_CAPACITY
Heat capacity at constant pressure,.
@ TILLOTSON_ENERGY_IV
Specific energy of incipient vaporization.
@ TILLOTSON_SMALL_A
"Small a" coefficient in Tillotson equation
@ TILLOTSON_SUBLIMATION
Specific sublimation energy.
Provides a convenient way to construct objects from settings.
AutoPtr< IMaterial > getMaterial(const BodySettings &settings)
AutoPtr< IRheology > getRheology(const BodySettings &settings)
AutoPtr< IEos > getEos(const BodySettings &settings)
Overload of std::swap for Sph::Array.
Shared data used when creating all bodies in the simulation.