MercuryDPM
Trunk
|
Contains contact force properties for contacts between particles with two different species. More...
#include <MixedSpecies.h>
Public Member Functions | |
MixedSpecies () | |
The default constructor. More... | |
MixedSpecies (const MixedSpecies &s) | |
The default copy constructor. More... | |
MixedSpecies (const Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies > &s) | |
Creates a mixed species with the same force properties as a Species. More... | |
virtual | ~MixedSpecies () |
The default destructor. More... | |
MixedSpecies < NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies > * | copy () const final |
Creates a deep copy of the MixedSpecies from which it is called. More... | |
void | copyInto (BaseSpecies *bs) const final |
Copies the content of this into the species bs, if they are of the same type. More... | |
void | read (std::istream &is) final |
Reads the species properties from an input stream. More... | |
void | write (std::ostream &os) const final |
Writes the MixedSpecies properties to an output stream. More... | |
std::string | getName () const final |
Returns the name of the MixedSpecies as it is used in the restart file. More... | |
BaseInteraction * | getNewInteraction (BaseInteractable *const P, BaseInteractable *const I, unsigned timeStamp) const final |
When a contact between two particles is determined, an Interaction object is created, as the type of Interaction depends on the MixedSpecies type. More... | |
BaseInteraction * | getEmptyInteraction () const final |
void | deleteEmptyInteraction (BaseInteraction *interaction) const final |
bool | getUseAngularDOFs () const final |
Returns true if torques have to be calculated. More... | |
void | mixAll (BaseSpecies *const S, BaseSpecies *const T) final |
sets the MixedSpecies properties by mixing the properties of two particle species More... | |
![]() | |
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... | |
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 | 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 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 |
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... | |
Contains contact force properties for contacts between particles with two different species.
See Species for details.
Definition at line 42 of file MixedSpecies.h.
MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::MixedSpecies | ( | ) |
The default constructor.
Definition at line 102 of file MixedSpecies.h.
MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::MixedSpecies | ( | const MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies > & | s | ) |
The default copy constructor.
Definition at line 109 of file MixedSpecies.h.
References BaseSpecies::adhesiveForce_, DEBUG, BaseSpecies::frictionForce_, logger, BaseSpecies::normalForce_, and BaseForce::setBaseSpecies().
MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::MixedSpecies | ( | const Species< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies > & | s | ) |
Creates a mixed species with the same force properties as a Species.
Definition at line 122 of file MixedSpecies.h.
References BaseSpecies::adhesiveForce_, DEBUG, BaseSpecies::frictionForce_, logger, BaseSpecies::normalForce_, and BaseForce::setBaseSpecies().
|
virtual |
The default destructor.
Definition at line 136 of file MixedSpecies.h.
|
finalvirtual |
Creates a deep copy of the MixedSpecies from which it is called.
MixedSpecies copy method. It calls to copy constructor of this MixedSpecies, useful for polymorphism.
Implements BaseSpecies.
Definition at line 145 of file MixedSpecies.h.
Referenced by SpeciesHandler::readAndAddObject().
|
finalvirtual |
Copies the content of this into the species bs, if they are of the same type.
Useful for polymorphism: speciesHandler.getObject(i)->copyInto(bs); creates a deep copy (i.e. also copies properties of the derived species), whereas bs = speciesHandler.getObject(i); would only create a shallow copy.
Implements BaseSpecies.
Definition at line 159 of file MixedSpecies.h.
References getName(), logger, and WARN.
|
finalvirtual |
Implements BaseSpecies.
Definition at line 263 of file MixedSpecies.h.
|
finalvirtual |
Implements BaseSpecies.
Definition at line 257 of file MixedSpecies.h.
|
finalvirtual |
Returns the name of the MixedSpecies as it is used in the restart file.
Returns the name of the MixedSpecies as it is used in the restart file. The name of the species is a concatenation of the names of the three force components, e.g.
MixedSpecies<LinearViscoelasticNormalSpecies,SlidingFrictionSpecies,ReversibleAdhesiveSpecies> species; std::cout << species.getName();
will output "LinearViscoelasticSlidingFrictionReversibleAdhesiveMixedSpecies". The EmptyFrictionSpecies and the EmptyAdhesiveSpecies return empty strings, such that
MixedSpecies<LinearViscoelasticNormalSpecies> species; std::cout << species.getName();
will output "LinearViscoelasticMixedSpecies".
Implements BaseObject.
Definition at line 231 of file MixedSpecies.h.
|
finalvirtual |
When a contact between two particles is determined, an Interaction object is created, as the type of Interaction depends on the MixedSpecies type.
The input parameters of this function are directly passed into the constructor for the new interaction. See Interaction for details.
[in] | P | first of the two objects that interact |
[in] | I | second of the two objects that interact |
[in] | timeStamp | current value of DPMBase::time_ |
Implements BaseSpecies.
Definition at line 247 of file MixedSpecies.h.
|
finalvirtual |
Returns true if torques have to be calculated.
Returns true for any FrictionForceSpecies except EmptyFrictionSpecies, because for spherical particles, torques are only caused by tangential forces. See SpeciesHandler::useAngularDOFs for more details
Implements BaseSpecies.
Definition at line 278 of file MixedSpecies.h.
|
finalvirtual |
sets the MixedSpecies properties by mixing the properties of two particle species
Uses the harmonic mean for most properties. Calls the mix function for each of the force species from which MixedSpecies is derived.
[in] | S | the first of two species whose properties are mixed to create the new species |
[in] | T | the second of two species whose properties are mixed to create the new species |
Implements BaseSpecies.
Definition at line 290 of file MixedSpecies.h.
References BaseNormalForce::getConstantRestitution(), BaseObject::getName(), BaseSpecies::getNormalForce(), and logger.
|
finalvirtual |
Reads the species properties from an input stream.
Called by SpeciesHandler::readAndAddObject
[in] | is | input stream (typically the restart file) |
Reimplemented from BaseSpecies.
Definition at line 201 of file MixedSpecies.h.
References BaseSpecies::read(), BaseObject::setId(), and BaseObject::setIndex().
|
finalvirtual |
Writes the MixedSpecies properties to an output stream.
It prints human readable MixedSpecies information to the output stream, typically to Files::restartFile::fstream_. The basic species information is written in ParticleSpecies::write; then the three force types write additional information to the stream.
[out] | os | output stream (typically the restart file) |
Reimplemented from BaseSpecies.
Definition at line 184 of file MixedSpecies.h.
References BaseObject::getId(), BaseObject::getIndex(), getName(), and BaseSpecies::write().