MercuryDPM
0.10
|
Container to store all BaseParticle. More...
#include <ParticleHandler.h>
Public Member Functions | |
ParticleHandler () | |
Default constructor, it simply creates an empty ParticleHandler. More... | |
ParticleHandler (const ParticleHandler &PH) | |
Copy constructor, it copies the ParticleHandler and all BaseParticle it contains. More... | |
ParticleHandler | operator= (const ParticleHandler &rhs) |
Assignment operator. More... | |
~ParticleHandler () | |
Destructor, it simply destructs the ParticleHandler and all BaseParticle it contains. More... | |
virtual void | addObject (BaseParticle *P) |
Adds a BaseParticle to the ParticleHandler. More... | |
BaseParticle * | getSmallestParticle () const |
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler. More... | |
BaseParticle * | getLargestParticle () const |
Gets a pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler. More... | |
BaseParticle * | getFastestParticle () const |
Gets a pointer to the fastests BaseParticle in this ParticleHandler. More... | |
BaseParticle * | getLowestPositionComponentParticle (const int i) const |
BaseParticle * | getHighestPositionComponentParticle (const int i) const |
BaseParticle * | getLowestVelocityComponentParticle (const int i) const |
BaseParticle * | getHighestVelocityComponentParticle (const int i) const |
BaseParticle * | getLightestParticle () const |
Gets a pointer to the lightest BaseParticle (by mass) in this ParticleHandler. More... | |
void | clear () |
Empties the whole ParticleHandler by removing all BaseParticle. More... | |
void | readObject (std::istream &is) |
Reads BaseParticle into the ParticleHandler from restart data. More... | |
void | checkExtrema (BaseParticle *P) |
Checks if the extrema of this ParticleHandler needs updating. More... | |
void | checkExtremaOnDelete (BaseParticle *P) |
Checks if the extrema of this ParticleHandler needs updating when a particle is deleted. More... | |
CSpecies & | getSpecies (const int i) |
void | setSpecies (std::vector< CSpecies > *) |
![]() | |
BaseHandler () | |
Default BaseHandler constructor, it simply creates an empty BaseHandler. More... | |
BaseHandler (const BaseHandler< BaseParticle > &BH) | |
Copy constructor, it copies the BaseHandler and all Object it contains. More... | |
virtual | ~BaseHandler () |
Assignment operator. More... | |
void | copyAndAddObject (const BaseParticle &O) |
Creates a copy of a Object and adds it to the BaseHandler. More... | |
void | copyAndAddObject (const BaseParticle *O) |
Creates a copy of a Object and adds it to the BaseHandler. More... | |
virtual void | removeObject (unsigned const int id) |
Removes a Object from the BaseHandler. More... | |
void | removeLastObject () |
Removes the last Object from the BaseHandler. More... | |
void | clear () |
Empties the whole BaseHandler by removing all Object. More... | |
BaseParticle * | getObject (const unsigned int id) const |
Gets a pointer to the Object at the specified index in the BaseHandler. More... | |
BaseParticle * | getLastObject () const |
Gets a pointer to the last Object in this BaseHandler. More... | |
unsigned int | getNumberOfObjects () const |
Gets the number of Object in this BaseHandler. More... | |
unsigned int | getStorageCapacity () const |
Gets the storage capacity of this BaseHandler. More... | |
void | setStorageCapacity (const unsigned int N) |
Sets the storage capacity of this BaseHandler. More... | |
const std::vector < BaseParticle * > ::const_iterator | begin () const |
Gets the begin of the const_iterator over all Object in this BaseHandler. More... | |
const std::vector < BaseParticle * >::iterator | begin () |
Gets the begin of the iterator over all BaseBoundary in this BaseHandler. More... | |
const std::vector < BaseParticle * > ::const_iterator | end () const |
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler. More... | |
const std::vector < BaseParticle * >::iterator | end () |
Gets the end of the iterator over all BaseBoundary in this BaseHandler. More... | |
Private Attributes | |
BaseParticle * | largestParticle_ |
A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler. More... | |
BaseParticle * | smallestParticle_ |
A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler. More... | |
std::vector< CSpecies > * | species_ |
Container to store all BaseParticle.
The ParticleHandler is a container to store all BaseParticle. It is implemented by a vector of pointers to BaseParticle.
Definition at line 38 of file ParticleHandler.h.
ParticleHandler::ParticleHandler | ( | ) |
Default constructor, it simply creates an empty ParticleHandler.
Constructor of the ParticleHandler class. It creates and empty ParticleHandler.
Definition at line 34 of file ParticleHandler.cc.
References largestParticle_, smallestParticle_, and species_.
ParticleHandler::ParticleHandler | ( | const ParticleHandler & | PH | ) |
Copy constructor, it copies the ParticleHandler and all BaseParticle it contains.
[in] | PH | The ParticleHandler that has te be copied. |
Definition at line 45 of file ParticleHandler.cc.
References addObject(), BaseHandler< T >::begin(), clear(), BaseHandler< T >::end(), and species_.
ParticleHandler::~ParticleHandler | ( | ) |
Destructor, it simply destructs the ParticleHandler and all BaseParticle it contains.
Definition at line 75 of file ParticleHandler.cc.
|
virtual |
Adds a BaseParticle to the ParticleHandler.
[in] | P | A pointer to the BaseParticle (or derived class) that has to be added. |
Reimplemented from BaseHandler< BaseParticle >.
Definition at line 84 of file ParticleHandler.cc.
References BaseHandler< T >::addObject(), checkExtrema(), BaseHandler< BaseParticle >::getLastObject(), and BaseParticle::setHandler().
Referenced by CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), CircularPeriodicBoundary::createPeriodicParticles(), PeriodicBoundary::createPeriodicParticles(), AngledPeriodicBoundary::createPeriodicParticles(), operator=(), and ParticleHandler().
void ParticleHandler::checkExtrema | ( | BaseParticle * | P | ) |
Checks if the extrema of this ParticleHandler needs updating.
[in] | P | A pointer to the particle, which properties have to be checked against the ParticleHandlers extrema. |
Definition at line 266 of file ParticleHandler.cc.
References BaseParticle::get_InteractionRadius(), largestParticle_, and smallestParticle_.
Referenced by addObject(), and BaseParticle::set_Radius().
void ParticleHandler::checkExtremaOnDelete | ( | BaseParticle * | P | ) |
Checks if the extrema of this ParticleHandler needs updating when a particle is deleted.
[in] | P | A pointer to the particle, which is going to get deleted. |
Definition at line 279 of file ParticleHandler.cc.
References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), largestParticle_, and smallestParticle_.
Referenced by BaseParticle::~BaseParticle().
void ParticleHandler::clear | ( | ) |
Empties the whole ParticleHandler by removing all BaseParticle.
Definition at line 222 of file ParticleHandler.cc.
References BaseHandler< T >::clear(), largestParticle_, and smallestParticle_.
Referenced by operator=(), ParticleHandler(), MD::read(), and MD::read_v2().
BaseParticle * ParticleHandler::getFastestParticle | ( | ) | const |
Gets a pointer to the fastests BaseParticle in this ParticleHandler.
Definition at line 104 of file ParticleHandler.cc.
References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().
BaseParticle * ParticleHandler::getHighestPositionComponentParticle | ( | const int | i | ) | const |
Definition at line 140 of file ParticleHandler.cc.
References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().
BaseParticle * ParticleHandler::getHighestVelocityComponentParticle | ( | const int | i | ) | const |
Definition at line 174 of file ParticleHandler.cc.
References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().
BaseParticle * ParticleHandler::getLargestParticle | ( | ) | const |
Gets a pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
Definition at line 213 of file ParticleHandler.cc.
References largestParticle_.
Referenced by CircularPeriodicBoundary::createPeriodicParticles(), PeriodicBoundary::createPeriodicParticles(), AngledPeriodicBoundary::createPeriodicParticles(), MD::getLargestParticle(), and HGridOptimiser::Initialise().
BaseParticle * ParticleHandler::getLightestParticle | ( | ) | const |
Gets a pointer to the lightest BaseParticle (by mass) in this ParticleHandler.
Definition at line 193 of file ParticleHandler.cc.
References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().
Referenced by Chute::get_LightestParticleMass().
BaseParticle * ParticleHandler::getLowestPositionComponentParticle | ( | const int | i | ) | const |
Definition at line 123 of file ParticleHandler.cc.
References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().
BaseParticle * ParticleHandler::getLowestVelocityComponentParticle | ( | const int | i | ) | const |
Definition at line 157 of file ParticleHandler.cc.
References BaseHandler< BaseParticle >::begin(), BaseHandler< BaseParticle >::end(), and BaseHandler< BaseParticle >::getNumberOfObjects().
BaseParticle * ParticleHandler::getSmallestParticle | ( | ) | const |
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.
Definition at line 95 of file ParticleHandler.cc.
References smallestParticle_.
Referenced by MD::getSmallestParticle(), and HGridOptimiser::Initialise().
Definition at line 309 of file ParticleHandler.cc.
References species_.
Referenced by BaseParticle::get_InteractionRadius(), and BaseParticle::get_WallInteractionRadius().
ParticleHandler ParticleHandler::operator= | ( | const ParticleHandler & | rhs | ) |
Assignment operator.
[in] | rhs | The ParticleHandler on the right hand side of the assignment. |
Definition at line 59 of file ParticleHandler.cc.
References addObject(), BaseHandler< T >::begin(), clear(), and BaseHandler< T >::end().
|
virtual |
Reads BaseParticle into the ParticleHandler from restart data.
[in] | is | The input stream from which the information is read. |
Implements BaseHandler< BaseParticle >.
Definition at line 230 of file ParticleHandler.cc.
References BaseHandler< BaseParticle >::copyAndAddObject(), and TangentialSpringParticle::oldRead().
Referenced by MD::read(), MD::read_v1(), and MD::read_v2().
void ParticleHandler::setSpecies | ( | std::vector< CSpecies > * | species | ) |
Definition at line 312 of file ParticleHandler.cc.
References species_.
Referenced by MD::constructor().
|
private |
A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
Definition at line 91 of file ParticleHandler.h.
Referenced by checkExtrema(), checkExtremaOnDelete(), clear(), getLargestParticle(), and ParticleHandler().
|
private |
A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.
Definition at line 94 of file ParticleHandler.h.
Referenced by checkExtrema(), checkExtremaOnDelete(), clear(), getSmallestParticle(), and ParticleHandler().
|
private |
Definition at line 97 of file ParticleHandler.h.
Referenced by getSpecies(), ParticleHandler(), and setSpecies().