|
Container to store all BaseParticle. More...
#include <ParticleHandler.h>
Public Member Functions | |
ParticleHandler () | |
Default constructor, it creates an empty ParticleHandler. More... | |
ParticleHandler (const ParticleHandler &PH) | |
Constructor that copies all BaseParticle it contains and then sets the smallest and largest particle. More... | |
ParticleHandler & | operator= (const ParticleHandler &rhs) |
Assignment operator. More... | |
~ParticleHandler () override | |
Destructor, it destructs the ParticleHandler and all BaseParticle it contains. More... | |
void | addExistingObject (BaseParticle *P) override |
Adds a BaseParticle to the ParticleHandler. More... | |
void | addObject (BaseParticle *P) override |
Adds a BaseParticle to the ParticleHandler. More... | |
void | addObject (int fromProcessor, BaseParticle *P) |
Adds a BaseParticle located at processor fromProcessor to toProcessor. More... | |
void | addGhostObject (int fromProcessor, int toProcessor, BaseParticle *p) |
Adds a ghost particle located at fromProcessor to toProcessor. More... | |
void | addGhostObject (BaseParticle *P) override |
Adds a BaseParticle to the ParticleHandler. More... | |
void | removeObject (unsigned int index) override |
Removes a BaseParticle from the ParticleHandler. More... | |
void | removeGhostObject (unsigned int index) |
Removes a BaseParticle from the ParticleHandler without a global check, this is only to be done for mpi routines. More... | |
void | removeLastObject () |
Removes the last BaseParticle from the ParticleHandler. More... | |
void | computeSmallestParticle () |
Computes the smallest particle (by interaction radius) and sets it in smallestParticle_. More... | |
void | computeLargestParticle () |
Computes the largest particle (by interaction radius) and sets it in largestParticle_. More... | |
BaseParticle * | getSmallestParticleLocal () const |
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler of the local domain. More... | |
BaseParticle * | getSmallestParticle () const |
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler of the local domain. When mercury is running in parallel this function throws an error since a pointer to another domain is useless. More... | |
BaseParticle * | getLargestParticleLocal () const |
Gets a pointer to the largest BaseParticle (by interactionRadius) in the ParticleHandler of the local domain. More... | |
BaseParticle * | getLargestParticle () const |
Returns the pointer of the largest particle in the particle handler. When mercury is running in parallel this function throws an error since a pointer to another domain is useless. More... | |
Mdouble | getSmallestInteractionRadiusLocal () const |
Returns the smallest interaction radius of the current domain. More... | |
Mdouble | getSmallestInteractionRadius () const |
Returns the smallest interaction radius. More... | |
Mdouble | getLargestInteractionRadiusLocal () const |
Returns the largest interaction radius of the current domain. More... | |
Mdouble | getLargestInteractionRadius () const |
Returns the largest interaction radius. More... | |
BaseParticle * | getFastestParticleLocal () const |
Gets a pointer to the fastest BaseParticle in this ParticleHandler. More... | |
BaseParticle * | getFastestParticle () const |
Mdouble | getKineticEnergy () const |
Mdouble | getRotationalEnergy () const |
Mdouble | getMass () const |
Vec3D | getMassTimesPosition () const |
Vec3D | getCentreOfMass () const |
Vec3D | getMomentum () const |
Vec3D | getAngularMomentum () const |
Mdouble | getVolume () const |
Mdouble | getMeanRadius () const |
BaseParticle * | getLowestPositionComponentParticleLocal (int i) const |
Gets a pointer to the particle with the lowest coordinates in direction i in this ParticleHandler. More... | |
BaseParticle * | getLowestPositionComponentParticle (int i) const |
Gets a pointer to the particle with the lowest coordinates in direction i in this ParticleHandler. More... | |
BaseParticle * | getHighestPositionComponentParticleLocal (int i) const |
Gets a pointer to the particle with the highest coordinates in direction i in this ParticleHandler. More... | |
BaseParticle * | getHighestPositionComponentParticle (int i) const |
Gets a pointer to the particle with the highest coordinates in direction i in this ParticleHandler. More... | |
BaseParticle * | getLowestVelocityComponentParticleLocal (int i) const |
Gets a pointer to the particle with the lowest velocity in direction i in this ParticleHandler. More... | |
BaseParticle * | getLowestVelocityComponentParticle (int i) const |
Gets a pointer to the particle with the lowest velocity in direction i in this ParticleHandler. More... | |
BaseParticle * | getHighestVelocityComponentParticleLocal (int i) const |
Gets a pointer to the particle with the highest velocity in direction i in this ParticleHandler. More... | |
BaseParticle * | getHighestVelocityComponentParticle (int i) const |
Gets a pointer to the particle with the highest velocity in direction i in this ParticleHandler. More... | |
template<typename T > | |
std::enable_if< std::is_scalar< T >::value, T >::type | getParticleAttributeLocal (std::function< T(BaseParticle *)> attribute, AttributeType type) const |
Computes an attribute type (min/max/..) of a particle attribute (position/velocity) in a local domain. More... | |
template<typename T > | |
std::enable_if< std::is_scalar< T >::value, T >::type | getParticleAttribute (std::function< T(BaseParticle *)> attribute, AttributeType type) const |
Computes an attribute type (min/max/..) of a particle attribute(position/velocity) in the global domain. More... | |
Mdouble | getHighestPositionX () const |
Function returns the highest position in the x-direction. More... | |
void | clear () override |
Empties the whole ParticleHandler by removing all BaseParticle. More... | |
unsigned int | getNumberOfFixedParticles () const |
Gets the number of particles that are fixed. More... | |
unsigned int | getNumberOfUnfixedParticles () const |
Gets the number of particles that are not fixed. More... | |
BaseParticle * | readAndCreateObject (std::istream &is) |
Create a new particle, based on the information provided in a restart file. More... | |
void | readAndAddObject (std::istream &is) override |
void | write (std::ostream &os) const |
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... | |
void | computeAllMasses (unsigned int indSpecies) |
Computes the mass for all BaseParticle of the given species in this ParticleHandler. More... | |
void | computeAllMasses () |
Computes the mass for all BaseParticle in this ParticleHandler. More... | |
void | addedFixedParticle () |
Increment of the number of fixed particles. More... | |
void | removedFixedParticle () |
Decrement of the number of fixed particles. More... | |
std::string | getName () const override |
Returns the name of the handler, namely the string "ParticleHandler". More... | |
unsigned int | getNumberOfRealObjects () const |
Returns the number of real objects (on all processors) More... | |
unsigned int | getNumberOfObjects () const override |
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid confusion with real and fake particles. If the size of the container is wished, call size() More... | |
unsigned int | getNumberOfFixedObjectsLocal () const |
Computes the number of Fixed particles on a local domain. More... | |
unsigned int | getNumberOfFixedObjects () const |
Computes the number of fixed particles in the whole simulation. More... | |
unsigned int | getNumberOfRealObjectsLocal () const |
Returns the number of real objects on a local domain. MPI particles and periodic particles are neglected. More... | |
void | actionsAfterTimeStep () |
double | getLiquidFilmVolume () const |
void | saveNumberPSDtoCSV (std::string csvFileName, std::vector< double > diameterBins={}) |
Public Member Functions inherited from BaseHandler< BaseParticle > | |
BaseHandler () | |
Default BaseHandler constructor, it creates an empty BaseHandler and assigns DPMBase_ to a null pointer. More... | |
BaseHandler (const BaseHandler< BaseParticle > &BH) | |
Constructor that copies the objects of the given handler into itself and sets other variables to 0/nullptr. More... | |
virtual | ~BaseHandler () |
Destructor, it destructs the BaseHandler and all Object it contains. More... | |
void | copyContentsFromOtherHandler (const BaseHandler< BaseParticle > &BH) |
Function that copies the contents (vector of pointers, maxObject_, nextId_, DPMBase_) from one handler (container) to the other. More... | |
std::enable_if<!std::is_pointer< U >::value, U * >::type | copyAndAddObject (const U &object) |
Creates a copy of a Object and adds it to the BaseHandler. More... | |
std::enable_if< std::is_pointer< U >::value, U >::type | copyAndAddObject (const U object) |
Creates a copy of a Object and adds it to the BaseHandler. More... | |
std::enable_if<!std::is_pointer< U >::value, U * >::type | copyAndAddGhostObject (const U &object) |
Creates a copy of a Object and adds it to the BaseHandler. This is one locally for inserting mpi particles, they avoid the global check if the particle can actually be inserted, because the mpi domain already knows that is the case. More... | |
std::enable_if< std::is_pointer< U >::value, U >::type | copyAndAddGhostObject (const U object) |
Creates a copy of a Object and adds it to the BaseHandler. This is one locally for inserting mpi particles, they avoid the global check if the particle can actually be inserted, because the mpi domain already knows that is the case. More... | |
virtual void | addExistingObject (BaseParticle *O) |
Adds an existing object to the BaseHandler without changing the id of the object. More... | |
virtual void | addObject (BaseParticle *object) |
Adds a new Object to the BaseHandler. More... | |
virtual void | addGhostObject (BaseParticle *O) |
Adds a new Object to the BaseHandler. called by the to avoid increasing the id. More... | |
void | removeIf (const std::function< bool(BaseParticle *)> cond) |
void | removeLastObject () |
Removes the last Object from the BaseHandler. More... | |
void | read (std::istream &is) |
Reads all objects from restart data. More... | |
BaseParticle * | getObjectById (const unsigned int id) |
Gets a pointer to the Object at the specified index in the BaseHandler. More... | |
std::vector< BaseParticle * > | getObjectsById (const unsigned int id) |
Gets a vector of pointers to the objects with the specific id. More... | |
BaseParticle * | getObject (const unsigned int id) |
Gets a pointer to the Object at the specified index in the BaseHandler. More... | |
const BaseParticle * | getObject (const unsigned int id) const |
Gets a constant pointer to the Object at the specified index in the BaseHandler. More... | |
BaseParticle * | getLastObject () |
Gets a pointer to the last Object in this BaseHandler. More... | |
const BaseParticle * | getLastObject () const |
Gets a constant pointer to the last Object in this BaseHandler. More... | |
unsigned int | getSize () const |
Gets the size of the particleHandler (including mpi and periodic particles) 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... | |
void | resize (const unsigned int N, const BaseParticle &obj) |
Resizes the container to contain N elements. 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... | |
void | setDPMBase (DPMBase *DPMBase) |
Sets the problem that is solved using this handler. More... | |
void | setId (BaseParticle *object, unsigned int id) |
void | increaseId () |
unsigned int | getNextId () |
void | setNextId (unsigned int id) |
DPMBase * | getDPMBase () |
Gets the problem that is solved using this handler. More... | |
DPMBase * | getDPMBase () const |
Gets the problem that is solved using this handler and does not change the class. More... | |
virtual void | writeVTK () const |
now empty function for writing VTK files. More... | |
unsigned | getNextGroupId () |
Should be called each time you assign a groupId. Returns the value of nextGroupId_ and increases nextGroupId_ by one. More... | |
Static Public Member Functions | |
static BaseParticle * | createObject (const std::string &type) |
Reads BaseParticle into the ParticleHandler from restart data. More... | |
Private Member Functions | |
Mdouble | getKineticEnergyLocal () const |
Mdouble | getRotationalEnergyLocal () const |
Mdouble | getMassLocal () const |
Mdouble | getVolumeLocal () const |
Vec3D | getMassTimesPositionLocal () const |
Mdouble | getSumRadiusLocal () const |
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... | |
unsigned int | NFixedParticles_ |
Number of fixed particles. More... | |
Additional Inherited Members | |
Protected Attributes inherited from BaseHandler< BaseParticle > | |
std::vector< BaseParticle * > | objects_ |
The actual list of Object pointers. More... | |
Container to store all BaseParticle.
The ParticleHandler is a container to store all BaseParticle. It is implemented by a vector of pointers to BaseParticle.
ParticleHandler::ParticleHandler | ( | ) |
Default constructor, it creates an empty ParticleHandler.
Constructor of the ParticleHandler class. It creates and empty ParticleHandler.
References DEBUG, largestParticle_, logger, and smallestParticle_.
ParticleHandler::ParticleHandler | ( | const ParticleHandler & | PH | ) |
Constructor that copies all BaseParticle it contains and then sets the smallest and largest particle.
[in] | PH | The ParticleHandler that has to be copied. |
This is not a copy constructor! It copies the DPMBase and all BaseParticle, and sets the other variables to 0. After that, it computes the smallest and largest particle in this handler.
References clear(), computeLargestParticle(), computeSmallestParticle(), BaseHandler< BaseParticle >::copyContentsFromOtherHandler(), DEBUG, BaseHandler< T >::getDPMBase(), largestParticle_, logger, BaseHandler< BaseParticle >::objects_, BaseHandler< BaseParticle >::setDPMBase(), and smallestParticle_.
|
override |
Destructor, it destructs the ParticleHandler and all BaseParticle it contains.
Set the pointers to largestParticle_ and smallestParticle_ to nullptr, all BaseParticle are destroyed by the BaseHandler afterwards.
References DEBUG, largestParticle_, logger, and smallestParticle_.
void ParticleHandler::actionsAfterTimeStep | ( | ) |
void ParticleHandler::addedFixedParticle | ( | ) |
Increment of the number of fixed particles.
References NFixedParticles_.
Referenced by BaseParticle::fixParticle().
|
override |
Adds a BaseParticle to the ParticleHandler.
[in] | P | A pointer to the BaseParticle that has to be added. |
To add a BaseParticle to the ParticleHandler, first check if it has a species, since it is as common bug to use a BaseParticle without species, which leads to a segmentation fault. To help the user with debugging, a warning is given if a particle without species is added. After that, the actions for adding the particle to the BaseHandler are taken, which include adding it to the vector of pointers to all BaseParticle and assigning the correct id and index. Then the particle is added to the HGrid, the particle is told that this is its handler, its mass is computed and finally it is checked if this is the smallest or largest particle in this ParticleHandler. The particle exists, in other words: it has been made before. This implies it already got an id Attached to it and hence we don't want to assign a new ID to it.
References BaseHandler< T >::addExistingObject(), checkExtrema(), BaseHandler< BaseParticle >::getDPMBase(), DPMBase::hGridInsertParticle(), DPMBase::hGridUpdateParticle(), logger, Global_Physical_Variables::P, and WARN.
Referenced by readAndAddObject().
|
override |
Adds a BaseParticle to the ParticleHandler.
This is a special function that is used in the parallel code. The functions differs from the standard parallel implementation as this function does not check if the particle is an mpi particle and the mpi domain is not updated. When the domain adds mpi particles to the simulation these checks are not required. It also doesnt increase the id of the particle
[in] | A | pointer to the BaseParticle that has to be added. |
References BaseHandler< T >::addGhostObject(), checkExtrema(), BaseHandler< BaseParticle >::getDPMBase(), DPMBase::handleParticleAddition(), DPMBase::hGridInsertParticle(), DPMBase::hGridUpdateParticle(), INFO, MPIContainer::Instance(), logger, Global_Physical_Variables::P, and WARN.
void ParticleHandler::addGhostObject | ( | int | fromProcessor, |
int | toProcessor, | ||
BaseParticle * | p | ||
) |
Adds a ghost particle located at fromProcessor to toProcessor.
This function adds a ghost particle from one processor to another processor.
When a periodic ghost particle or a mpi ghost particle is created, the ID should not be updated and hence the addGhostObject needs to be called. Adding a ghost keeps the ID constant. Additionally this function copies the particle information given on processor fromProcessor to all other processors. The target processor then adds the particle.
[in] | fromProcessor | processor containing the particle data |
[in] | toProcessor | processor that needs to add the particle |
[in,out] | particle | that contains the data and receives the data |
References copyDataFromMPIParticleToParticle(), MPISphericalParticle::copyDataFromParticleToMPIParticle(), MPIContainer::getProcessorID(), MPIContainer::Instance(), logger, MAX_PROC, PARTICLE, PARTICLE_DATA, MPIContainer::receive(), MPIContainer::send(), MPIContainer::sync(), and WARN.
Referenced by PeriodicBoundaryHandler::processLocalGhostParticles(), Domain::processReceivedBoundaryParticleData(), and PeriodicBoundaryHandler::processReceivedGhostParticleData().
|
override |
Adds a BaseParticle to the ParticleHandler.
[in] | P | A pointer to the BaseParticle that has to be added. |
To add a BaseParticle to the ParticleHandler, first check if it has a species, since it is as common bug to use a BaseParticle without species, which leads to a segmentation fault. To help the user with debugging, a warning is given if a particle without species is added. After that, the actions for adding the particle to the BaseHandler are taken, which include adding it to the vector of pointers to all BaseParticle and assigning the correct id and index. Then the particle is added to the HGrid, the particle is told that this is its handler, its mass is computed and finally it is checked if this is the smallest or largest particle in this ParticleHandler.
References BaseHandler< T >::addObject(), checkExtrema(), BaseHandler< BaseParticle >::getDPMBase(), DPMBase::handleParticleAddition(), DPMBase::hGridInsertParticle(), DPMBase::hGridUpdateParticle(), BaseHandler< T >::increaseId(), DPMBase::insertGhostParticle(), logger, DPMBase::mpiInsertParticleCheck(), NUMBER_OF_PROCESSORS, Global_Physical_Variables::P, DPMBase::setRotation(), DPMBase::updateGhostGrid(), and WARN.
Referenced by ChuteWithPeriodicInflow::AddContinuingBottom(), addObject(), CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), ConstantMassFlowMaserBoundary::checkBoundaryAfterParticleMoved(), SubcriticalMaserBoundary::checkBoundaryAfterParticleMoved(), SubcriticalMaserBoundaryTEST::checkBoundaryAfterParticleMoved(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContinuingBottom::ChuteWithPeriodicInflowAndContinuingBottom(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ChuteWithPeriodicInflowAndVariableBottom::ChuteWithPeriodicInflowAndVariableBottom(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), SubcriticalMaserBoundaryTEST::copyExtraParticles(), CurvyChute::createBottom(), PeriodicBoundary::createGhostParticle(), TimeDependentPeriodicBoundary::createGhostParticle(), LeesEdwardsBoundary::createHorizontalPeriodicParticle(), ShearBoxBoundary::createHorizontalPeriodicParticle(), AngledPeriodicBoundary::createPeriodicParticle(), CircularPeriodicBoundary::createPeriodicParticle(), ConstantMassFlowMaserBoundary::createPeriodicParticle(), SubcriticalMaserBoundary::createPeriodicParticle(), LeesEdwardsBoundary::createVerticalPeriodicParticle(), ShearBoxBoundary::createVerticalPeriodicParticle(), SubcriticalMaserBoundaryTEST::extendBottom(), ChuteWithPeriodicInflow::ExtendInWidth(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), and ContactDetectionTester::setupParticles().
void ParticleHandler::addObject | ( | int | fromProcessor, |
BaseParticle * | p | ||
) |
Adds a BaseParticle located at processor fromProcessor to toProcessor.
This function adds a particle to the simulation where the information of the particle is not available by the target processor.
When a certain processor generates a particle which needs to be inserted in a domain of another processor, this information needs to be transfered before the particle can be actually added
[in] | fromProcessor | processor containing the particle data |
[in,out] | particle | that contains the data and receives the data |
References addObject(), MPIContainer::broadcast(), copyDataFromMPIParticleToParticle(), MPISphericalParticle::copyDataFromParticleToMPIParticle(), MPIContainer::getProcessorID(), MPIContainer::Instance(), logger, PARTICLE, and WARN.
void ParticleHandler::checkExtrema | ( | BaseParticle * | P | ) |
Checks if the extrema of this ParticleHandler needs updating.
\param[in] type The first value of the position. \param[in] is The input stream from which the information is read. \details The old objects did not have their type in the beginning of the line. Instead, the first string of the file was the position in x-direction. Since we already read the first string of the file, we need to give it to this function and convert it to the position in x-direction. The rest of the stream is then read in the usual way. ‍/
void ParticleHandler::readAndCreateOldObject(std::istream& is, const std::string& type) { //read in next line std::stringstream line; helpers::getLineFromStringStream(is, line); logger(VERBOSE, line.str()); //stdcout << line.str() << std::endl;
BaseParticle particle;
//Declare all properties of the particle unsigned int indSpecies; Mdouble radius, inverseMass, inverseInertia; Vec3D position, velocity, euler, angularVelocity;
//Read all values position.X = atof(type.c_str());
line >> position.Y >> position.Z >> velocity >> radius >> euler >> angularVelocity >> inverseMass >> inverseInertia >> indSpecies;
//Put the values in the particle particle.setSpecies(getDPMBase()->speciesHandler.getObject(indSpecies)); particle.setPosition(position); particle.setVelocity(velocity); particle.setRadius(radius); Quaternion q; q.setEuler(euler); particle.setOrientation(q); particle.setAngularVelocity(angularVelocity); if (inverseMass == 0.0) particle.fixParticle(); else { particle.setInverseInertia(MatrixSymmetric3D(1,0,0,1,0,1)*inverseInertia); }
//Put the particle in the handler copyAndAddObject(particle); }
void ParticleHandler::write(std::ostream& os) const {
os << "Particles " << getSize() << '\n'; for (BaseParticle* it : *this) { os << (*it) << '\n'; }
os.flush(); }
/*!
[in] | P | A pointer to the particle, which properties have to be checked against the ParticleHandlers extrema. |
References computeLargestParticle(), computeSmallestParticle(), BaseParticle::getMaxInteractionRadius(), largestParticle_, Global_Physical_Variables::P, and smallestParticle_.
Referenced by addExistingObject(), addGhostObject(), addObject(), and BaseParticle::setRadius().
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. |
References computeLargestParticle(), computeSmallestParticle(), largestParticle_, Global_Physical_Variables::P, and smallestParticle_.
Referenced by BaseParticle::~BaseParticle(), and SuperQuadricParticle::~SuperQuadricParticle().
|
overridevirtual |
Empties the whole ParticleHandler by removing all BaseParticle.
Note that the pointers to smallestParticle_ and largestParticle_ are set to nullptr since these particles don't exist anymore after calling this function.
Reimplemented from BaseHandler< BaseParticle >.
References BaseHandler< T >::clear(), BaseHandler< BaseParticle >::getDPMBase(), DPMBase::handleParticleRemoval(), largestParticle_, and smallestParticle_.
Referenced by NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), CGHandler::evaluateRestartFiles(), HorizontalMixer::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), HorizontalMixer::introduceSingleParticle(), operator=(), ParticleHandler(), FileReader::read(), DPMBase::read(), DPMBase::readNextDataFile(), HorizontalMixerWalls::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), and BaseCluster::setupInitialConditions().
void ParticleHandler::computeAllMasses | ( | ) |
Computes the mass for all BaseParticle in this ParticleHandler.
References BaseHandler< BaseParticle >::objects_.
void ParticleHandler::computeAllMasses | ( | unsigned int | indSpecies | ) |
Computes the mass for all BaseParticle of the given species in this ParticleHandler.
[in] | indSpecies | Unsigned integer with the index of the species for which the masses must be computed. |
References BaseHandler< BaseParticle >::objects_.
Referenced by SpeciesHandler::addObject(), DPMBase::initialiseSolve(), DPMBase::readNextDataFile(), ParticleSpecies::setDensity(), and DPMBase::setParticleDimensions().
void ParticleHandler::computeLargestParticle | ( | ) |
Computes the largest particle (by interaction radius) and sets it in largestParticle_.
References DEBUG, BaseHandler< BaseParticle >::getSize(), largestParticle_, logger, and BaseHandler< BaseParticle >::objects_.
Referenced by DeletionBoundary::checkBoundaryAfterParticleMoved(), checkExtrema(), checkExtremaOnDelete(), operator=(), and ParticleHandler().
void ParticleHandler::computeSmallestParticle | ( | ) |
Computes the smallest particle (by interaction radius) and sets it in smallestParticle_.
References DEBUG, BaseHandler< BaseParticle >::getSize(), logger, BaseHandler< BaseParticle >::objects_, and smallestParticle_.
Referenced by DeletionBoundary::checkBoundaryAfterParticleMoved(), checkExtrema(), checkExtremaOnDelete(), operator=(), and ParticleHandler().
|
static |
Reads BaseParticle into the ParticleHandler from restart data.
[in] | is | The input stream from which the information is read. |
Referenced by readAndCreateObject().
Vec3D ParticleHandler::getAngularMomentum | ( | ) | const |
Vec3D ParticleHandler::getCentreOfMass | ( | ) | const |
References getMass(), getMassTimesPosition(), and constants::NaN.
Referenced by DPMBase::getCentreOfMass(), and RotatingDrumWet::printTime().
BaseParticle * ParticleHandler::getFastestParticle | ( | ) | const |
References ERROR, getFastestParticleLocal(), and logger.
BaseParticle * ParticleHandler::getFastestParticleLocal | ( | ) | const |
Gets a pointer to the fastest BaseParticle in this ParticleHandler.
References BaseHandler< BaseParticle >::getSize(), logger, BaseHandler< BaseParticle >::objects_, and WARN.
Referenced by getFastestParticle().
BaseParticle * ParticleHandler::getHighestPositionComponentParticle | ( | int | i | ) | const |
Gets a pointer to the particle with the highest coordinates in direction i in this ParticleHandler.
References ERROR, getHighestPositionComponentParticleLocal(), constants::i, and logger.
BaseParticle * ParticleHandler::getHighestPositionComponentParticleLocal | ( | int | i | ) | const |
Gets a pointer to the particle with the highest coordinates in direction i in this ParticleHandler.
[in] | i | Direction for which one wants the particle with highest coordinates. |
References BaseHandler< BaseParticle >::getSize(), constants::i, logger, BaseHandler< BaseParticle >::objects_, and WARN.
Referenced by getHighestPositionComponentParticle().
Mdouble ParticleHandler::getHighestPositionX | ( | ) | const |
Function returns the highest position in the x-direction.
This is a prototype example of how to obtain global particle attributes in the parallel code
References MAX.
BaseParticle * ParticleHandler::getHighestVelocityComponentParticle | ( | int | i | ) | const |
Gets a pointer to the particle with the highest velocity in direction i in this ParticleHandler.
References ERROR, getHighestVelocityComponentParticleLocal(), constants::i, and logger.
BaseParticle * ParticleHandler::getHighestVelocityComponentParticleLocal | ( | int | i | ) | const |
Gets a pointer to the particle with the highest velocity in direction i in this ParticleHandler.
[in] | i | Direction for which you want the particle with highest velocity. |
References BaseHandler< BaseParticle >::getSize(), constants::i, logger, BaseHandler< BaseParticle >::objects_, and WARN.
Referenced by getHighestVelocityComponentParticle().
Mdouble ParticleHandler::getKineticEnergy | ( | ) | const |
References getKineticEnergyLocal(), and MPIContainer::Instance().
Referenced by main(), DPMBase::writeEneTimeStep(), and LawinenBox::writeEneTimeStep().
|
private |
Referenced by getKineticEnergy().
Mdouble ParticleHandler::getLargestInteractionRadius | ( | ) | const |
Returns the largest interaction radius.
References getLargestInteractionRadiusLocal(), and MPIContainer::Instance().
Referenced by Contact::actionsAfterSolve(), DPMBase::read(), and saveNumberPSDtoCSV().
Mdouble ParticleHandler::getLargestInteractionRadiusLocal | ( | ) | const |
Returns the largest interaction radius of the current domain.
References getLargestParticle(), getLargestParticleLocal(), and BaseParticle::getMaxInteractionRadius().
Referenced by MercuryBase::getHGridTargetMaxInteractionRadius(), and getLargestInteractionRadius().
BaseParticle * ParticleHandler::getLargestParticle | ( | ) | const |
Returns the pointer of the largest particle in the particle handler. When mercury is running in parallel this function throws an error since a pointer to another domain is useless.
References getLargestParticleLocal(), logger, and WARN.
Referenced by DPMBase::checkParticleForInteractionLocalPeriodic(), ChuteWithPeriodicInflow::computeInternalForces(), LeesEdwardsBoundary::createHorizontalPeriodicParticle(), ShearBoxBoundary::createHorizontalPeriodicParticle(), AngledPeriodicBoundary::createPeriodicParticle(), CircularPeriodicBoundary::createPeriodicParticle(), PeriodicBoundary::createPeriodicParticle(), SubcriticalMaserBoundary::createPeriodicParticle(), SubcriticalMaserBoundaryTEST::createPeriodicParticle(), TimeDependentPeriodicBoundary::createPeriodicParticle(), LeesEdwardsBoundary::createVerticalPeriodicParticle(), ShearBoxBoundary::createVerticalPeriodicParticle(), getLargestInteractionRadiusLocal(), MercuryBase::hGridNeedsRebuilding(), HGridOptimiser::initialise(), saveNumberPSDtoCSV(), ParticleCreation::setupInitialConditions(), and BaseCluster::setupInitialConditions().
BaseParticle * ParticleHandler::getLargestParticleLocal | ( | ) | const |
Gets a pointer to the largest BaseParticle (by interactionRadius) in the ParticleHandler of the local domain.
References largestParticle_.
Referenced by ConstantMassFlowMaserBoundary::activateMaser(), ConstantMassFlowMaserBoundary::createPeriodicParticle(), getLargestInteractionRadiusLocal(), getLargestParticle(), RotatingDrum::setupInitialConditions(), and DPMBase::writeFstatHeader().
double ParticleHandler::getLiquidFilmVolume | ( | ) | const |
References getMPISum(), constants::i, and BaseHandler< BaseParticle >::objects_.
Referenced by LiquidMigrationMPI2Test::printTime().
BaseParticle * ParticleHandler::getLowestPositionComponentParticle | ( | int | i | ) | const |
Gets a pointer to the particle with the lowest coordinates in direction i in this ParticleHandler.
References ERROR, getLowestPositionComponentParticleLocal(), constants::i, and logger.
BaseParticle * ParticleHandler::getLowestPositionComponentParticleLocal | ( | int | i | ) | const |
Gets a pointer to the particle with the lowest coordinates in direction i in this ParticleHandler.
[in] | i | Direction for which you want the particle with lowest coordinates. |
References ERROR, BaseHandler< BaseParticle >::getSize(), constants::i, logger, BaseHandler< BaseParticle >::objects_, and WARN.
Referenced by getLowestPositionComponentParticle().
BaseParticle * ParticleHandler::getLowestVelocityComponentParticle | ( | int | i | ) | const |
Gets a pointer to the particle with the lowest velocity in direction i in this ParticleHandler.
References ERROR, getLowestVelocityComponentParticleLocal(), constants::i, and logger.
BaseParticle * ParticleHandler::getLowestVelocityComponentParticleLocal | ( | int | i | ) | const |
Gets a pointer to the particle with the lowest velocity in direction i in this ParticleHandler.
[in] | i | Direction for which you want the particle with lowest velocity. |
References BaseHandler< BaseParticle >::getSize(), constants::i, logger, BaseHandler< BaseParticle >::objects_, and WARN.
Referenced by getLowestVelocityComponentParticle().
Mdouble ParticleHandler::getMass | ( | ) | const |
References getMassLocal(), and MPIContainer::Instance().
Referenced by BoundariesSelfTest::actionsAfterTimeStep(), FluxAndPeriodicBoundarySelfTest::actionsAfterTimeStep(), FluxBoundarySelfTest::actionsAfterTimeStep(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), getCentreOfMass(), DPMBase::getTotalMass(), HeaterBoundaryTest::setupInitialConditions(), DPMBase::writeEneTimeStep(), and LawinenBox::writeEneTimeStep().
|
private |
Vec3D ParticleHandler::getMassTimesPosition | ( | ) | const |
References getMassTimesPositionLocal(), MPIContainer::Instance(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by getCentreOfMass(), and DPMBase::writeEneTimeStep().
|
private |
Referenced by getMassTimesPosition().
Mdouble ParticleHandler::getMeanRadius | ( | ) | const |
References getNumberOfRealObjectsLocal(), BaseHandler< BaseParticle >::getSize(), getSumRadiusLocal(), and MPIContainer::Instance().
Referenced by InitialConditions< SpeciesType >::getMeanRelativeContactRadius(), Sintering::getMeanRelativeContactRadius(), regimeForceUnitTest::getMeanRelativeContactRadius(), main(), GranuDrum::printTime(), Drum::printTime(), RotatingDrumWet::printTime(), regimeForceUnitTest::printTime(), and SingleParticle< SpeciesType >::writeEneTimeStep().
Vec3D ParticleHandler::getMomentum | ( | ) | const |
References getMPISum().
Referenced by DPMBase::getTotalMomentum(), main(), ParticleBeam::printTime(), and LawinenBox::writeEneTimeStep().
|
overridevirtual |
Returns the name of the handler, namely the string "ParticleHandler".
Implements BaseHandler< BaseParticle >.
unsigned int ParticleHandler::getNumberOfFixedObjects | ( | ) | const |
Computes the number of fixed particles in the whole simulation.
References getNumberOfFixedObjectsLocal(), and MPIContainer::Instance().
Referenced by LawinenBox::setupInitialConditions().
unsigned int ParticleHandler::getNumberOfFixedObjectsLocal | ( | ) | const |
Computes the number of Fixed particles on a local domain.
Loops over all particles to check if the particle is fixed or not, in a local domain.
References BaseParticle::isFixed().
Referenced by getNumberOfFixedObjects().
unsigned int ParticleHandler::getNumberOfFixedParticles | ( | ) | const |
Gets the number of particles that are fixed.
References NFixedParticles_.
|
overridevirtual |
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid confusion with real and fake particles. If the size of the container is wished, call size()
Reimplemented from BaseHandler< BaseParticle >.
References BaseHandler< BaseParticle >::getSize().
Referenced by Contact::actionsAfterSolve(), TwoByTwoMPIDomainMPI4Test::actionsAfterTimeStep(), GranularCollapse::actionsAfterTimeStep(), MercuryProblem::actionsAfterTimeStep(), LawinenBox::actionsBeforeTimeStep(), SmoothChute::actionsBeforeTimeStep(), AngleOfRepose::actionsBeforeTimeStep(), Chutebelt::actionsBeforeTimeStep(), ChutePeriodic::add_flow_particles(), SilbertPeriodic::add_flow_particles(), ChuteWithPeriodicInflow::AddContinuingBottom(), Chute::addFlowParticlesCompactly(), NautaMixer::addParticles(), statistics_while_running< T >::auto_set_domain(), statistics_while_running< T >::auto_set_z(), Mercury3Dclump::checkClumpForInteractionPeriodic(), DPMBase::checkParticleForInteractionLocalPeriodic(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContinuingBottom::ChuteWithPeriodicInflowAndContinuingBottom(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ChuteWithPeriodicInflowAndVariableBottom::ChuteWithPeriodicInflowAndVariableBottom(), ChuteWithPeriodicInflow::cleanChute(), ChuteWithContraction::cleanChute(), Funnel::cleanChute(), Chute::cleanChute(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), Slide::create_rough_wall(), AngleOfRepose::createBaseSpecies(), SilbertPeriodic::createBaseSpecies(), CSCInit::CSCInit(), ChuteWithPeriodicInflow::ExtendInWidth(), SphericalIndenter::getBedHeight(), getNumberOfUnfixedParticles(), InitialConditions< SpeciesType >::InitialConditions(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), LawinenBox::LawinenBox(), main(), ChuteBottom::makeRoughBottom(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), LawinenBox::printTime(), GranuDrum::printTime(), GranuHeap::printTime(), ChuteWithPeriodicInflow::printTime(), Drum::printTime(), RotatingDrumWet::printTime(), VerticalMixer::printTime(), SilbertPeriodic::printTime(), vibratedBed::printTime(), Chute::printTime(), readAndCreateObject(), CSCInit::save(), save(), saveNumberPSDtoCSV(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), MeshTriangle::setHandler(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCWalls::setupInitialConditions(), Binary::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), HourGlass2D::setupInitialConditions(), HourGlass::setupInitialConditions(), Cstatic2d::setupInitialConditions(), Cstatic3D::setupInitialConditions(), AngleOfRepose::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), Chutebelt::setupInitialConditions(), ParticleCreation::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedStepWallSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), SphericalIndenter::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), GranularCollapse::setupInitialConditions(), Tutorial11::setupInitialConditions(), MD_demo::setupInitialConditions(), ChuteBottom::setupInitialConditions(), and SingleParticleIndenter::SingleParticleIndenter().
unsigned int ParticleHandler::getNumberOfRealObjects | ( | ) | const |
Returns the number of real objects (on all processors)
References MPIContainer::broadcast(), getNumberOfRealObjectsLocal(), BaseHandler< BaseParticle >::getSize(), and MPIContainer::Instance().
Referenced by Membrane::createVertexParticles(), DPMBase::decompose(), and HourGlass2D::setupInitialConditions().
unsigned int ParticleHandler::getNumberOfRealObjectsLocal | ( | ) | const |
Returns the number of real objects on a local domain. MPI particles and periodic particles are neglected.
References DPMBase::domainHandler, DomainHandler::getCurrentDomain(), BaseHandler< BaseParticle >::getDPMBase(), PeriodicBoundaryHandler::getNumberOfPeriodicGhostParticles(), MPIContainer::getNumberOfProcessors(), Domain::getNumberOfTrueMPIParticles(), BaseHandler< BaseParticle >::getSize(), MPIContainer::Instance(), logger, and DPMBase::periodicBoundaryHandler.
Referenced by MaserRepeatedOutInMPI2Test::actionsAfterSolve(), TwoByTwoMPIDomainMPI4Test::actionsAfterTimeStep(), getMeanRadius(), getNumberOfRealObjects(), and DPMBase::outputXBallsData().
unsigned int ParticleHandler::getNumberOfUnfixedParticles | ( | ) | const |
Gets the number of particles that are not fixed.
References getNumberOfObjects(), and NFixedParticles_.
|
inline |
Computes an attribute type (min/max/..) of a particle attribute(position/velocity) in the global domain.
Many functions the particleHandler return a pointer to a BaseParticle, i.e. the fastest particle, however in parallel this is not useful as pointers can't be send across processes. This function gives the flexibility to find a global particle extremum such as the fastest particle Velocity or lowest particle position.
[in] | attribute | A function that obtains a scalar from a particle. i.e. position or radius |
[in] | type | An AttributeType tells this function what to do with the attribute, take the maximum or the minimum |
References ERROR, getParticleAttributeLocal(), MPIContainer::Instance(), logger, MAX, and MIN.
|
inline |
Computes an attribute type (min/max/..) of a particle attribute (position/velocity) in a local domain.
Computes an attribute type (min/max/..) of a particle attribute (position/velocity) in a local domain
Many functions the particleHandler return a pointer to a BaseParticle, i.e. the fastest particle, however in parallel this is not useful as pointers can't be send across processes. This function gives the flexibility to find a global particle extremum such as the fastest particle Velocity or lowest particle position.
[in] | attribute | A function that obtains a scalar from a particle. i.e. position or radius |
[in] | type | An AttributeType tells this function what to do with the attribute, take the maximum or the minimum |
References ERROR, logger, MAX, MIN, BaseHandler< BaseParticle >::objects_, and WARN.
Referenced by getParticleAttribute().
Mdouble ParticleHandler::getRotationalEnergy | ( | ) | const |
References getRotationalEnergyLocal(), and MPIContainer::Instance().
Referenced by main(), DPMBase::writeEneTimeStep(), and LawinenBox::writeEneTimeStep().
|
private |
Referenced by getRotationalEnergy().
Mdouble ParticleHandler::getSmallestInteractionRadius | ( | ) | const |
Returns the smallest interaction radius.
References getSmallestInteractionRadiusLocal(), and MPIContainer::Instance().
Referenced by Contact::actionsAfterSolve(), main(), and saveNumberPSDtoCSV().
Mdouble ParticleHandler::getSmallestInteractionRadiusLocal | ( | ) | const |
Returns the smallest interaction radius of the current domain.
References BaseParticle::getMaxInteractionRadius(), and getSmallestParticleLocal().
Referenced by MercuryBase::getHGridTargetMinInteractionRadius(), and getSmallestInteractionRadius().
BaseParticle * ParticleHandler::getSmallestParticle | ( | ) | const |
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler of the local domain. When mercury is running in parallel this function throws an error since a pointer to another domain is useless.
References getSmallestParticleLocal(), logger, and WARN.
Referenced by HGridOptimiser::initialise(), and saveNumberPSDtoCSV().
BaseParticle * ParticleHandler::getSmallestParticleLocal | ( | ) | const |
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler of the local domain.
References smallestParticle_.
Referenced by getSmallestInteractionRadiusLocal(), getSmallestParticle(), RotatingDrum::setupInitialConditions(), and DPMBase::writeFstatHeader().
|
private |
References BaseHandler< BaseParticle >::objects_.
Referenced by getMeanRadius().
Mdouble ParticleHandler::getVolume | ( | ) | const |
References getVolumeLocal(), and MPIContainer::Instance().
Referenced by PSDManualInsertionSelfTest::actionsAfterSolve(), ShearStage::actionsAfterTimeStep(), LeesEdwardsDemo::actionsAfterTimeStep(), ShiftingConstantMassFlowMaserBoundarySelfTest::actionsAfterTimeStep(), ShiftingMaserBoundarySelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundary3DSelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundaryTest::actionsAfterTimeStep(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and GranuHeap::GranuHeap().
|
private |
Referenced by getVolume().
ParticleHandler & ParticleHandler::operator= | ( | const ParticleHandler & | rhs | ) |
Assignment operator.
[in] | rhs | The ParticleHandler on the right hand side of the assignment. |
This is not a copy assignment operator! It copies the DPMBase and all BaseParticle, and sets the other variables to 0. After that, it computes the smallest and largest particle in this handler.
References clear(), computeLargestParticle(), computeSmallestParticle(), BaseHandler< BaseParticle >::copyContentsFromOtherHandler(), DEBUG, largestParticle_, logger, BaseHandler< BaseParticle >::objects_, and smallestParticle_.
|
overridevirtual |
\brief Create a new particle, based on the information from old-style restart data. ‍/
void readAndCreateOldObject(std::istream &is, const std::string& type);
/*! \brief Create a new particle in the WallHandler, based on the information provided in a restart file.
[in] | is | The input stream from which the information is read. |
Implements BaseHandler< BaseParticle >.
References addExistingObject(), and readAndCreateObject().
Referenced by DPMBase::read().
BaseParticle * ParticleHandler::readAndCreateObject | ( | std::istream & | is | ) |
Create a new particle, based on the information provided in a restart file.
[in] | is | The input stream from which the information is read. |
References createObject(), DEBUG, BaseHandler< BaseParticle >::getDPMBase(), BaseInteractable::getIndSpecies(), BaseHandler< BaseParticle >::getLastObject(), getNumberOfObjects(), BaseHandler< BaseParticle >::getStorageCapacity(), logger, BaseParticle::read(), BaseParticle::setHandler(), and BaseParticle::setSpecies().
Referenced by InsertionBoundary::read(), and readAndAddObject().
void ParticleHandler::removedFixedParticle | ( | ) |
Decrement of the number of fixed particles.
References NFixedParticles_.
Referenced by BaseParticle::unfix(), and BaseParticle::~BaseParticle().
void ParticleHandler::removeGhostObject | ( | unsigned int | index | ) |
Removes a BaseParticle from the ParticleHandler without a global check, this is only to be done for mpi routines.
[in] | index | The index of which BaseParticle has to be removed from this ParticleHandler. |
The BaseParticle with index is removed and the last BaseParticle in the vector is moved to its position. It also removes the BaseParticle from the HGrid. This function is only called by the parallel routines where we are sure the particles have been flushed out of the communication boundaries.
References ERROR, BaseHandler< BaseParticle >::getDPMBase(), BaseHandler< BaseParticle >::getObject(), DPMBase::handleParticleRemoval(), DPMBase::hGridRemoveParticle(), logger, and BaseHandler< T >::removeObject().
Referenced by DeletionBoundary::checkBoundaryAfterParticleMoved(), DPMBase::checkInteractionWithBoundaries(), PeriodicBoundaryHandler::clearCommunicationLists(), and DPMBase::deleteGhostParticles().
void ParticleHandler::removeLastObject | ( | ) |
Removes the last BaseParticle from the ParticleHandler.
Function that removes the last object from this ParticleHandler. It also removes the particle from the HGrid.
References BaseHandler< BaseParticle >::getDPMBase(), BaseHandler< BaseParticle >::getLastObject(), DPMBase::handleParticleRemoval(), DPMBase::hGridRemoveParticle(), and BaseHandler< T >::removeLastObject().
Referenced by Penetration::setupInitialConditions().
|
overridevirtual |
Removes a BaseParticle from the ParticleHandler.
[in] | index | The index of which BaseParticle has to be removed from this ParticleHandler. |
The BaseParticle with index is removed and the last BaseParticle in the vector is moved to its position. It also removes the BaseParticle from the HGrid. When running this in parallel a warning is thrown that deleting particles might cause havoc in the communication between boundaries, as the deleted particle might still be in one of the boundary lists
Reimplemented from BaseHandler< BaseParticle >.
References BaseHandler< BaseParticle >::getDPMBase(), MPIContainer::getNumberOfProcessors(), BaseHandler< BaseParticle >::getObject(), DPMBase::handleParticleRemoval(), DPMBase::hGridRemoveParticle(), MPIContainer::Instance(), logger, BaseHandler< T >::removeObject(), and WARN.
Referenced by AngleOfRepose::actionsBeforeTimeStep(), PeriodicWallsWithSlidingFrictionUnitTest::actionsBeforeTimeStep(), SilbertPeriodic::add_flow_particles(), CircularPeriodicBoundary::checkBoundaryAfterParticleMoved(), ConstantMassFlowMaserBoundary::checkBoundaryAfterParticleMoved(), DeletionBoundary::checkBoundaryAfterParticleMoved(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ChuteWithPeriodicInflow::cleanChute(), ChuteWithContraction::cleanChute(), Funnel::cleanChute(), Chute::cleanChute(), ContactDetectionTester::cleanup(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), ChuteBottom::makeRoughBottom(), CurvyChute::recreateBottom(), DPMBase::removeDuplicatePeriodicParticles(), CSCWalls::saveWalls(), and AngleOfRepose::setupInitialConditions().
void ParticleHandler::saveNumberPSDtoCSV | ( | std::string | csvFileName, |
std::vector< double > | diameterBins = {} |
||
) |
References getLargestInteractionRadius(), getLargestParticle(), getNumberOfObjects(), BaseParticle::getRadius(), getSmallestInteractionRadius(), getSmallestParticle(), constants::i, INFO, logger, n, and WARN.
Referenced by main().
void ParticleHandler::write | ( | std::ostream & | os | ) | const |
|
private |
A pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
Referenced by checkExtrema(), checkExtremaOnDelete(), clear(), computeLargestParticle(), getLargestParticleLocal(), operator=(), ParticleHandler(), and ~ParticleHandler().
|
private |
Number of fixed particles.
Referenced by addedFixedParticle(), getNumberOfFixedParticles(), getNumberOfUnfixedParticles(), and removedFixedParticle().
|
private |
A pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler.
Referenced by checkExtrema(), checkExtremaOnDelete(), clear(), computeSmallestParticle(), getSmallestParticleLocal(), operator=(), ParticleHandler(), and ~ParticleHandler().