15 Storage storage(makeAuto<NullMaterial>(settings));
51 material->initialize(
SEQUENTIAL, storage, material.sequence());
67 rheology = makeAuto<ElasticRheology>();
84 context.
rng = makeRng<UniformRng>();
85 material->create(storage, context);
86 material->initialize(
SEQUENTIAL, storage, material.sequence());
98 for (
Size i = 0; i < r.
size(); ++i) {
100 if (distSqr < closestDistSqr) {
101 closestDistSqr = distSqr;
#define SPH_ASSERT(x,...)
Filling spatial domain with SPH particles.
Object defining computational domain.
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.
SPH-specific implementation of particle materials.
constexpr INLINE Float sphereVolume(const Float radius)
Computes a volume of a sphere given its radius.
#define NAMESPACE_SPH_END
@ FLAG
ID of original body, used to implement discontinuities between bodies in SPH.
@ DEVIATORIC_STRESS
Deviatoric stress tensor, always a traceless tensor.
@ POSITION
Positions (velocities, accelerations) of particles, always a vector quantity,.
@ ENERGY
Specific internal energy, always a scalar quantity.
@ DENSITY
Density, always a scalar quantity.
@ MASS
Paricles masses, always a scalar quantity.
Holder of quantity values and their temporal derivatives.
@ SECOND
Quantity with 1st and 2nd derivative.
@ FIRST
Quantity with 1st derivative.
@ ZERO
Quantity without derivatives, or "zero order" of quantity.
SequentialScheduler SEQUENTIAL
Global instance of the sequential scheduler.
Helper functions performing common tasks in unit testing and benchmarks.
INLINE Float getSqrLength(const Vector &v)
BasicVector< Float > Vector
Object providing safe access to continuous memory of data.
INLINE TCounter size() const
Generic dynamically allocated resizable storage.
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const =0
Generates the requested number of particles in the domain.
Base class for computational domains.
virtual Float getVolume() const =0
Returns the total volume of the domain.
Object representing a 1D interval of real numbers.
Non-owning wrapper of a material and particles with this material.
TValue get(const TEnum idx, std::enable_if_t<!std::is_enum< std::decay_t< TValue >>::value, int >=0) const
Returns a value of given type from the settings.
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.
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.
MaterialView getMaterial(const Size matIdx) const
Returns an object containing a reference to given material.
Array< TValue > & getValue(const QuantityId key)
Retrieves a quantity values from the storage, given its key and value type.
Symmetric traceless 2nd order tensor.
static INLINE TracelessTensor null()
Returns a tensor with all zeros.
Creating code components based on values from settings.
@ NONE
Gass or material with no stress tensor.
@ IDEAL_GAS
Equation of state for ideal gas.
@ TILLOTSON
Tillotson (1962) equation of state.
@ RHEOLOGY_DAMAGE
Model of fragmentation used within the rheological model.
@ DENSITY_RANGE
Allowed range of density. Densities of all particles all clamped to fit in the range.
@ ENERGY
Initial specific internal energy.
@ DENSITY
Density at zero pressure.
@ EOS
Equation of state for this material, see EosEnum for options.
@ RHEOLOGY_YIELDING
Model of stress reducing used within the rheological model.
AutoPtr< IRheology > getRheology(const BodySettings &settings)
AutoPtr< IDistribution > getDistribution(const BodySettings &settings, Function< bool(Float)> progressCallback=nullptr)
AutoPtr< IEos > getEos(const BodySettings &settings)
Storage getSolidStorage(const Size particleCnt, BodySettings settings, const IDomain &domain)
Returns a storage with stress tensor.
Storage getStorage(const Size particleCnt)
Storage getGassStorage(const Size particleCnt, BodySettings settings, const IDomain &domain)
Returns a storage with ideal gas particles, having pressure, energy and sound speed.
Size getClosestParticle(const Storage &storage, const Vector &p)
Returns the index to the particle closest to given point.
Shared data used when creating all bodies in the simulation.
AutoPtr< IRng > rng
Random number generator.