SPH
|
Object for adding one or more bodies with given material into a Storage. More...
#include <Initial.h>
Classes | |
struct | BodySetup |
Holds data needed to create a single body in addHeterogeneousBody function. More... | |
Public Member Functions | |
InitialConditions (const RunSettings &settings) | |
Creates new initial conditions. More... | |
~InitialConditions () | |
BodyView | addMonolithicBody (Storage &storage, const BodySettings &body) |
Creates a monolithic body by filling given domain with particles. More... | |
BodyView | addMonolithicBody (Storage &storage, const IDomain &domain, const BodySettings &body) |
Creates a monolithic body by filling given domain with particles. More... | |
BodyView | addMonolithicBody (Storage &storage, const IDomain &domain, SharedPtr< IMaterial > material) |
BodyView | addMonolithicBody (Storage &storage, const IDomain &domain, SharedPtr< IMaterial > material, const IDistribution &distribution) |
BodyView | addHeterogeneousBody (Storage &storage, const BodySetup &environment, ArrayView< const BodySetup > bodies) |
Creates particles composed of different materials. More... | |
void | addRubblePileBody (Storage &storage, const IDomain &domain, const PowerLawSfd &sfd, const BodySettings &bodySettings) |
Creates a rubble-pile body, composing of monolithic spheres. More... | |
![]() | |
Noncopyable ()=default | |
Noncopyable (const Noncopyable &)=delete | |
Noncopyable (Noncopyable &&)=default | |
Noncopyable & | operator= (const Noncopyable &)=delete |
Noncopyable & | operator= (Noncopyable &&)=default |
Object for adding one or more bodies with given material into a Storage.
All particles created in one run should be created using the same InitialConditions object. If multiple objects are used, quantity QuantityId::FLAG must be manually updated to be unique for each body in the simulation. For every body added into the storage, it is further necessary to call ISolver::create before starting the simulation. This creates additional solver-dependent quantities.
|
explicit |
Creates new initial conditions.
settings | Run settings used to initialize MaterialInitialContext. |
Definition at line 76 of file Initial.cpp.
|
default |
BodyView InitialConditions::addHeterogeneousBody | ( | Storage & | storage, |
const BodySetup & | environment, | ||
ArrayView< const BodySetup > | bodies | ||
) |
Creates particles composed of different materials.
Particles of different materials fill given domains inside the parent (environment) body. Each body can have different material and have different initial velocity. These bodies don't add more particles (particle count in settings is irrelevant when creating the bodies), they simply override particles created by environment body. If multiple bodies overlap, particles are assigned to body listed first in the array.
storage | Particle storage to which the new body is added |
environment | Base body, domain of which defines the body. No particles are generated outside of this domain. By default, all particles have the material given by this body. |
bodies | List of bodies created inside the main environment. |
Definition at line 140 of file Initial.cpp.
BodyView InitialConditions::addMonolithicBody | ( | Storage & | storage, |
const BodySettings & | body | ||
) |
Creates a monolithic body by filling given domain with particles.
Particles are created on positions given by distribution in body settings. Beside positions of particles, the function initialize particle masses, pressure and sound speed, assuming both the pressure and sound speed are computed from equation of state.
storage | Particle storage to which the new body is added |
body | Parameters of the body |
Definition at line 81 of file Initial.cpp.
BodyView InitialConditions::addMonolithicBody | ( | Storage & | storage, |
const IDomain & | domain, | ||
const BodySettings & | body | ||
) |
Creates a monolithic body by filling given domain with particles.
Particles are created on positions given by distribution in body settings. Beside positions of particles, the function initialize particle masses, pressure and sound speed, assuming both the pressure and sound speed are computed from equation of state.
storage | Particle storage to which the new body is added |
domain | Spatial domain where the particles are placed. The domain should not overlap a body already added into the storage as that would lead to incorrect density estimating in overlapping regions. |
body | Parameters of the body |
Definition at line 86 of file Initial.cpp.
BodyView InitialConditions::addMonolithicBody | ( | Storage & | storage, |
const IDomain & | domain, | ||
SharedPtr< IMaterial > | material | ||
) |
Adds a body by explicitly specifying its material.
Definition at line 93 of file Initial.cpp.
BodyView InitialConditions::addMonolithicBody | ( | Storage & | storage, |
const IDomain & | domain, | ||
SharedPtr< IMaterial > | material, | ||
const IDistribution & | distribution | ||
) |
Definition at line 100 of file Initial.cpp.
void InitialConditions::addRubblePileBody | ( | Storage & | storage, |
const IDomain & | domain, | ||
const PowerLawSfd & | sfd, | ||
const BodySettings & | bodySettings | ||
) |
Creates a rubble-pile body, composing of monolithic spheres.
The spheres are created randomly, using the RNG from InitialMaterialContext. Each sphere is considered as a different body, so the interactions between the spheres is the same as the interactions between an impactor an a target, for example. The spheres can partially exceed the boundary of the domain; the particles outside of the domain are removed in this case. The body is created 'statically', no gravitational interaction is considered and the created configuration might not be stable. The body is created similarly as in [4]. For more complex initial conditions of rubble-pile bodies, see [7].
storage | Particle storage to which the rubble-pile body is added. |
domain | Spatial domain where the particles are placed. |
sfd | Power-law size-frequency distribution of the spheres. |
bodySettings | Material parameters of the spheres. |
Definition at line 193 of file Initial.cpp.