SPH
Classes | Public Member Functions | List of all members
InitialConditions Class Reference

Object for adding one or more bodies with given material into a Storage. More...

#include <Initial.h>

Inheritance diagram for InitialConditions:
Noncopyable

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...
 
- Public Member Functions inherited from Noncopyable
 Noncopyable ()=default
 
 Noncopyable (const Noncopyable &)=delete
 
 Noncopyable (Noncopyable &&)=default
 
Noncopyableoperator= (const Noncopyable &)=delete
 
Noncopyableoperator= (Noncopyable &&)=default
 

Detailed Description

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.

Definition at line 106 of file Initial.h.

Constructor & Destructor Documentation

◆ InitialConditions()

InitialConditions::InitialConditions ( const RunSettings settings)
explicit

Creates new initial conditions.

Parameters
settingsRun settings used to initialize MaterialInitialContext.

Definition at line 76 of file Initial.cpp.

◆ ~InitialConditions()

InitialConditions::~InitialConditions ( )
default

Member Function Documentation

◆ addHeterogeneousBody()

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.

Parameters
storageParticle storage to which the new body is added
environmentBase 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.
bodiesList of bodies created inside the main environment.

Definition at line 140 of file Initial.cpp.

◆ addMonolithicBody() [1/4]

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.

Parameters
storageParticle storage to which the new body is added
bodyParameters of the body

Definition at line 81 of file Initial.cpp.

◆ addMonolithicBody() [2/4]

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.

Parameters
storageParticle storage to which the new body is added
domainSpatial 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.
bodyParameters of the body

Definition at line 86 of file Initial.cpp.

◆ addMonolithicBody() [3/4]

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.

◆ addMonolithicBody() [4/4]

BodyView InitialConditions::addMonolithicBody ( Storage storage,
const IDomain domain,
SharedPtr< IMaterial material,
const IDistribution distribution 
)
Todo:
refactor

Definition at line 100 of file Initial.cpp.

◆ addRubblePileBody()

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].

Parameters
storageParticle storage to which the rubble-pile body is added.
domainSpatial domain where the particles are placed.
sfdPower-law size-frequency distribution of the spheres.
bodySettingsMaterial parameters of the spheres.
Todo:
potentially move to other object / create an abstract interface for addBody ?

Definition at line 193 of file Initial.cpp.


The documentation for this class was generated from the following files: