40 #ifdef DEBUG_CONSTRUCTOR
41 std::cout<<
"ParticleSpecies::ParticleSpecies() finished"<<std::endl;
51 #ifdef DEBUG_CONSTRUCTOR
52 std::cout<<
"ParticleSpecies::ParticleSpecies(const ParticleSpecies &p) finished"<<std::endl;
58 #ifdef DEBUG_DESTRUCTOR
59 std::cout<<
"ParticleSpecies::~ParticleSpecies() finished"<<std::endl;
96 logger.assert_always(density>=0,
"[ParticleSpecies::setDensity(%)] value cannot be negative",density);
119 logger(
ERROR,
"[Species::VolumeFromRadius()] No handler has been set, therefore, I can't figure out the dimensions.");
124 if (particleDimensions == 3)
128 else if (particleDimensions == 2)
132 else if (particleDimensions == 1)
138 logger(
ERROR,
"[Species::VolumeFromRadius()] the dimension of the particle is wrongly set to %",particleDimensions);
172 p->
invInertia_ = std::numeric_limits<Mdouble>::quiet_NaN();
177 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")
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_.
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 getVolumeFromRadius(const Mdouble radius) const
Mdouble inertia_
Inverse Particle mass (for computation optimization)
Mdouble getMassFromRadius(const Mdouble radius) const
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 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 mass density.
Defines the basic properties that a interactable object can have.
Mdouble getDensity() const
Allows 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...