39 :
BaseObject(), handler_(nullptr), interactionDistance_(0)
41 logger(
DEBUG,
"BaseSpecies::BaseSpecies() finished");
45 :
BaseObject(), normalForce_(normalForce), frictionForce_(frictionForce), adhesiveForce_(adhesiveForce),
46 handler_(nullptr), interactionDistance_(0)
51 logger(
DEBUG,
"BaseSpecies::BaseSpecies() finished");
59 :
BaseObject(p), handler_(p.handler_), interactionDistance_(p.interactionDistance_)
61 logger(
DEBUG,
"BaseSpecies::BaseSpecies(const BaseSpecies &p) finished");
85 logger(
DEBUG,
"BaseSpecies::~BaseSpecies() finished");
114 return (a==0||b==0) ? 0.0 : (2. / (1.0 / a + 1.0 / b));
143 bool constantRestitution;
160 if (handler ==
nullptr)
return;
163 if (mixedSpecies ==
this) {
165 unsigned mixedId = mixedSpecies->getIndex();
167 unsigned maxMixedId = (maxId * (maxId + 1)) / 2;
168 while (maxMixedId<mixedId) {
170 maxMixedId = (maxId * (maxId + 1)) / 2;
172 unsigned minId = (mixedId + maxId) - maxMixedId;
Container to store all ParticleSpecies.
bool getConstantRestitution() const
void setBaseSpecies(BaseSpecies *baseSpecies)
unsigned int getId() const
Returns the unique identifier of any particular object.
Mdouble interactionDistance_
Returns the distance between particles of this species below which adhesive forces can occur (needed ...
void setMaxInteractionDistance(Mdouble interactionDistance=0)
Sets maxInteractionDistance_.
BaseSpecies is the class from which all other species are derived.
BaseNormalForce * normalForce_
A pointer to the normal force parameters This pointer is used by the Interaction's to get a pointer ...
~BaseSpecies()
The default destructor.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here...
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
const std::vector< BaseSpecies * > & getMixedObjects() const
Returns a pointer to the vector of all mixed objects.
void setInteractionDistance(Mdouble interactionDistance)
Sets BaseSpecies::interactionDistance_.
BaseAdhesiveForce * adhesiveForce_
A pointer to the adhesive force parameters This pointer is used by the Interaction's to get a pointe...
void setConstantRestitution(bool constantRestitution)
SpeciesHandler * getHandler() const
Returns the pointer to the handler to which this species belongs.
void write(std::ostream &os) const override
Sets the boolean constantRestitution_.
SpeciesHandler * handler_
A pointer to the handler to which this species belongs. It is initialized to nullptr and gets set whe...
static Mdouble averageInf(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables, returning inf if either is inf.
static Mdouble average(Mdouble a, Mdouble b)
Returns the harmonic mean of two variables.
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
bool readOptionalVariable(std::istream &is, const std::string &name, T &variable)
Reads optional variables in the restart file.
void read(std::istream &is) override
void setHandler(SpeciesHandler *handler)
Sets the pointer to the handler to which this species belongs.
BaseSpecies()
The default constructor.
BaseFrictionForce * frictionForce_
A pointer to the friction force parameters This pointer is used by the Interaction's to get a pointe...
Defines the basic properties that a interactable object can have.