|
BaseSpecies is the class from which all other species are derived. More...
#include <BaseSpecies.h>
Public Member Functions | |
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 BaseSpecies * | copy () const =0 |
Creates a deep copy of the object from which it is called. 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) |
Public Member Functions inherited from BaseObject | |
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 |
Static Public Member Functions | |
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... | |
Protected Member Functions | |
void | write (std::ostream &os) const override |
Sets the boolean constantRestitution_. More... | |
void | read (std::istream &is) override |
Protected Attributes | |
BaseNormalForce * | normalForce_ |
A pointer to the normal force parameters \detail 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 \detail 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 \detail 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... | |
Private Attributes | |
SpeciesHandler * | handler_ |
A pointer to the handler to which this species belongs. It is initialized to nullptr and gets set when SpeciesHandler::addObject() is called. More... | |
Mdouble | interactionDistance_ |
BaseSpecies is the class from which all other species are derived.
A base species is almost empty, with the exception of a pointer to the particleHandler. All other properties get added in the inherited classes. See Species for more details.
BaseSpecies::BaseSpecies | ( | ) |
The default constructor.
BaseSpecies::BaseSpecies | ( | BaseNormalForce * | normalForce, |
BaseFrictionForce * | frictionForce_, | ||
BaseAdhesiveForce * | adhesiveForce | ||
) |
References adhesiveForce_, DEBUG, frictionForce_, logger, normalForce_, and BaseForce::setBaseSpecies().
BaseSpecies::BaseSpecies | ( | const BaseSpecies & | p | ) |
The copy constructor.
[in] | p | the species that is copied |
BaseSpecies::~BaseSpecies | ( | ) |
The default destructor.
Returns the harmonic mean of two variables.
\detail Returns the harmonic mean of two variables. This function is used to define default mixed species.
[in] | a,b | The two variables you want to average |
Referenced by averageInf(), BondedSpecies::mix(), ChargedBondedSpecies::mix(), FrictionSpecies::mix(), HertzianSinterNormalSpecies::mix(), LinearPlasticViscoelasticNormalSpecies::mix(), LinearViscoelasticNormalSpecies::mix(), LiquidBridgeWilletSpecies::mix(), LiquidMigrationLSSpecies::mix(), LiquidMigrationWilletSpecies::mix(), MindlinRollingTorsionSpecies::mix(), MindlinSpecies::mix(), ReversibleAdhesiveSpecies::mix(), SinterLinNormalSpecies::mix(), SinterNormalSpecies::mix(), SlidingFrictionSpecies::mix(), and SPHNormalSpecies::mix().
Returns the harmonic mean of two variables, returning inf if either is inf.
\detail Returns the harmonic mean of two variables, returning inf if either is inf.
References average(), and constants::inf.
Referenced by FrictionSpecies::mix().
|
pure virtual |
Creates a deep copy of the object from which it is called.
Creates a deep copy of the Species, or MixedSpecies from which it is called. As this depends on the template parameters of Species, the definition of this function is in the Species class.
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).
To create a copy of a MixedSpecies, use
BaseSpecies* mixedSpecies->copy();
To create a copy of a Species, use
ParticleSpecies* species->copy();
Implemented in ParticleSpecies, Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Referenced by SubcriticalMaserBoundary::addParticleToMaser(), SpeciesHandler::operator=(), and SpeciesHandler::SpeciesHandler().
|
pure virtual |
Copies the content of this into the species bs, if they are of the same type.
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Referenced by ConstantMassFlowMaserBoundary::addParticleToMaser().
|
pure virtual |
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Referenced by InteractionHandler::deleteEmptyInteraction(), and MPIContainer::initialiseMercuryMPITypes().
|
inline |
References adhesiveForce_.
Referenced by ChargedBondedInteraction::getElasticEnergy(), BondedInteraction::getSpecies(), ChargedBondedInteraction::getSpecies(), EmptyAdhesiveInteraction::getSpecies(), IrreversibleAdhesiveInteraction::getSpecies(), LiquidBridgeWilletInteraction::getSpecies(), LiquidMigrationLSInteraction::getSpecies(), LiquidMigrationWilletInteraction::getSpecies(), ParhamiMcMeekingSinterInteraction::getSpecies(), RegimeSinterInteraction::getSpecies(), and ReversibleAdhesiveInteraction::getSpecies().
|
pure virtual |
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Referenced by InteractionHandler::createEmptyInteraction(), and MPIContainer::initialiseMercuryMPITypes().
|
inline |
SpeciesHandler * BaseSpecies::getHandler | ( | ) | const |
Returns the pointer to the handler to which this species belongs.
References handler_.
Referenced by SuperQuadricParticle::getInteractionRadius(), ParticleSpecies::getLargestInverseParticleMassLocal(), ParticleSpecies::getMixedSpecies(), ParticleSpecies::getVolumeFromRadius(), ParticleSpecies::setDensity(), setInteractionDistance(), ParticleSpecies::setMaxInteractionDistance(), BaseInteractable::setSpecies(), BaseParticle::setSpecies(), BaseWall::setSpecies(), and BaseInteraction::writeInteraction().
|
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).
References interactionDistance_.
Referenced by SpeciesHandler::addObject(), NurbsWall::getDistanceAndNormal(), Screw::getDistanceAndNormal(), IntersectionOfWalls::getDistanceAndNormal(), ChargedBondedInteraction::getElasticEnergy(), BaseParticle::getInteractionDistance(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), and ParticleWallInteraction::setupInitialConditions().
|
pure virtual |
returns new Interaction object.
As each Species has its own Interaction type, getNewInteraction can be used to access the right type of Interaction 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).
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Referenced by InteractionHandler::addInteraction(), and InteractionHandler::getInteraction().
|
inline |
References normalForce_.
Referenced by LinearPlasticViscoelasticInteraction::getElasticEnergy(), LinearViscoelasticInteraction::getElasticEnergy(), HertzianSinterInteraction::getSpecies(), HertzianViscoelasticInteraction::getSpecies(), LinearPlasticViscoelasticInteraction::getSpecies(), LinearViscoelasticInteraction::getSpecies(), SinterInteraction::getSpecies(), SPHInteraction::getSpecies(), and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::mixAll().
|
pure virtual |
Returns true if torques (i.e. angular degrees of freedom) have to be calculated.
returns true if torques have to be calculated. This is currently only true if a tangential force is applied, but can be true for non-spherical objects even if no tangential force is applied . Defined in FrictionForceSpecies. 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).
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
Referenced by SpeciesHandler::useAngularDOFs().
|
pure virtual |
creates default values for mixed species
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).
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
|
overrideprotectedvirtual |
[in] | is | input stream (typically the restart file) |
Implements BaseObject.
Reimplemented in ParticleSpecies, Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
References normalForce_, helpers::readOptionalVariable(), and BaseNormalForce::setConstantRestitution().
Referenced by MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::read(), and ParticleSpecies::read().
void BaseSpecies::setHandler | ( | SpeciesHandler * | handler | ) |
Sets the pointer to the handler to which this species belongs.
[in] | the | pointer to the handler to which this species belongs. |
References handler_.
Referenced by SpeciesHandler::addObject(), NautaMixer::addSpeciesAndSetTimeStepAndSaveCount(), ParticleSpecies::getMassFromRadius(), main(), regimeForceUnitTest::regimeForceUnitTest(), SinterPair::SinterPair(), and viscoElasticUnitTest::viscoElasticUnitTest().
void BaseSpecies::setInteractionDistance | ( | Mdouble | interactionDistance | ) |
Sets BaseSpecies::interactionDistance_. This function should not be called by the user, only by functions in classes derived from BaseSpecies (in particular, the adhesive-force species). This function gets called every time a variable is set on which the interaction distance depends. See for example LiquidBridgeWilletSpecies::setLiquidBridgeVolume.
interactionDistance |
References getHandler(), BaseObject::getId(), SpeciesHandler::getMixedObjects(), BaseHandler< T >::getObject(), interactionDistance_, and ParticleSpecies::setMaxInteractionDistance().
Referenced by ChargedBondedSpecies::setInteractionDistance(), LiquidBridgeWilletSpecies::setInteractionDistance(), LiquidMigrationLSSpecies::setInteractionDistance(), LiquidMigrationWilletSpecies::setInteractionDistance(), and ReversibleAdhesiveSpecies::setInteractionDistance().
|
overrideprotectedvirtual |
Sets the boolean constantRestitution_.
[out] | os | output stream (typically the restart file) |
Implements BaseObject.
Reimplemented in ParticleSpecies, Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, Species< LinearViscoelasticNormalSpecies >, Species< LinearPlasticViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies, IrreversibleAdhesiveSpecies >, and MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >.
References BaseNormalForce::getConstantRestitution(), and normalForce_.
Referenced by MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::write(), and ParticleSpecies::write().
|
protected |
A pointer to the adhesive force parameters \detail 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.
Referenced by BaseSpecies(), getAdhesiveForce(), MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::MixedSpecies(), and Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::Species().
|
protected |
A pointer to the friction force parameters \detail 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.
Referenced by BaseSpecies(), getFrictionForce(), MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::MixedSpecies(), and Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::Species().
|
private |
A pointer to the handler to which this species belongs. It is initialized to nullptr and gets set when SpeciesHandler::addObject() is called.
Referenced by getHandler(), and setHandler().
|
private |
Returns the distance between particles of this species below which adhesive forces can occur (needed for contact detection) set by the adhesive species
Referenced by getInteractionDistance(), and setInteractionDistance().
|
protected |
A pointer to the normal force parameters \detail 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.
Referenced by BaseSpecies(), getNormalForce(), MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::MixedSpecies(), read(), Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::Species(), and write().