MercuryDPM
Trunk
|
#include <ParticleSpecies.h>
Public Types | |
typedef BaseInteraction | InteractionType |
typedef BaseSpecies | MixedSpeciesType |
Public Member Functions | |
ParticleSpecies () | |
The default constructor. More... | |
ParticleSpecies (const ParticleSpecies &p) | |
The default copy constructor. More... | |
ParticleSpecies (BaseNormalForce *normalForce, BaseFrictionForce *frictionForce, BaseAdhesiveForce *adhesiveForce) | |
~ParticleSpecies () | |
The default destructor. More... | |
ParticleSpecies * | copy () const override=0 |
Creates a deep copy of the object from which it is called. More... | |
virtual BaseSpecies * | copyMixed () const =0 |
Creates a new MixedSpecies with the same force properties as the Species from which it is called. See Species::copyMixed for details. More... | |
void | read (std::istream &is) override |
Reads the species properties from an input stream. More... | |
void | write (std::ostream &os) const override |
Writes the species properties to an output stream. More... | |
std::string | getBaseName () const |
Used in Species::getName to obtain a unique name for each Species. More... | |
void | setDensity (Mdouble density) |
Allows density_ to be changed. More... | |
Mdouble | getMassFromRadius (Mdouble radius) const |
Mdouble | getMassFromRadius (const Mdouble radius, SpeciesHandler &speciesHandler) |
Mdouble | getVolumeFromRadius (Mdouble radius) const |
Mdouble | getDensity () const |
Allows density_ to be accessed. More... | |
void | computeMass (BaseParticle *p) const |
Compute Particle mass function, which required a reference to the Species vector. It computes the Particles mass, Inertia and the inverses. More... | |
void | setTemperatureDependentDensity (const std::function< double(double)> &temperatureDependentDensity) |
const std::function< double(double)> & | getTemperatureDependentDensity () const |
Mdouble | getSmallestParticleMass () const |
Computes mass of the lightest particle (by mass) belonging to this species. This computation calls getLightestInverseParticleMassLocal, such that the computation is done on each node. More... | |
Mdouble | getMaxInteractionDistance () const |
returns the largest separation distance at which adhesive short-range forces can occur. More... | |
void | setMaxInteractionDistance (Mdouble interactionDistance=0) |
Sets maxInteractionDistance_. More... | |
const BaseSpecies * | getMixedSpecies (const ParticleSpecies *s) const |
![]() | |
BaseSpecies () | |
The default constructor. More... | |
BaseSpecies (BaseNormalForce *normalForce, BaseFrictionForce *frictionForce_, BaseAdhesiveForce *adhesiveForce) | |
BaseSpecies (const BaseSpecies &p) | |
The copy constructor. More... | |
~BaseSpecies () | |
The default destructor. More... | |
virtual void | copyInto (BaseSpecies *s) const =0 |
void | setHandler (SpeciesHandler *handler) |
Sets the pointer to the handler to which this species belongs. More... | |
SpeciesHandler * | getHandler () const |
Returns the pointer to the handler to which this species belongs. More... | |
virtual void | mixAll (BaseSpecies *S, BaseSpecies *T)=0 |
creates default values for mixed species More... | |
virtual bool | getUseAngularDOFs () const =0 |
Returns true if torques (i.e. angular degrees of freedom) have to be calculated. More... | |
virtual BaseInteraction * | getNewInteraction (BaseInteractable *P, BaseInteractable *I, unsigned timeStamp) const =0 |
returns new Interaction object. More... | |
virtual BaseInteraction * | getEmptyInteraction () const =0 |
virtual void | deleteEmptyInteraction (BaseInteraction *interaction) const =0 |
Mdouble | getInteractionDistance () const |
returns the largest separation distance at which adhesive short-range forces can occur. More... | |
BaseNormalForce * | getNormalForce () const |
BaseFrictionForce * | getFrictionForce () const |
BaseAdhesiveForce * | getAdhesiveForce () const |
void | setInteractionDistance (Mdouble interactionDistance) |
Sets BaseSpecies::interactionDistance_. More... | |
![]() | |
BaseObject ()=default | |
Default constructor. More... | |
BaseObject (const BaseObject &p)=default | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject ()=default |
virtual destructor More... | |
virtual std::string | getName () const =0 |
A purely virtual function. More... | |
virtual void | moveInHandler (unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (unsigned long id) |
Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More... | |
unsigned int | getIndex () const |
Returns the index of the object in the handler. More... | |
unsigned int | getId () const |
Returns the unique identifier of any particular object. More... | |
void | setGroupId (unsigned groupId) |
unsigned | getGroupId () const |
Private Member Functions | |
Mdouble | getLargestInverseParticleMassLocal () const |
Computes inverse mass of the lightest particle (by mass) belonging to this species. If MPI is used, this computation is done locally on each node. More... | |
Private Attributes | |
Mdouble | density_ |
The mass density. More... | |
std::function< double(double temperature)> | temperatureDependentDensity_ |
Mdouble | maxInteractionDistance_ |
Returns the max distance between particles of this species and any other species below which adhesive forces can occur (needed for contact detection) More... | |
Additional Inherited Members | |
![]() | |
static Mdouble | average (Mdouble a, Mdouble b) |
Returns the harmonic mean of two variables. More... | |
static Mdouble | averageInf (Mdouble a, Mdouble b) |
Returns the harmonic mean of two variables, returning inf if either is inf. More... | |
![]() | |
BaseNormalForce * | normalForce_ |
A pointer to the normal force parameters This pointer is used by the Interaction's to get a pointer to the species The pointer is set in the constructors of SPecies and MixedSpecies. More... | |
BaseFrictionForce * | frictionForce_ |
A pointer to the friction force parameters This pointer is used by the Interaction's to get a pointer to the species The pointer is set in the constructors of SPecies and MixedSpecies. More... | |
BaseAdhesiveForce * | adhesiveForce_ |
A pointer to the adhesive force parameters This pointer is used by the Interaction's to get a pointer to the species The pointer is set in the constructors of SPecies and MixedSpecies. More... | |
Definition at line 36 of file ParticleSpecies.h.
Definition at line 39 of file ParticleSpecies.h.
Definition at line 40 of file ParticleSpecies.h.
ParticleSpecies::ParticleSpecies | ( | ) |
ParticleSpecies::ParticleSpecies | ( | const ParticleSpecies & | p | ) |
The default copy constructor.
[in] | p | the species that is copied |
Definition at line 56 of file ParticleSpecies.cc.
References density_, and temperatureDependentDensity_.
ParticleSpecies::ParticleSpecies | ( | BaseNormalForce * | normalForce, |
BaseFrictionForce * | frictionForce, | ||
BaseAdhesiveForce * | adhesiveForce | ||
) |
Definition at line 44 of file ParticleSpecies.cc.
ParticleSpecies::~ParticleSpecies | ( | ) |
The default destructor.
Definition at line 66 of file ParticleSpecies.cc.
void ParticleSpecies::computeMass | ( | BaseParticle * | p | ) | const |
Compute Particle mass function, which required a reference to the Species vector. It computes the Particles mass, Inertia and the inverses.
Compute BaseParticle mass function, which required a reference to the Species vector.
It computes the Particles mass, Inertia and the inverses. this function is called, if BaseParticleHandler::addObject, SpeciesHandler::addObject, ParticleSpecies::setDensity, BaseParticle::setRadius or DPMBase::setParticleDimensions is called
Definition at line 166 of file ParticleSpecies.cc.
References BaseParticle::computeMass().
Referenced by ParticleHandler::addExistingObject(), ParticleHandler::addGhostObject(), ParticleHandler::addObject(), SuperQuadricParticle::setAxes(), SuperQuadricParticle::setExponents(), BaseParticle::setRadius(), and BaseParticle::unfix().
|
overridepure virtual |
Creates a deep copy of the object from which it is called.
See BaseSpecies::copy for details
Implements BaseSpecies.
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Referenced by CurvyChute::createBottom().
|
pure virtual |
Creates a new MixedSpecies with the same force properties as the Species from which it is called. See Species::copyMixed for details.
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Referenced by SpeciesHandler::addObject().
std::string ParticleSpecies::getBaseName | ( | ) | const |
Used in Species::getName to obtain a unique name for each Species.
Definition at line 99 of file ParticleSpecies.cc.
Mdouble ParticleSpecies::getDensity | ( | ) | const |
Allows density_ to be accessed.
Definition at line 117 of file ParticleSpecies.cc.
References density_.
Referenced by Membrane::adjustVertexParticleSize(), Membrane::buildMesh(), SuperQuadricParticle::computeMass(), BaseParticle::computeMass(), HertzianSinterNormalSpecies::computeTimeStep(), getMassFromRadius(), FileReader::read(), LinearViscoelasticNormalSpecies::setCollisionTimeAndRestitutionCoefficient(), and SuperQuadricParticle::setInertia().
|
private |
Computes inverse mass of the lightest particle (by mass) belonging to this species. If MPI is used, this computation is done locally on each node.
Definition at line 187 of file ParticleSpecies.cc.
References BaseSpecies::getHandler(), and logger.
Referenced by getSmallestParticleMass().
Definition at line 122 of file ParticleSpecies.cc.
References getDensity(), and getVolumeFromRadius().
Referenced by BaseCluster::calculateTimeStep(), getMassFromRadius(), ChuteBottom::makeRoughBottom(), and BaseCluster::setupInitialConditions().
Mdouble ParticleSpecies::getMassFromRadius | ( | const Mdouble | radius, |
SpeciesHandler & | speciesHandler | ||
) |
Definition at line 127 of file ParticleSpecies.cc.
References getMassFromRadius(), and BaseSpecies::setHandler().
|
inline |
returns the largest separation distance at which adhesive short-range forces can occur.
returns the largest separation distance (negative overlap) at which (adhesive) short-range forces can occur (needed for contact detection). Defined in each of the AdhesiveForceSpecies It is defined as a virtual function here to allow the function to be called from a BaseSpecies pointer (which is the kind of pointer used for MixedSpecies).
Definition at line 113 of file ParticleSpecies.h.
References maxInteractionDistance_.
Referenced by BaseParticle::getMaxInteractionRadius().
const BaseSpecies * ParticleSpecies::getMixedSpecies | ( | const ParticleSpecies * | s | ) | const |
Definition at line 237 of file ParticleSpecies.cc.
References BaseSpecies::getHandler(), BaseObject::getIndex(), and SpeciesHandler::getMixedObject().
Referenced by BaseParticle::getInteractionDistance().
Mdouble ParticleSpecies::getSmallestParticleMass | ( | ) | const |
Computes mass of the lightest particle (by mass) belonging to this species. This computation calls getLightestInverseParticleMassLocal, such that the computation is done on each node.
Definition at line 201 of file ParticleSpecies.cc.
References getLargestInverseParticleMassLocal(), and MPIContainer::Instance().
const std::function< double(double)> & ParticleSpecies::getTemperatureDependentDensity | ( | ) | const |
Definition at line 171 of file ParticleSpecies.cc.
References temperatureDependentDensity_.
Referenced by ThermalParticle::actionsAfterTimeStep().
Definition at line 134 of file ParticleSpecies.cc.
References ERROR, BaseHandler< T >::getDPMBase(), BaseSpecies::getHandler(), DPMBase::getParticleDimensions(), logger, and constants::pi.
Referenced by getMassFromRadius().
|
overridevirtual |
Reads the species properties from an input stream.
[in] | is | input stream (typically the restart file) |
Reimplemented from BaseSpecies.
Reimplemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Definition at line 88 of file ParticleSpecies.cc.
References density_, BaseObject::read(), and BaseSpecies::read().
Referenced by Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::read().
void ParticleSpecies::setDensity | ( | Mdouble | density | ) |
Allows density_ to be changed.
[in] | density | the particle density |
Definition at line 107 of file ParticleSpecies.cc.
References ParticleHandler::computeAllMasses(), density_, BaseHandler< T >::getDPMBase(), BaseSpecies::getHandler(), BaseObject::getIndex(), logger, and DPMBase::particleHandler.
Referenced by Membrane::buildMesh(), FileReader::read(), and SpeciesHandler::readOldObject().
void ParticleSpecies::setMaxInteractionDistance | ( | Mdouble | interactionDistance = 0 | ) |
Sets maxInteractionDistance_.
interactionDistance | the interaction distance that has been changed |
interactionDistance | the interaction distance that has been changed |
Definition at line 220 of file ParticleSpecies.cc.
References BaseSpecies::getHandler(), BaseObject::getIndex(), SpeciesHandler::getMixedObject(), BaseHandler< T >::getSize(), constants::i, and maxInteractionDistance_.
Referenced by SpeciesHandler::addObject(), and BaseSpecies::setInteractionDistance().
void ParticleSpecies::setTemperatureDependentDensity | ( | const std::function< double(double)> & | temperatureDependentDensity | ) |
Definition at line 176 of file ParticleSpecies.cc.
References temperatureDependentDensity_.
|
overridevirtual |
Writes the species properties to an output stream.
[out] | os | output stream (typically the restart file) |
Reimplemented from BaseSpecies.
Reimplemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Definition at line 76 of file ParticleSpecies.cc.
References density_, BaseObject::write(), and BaseSpecies::write().
Referenced by Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::write().
|
private |
The mass density.
Definition at line 134 of file ParticleSpecies.h.
Referenced by getDensity(), ParticleSpecies(), read(), setDensity(), and write().
|
private |
Returns the max distance between particles of this species and any other species below which adhesive forces can occur (needed for contact detection)
Definition at line 145 of file ParticleSpecies.h.
Referenced by getMaxInteractionDistance(), and setMaxInteractionDistance().
|
private |
Change this function to let the particles expand due to temperature. The default value (empty) stands for constant density.
Definition at line 140 of file ParticleSpecies.h.
Referenced by getTemperatureDependentDensity(), ParticleSpecies(), and setTemperatureDependentDensity().