39 #ifdef DEBUG_CONSTRUCTOR
40 std::cout<<
"ParticleSpecies::ParticleSpecies() finished"<<std::endl;
45 :
BaseSpecies(normalForce,frictionForce, adhesiveForce), density_(1.0)
47 #ifdef DEBUG_CONSTRUCTOR
48 std::cout<<
"ParticleSpecies::ParticleSpecies(n,f,a) finished"<<std::endl;
61 #ifdef DEBUG_CONSTRUCTOR
62 std::cout<<
"ParticleSpecies::ParticleSpecies(const ParticleSpecies &p) finished"<<std::endl;
68 #ifdef DEBUG_DESTRUCTOR
69 std::cout<<
"ParticleSpecies::~ParticleSpecies() finished"<<std::endl;
109 logger.assert_always(density >= 0,
"[ParticleSpecies::setDensity(%)] value cannot be negative", density);
139 "[Species::VolumeFromRadius()] No handler has been set, therefore, I can't figure out the dimensions.");
144 if (particleDimensions == 3)
148 else if (particleDimensions == 2)
152 else if (particleDimensions == 1)
158 logger(
ERROR,
"[Species::VolumeFromRadius()] the dimension of the particle is wrongly set to %",
177 const std::function<
double(
double)>& temperatureDependentDensity)
193 if (p->getSpecies()==
this && !(p->isFixed() || p->isMPIParticle() || p->isPeriodicGhostParticle()) && p->getInvMass() > maxInvMass)
195 maxInvMass = p->getInvMass();
203 #ifdef MERCURY_USE_MPI
209 return 1.0 / maxInvMass;
231 mixedSpecies->getInteractionDistance());
Container to store all ParticleSpecies.
unsigned int getIndex() const
Returns the index of the object in the handler.
std::enable_if<!std::is_pointer< typename U::MixedSpeciesType >::value, typename U::MixedSpeciesType * >::type getMixedObject(const U *S, const U *T)
Mdouble maxInteractionDistance_
Returns the max distance between particles of this species and any other species below which adhesive...
static MPIContainer & Instance()
fetch the instance to be used for communication
void setMaxInteractionDistance(Mdouble interactionDistance=0)
Sets maxInteractionDistance_.
BaseSpecies is the class from which all other species are derived.
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here...
const std::function< double(double)> & getTemperatureDependentDensity() const
unsigned int getParticleDimensions() const
Returns the particle dimensionality.
void computeAllMasses(unsigned int indSpecies)
Computes the mass for all BaseParticle of the given species in this ParticleHandler.
const std::complex< Mdouble > i
std::function< double(double temperature)> temperatureDependentDensity_
void computeMass(BaseParticle *p) const
Compute Particle mass function, which required a reference to the Species vector. It computes the Par...
Mdouble getMassFromRadius(Mdouble radius) const
Mdouble getVolumeFromRadius(Mdouble radius) const
virtual void computeMass(const ParticleSpecies &s)
Computes the particle's (inverse) mass and inertia.
SpeciesHandler * getHandler() const
Returns the pointer to the handler to which this species belongs.
std::string getBaseName() const
Used in Species::getName to obtain a unique name for each Species.
void write(std::ostream &os) const override
Sets the boolean constantRestitution_.
const BaseSpecies * getMixedSpecies(const ParticleSpecies *s) const
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
void setDensity(Mdouble density)
Allows density_ to be changed.
ParticleSpecies()
The default constructor.
virtual void read(std::istream &is)=0
void read(std::istream &is) override
void setHandler(SpeciesHandler *handler)
Sets the pointer to the handler to which this species belongs.
Mdouble getLargestInverseParticleMassLocal() const
Computes inverse mass of the lightest particle (by mass) belonging to this species. If MPI is used, this computation is done locally on each node.
Mdouble density_
The mass density.
Defines the basic properties that a interactable object can have.
Mdouble getDensity() const
Allows density_ to be accessed.
void write(std::ostream &os) const override
Writes the species properties to an output stream.
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Mdouble getSmallestParticleMass() const
Computes mass of the lightest particle (by mass) belonging to this species. This computation calls ge...
~ParticleSpecies()
The default destructor.
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...
void setTemperatureDependentDensity(const std::function< double(double)> &temperatureDependentDensity)
void read(std::istream &is) override
Reads the species properties from an input stream.