62 "If true, a user-specified geometry input is used instead of shape parameters of the node.");
86 materialCat.
connect<
bool>(
"Custom material",
"useMaterialSlot",
slotUsage.material)
88 "If true, a user-specified material input is used instead of material parameters of the node.");
91 auto diehlEnabler = [
this] {
97 .setEnabler(diehlEnabler);
107 {
"JPEG image",
"jpg" },
108 {
"PNG image",
"png" },
109 {
"TIFF image",
"tif" },
121 : callbacks(callbacks) {}
137 : callbacks(callbacks)
138 , iterCnt(iterCnt) {}
150 callbacks.
onSetUp(storage, stats);
174 distribution = makeAuto<DiehlDistribution>(diehl);
189 result = makeShared<ParticleData>();
198 "create monolithic body",
200 "initial conditions",
201 [](
const std::string& name) {
return makeAuto<MonolithicBodyIc>(name); },
202 "Creates a single monolithic homogeneous body.");
215 layersCat.
connect(
"Layer count",
"layer_cnt", layerCnt);
226 mantle.
domain = this->getInput<IDomain>(
"base shape");
227 mantle.
material = this->getInput<IMaterial>(
"base material");
236 for (
int i = layerCnt - 1; i >= 0; --i) {
238 layer.
domain = this->getInput<IDomain>(
"shape " + std::to_string(i + 1));
239 layer.
material = this->getInput<IMaterial>(
"material " + std::to_string(i + 1));
243 result = makeShared<ParticleData>();
249 "create differentiated body",
251 "initial conditions",
252 [](
const std::string& name) {
return makeAuto<DifferentiatedBodyIc>(name); },
253 "Creates a body consisting of multiple different materials. The base shape/material describes the "
254 "global shape of body and material of a particles not assigned to any layer. The indexed layers than "
255 "assign a specific material to a subset of particles.");
269 particleCat.
connect(
"Flag",
"flag", flag);
275 result = makeShared<ParticleData>();
292 "create single particle",
294 "initial conditions",
295 [](
const std::string& name) {
return makeAuto<SingleParticleIc>(name); },
296 "Creates a single particle with given mass, providing a convenient central potential for simulations of "
297 "circumplanetary (circumstelar, circumbinary) disk.");
316 for (
Size i = 0; i < m.
size(); ++i) {
317 volume += m[i] / rho[i];
321 return m.
size() / volume;
338 "initial conditions",
339 [](
const std::string& name) {
return makeAuto<ImpactorIc>(name); },
340 "Creates a monolithic body with automatic particle count. The number of particles is assigned "
341 "to match the particle concentration (number density) of a target body.");
355 "Computes equilibrium assuming spherically symmetric configuration." },
362 boundaryThreshold = 40;
370 solverCat.
connect(
"Solver",
"solver", solver);
371 solverCat.
connect(
"Boundary threshold",
"threshold", boundaryThreshold).
setEnabler([&] {
386 for (
Size i = 0; i < r.
size(); ++i) {
392 return s1.get<1>() < s2.get<1>();
396 for (
Size i = 1; i < r.
size(); ++i) {
397 table[i].get<2>() += table[i - 1].get<2>();
409 for (
Size k = 1; k < massInRadius.
size(); ++k) {
410 const Size i = massInRadius[k].get<0>();
411 const Float r = massInRadius[k].get<1>();
412 const Float dr = r - massInRadius[k - 1].get<1>();
414 const Float M = massInRadius[k].get<2>();
421 for (
Size i = 0; i < p.size(); ++i) {
428 static void solveSpherical(
Storage& storage) {
432 Sphere boundingSphere(r0, 0._f);
433 for (
Size i = 0; i < r.
size(); ++i) {
448 u[i] = eosMat->getEos().getInternalEnergy(rho[i], p[i]);
454 result = this->getInput<ParticleData>(
"particles");
459 solveSpherical(storage);
476 throw InvalidSetup(
"OpenSPH needs to be compiled with CONFIG+=use_eigen to use this option");
486 "set equilibrium energy",
488 "initial conditions",
489 [](
const std::string& name) {
return makeAuto<EquilibriumIc>(name); },
490 "Modifies the internal energy of the input body to create a pressure gradient that balances "
491 "the gravitational acceleration. This can be used only for material with equation of state, "
492 "it further expects spherical symmetry of the input body (although homogeneity is not "
534 quantityCat.
connect(
"Quantity",
"quantity",
id);
535 quantityCat.
connect(
"Mode",
"mode", mode);
536 quantityCat.
connect(
"Center value [si]",
"central_value", centralValue).
setEnabler(paramEnabler);
537 quantityCat.
connect(
"Radial gradient [si/km]",
"radial_grad", radialGrad)
546 result = this->getInput<ParticleData>(
"particles");
563 for (
Size i = 0; i < r.
size(); ++i) {
565 q[i] = centralValue + radialGrad * dist;
570 const Curve func = curveEntry->getCurve();
571 for (
Size i = 0; i < r.
size(); ++i) {
585 "initial conditions",
586 [](
const std::string& name) {
return makeAuto<ModifyQuantityIc>(name); },
587 "Modifies given quantity of the input body, optionally specifying a radial gradient or generic radial "
588 "dependency via a user-defined curve.");
616 quantityCat.
connect(
"Quantity",
"quantity",
id);
617 quantityCat.
connect(
"Mean [si]",
"mean", mean);
618 quantityCat.
connect(
"Magnitude [si]",
"magnitude", magnitude);
624 result = this->getInput<ParticleData>(
"particles");
638 this->randomize<3>(callbacks, r, [&v](
Float value,
Size i,
Size j) { v[i][j] = value; });
646 template <Size Dims,
typename TSetter>
649 const TSetter& setter)
const {
653 for (
Size dim = 0; dim < Dims; ++dim) {
655 for (
Vector& grad : gradients[dim]) {
661 for (
Size i = 0; i < r.
size(); ++i) {
667 for (
Size i = 0; i < r.
size(); ++i) {
669 for (
Size dim = 0; dim < Dims; ++dim) {
671 const Float value = mean + magnitude * perlin(gradients[dim], pos);
673 setter(value, i, dim);
687 const Float x000 = this->dotGradient(gradients, v0 +
Indices(0, 0, 0), v);
688 const Float x001 = this->dotGradient(gradients, v0 +
Indices(0, 0, 1), v);
689 const Float x010 = this->dotGradient(gradients, v0 +
Indices(0, 1, 0), v);
690 const Float x011 = this->dotGradient(gradients, v0 +
Indices(0, 1, 1), v);
691 const Float x100 = this->dotGradient(gradients, v0 +
Indices(1, 0, 0), v);
692 const Float x101 = this->dotGradient(gradients, v0 +
Indices(1, 0, 1), v);
693 const Float x110 = this->dotGradient(gradients, v0 +
Indices(1, 1, 0), v);
694 const Float x111 = this->dotGradient(gradients, v0 +
Indices(1, 1, 1), v);
704 return lerp(x0, x1, dv[
X]);
712 return dot(dv, gradients[is]);
719 "initial conditions",
720 [](
const std::string& name) {
return makeAuto<NoiseQuantityIc>(name); },
721 "Perturbs selected quantity of the input body using a noise function.");
731 "Number of generated particles." },
733 "Total mass of the particles. Masses of individual particles depend on total number "
734 "of particles and on particle sizes." },
736 "Radius of the domain where the particles are initially generated. This is not a boundary, particles "
737 "can leave the domain. " },
739 "Specifies a balance between particle concentration in the center of the domain and at the boundary. "
740 "Higher values imply more dense center and fewer particles at the boundary." },
742 "Specifies the relative scale of the domain in z-direction. For 1, the domain is spherical, lower values "
743 "can be used to create a disk-like domain." },
745 "Interval of sizes generated particles." },
747 "Exponent of the power-law, used to generate particle sizes." },
749 "Multiplier of the Keplerian velocity of particles. " },
751 "Specifies a random component of initial particle velocities." },
760 settings.addEntries(overrides);
775 distributionCat.addEntry(
"min_size",
777 distributionCat.addEntry(
"max_size",
794 const Float l = rng(0);
795 const Float u = rng(1) * 2._f - 1._f;
796 const Float phi = rng(2) * 2._f *
PI;
821 Size bailoutCounter = 0;
822 const Float sep = 1._f;
823 const Size reportStep =
max(particleCnt / 1000, 1u);
838 if (cloud.
size() % reportStep == reportStep - 1) {
848 }
while (cloud.
size() < particleCnt && bailoutCounter < 1000);
855 for (
Size i = 0; i < positions.
size(); ++i) {
862 for (
Size i = 0; i < positions.
size(); ++i) {
863 masses[i] *= totalMass / m_sum;
870 Vector v_random = sampleSphere(velocityDispersion, 0.333_f, *rng);
871 v_random[
Z] *= heightScale;
872 velocities[i] = dir * v_kepl + v_random;
881 result = makeShared<ParticleData>();
887 "initial conditions",
888 [](
const std::string& name) {
return makeAuto<NBodyIc>(name); },
889 "Creates a spherical or ellipsoidal cloud of particles.");
904 starCat.
connect(
"Particle count",
"particleCnt", particleCnt);
905 starCat.
connect(
"Distribution",
"distribution", distId);
908 starCat.
connect(
"Polytrope index",
"polytrope_index", n);
919 result = makeShared<ParticleData>();
926 "initial conditions",
927 [](
const std::string& name) {
return makeAuto<PolytropicStarIc>(name); },
928 "Creates a single polytropic star.");
942 sphereCat.
connect(
"Particle count",
"particleCnt", particleCnt);
944 sphereCat.
connect(
"Central density [kg/m^3]",
"density", centralDensity);
945 sphereCat.
connect(
"Central energy [J/kg]",
"energy", centralEnergy);
946 sphereCat.
connect(
"Adiabatic index []",
"gamma", gamma);
971 const Float K = (gamma - 1._f) * centralEnergy;
979 for (
Size i = 0; i < rho.
size(); ++i) {
980 rho[i] = centralDensity / (1._f +
getSqrLength(r[i]) /
sqr(kingRadius));
984 material->
create(storage, context);
986 result = makeShared<ParticleData>();
992 "isothermal sphere ICs",
994 "initial conditions",
995 [](
const std::string& name) {
return makeAuto<IsothermalSphereIc>(name); },
996 "Creates a single isothermal sphere.");
1006 settings.addEntries(overrides);
1052 if (storage.
empty()) {
1080 result = makeShared<ParticleData>();
1089 "initial conditions",
1090 [](
const std::string& name) {
return makeAuto<GalaxyIc>(name); },
1091 "Creates a single galaxy.");
Various function for interpretation of the results of a simulation.
INLINE bool isReal(const AntisymmetricTensor &t)
#define SPH_ASSERT(x,...)
#define NOT_IMPLEMENTED
Helper macro marking missing implementation.
INLINE AutoPtr< T > makeAuto(TArgs &&... args)
Filling spatial domain with SPH particles.
Computes quantities to get equilibrium state.
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 solvers of gravity.
Basic interface defining a single run.
const Indices GRID_DIMS(8, 8, 8)
Generating initial conditions of SPH particles.
VirtualSettings::Category & addGenericCategory(VirtualSettings &connector, std::string &instanceName)
Adds a common settings category, used by all jobs.
@ GEOMETRY
Job providing geometry.
@ MATERIAL
Job providing a material.
SPH-specific implementation of particle materials.
constexpr INLINE T max(const T &f1, const T &f2)
INLINE int positiveMod(const int i, const int n)
Returns a positive modulo value.
INLINE T lerp(const T v1, const T v2, const TAmount amount)
constexpr INLINE T sqr(const T &f) noexcept
Return a squared value.
INLINE T sqrt(const T f)
Return a squared root of a value.
constexpr INLINE Float pow(const Float v)
Power for floats.
constexpr INLINE Float sphereVolume(const Float radius)
Computes a volume of a sphere given its radius.
constexpr Float PI
Mathematical constants.
#define MARK_USED(x)
Silences the "unused variable" warning for given variable.
#define NAMESPACE_SPH_END
@ VELOCITY
Current velocities of particles, always a vector quantity.
@ ENERGY
Specific internal energy, always a scalar quantity.
@ DENSITY
Density, always a scalar quantity.
@ FLAG
ID of original body, used to implement discontinuities between bodies in SPH.
@ PRESSURE
Pressure, affected by yielding and fragmentation model, always a scalar quantity.
@ 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.
INLINE RawPtr< T > addressOf(T &ref)
INLINE Vector sampleUnitSphere(TRng &rng)
Generates a random position on a unit sphere.
Interface for executing tasks (potentially) asynchronously.
Additional bindings to IVirtualSettings.
INLINE AutoPtr< IVirtualEntry > makeEntry(Settings< TEnum > &settings, const TEnum id, const std::string &name, const IntervalBound bound)
Object representing a three-dimensional sphere.
StaticArray< T0 &, sizeof...(TArgs)+1 > tie(T0 &t0, TArgs &... rest)
Creates a static array from a list of l-value references.
Statistics gathered and periodically displayed during the run.
@ RUN_TIME
Current time of the simulation in code units. Does not necessarily have to be 0 when run starts.
@ INDEX
Current number of time step, indexed from 0.
INLINE auto makeTuple(TArgs &&... args)
Creates a tuple from a pack of values, utilizing type deduction.
INLINE Float getLength(const Vector &v)
Returns the length of the vector. Enabled only for vectors of floating-point precision.
INLINE Float getSqrLength(const Vector &v)
BasicVector< Float > Vector
INLINE float dot(const BasicVector< float > &v1, const BasicVector< float > &v2)
Make sure the vector is trivially constructible and destructible, needed for fast initialization of a...
INLINE Vector getNormalized(const Vector &v)
Object providing safe access to continuous memory of data.
INLINE TCounter size() const
INLINE Iterator< StorageType > begin()
INLINE Iterator< StorageType > end()
Generic dynamically allocated resizable storage.
StorageType & emplaceBack(TArgs &&... args)
Constructs a new element at the end of the array in place, using the provided arguments.
INLINE TCounter size() const noexcept
void pushAll(const TIter first, const TIter last)
Non-owning view of particles belonging to the same body.
BodyView & addRotation(const Vector &omega, const RotationOrigin origin)
Adds an angular velocity to all particles of the body.
Helper object defining three-dimensional interval (box).
INLINE void extend(const Vector &v)
Enlarges the box to contain the vector.
INLINE const Vector & lower() const
Returns lower bounds of the box.
INLINE Vector size() const
Returns box dimensions.
Special entry allowing to access and (de)serialize a curve.
Represents a user-defined function, defined by a set of points interpolated by either piecewise linea...
Distribution with given particle density.
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const override
Returns generated particle distribution.
DiehlReporter(IRunCallbacks &callbacks, const int iterCnt)
bool operator()(const Size i, const ArrayView< const Vector > positions) const
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
DifferentiatedBodyIc(const std::string &name)
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
EntryControl & setEnabler(const Enabler &newEnabler)
Adds or replaces the enabler functor of the entry.
EntryControl & setUnits(const Float newMult)
Sets units in which the entry is stored.
Solver for equilibrium internal energy.
Outcome solve(Storage &storage, Statistics &stats)
EquilibriumIc(const std::string &name)
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
GalaxyCallbacks(IRunCallbacks &run)
virtual void onPart(const Storage &storage, const Size partId, const Size numParts) const override
Called when computing new part of the galaxy (particle positions or velocities).
GalaxyIc(const std::string &name, const GalaxySettings &overrides=EMPTY_SETTINGS)
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
virtual Float getVolume() const =0
Returns the total volume of the domain.
virtual Vector getCenter() const =0
Returns the center of the domain.
INLINE IMaterial & setParam(const BodySettingsId paramIdx, TValue &&value)
virtual void create(Storage &storage, const MaterialInitialContext &context)=0
Create all quantities needed by the material.
Base class for all jobs providing particle data.
SharedPtr< ParticleData > result
Data filled by the job when it finishes.
Polymorphic holder allowing to store any RNG (type erasure).
Callbacks executed by the simulation to provide feedback to the user.
virtual bool shouldAbortRun() const =0
Returns whether current run should be aborted or not.
virtual void onSetUp(const Storage &storage, Statistics &stats)=0
Called right before the run starts, i.e. after initial conditions are set up.
virtual void onTimeStep(const Storage &storage, Statistics &stats)=0
Called every timestep.
bool operator()(const Float progress) const
IcProgressCallback(IRunCallbacks &callbacks)
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
Helper object for storing three (possibly four) int or bool values.
Object for adding one or more bodies with given material into a Storage.
BodyView addMonolithicBody(Storage &storage, const BodySettings &body)
Creates a monolithic body by filling given domain with particles.
BodyView addHeterogeneousBody(Storage &storage, const BodySetup &environment, ArrayView< const BodySetup > bodies)
Creates particles composed of different materials.
Object representing a 1D interval of real numbers.
Thrown when components of the run are mutually incompatible.
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
IsothermalSphereIc(const std::string &name)
void addMaterialEntries(VirtualSettings::Category &category, Function< bool()> enabler)
Non-owning wrapper of a material and particles with this material.
INLINE IMaterial & material()
Returns the reference to the material of the particles.
INLINE IndexSequence sequence()
Returns iterable index sequence.
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
ModifyQuantityIc(const std::string &name)
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
struct MonolithicBodyIc::@13 slotUsage
virtual UnorderedMap< std::string, ExtJobType > requires() const override
List of slots that need to be connected to evaluate the job.
virtual void addParticleCategory(VirtualSettings &settings)
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
MonolithicBodyIc(const std::string &name, const BodySettings &overrides=EMPTY_SETTINGS)
NBodyIc(const std::string &name, const NBodySettings &overrides=EMPTY_SETTINGS)
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
NoiseQuantityIc(const std::string &name)
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
Object representing a path on a filesystem.
Container of points with optimized search queries.
Size getClosePointsCount(const Vector ¢er, const Float radius) const
Returns the number of points within given distance from the center point.
Handle push(const Vector &p)
Adds a point into the cloud.
Size size() const
Returns the number of points in the cloud.
Array< Vector > array() const
Returns all points in the cloud as array.
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
PolytropicStarIc(const std::string &name)
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
Non-owning wrapper of pointer.
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.
static const Settings & getDefaults()
\brief Returns a reference to object containing default values of all 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.
void addEntries(const Settings &settings)
Adds entries from different Settings object into this one, overriding current entries.
virtual void evaluate(const RunSettings &global, IRunCallbacks &UNUSED(callbacks)) override
virtual VirtualSettings getSettings() override
Returns a settings object which allows to query and modify the state of the job.
Spherical domain, defined by the center of sphere and its radius.
Array with fixed number of allocated elements.
Object holding various statistics about current run.
Statistics & set(const StatisticsId idx, TValue &&value)
Sets new values of a statistic.
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.
bool empty() const
Checks if the storage is empty, i.e. without particles.
Array< TValue > & getDt(const QuantityId key)
Retrieves a quantity derivative 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.
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.
Heterogeneous container capable of storing a fixed number of values.
INLINE TValue & insert(const TKey &key, const TValue &value)
Adds a new element into the map or sets new value of element with the same key.
EntryControl & connect(const std::string &name, const std::string &key, TValue &value)
Connects to given reference.
Holds a map of virtual entries, associated with a unique name.
IVirtualEntry::Value get(const std::string &key) const
Returns a value of an entry.
Category & addCategory(const std::string &name)
Creates a new category of entries.
Creating code components based on values from settings.
@ NONE
Gass or material with no stress tensor.
@ DIEHL_ET_AL
Isotropic uniform distribution by Diehl et al. (2012)
@ IDEAL_GAS
Equation of state for ideal gas.
@ DIEHL_STRENGTH
Strength parameter of the Diehl's distribution.
@ RHEOLOGY_DAMAGE
Model of fragmentation used within the rheological model.
@ INITIAL_DISTRIBUTION
Initial distribution of SPH particles within the domain, see DistributionEnum for options.
@ DIEHL_ITERATION_COUNT
Number of iterations of particle repelling.
@ ENERGY
Initial specific internal energy.
@ ADIABATIC_INDEX
Adiabatic index used by some equations of state (such as ideal gas)
@ PARTICLE_COUNT
Number of SPH particles in the body.
@ DENSITY
Density at zero pressure.
@ SMOOTHING_LENGTH_ETA
Eta-factor between smoothing length and particle concentration (h = eta * n^(-1/d) )
@ EOS
Equation of state for this material, see EosEnum for options.
@ RHEOLOGY_YIELDING
Model of stress reducing used within the rheological model.
@ GRAVITY_CONSTANT
Gravitational constant. To be generalized.
@ BLOCK
Block with edge sizes given by vector.
@ SPHERICAL
Sphere with given radius.
@ ELLIPSOIDAL
Axis-aligned ellipsoid.
@ CYLINDER
Cylindrical domain aligned with z axis.
constexpr Float gravity
Gravitational constant (CODATA 2014)
constexpr Float R_sun
Solar radius.
constexpr Float M_earth
Earth mass.
constexpr Float year
Number of seconds in a year.
AutoPtr< IGravity > getGravity(const RunSettings &settings)
AutoPtr< IMaterial > getMaterial(const BodySettings &settings)
AutoPtr< IDistribution > getDistribution(const BodySettings &settings, Function< bool(Float)> progressCallback=nullptr)
AutoPtr< IDomain > getDomain(const RunSettings &settings)
AutoPtr< IRng > getRng(const RunSettings &settings)
SharedPtr< IScheduler > getScheduler(const RunSettings &settings=RunSettings::getDefaults())
Storage generateIc(const RunSettings &globals, const GalaxySettings &settings, const IProgressCallbacks &callbacks)
Vector getCenterOfMass(ArrayView< const Float > m, ArrayView< const Vector > r, ArrayView< const Size > idxs=nullptr)
Computes the center of mass.
Storage generateIc(const IDistribution &distribution, const Size particleCnt, const Float radius, const Float mass, const Float n)
Creates a spherical polytropic star.
Parameters of DiehlDistribution.
DensityFunc particleDensity
Function specifies the particle density in space.
Size numOfIters
Number of iterations.
Float strength
Magnitude of a repulsive force between particles that moves them to their final locations.
Function< bool(Size iter, ArrayView< const Vector > r)> onIteration
Optional callback executed once every iteration.
Holds data needed to create a single body in addHeterogeneousBody function.
SharedPtr< IDomain > domain
SharedPtr< IMaterial > material
Helper class, allowing to register job into the global list of jobs.
Shared data used when creating all bodies in the simulation.
Storage storage
Holds all particle positions and other quantities.
RunSettings overrides
Overrides associated with the particle state.
Holds the information about a power-law size-frequency distributions.
Helper class for adding individual enums to the enum map.