39 #ifdef DEBUG_CONSTRUCTOR
40 std::cout<<
"ParticleSpecies::ParticleSpecies() finished"<<std::endl;
50 #ifdef DEBUG_CONSTRUCTOR
51 std::cout<<
"ParticleSpecies::ParticleSpecies(const ParticleSpecies &p) finished"<<std::endl;
57 #ifdef DEBUG_DESTRUCTOR
58 std::cout<<
"ParticleSpecies::~ParticleSpecies() finished"<<std::endl;
103 logger(
ERROR,
"[ParticleSpecies::setDensity()] Error in the density to be set: % ", density);
120 logger(
ERROR,
"[Species::MassFromRadius()] No handler has been set, therefore, I can't figure out the dimensions.");
125 if (particleDimensions == 3)
129 else if (particleDimensions == 2)
133 else if (particleDimensions == 1)
139 logger(
ERROR,
"[Species::MassFromRadius()] the dimension of the particle is wrongly set to %",particleDimensions);
173 p->
invInertia_ = std::numeric_limits<Mdouble>::quiet_NaN();
178 logger(
ERROR,
"ParticleSpecies::computeMass()] the dimension of the particle is not set");
unsigned int getIndex() const
Returns the index of the object in the handler.
Mdouble invInertia_
Particle inertia_.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble getMassFromRadius(const Mdouble radius)
unsigned int getParticleDimensions() const
Returns the particle dimensions.
void computeAllMasses(unsigned int indSpecies)
Computes the mass for all BaseParticle of the given species in this ParticleHandler.
Mdouble mass_
Pointer to the previous Particle in the same HGrid cell.
Mdouble invMass_
Particle mass_.
virtual void computeMass(BaseParticle *p) const
Compute Particle mass function, which required a reference to the Species vector. It computes the Par...
T square(T val)
squares a number
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.
Mdouble inertia_
Inverse Particle mass (for computation optimization)
Mdouble getMass() const
Returns the particle's mass_.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
void setDensity(Mdouble density)
Allows the density to be changed.
void write(std::ostream &os) const
Writes the species properties to an output stream.
Mdouble getRadius() const
Returns the particle's radius_.
ParticleSpecies()
The default constructor.
virtual void read(std::istream &is)=0
A purely virtual method with an implementation which reads the index from the stream and assigns it t...
void read(std::istream &is)
Reads the species properties from an input stream.
Mdouble density_
The particle mass density.
Defines the basic properties that a interactable object can have.
Mdouble getDensity() const
Allows the density to be accessed.
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
unsigned int getParticleDimensions() const
Returns the particle's dimensions (either 2 or 3).
bool isFixed() const
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
virtual ~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...