|
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... | |
Public Member Functions inherited from BaseSpecies | |
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) |
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 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 |
Public Member Functions inherited from EmptyFrictionSpecies | |
EmptyFrictionSpecies () | |
The default constructor. More... | |
EmptyFrictionSpecies (const EmptyFrictionSpecies &s UNUSED) | |
The default copy constructor. More... | |
~EmptyFrictionSpecies () | |
The default destructor. More... | |
void | read (std::istream &is) |
Reads the species properties from an input stream. More... | |
void | write (std::ostream &os) const |
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 | mix (EmptyFrictionSpecies *S, EmptyFrictionSpecies *T) |
creates default values for mixed species More... | |
Public Member Functions inherited from BaseForce | |
BaseSpecies * | getBaseSpecies () const |
void | setBaseSpecies (BaseSpecies *baseSpecies) |
Public Member Functions inherited from EmptyAdhesiveSpecies | |
EmptyAdhesiveSpecies () | |
The default constructor. More... | |
EmptyAdhesiveSpecies (const EmptyAdhesiveSpecies &s UNUSED) | |
The default copy constructor. More... | |
~EmptyAdhesiveSpecies () | |
The default destructor. More... | |
void | read (std::istream &is) |
Reads the species properties from an input stream. More... | |
void | write (std::ostream &os) const |
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 | mix (EmptyAdhesiveSpecies *S, EmptyAdhesiveSpecies *T) |
creates default values for mixed species More... | |
Additional Inherited Members | |
Public Types inherited from EmptyFrictionSpecies | |
typedef EmptyFrictionInteraction | InteractionType |
The correct Interaction type for this FrictionForceSpecies. More... | |
Public Types inherited from EmptyAdhesiveSpecies | |
typedef EmptyAdhesiveInteraction | InteractionType |
The correct Interaction type for this AdhesiveForceSpecies. More... | |
Static Public Member Functions inherited from BaseSpecies | |
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 Attributes inherited from BaseSpecies | |
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... | |
Contains contact force properties for contacts between particles with two different species.
See Species for details.
MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::MixedSpecies |
The default constructor.
MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies >::MixedSpecies | ( | const MixedSpecies< NormalForceSpecies, FrictionForceSpecies, AdhesiveForceSpecies > & | s | ) |
The default copy constructor.
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.
References BaseSpecies::adhesiveForce_, DEBUG, BaseSpecies::frictionForce_, logger, BaseSpecies::normalForce_, and BaseForce::setBaseSpecies().
|
virtual |
|
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.
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.
|
finalvirtual |
Implements BaseSpecies.
|
finalvirtual |
Implements BaseSpecies.
|
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.
|
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.
References Global_Physical_Variables::P.
|
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.
|
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.
References BaseNormalForce::getConstantRestitution(), BaseObject::getName(), BaseSpecies::getNormalForce(), and logger.
Referenced by main().
|
finalvirtual |
Reads the species properties from an input stream.
Called by SpeciesHandler::readAndAddObject
[in] | is | input stream (typically the restart file) |
Reimplemented from BaseSpecies.
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.
References BaseObject::getId(), BaseObject::getIndex(), getName(), and BaseSpecies::write().