19 : damage(
std::move(damage)) {
33 damage->
setFlaws(storage, material, context);
53 constexpr
Float eps = 1.e-15_f;
56 const Float d = D ? pow<3>(D[i]) : 0._f;
58 p[i] = (1._f - d) * p[i];
62 const Float unorm = u[i] / u_melt;
63 Float Y = unorm < 1.e-5_f ? limit : limit *
max(1._f - unorm, 0._f);
73 const Float J2 = 0.5_f *
ddot(S[i], S[i]) + eps;
87 damage->
integrate(scheduler, storage, material);
98 : damage(
std::move(damage)) {
116 damage->
setFlaws(storage, material, context);
148 const Float d = D ? pow<3>(D[i]) : 0._f;
150 p[i] = (1._f - d) * p[i];
153 const Float Y_i = Y_0 + mu_i * p[i] / (1._f + mu_i *
max(p[i], 0._f) / (Y_M - Y_0));
154 Float Y_d = mu_d * p[i];
157 const Float p_vib = rho[i] * cs[i] * v_vib[i];
158 Y_d =
max(0._f, Y_d - mu_d * p_vib);
167 Y = (1._f - d) * Y_i + d * Y_d;
171 Y = (u[i] < 1.e-5_f * u_melt) ?
Y :
Y *
max(1._f - u[i] / u_melt, 0._f);
209 dv[i] =
sqrt(2._f * dE / rho) - v[i] / t_dec;
213 damage->
integrate(scheduler, storage, material);
INLINE bool isReal(const AntisymmetricTensor &t)
INLINE Float ddot(const AntisymmetricTensor &t1, const AntisymmetricTensor &t2)
Double-dot product t1 : t2 = sum_ij t1_ij t2_ij.
#define SPH_ASSERT(x,...)
INLINE AutoPtr< T > makeAuto(TArgs &&... args)
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.
Base class for all particle materials.
Logging routines of the run.
#define VERBOSE_LOG
Helper macro, creating.
constexpr INLINE T max(const T &f1, const T &f2)
NAMESPACE_SPH_BEGIN constexpr INLINE T min(const T &f1, const T &f2)
Minimum & Maximum value.
INLINE T sqrt(const T f)
Return a squared root of a value.
#define NAMESPACE_SPH_END
@ DEVIATORIC_STRESS
Deviatoric stress tensor, always a traceless tensor.
@ PRESSURE
Pressure, affected by yielding and fragmentation model, always a scalar quantity.
@ VELOCITY_GRADIENT
Velocity gradient.
@ ENERGY
Specific internal energy, always a scalar quantity.
@ DENSITY
Density, always a scalar quantity.
@ SOUND_SPEED
Sound speed, always a scalar quantity.
@ STRESS_REDUCING
Total stress reduction factor due to damage and yielding. Is always scalar.
@ VIBRATIONAL_VELOCITY
Vibrational particle velocity, used by the block model of acoustic fluidization.
Holder of quantity values and their temporal derivatives.
@ FIRST
Quantity with 1st derivative.
@ 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.
Pressure dependent failure modes .
virtual void integrate(IScheduler &scheduler, Storage &storage, const MaterialView material) override
Computes derivatives of the time-dependent quantities of the rheological model.
virtual void initialize(IScheduler &scheduler, Storage &storage, const MaterialView material) override
Evaluates the stress tensor reduction factors.
DruckerPragerRheology()
Constructs a rheology with no fragmentation model.
virtual void create(Storage &storage, IMaterial &material, const MaterialInitialContext &context) const override
Creates all the necessary quantities and material parameters needed by the rheology.
virtual void integrate(IScheduler &scheduler, Storage &storage, const MaterialView material) override
Computes derivatives of the time-dependent quantities of the rheological model.
virtual void initialize(IScheduler &scheduler, Storage &storage, const MaterialView material) override
Evaluates the stress tensor reduction factors.
virtual void create(Storage &storage, IMaterial &material, const MaterialInitialContext &context) const override
Creates all the necessary quantities and material parameters needed by the rheology.
virtual void integrate(IScheduler &scheduler, Storage &storage, const MaterialView sequence)=0
Compute damage derivatives.
virtual void setFlaws(Storage &storage, IMaterial &material, const MaterialInitialContext &context) const =0
Sets up all the necessary quantities in the storage given material settings.
Material settings and functions specific for one material.
INLINE TValue getParam(const BodySettingsId paramIdx) const
Returns a parameter associated with given particle.
void setRange(const QuantityId id, const Interval &range, const Float minimal)
Sets the timestepping parameters of given quantity.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
INLINE IndexIterator begin() const
INLINE IndexIterator end() const
Object representing a 1D interval of real numbers.
Non-owning wrapper of a material and particles with this material.
INLINE IndexSequence sequence()
Returns iterable index sequence.
Container storing all quantities used within the simulations.
Size getMaterialCnt() const
Return the number of materials in the storage.
Quantity & insert(const QuantityId key, const OrderEnum order, const TValue &defaultValue)
Creates a quantity in the storage, given its key, value type and order.
StaticArray< Array< TValue > &, 3 > getAll(const QuantityId key)
Retrieves quantity buffers from the storage, given its key and value type.
auto getValues(const QuantityId first, const QuantityId second, const TArgs... others)
Retrieves an array of quantities from the key.
bool has(const QuantityId key) const
Checks if the storage contains quantity with given key.
Array< TValue > & getValue(const QuantityId key)
Retrieves a quantity values from the storage, given its key and value type.
Symmetric tensor of 2nd order.
static INLINE SymmetricTensor identity()
Returns an identity tensor.
Symmetric traceless 2nd order tensor.
static INLINE TracelessTensor null()
Returns a tensor with all zeros.
Introduces plastic behavior for stress tensor, using von Mises yield criterion .
VonMisesRheology()
Constructs a rheology with no fragmentation model.
virtual void create(Storage &storage, IMaterial &settings, const MaterialInitialContext &context) const override
Creates all the necessary quantities and material parameters needed by the rheology.
virtual void integrate(IScheduler &scheduler, Storage &storage, const MaterialView material) override
Computes derivatives of the time-dependent quantities of the rheological model.
virtual void initialize(IScheduler &scheduler, Storage &storage, const MaterialView material) override
Evaluates the stress tensor reduction factors.
@ INTERNAL_FRICTION
Coefficient of friction for undamaged material.
@ ELASTICITY_LIMIT
Elasticity limit of the von Mises yielding criterion.
@ DRY_FRICTION
Coefficient of friction for fully damaged material.
@ OSCILLATION_REGENERATION
Regeneration efficiency of acoustric oscillations.
@ MELT_ENERGY
Melting energy, used for temperature-dependence of the stress tensor.
@ USE_ACOUSTIC_FLUDIZATION
Whether to use the acoustic fludization model.
@ COHESION
Cohesion, yield strength at zero pressure.
@ DENSITY
Density at zero pressure.
@ OSCILLATION_DECAY_TIME
Characteristic decay time of acoustic oscillations in the material.
Overload of std::swap for Sph::Array.
Shared data used when creating all bodies in the simulation.