MercuryDPM
Beta
|
BaseSpecies is the class from which all other species are derived. More...
#include <BaseSpecies.h>
Public Member Functions | |
BaseSpecies () | |
The default constructor. More... | |
BaseSpecies (const BaseSpecies &p) | |
The copy constructor. More... | |
virtual | ~BaseSpecies () |
The default destructor. More... | |
virtual BaseSpecies * | copy () const =0 |
Creates a deep copy of the object from which it is called. More... | |
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... | |
Mdouble | average (Mdouble a, Mdouble b) |
defines the average of two variables by the harmonic mean. More... | |
virtual void | mixAll (BaseSpecies *const S, BaseSpecies *const T)=0 |
creates default values for mixed species More... | |
virtual Mdouble | getInteractionDistance () const =0 |
returns the largest separation distance at which adhesive short-range forces can occur. 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, Mdouble timeStamp)=0 |
returns new Interaction object. More... | |
Public Member Functions inherited from BaseObject | |
BaseObject () | |
Default constructor. More... | |
BaseObject (const BaseObject &p) | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject () |
virtual destructor More... | |
virtual void | read (std::istream &is)=0 |
A purely virtual method with an implementation which reads the index from the stream and assigns it to id_. More... | |
virtual void | write (std::ostream &os) const =0 |
A purely virtual function which has an implementation which writes the name and the object id_ to the output stream. More... | |
virtual std::string | getName () const =0 |
A purely virtual function. More... | |
virtual void | moveInHandler (const unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (const unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (const unsigned int 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... | |
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... | |
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.
Definition at line 44 of file BaseSpecies.h.
BaseSpecies::BaseSpecies | ( | ) |
The default constructor.
Definition at line 35 of file BaseSpecies.cc.
References handler_.
BaseSpecies::BaseSpecies | ( | const BaseSpecies & | p | ) |
The copy constructor.
[in] | p | the species that is copied |
Definition at line 47 of file BaseSpecies.cc.
References handler_.
|
virtual |
The default destructor.
Definition at line 56 of file BaseSpecies.cc.
defines the average of two variables by the harmonic mean.
Defines the average of two variables by the harmonic mean. This function is used to define default mixed species.
[in] | a,b | The two variables you want to average |
Definition at line 85 of file BaseSpecies.cc.
Referenced by LiquidBridgeWilletSpecies::mix(), ReversibleAdhesiveSpecies::mix(), LinearPlasticViscoelasticNormalSpecies::mix(), FrictionSpecies::mix(), LinearViscoelasticNormalSpecies::mix(), HertzianViscoelasticNormalSpecies::mix(), and SlidingFrictionSpecies::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 Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, and ParticleSpecies.
Referenced by SpeciesHandler::operator=(), and SpeciesHandler::SpeciesHandler().
SpeciesHandler * BaseSpecies::getHandler | ( | ) | const |
Returns the pointer to the handler to which this species belongs.
Definition at line 74 of file BaseSpecies.cc.
References handler_.
Referenced by ParticleSpecies::getMassFromRadius(), ParticleSpecies::setDensity(), BaseWall::setSpecies(), and BaseParticle::setSpecies().
|
pure virtual |
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).
Implemented in Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >, LiquidBridgeWilletSpecies, ReversibleAdhesiveSpecies, and EmptyAdhesiveSpecies.
Referenced by BaseParticle::getInteractionRadius(), and BaseParticle::getWallInteractionRadius().
|
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 >.
Referenced by InteractionHandler::getInteraction().
|
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 >, SlidingFrictionSpecies, EmptyFrictionSpecies, and FrictionSpecies.
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 >.
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. |
Definition at line 66 of file BaseSpecies.cc.
References handler_.
Referenced by SpeciesHandler::addObject().
|
private |
A pointer to the handler to which this species belongs. It is initialized to nullptr and gets set when SpeciesHandler::addObject() is called.
Definition at line 134 of file BaseSpecies.h.
Referenced by BaseSpecies(), getHandler(), and setHandler().