|
Container to store pointers to all BasePeriodicBoundary objects. More...
#include <PeriodicBoundaryHandler.h>
Public Member Functions | |
PeriodicBoundaryHandler () | |
Default constructor, it creates an empty PeriodicBoundaryHandler. More... | |
PeriodicBoundaryHandler (const PeriodicBoundaryHandler &BH) | |
Constructor that copies all BasePeriodicBoundary it contains and sets the other variables to 0/nullptr. More... | |
PeriodicBoundaryHandler | operator= (const PeriodicBoundaryHandler &rhs) |
Assignment operator, copies only the vector of BasePeriodicBoundary and sets the other variables to 0/nullptr. More... | |
~PeriodicBoundaryHandler () override | |
Destructor, it destructs the PeriodicBoundaryHandler and all BasePeriodicBoundary it contains. More... | |
void | addObject (BasePeriodicBoundary *P) override |
Adds a BasePeriodicBoundary to the PeriodicBoundaryHandler. More... | |
void | readAndAddObject (std::istream &is) override |
Pure virtual function needs implementation, but it does nothing for the periodicBoudnaryHandler. More... | |
std::string | getName () const override |
Returns the name of the handler, namely the string "PeriodicBoundaryHandler". More... | |
void | setInteractionDistance (Mdouble interactionDistance) |
Sets the interaction distance. More... | |
Mdouble | getInteractionDistance () |
Returns the interaction distance. More... | |
void | updateStatus (std::set< BaseParticle * > &ghostParticlesToBeDeleted) |
Updates the positions/velocity of ghost particles and accordingly the status of these particles. More... | |
void | shiftParticle (BaseParticle *particle) |
Shifts the position of the particle based on its current periodic complexity. More... | |
void | shiftParticle (BaseParticle *particle, const std::vector< int > &complexity) |
Shifts the position of the particle based on a given periodic complexity. More... | |
std::vector< int > | computePeriodicComplexity (Vec3D position) |
Computes the periodic complexity based on a given position. More... | |
void | computePeriodicComplexity (std::vector< int > &periodicComplexity, int &totalPeriodicComplexity, Vec3D position) |
Computes the periodic complexity and total periodic complexity based on a given position. More... | |
void | addNewParticles () |
Adds new particles to the periodic particle lists. More... | |
void | addNewParticle (BaseParticle *particle) |
Adds a new particle to the periodic list. More... | |
unsigned int | getNumberOfPeriodicGhostParticles () |
Returns the number of particles that are flagged is periodicGhostParticle. More... | |
Mdouble | getNumberOfTruePeriodicGhostParticles () |
Returns the number of particles that are flagged as periodicGhostParticles, but not as MPIParticles. More... | |
void | getMPIFlags (BaseParticle *particle, bool &isInMPIDomain, bool &isMPIParticle) |
Determines if a given particle is in the MPI domain and if it is an MPI Particle. More... | |
void | setMPIFlags (BaseParticle *particle) |
Sets the MPIParticle and isMPIParticle flags of a given particle. More... | |
void | generateGhosts (std::vector< std::vector< int > > &list, std::vector< int > periodicComplexity, std::vector< int > &complexity, int level) |
generates a list of periodic complexities corresponding to a give real particle. More... | |
void | collectGhostParticleData () |
Collects ghost particle data that needs to be be sent to other processors. More... | |
void | collectInteractionData () |
Collects interaction data into an MPI data structure. More... | |
void | processReceivedGhostParticleData (int targetIndex, std::vector< BaseParticle * > &newParticles) |
Processes the received ghost data, creates a ghost particle and does some book keeping. More... | |
void | processReceivedInteractionData (int targetIndex, std::vector< BaseParticle * > &newParticles) |
Process the received interaction data. More... | |
void | processLocalInteractionData (std::vector< BaseParticle * > &newParticles) |
Process the interaction data for local ghosts. More... | |
void | processPeriodicParticles () |
Creates a periodioc particle ID for book keeping and moves the ID to the correct list. More... | |
void | processLocalGhostParticles (std::vector< BaseParticle * > &newParticles) |
Creates ghost particles of periodic particles that are located on the same processor. More... | |
void | updateParticles () |
Updates position/velocity and periodic complexity of ghost particles. More... | |
bool | checkIsReal (std::vector< int > complexity) |
checks if a periodic complexity is real More... | |
bool | checkChanged (std::vector< int > previousComplexity, std::vector< int > complexity) |
checks of two periodic complexities differ More... | |
void | updateParticleStatus (std::set< BaseParticle * > &particlesToBeDeleted) |
Updates the status of periodic particles and ghost particles. More... | |
int | findTargetProcessor (const std::vector< int > &complexity) |
For a given complexity this function returns the target processor. More... | |
void | findNewParticle (BaseParticle *particle) |
Checks if a particle is in the periodic domain, but are not flagged as being in the periodic domain. More... | |
bool | checkIfAddNewParticle (BaseParticle *particle) |
void | findNewParticles () |
Loops over all particles in the simulation to check if they need to be added to the periodic lists. More... | |
void | findNewInteractions () |
Finds interactions that accompany future ghost particles. More... | |
void | communicateTargetDomains () |
Creats a list of send and receive targets for periodic/ghost particles. More... | |
void | communicateNumberOfNewParticlesAndInteractions () |
Communicate the number of new particles and interactions to target processors. More... | |
void | prepareNewParticleTransmission () |
Initial preparation work for sending ghost particles. More... | |
void | performNewParticleTransmission () |
Collects and sends the ghost particle data. More... | |
void | finaliseNewParticleTransmission () |
creates the ghost particles and performs some bookkeeping to keep track of them More... | |
void | preparePositionAndVelocityUpdate () |
Collects the position and velocity data from periodic boundaries. More... | |
void | finalisePositionAndVelocityUpdate () |
Communicates position and velocity data from periodic boundaries and updates ghost particles. More... | |
void | flushParticles (std::set< BaseParticle * > &particlesToBeFlushed) |
Removes particles from the periodiocParticleList_ and periociGhostList_. More... | |
void | cleanCommunicationList (std::vector< MpiPeriodicParticleIDBase * > &list) |
Removes the nullptr's from a communication list. More... | |
void | cleanCommunicationLists () |
void | clearCommunicationLists () |
Removes all ghost particles and bookkeeping for a fresh start. More... | |
void | initialise () |
Initialises the communication list vectors as they can not be determined on compile time. More... | |
void | flushPeriodicParticles (std::set< BaseParticle * > &particlesToBeDeleted) |
Flushes periodioc particles that need to be deleted from the periodic lists. More... | |
void | performActionsBeforeAddingParticles () |
Actions that boundaries perform before adding new periodic/ghost particles. More... | |
void | updateMaserParticle (BaseParticle *particle) |
Updates the maser flag of particles leaving the maser. More... | |
void | findBoundariesToIgnore (BaseParticle *particle, std::vector< int > &periodicComplexity, int &totalPeriodicComplexity) |
Disables boundaries that need to be ignored (i.e. a non-maser particle needs to ignore the maser boundary) More... | |
Public Member Functions inherited from BaseHandler< BasePeriodicBoundary > | |
BaseHandler () | |
Default BaseHandler constructor, it creates an empty BaseHandler and assigns DPMBase_ to a null pointer. More... | |
BaseHandler (const BaseHandler< BasePeriodicBoundary > &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< BasePeriodicBoundary > &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 (BasePeriodicBoundary *O) |
Adds an existing object to the BaseHandler without changing the id of the object. More... | |
virtual void | addObject (BasePeriodicBoundary *object) |
Adds a new Object to the BaseHandler. More... | |
virtual void | addGhostObject (BasePeriodicBoundary *O) |
Adds a new Object to the BaseHandler. called by the to avoid increasing the id. More... | |
void | removeIf (const std::function< bool(BasePeriodicBoundary *)> cond) |
virtual void | removeObject (unsigned const int index) |
Removes an Object from the BaseHandler. More... | |
void | removeLastObject () |
Removes the last Object from the BaseHandler. More... | |
virtual void | clear () |
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0. More... | |
void | read (std::istream &is) |
Reads all objects from restart data. More... | |
BasePeriodicBoundary * | getObjectById (const unsigned int id) |
Gets a pointer to the Object at the specified index in the BaseHandler. More... | |
std::vector< BasePeriodicBoundary * > | getObjectsById (const unsigned int id) |
Gets a vector of pointers to the objects with the specific id. More... | |
BasePeriodicBoundary * | getObject (const unsigned int id) |
Gets a pointer to the Object at the specified index in the BaseHandler. More... | |
const BasePeriodicBoundary * | getObject (const unsigned int id) const |
Gets a constant pointer to the Object at the specified index in the BaseHandler. More... | |
BasePeriodicBoundary * | getLastObject () |
Gets a pointer to the last Object in this BaseHandler. More... | |
const BasePeriodicBoundary * | getLastObject () const |
Gets a constant pointer to the last Object in this BaseHandler. More... | |
virtual unsigned int | getNumberOfObjects () const |
Gets the number of real Object in this BaseHandler. (i.e. no mpi or periodic particles) 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 BasePeriodicBoundary &obj) |
Resizes the container to contain N elements. More... | |
const std::vector< BasePeriodicBoundary * >::const_iterator | begin () const |
Gets the begin of the const_iterator over all Object in this BaseHandler. More... | |
const std::vector< BasePeriodicBoundary * >::iterator | begin () |
Gets the begin of the iterator over all BaseBoundary in this BaseHandler. More... | |
const std::vector< BasePeriodicBoundary * >::const_iterator | end () const |
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler. More... | |
const std::vector< BasePeriodicBoundary * >::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 (BasePeriodicBoundary *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... | |
Private Attributes | |
Mdouble | interactionDistance_ |
The interaction distance between a position and the boundary for which particles start to participate with a boundary or not. More... | |
std::vector< int > | receiveTargetList_ |
A list that keeps track which target processors the current processor is receiving new particles from. More... | |
std::vector< int > | sendTargetList_ |
A list that keeps track to which targets this processor is sending new particles to. More... | |
std::vector< int > | numberOfNewPeriodicGhostParticlesReceive_ |
A vector that stores how many new ghost particles will be received from other processors. More... | |
std::vector< int > | numberOfNewPeriodicGhostParticlesSend_ |
A vector that stores how many particles are going to be send to other processors. More... | |
std::vector< int > | numberOfNewInteractionsSend_ |
Stores the number of new interactions to be send to target processor corresponding to sendTargetList_. More... | |
std::vector< int > | numberOfNewInteractionsReceive_ |
Stores the number of new interactions to be received from target processor corresponding to receiveTargetList_. More... | |
std::vector< std::vector< MPIParticle > > | periodicGhostParticleReceive_ |
Data container for particles that are being received from other processors. More... | |
std::vector< std::vector< MPIParticle > > | periodicGhostParticleSend_ |
Data container for particles that are being send to other processors. More... | |
std::vector< std::vector< int > > | periodicGhostComplexityReceive_ |
Data container for periodic complexity that is being received from other processors. More... | |
std::vector< std::vector< int > > | periodicGhostComplexitySend_ |
Data container for periodic complexity that is being send to other processors. More... | |
std::vector< std::vector< MPIParticlePosition > > | updatePositionDataReceive_ |
Data container for position data that is being received from other processors. More... | |
std::vector< std::vector< MPIParticlePosition > > | updatePositionDataSend_ |
Data container for position data that is being send to other processors. More... | |
std::vector< std::vector< MPIParticleVelocity > > | updateVelocityDataReceive_ |
Data container for velocity data that is being received from other processors. More... | |
std::vector< std::vector< MPIParticleVelocity > > | updateVelocityDataSend_ |
Data container for velocity data that is being send to other processors. More... | |
std::vector< void * > | interactionDataSend_ |
Stores the interaction data that is going to be send. More... | |
std::vector< void * > | interactionDataReceive_ |
Stores the interaction data that is going to be received. More... | |
std::vector< PeriodicList > | newPeriodicParticleList_ |
std::vector< std::vector< BaseInteraction * > > | newInteractionList_ |
std::vector< PeriodicList > | periodicParticleList_ |
A vector the size of the number of processors, each entry containing a vector of periodic particle ID's to keep track of periodic particles and their corresponding ghosts. More... | |
std::vector< PeriodicGhostList > | periodicGhostList_ |
A vector the size of the number of processors, each entry containing a vector of ghost periodioc particle ID's to keep track of periodic ghost particles and their corresponding real particles. More... | |
Additional Inherited Members | |
Protected Attributes inherited from BaseHandler< BasePeriodicBoundary > | |
std::vector< BasePeriodicBoundary * > | objects_ |
The actual list of Object pointers. More... | |
Container to store pointers to all BasePeriodicBoundary objects.
The PeriodicBoundaryHandler is a container to store all BasePeriodicBoundary. It is implemented by a vector of pointers to BasePeriodicBoundary.
PeriodicBoundaryHandler::PeriodicBoundaryHandler | ( | ) |
Default constructor, it creates an empty PeriodicBoundaryHandler.
Constructor of the PeriodicBoundaryHandler class. It creates and empty PeriodicBoundaryHandler.
References DEBUG, interactionDistance_, and logger.
PeriodicBoundaryHandler::PeriodicBoundaryHandler | ( | const PeriodicBoundaryHandler & | PBH | ) |
Constructor that copies all BasePeriodicBoundary it contains and sets the other variables to 0/nullptr.
[in] | BH | The PeriodicBoundaryHandler that has to be copied. |
This is not a copy constructor! It just copies all BasePeriodicBoundary from the other handler into this handler, and clears all other variables.
References DEBUG, interactionDistance_, logger, BaseHandler< BasePeriodicBoundary >::objects_, and BaseHandler< BasePeriodicBoundary >::setDPMBase().
|
override |
Destructor, it destructs the PeriodicBoundaryHandler and all BasePeriodicBoundary it contains.
Default destructor. Note that the delete for all boundaries is done in the BaseHandler.
References DEBUG, logger, and BaseHandler< BasePeriodicBoundary >::objects_.
void PeriodicBoundaryHandler::addNewParticle | ( | BaseParticle * | particle | ) |
Adds a new particle to the periodic list.
\detail When a user or an insertion boundary is adding a single new particle to the system, this function will add it to the corresponding lists if required. If this is the case, the particle will be communicated to the receiving processor in a three step process. First the processors communicate which each other to determine who is getting how many particles from who. Secondly the actual data transfer is performed and thirdly the received data is processed into the correct bookkeeping lists.
[in] | particle | The particle that is (or not) being add to the periodic lists. |
References finaliseNewParticleTransmission(), findNewParticle(), BaseHandler< BasePeriodicBoundary >::getDPMBase(), NUMBER_OF_PROCESSORS, performNewParticleTransmission(), and prepareNewParticleTransmission().
Referenced by DPMBase::insertGhostParticle().
void PeriodicBoundaryHandler::addNewParticles | ( | ) |
Adds new particles to the periodic particle lists.
\detail This function adds new particles to the periodiocBoundary lists. Particles that are not yet flagged as periodic(ghost) particles are checked if they entered the interaction distances of periodic boundaries. If this is the case these will be communicated to the other processors in a three step process. First the processors communicate which each other to determine who is getting how many particles from who. Secondly the actual data transfer is performed and thirdly the received data is processed into the correct bookkeeping lists.
References finaliseNewParticleTransmission(), findNewParticles(), NUMBER_OF_PROCESSORS, performActionsBeforeAddingParticles(), performNewParticleTransmission(), and prepareNewParticleTransmission().
Referenced by SubcriticalMaserBoundaryTEST::activateMaser(), addObject(), DPMBase::initialiseSolve(), DPMBase::performGhostParticleUpdate(), DPMBase::read(), and DPMBase::updateGhostGrid().
|
override |
Adds a BasePeriodicBoundary to the PeriodicBoundaryHandler.
[in] | P | A pointer to the BasePeriodicBoundary (or derived class) that has to be added. Add the object and tell the object that this is his handler. |
References addNewParticles(), clearCommunicationLists(), NUMBER_OF_PROCESSORS, BaseHandler< BasePeriodicBoundary >::objects_, and Global_Physical_Variables::P.
Referenced by BoundaryHandler::addObject().
bool PeriodicBoundaryHandler::checkChanged | ( | std::vector< int > | previousComplexity, |
std::vector< int > | complexity | ||
) |
checks of two periodic complexities differ
\detail A large part of the status update requires on if the periodic complexity of the real particle is changed. This function will check if the previous and current periodic complexity differ. If this is the case it returns true, if they remain the same the function returns false
[in] | previousPeriodicComplexity | A periodioc complexity vector that is used as reference |
[in] | currentPeriodicComplexity | A periodic complexity that is checked for difference against a reference periodic complexity. |
References constants::i.
Referenced by updateParticleStatus().
bool PeriodicBoundaryHandler::checkIfAddNewParticle | ( | BaseParticle * | particle | ) |
References BaseParticle::isInPeriodicDomain(), and BaseParticle::isPeriodicGhostParticle().
Referenced by findNewParticle().
bool PeriodicBoundaryHandler::checkIsReal | ( | std::vector< int > | complexity | ) |
checks if a periodic complexity is real
\detail An important distinction between periodic particles is if they are real or not. This check is generally required for the particle status update. A real particle only has positive periodic complexity values. So the moment a negative value is found it is clear the particle is not real.
[in] | complexity | The periodic complexity that indicates the status of the periodic particle |
References BaseHandler< BasePeriodicBoundary >::getSize(), constants::i, and mathsFunc::sign().
Referenced by updateParticleStatus().
void PeriodicBoundaryHandler::cleanCommunicationList | ( | std::vector< MpiPeriodicParticleIDBase * > & | list | ) |
Removes the nullptr's from a communication list.
When a particle is deleted the ID is also removed, but to ensure everything happens in the same order a nullptr is introduced instead. This function removes these nullptr's by adding the last entry of the list on such empty spot and making the list shorter.
[in] | list | A list of MPiPeriodicParticleIDBase's that need to be cleaned from empty entries |
References constants::i.
Referenced by cleanCommunicationLists().
void PeriodicBoundaryHandler::cleanCommunicationLists | ( | ) |
References cleanCommunicationList(), constants::i, NUMBER_OF_PROCESSORS, periodicGhostList_, and periodicParticleList_.
Referenced by DPMBase::checkInteractionWithBoundaries(), and DPMBase::deleteGhostParticles().
void PeriodicBoundaryHandler::clearCommunicationLists | ( | ) |
Removes all ghost particles and bookkeeping for a fresh start.
This function deletes all periodic/ghost ID's and all corresponding ghosts. starting with a fresh clean periodicBoundaryHandler. Useful when another boundary is added - after - particles already have been added
References Domain::cleanCommunicationLists(), Domain::flushParticles(), DPMBase::getCurrentDomain(), BaseHandler< BasePeriodicBoundary >::getDPMBase(), constants::i, NUMBER_OF_PROCESSORS, DPMBase::particleHandler, periodicGhostList_, periodicParticleList_, and ParticleHandler::removeGhostObject().
Referenced by SubcriticalMaserBoundaryTEST::activateMaser(), and addObject().
void PeriodicBoundaryHandler::collectGhostParticleData | ( | ) |
Collects ghost particle data that needs to be be sent to other processors.
Sending ghosts to other processors is done in an non-blocking communication way and hence the data needs to be stored somewhere. This function collects and stores the data in a convenient format.
References copyDataFromParticleToMPIParticle(), BaseHandler< BasePeriodicBoundary >::getSize(), constants::i, newPeriodicParticleList_, numberOfNewPeriodicGhostParticlesSend_, MpiPeriodicParticleIDBase::particle, periodicGhostComplexitySend_, periodicGhostParticleSend_, PROCESSOR_ID, sendTargetList_, and MpiPeriodicParticleIDBase::targetPeriodicComplexity.
Referenced by performNewParticleTransmission().
void PeriodicBoundaryHandler::collectInteractionData | ( | ) |
Collects interaction data into an MPI data structure.
Not only particles need to be copied to other ghosts, also their interactions with their surroundings, because these interactions contain history parameters. This function collects the basic interaction data and history data into a useful MPI structure
References InteractionHandler::createMPIInteractionDataArray(), BaseHandler< BasePeriodicBoundary >::getDPMBase(), constants::i, interactionDataSend_, DPMBase::interactionHandler, newInteractionList_, numberOfNewInteractionsSend_, and sendTargetList_.
Referenced by performNewParticleTransmission().
void PeriodicBoundaryHandler::communicateNumberOfNewParticlesAndInteractions | ( | ) |
Communicate the number of new particles and interactions to target processors.
Every receiving target that will receive ghost particle data will need to know how many particles are coming their way. This function performs that communication step. The same for interactions, not every ghost particle receives the same number of interactions and hence that step is done seperately.
References constants::i, MPIContainer::Instance(), INTERACTION_COUNT, MAX_PROC, numberOfNewInteractionsReceive_, numberOfNewInteractionsSend_, numberOfNewPeriodicGhostParticlesReceive_, numberOfNewPeriodicGhostParticlesSend_, PARTICLE_COUNT, PROCESSOR_ID, MPIContainer::receive(), receiveTargetList_, MPIContainer::send(), and sendTargetList_.
Referenced by prepareNewParticleTransmission().
void PeriodicBoundaryHandler::communicateTargetDomains | ( | ) |
Creats a list of send and receive targets for periodic/ghost particles.
When communicating ghost particles from periodic boundaries in paralell, it is not clear from the start which processor is sending to which processor. First all processors check to how many domains the processor is sending. A second communication step is then performed to tell all other processors which domains the processor is sending to. After this function has completed every processor has a list of targets that the processor sends data to and a list of targets the processor receives data from.
References MPIContainer::broadcast(), constants::i, MPIContainer::Instance(), newPeriodicParticleList_, NUMBER_OF_PROCESSORS, numberOfNewPeriodicGhostParticlesSend_, PROCESSOR_ID, receiveTargetList_, and sendTargetList_.
Referenced by prepareNewParticleTransmission().
void PeriodicBoundaryHandler::computePeriodicComplexity | ( | std::vector< int > & | periodicComplexity, |
int & | totalPeriodicComplexity, | ||
Vec3D | position | ||
) |
Computes the periodic complexity and total periodic complexity based on a given position.
\detail This function computes the periodic complexity, a vector of intergers that indicate how this particle is related to the periodic boundaries. Every boundary has a status value following: [2] = Real particle, not in the proximity of the boundary [1] = Real particle, in the proximity of the boundary [-1] = ghost particle, in the proximity of the boundary [-2] = ghost particle, not in the proximity of the boundary In addition to the periodic complexity it also computes the totalPeriodicComplexity that indicates with how many boundaries this position is in close proximity
[in,out] | periodicComplexity | The periodic complexity indicating how a given position is related to the periodic boundaries. |
[in,out] | totalPeriodicComplexity | The number of boundaries the position is in close proximity with. |
[in] | position | The input position for which the relation to the boundaries are determined. |
References BasePeriodicBoundary::getDistance(), BaseHandler< BasePeriodicBoundary >::getSize(), interactionDistance_, and BasePeriodicBoundary::isClosestToLeftBoundary().
std::vector< int > PeriodicBoundaryHandler::computePeriodicComplexity | ( | Vec3D | position | ) |
Computes the periodic complexity based on a given position.
\detail This function computes the periodic complexity, a vector of intergers that indicate how this particle is related to the periodic boundaries. Every boundary has a status value following: [2] = Real particle, not in the proximity of the boundary [1] = Real particle, in the proximity of the boundary [-1] = ghost particle, in the proximity of the boundary [-2] = ghost particle, not in the proximity of the boundary
[in] | position | The input position for which the relation to the boundaries are determined. |
Referenced by findNewParticle(), processReceivedGhostParticleData(), updateParticles(), and updateParticleStatus().
void PeriodicBoundaryHandler::finaliseNewParticleTransmission | ( | ) |
creates the ghost particles and performs some bookkeeping to keep track of them
References constants::i, interactionDataReceive_, interactionDataSend_, newInteractionList_, newPeriodicParticleList_, numberOfNewInteractionsReceive_, numberOfNewInteractionsSend_, numberOfNewPeriodicGhostParticlesReceive_, numberOfNewPeriodicGhostParticlesSend_, periodicGhostComplexityReceive_, periodicGhostComplexitySend_, periodicGhostParticleReceive_, periodicGhostParticleSend_, processLocalGhostParticles(), processLocalInteractionData(), processPeriodicParticles(), processReceivedGhostParticleData(), processReceivedInteractionData(), receiveTargetList_, and sendTargetList_.
Referenced by addNewParticle(), and addNewParticles().
void PeriodicBoundaryHandler::finalisePositionAndVelocityUpdate | ( | ) |
Communicates position and velocity data from periodic boundaries and updates ghost particles.
References updateParticles(), updatePositionDataReceive_, updatePositionDataSend_, updateVelocityDataReceive_, and updateVelocityDataSend_.
Referenced by updateStatus().
void PeriodicBoundaryHandler::findBoundariesToIgnore | ( | BaseParticle * | particle, |
std::vector< int > & | periodicComplexity, | ||
int & | totalPeriodicComplexity | ||
) |
Disables boundaries that need to be ignored (i.e. a non-maser particle needs to ignore the maser boundary)
void PeriodicBoundaryHandler::findNewInteractions | ( | ) |
Finds interactions that accompany future ghost particles.
Ghost particles have interactions with history parameters. These interactions also need to be copied to the other processor. This function finds these interactions and stores them.
References BaseInteractable::getInteractions(), constants::i, newInteractionList_, newPeriodicParticleList_, numberOfNewInteractionsSend_, and sendTargetList_.
Referenced by prepareNewParticleTransmission().
void PeriodicBoundaryHandler::findNewParticle | ( | BaseParticle * | particle | ) |
Checks if a particle is in the periodic domain, but are not flagged as being in the periodic domain.
Particles that are located close to a periodic boundary, but not flagged as being in the periodic domain will be added to a list by this function. If they indeed have to be added a periodic ID will be created that stores some basic information required to setup a ghost particle.
[in] | particle | A particle that is considered to be added to the periodic boundary lists |
References checkIfAddNewParticle(), computePeriodicComplexity(), findTargetProcessor(), generateGhosts(), BaseObject::getId(), BaseParticle::getPeriodicComplexity(), BaseInteractable::getPosition(), BaseHandler< BasePeriodicBoundary >::getSize(), constants::i, logger, newPeriodicParticleList_, BaseHandler< BasePeriodicBoundary >::objects_, MpiPeriodicParticleIDBase::particle, MpiPeriodicParticleIDBase::periodicComplexity, BaseParticle::setPeriodicComplexity(), MpiPeriodicParticleIDBase::targetPeriodicComplexity, MpiPeriodicParticleIDBase::targetProcessor, and VERBOSE.
Referenced by addNewParticle(), and findNewParticles().
void PeriodicBoundaryHandler::findNewParticles | ( | ) |
Loops over all particles in the simulation to check if they need to be added to the periodic lists.
Loops over all base particles in the domain to see if they have to be added to the periodic domain lists
References findNewParticle(), and BaseHandler< BasePeriodicBoundary >::getDPMBase().
Referenced by addNewParticles().
int PeriodicBoundaryHandler::findTargetProcessor | ( | const std::vector< int > & | complexity | ) |
For a given complexity this function returns the target processor.
A given complexity can be turned into a particle position, somewhere in the simulation domain. This position belongs to a specific processor and this function computes which processor this actually is. Note: When an PMG particle is in the periodic domain, it needs to be copied into a PG"MG" particle. A particle that is in the MG domain, but is not updated by the M boundaries. The position of this MG particle is not in the actual domain to where it has to be copied, but slightly outside. For that reason the position is shifted to the middle of the domain the official particle is found on, and that position is used to determine the actual domain the particle has to go to. Note that currently this only works for a structured grid with equal domain sizes
[in] | complexity | A complexity vector which determines the location of a ghost particle |
References DPMBase::domainHandler, DomainHandler::getCurrentDomain(), BaseHandler< BasePeriodicBoundary >::getDPMBase(), Domain::getMiddle(), DomainHandler::getParticleDomainGlobalIndex(), DomainHandler::getParticleProcessor(), BaseInteractable::setPosition(), and shiftParticle().
Referenced by findNewParticle().
void PeriodicBoundaryHandler::flushParticles | ( | std::set< BaseParticle * > & | particlesToBeFlushed | ) |
Removes particles from the periodiocParticleList_ and periociGhostList_.
References constants::i, NUMBER_OF_PROCESSORS, periodicGhostList_, and periodicParticleList_.
Referenced by DPMBase::checkInteractionWithBoundaries(), and DPMBase::deleteGhostParticles().
void PeriodicBoundaryHandler::flushPeriodicParticles | ( | std::set< BaseParticle * > & | particlesToBeDeleted | ) |
Flushes periodioc particles that need to be deleted from the periodic lists.
void PeriodicBoundaryHandler::generateGhosts | ( | std::vector< std::vector< int > > & | list, |
std::vector< int > | periodicComplexity, | ||
std::vector< int > & | complexity, | ||
int | level | ||
) |
generates a list of periodic complexities corresponding to a give real particle.
Given a real particle that interacts with periodic boundaries, ghosts need to be generated. Depending on the number of boundaries this particle is interacting the number of ghosts differs. A recursive function makes sure that all possibilities of the periodic complexity of the real particle are generated. Note that the first periodic complexity in the list returned by this function is always the periodic complexity of the real particle.
[in,out] | list | A list containing all possible ghost periodic complexities for a given periodic complexity |
[in] | periodicComplexity | A periodic complexity of a real particle that is used to determine all its possible ghost periodic complexities |
[in,out] | complexity | One of the possible permutations of the ghost periodic complexity |
[in] | level | Indicator at which level the recursive function is |
Referenced by findNewParticle().
Mdouble PeriodicBoundaryHandler::getInteractionDistance | ( | ) |
Returns the interaction distance.
This distance determines when a particle starts to interact with a periodic boundary.
References interactionDistance_.
void PeriodicBoundaryHandler::getMPIFlags | ( | BaseParticle * | particle, |
bool & | isInMPIDomain, | ||
bool & | isMPIParticle | ||
) |
Determines if a given particle is in the MPI domain and if it is an MPI Particle.
Mixed particles that are both a interacting with a periodic boundary and also in an mpi boundary are special cases that need to be handled with care. As example a real particle that moves to another domain will be removed by the mpi boundaries. To avoid segmentation faults the particle needs to be flushed from the periodic boundaries as well. This function determines if a particle is in the MPI domain and if it is a MPIParticle or not.
[in] | particle | The particle for which the MPI flags are being computed |
[in,out] | isInMPIDomain | A check to see if the particle is in the MPI domain (true) or not (false) |
[in,out] | isMPIParticle | A bool to see if the particle is a ghost in the MPI domain (true) or not (false) |
References Domain::containsParticle(), DPMBase::domainHandler, DomainHandler::getCurrentDomain(), BaseHandler< BasePeriodicBoundary >::getDPMBase(), Domain::isInGreaterDomain(), and Domain::isInInnerDomain().
Referenced by setMPIFlags(), and updateParticleStatus().
|
overridevirtual |
Returns the name of the handler, namely the string "PeriodicBoundaryHandler".
This determines the unique name of the current class
Implements BaseHandler< BasePeriodicBoundary >.
unsigned int PeriodicBoundaryHandler::getNumberOfPeriodicGhostParticles | ( | ) |
Returns the number of particles that are flagged is periodicGhostParticle.
Counts the number of periodic ghost particles by simply checking how many entries there are in the periodicGhostLists.
References periodicGhostList_.
Referenced by ParticleHandler::getNumberOfRealObjectsLocal().
Mdouble PeriodicBoundaryHandler::getNumberOfTruePeriodicGhostParticles | ( | ) |
Returns the number of particles that are flagged as periodicGhostParticles, but not as MPIParticles.
Counts the number of true periodic ghost particles by checking how many entries there are in the periodiocGhostLists, but ignores mixed ghost particles that additionally have the flay isMPIParticle() == true.
References periodicGhostList_.
void PeriodicBoundaryHandler::initialise | ( | ) |
Initialises the communication list vectors as they can not be determined on compile time.
On compile time it is not clear how many processors will be used when running the simulation and therefore the basic periodioc lists can't be initialised /bi the constructor. This function initialises the vectors to avoid segmentationfaults.
References newPeriodicParticleList_, NUMBER_OF_PROCESSORS, periodicGhostList_, and periodicParticleList_.
Referenced by DPMBase::constructor(), and DPMBase::DPMBase().
PeriodicBoundaryHandler PeriodicBoundaryHandler::operator= | ( | const PeriodicBoundaryHandler & | rhs | ) |
Assignment operator, copies only the vector of BasePeriodicBoundary and sets the other variables to 0/nullptr.
[in] | rhs | The PeriodicBoundaryHandler on the right hand side of the assignment. |
This is not a copy assignment operator! It just copies all BaseBoundary from the other handler into this handler, and clears all other variables.
References DEBUG, interactionDistance_, logger, and BaseHandler< BasePeriodicBoundary >::objects_.
void PeriodicBoundaryHandler::performActionsBeforeAddingParticles | ( | ) |
Actions that boundaries perform before adding new periodic/ghost particles.
References BasePeriodicBoundary::performActionsBeforeAddingParticles().
Referenced by addNewParticles().
void PeriodicBoundaryHandler::performNewParticleTransmission | ( | ) |
Collects and sends the ghost particle data.
References collectGhostParticleData(), collectInteractionData(), InteractionHandler::createMPIInteractionDataArray(), BaseHandler< BasePeriodicBoundary >::getDPMBase(), BaseHandler< BasePeriodicBoundary >::getSize(), constants::i, MPIContainer::Instance(), INTERACTION, INTERACTION_DATA, interactionDataReceive_, interactionDataSend_, DPMBase::interactionHandler, MAX_PROC, numberOfNewInteractionsReceive_, numberOfNewInteractionsSend_, numberOfNewPeriodicGhostParticlesReceive_, numberOfNewPeriodicGhostParticlesSend_, PARTICLE, PARTICLE_DATA, PERIODIC_COMPLEXITY, periodicGhostComplexityReceive_, periodicGhostComplexitySend_, periodicGhostParticleReceive_, periodicGhostParticleSend_, PROCESSOR_ID, MPIContainer::receive(), receiveTargetList_, MPIContainer::send(), sendTargetList_, and MPIContainer::sync().
Referenced by addNewParticle(), and addNewParticles().
void PeriodicBoundaryHandler::prepareNewParticleTransmission | ( | ) |
Initial preparation work for sending ghost particles.
The first step in adding new particles is the prepare step. First the target domains are determined such that every processors knows where particles are coming from. This step includes finding new particles. The second step is to find the interactions that have to be send with the new particles. The receiving targets need to know how many particles and interactions they receive which is the third step. Finally a communication synchronisation is performed to actually perform the communications which were pending in the MPIContainer.
References communicateNumberOfNewParticlesAndInteractions(), communicateTargetDomains(), findNewInteractions(), MPIContainer::Instance(), and MPIContainer::sync().
Referenced by addNewParticle(), and addNewParticles().
void PeriodicBoundaryHandler::preparePositionAndVelocityUpdate | ( | ) |
Collects the position and velocity data from periodic boundaries.
References copyPositionFrom(), copyVelocityFrom(), MPIContainer::getNumberOfProcessors(), MPIContainer::getProcessorID(), constants::i, MPIContainer::Instance(), MAX_PROC, periodicGhostList_, periodicParticleList_, POSITION, POSITION_DATA, MPIContainer::receive(), MPIContainer::send(), MPIContainer::sync(), updatePositionDataReceive_, updatePositionDataSend_, updateVelocityDataReceive_, updateVelocityDataSend_, VELOCITY, and VELOCITY_DATA.
Referenced by updateStatus().
void PeriodicBoundaryHandler::processLocalGhostParticles | ( | std::vector< BaseParticle * > & | newParticles | ) |
Creates ghost particles of periodic particles that are located on the same processor.
Ghost particles sometimes are located on the same processor as the original periodic particle. These particles are processed in this function. Firstly the ghost is created with the correct position, periodic complexity and flags and is added to the particleHandler. Secondly ID's are made for both ghost and periodic particles to keep track of their movements. Periodic particles are flaged now as being in the periodic domain.
References ParticleHandler::addGhostObject(), BaseParticle::copy(), BaseHandler< BasePeriodicBoundary >::getDPMBase(), BaseObject::getId(), BaseParticle::getPeriodicComplexity(), BaseInteractable::getPosition(), constants::i, logger, newPeriodicParticleList_, numberOfNewPeriodicGhostParticlesSend_, MpiPeriodicParticleIDBase::otherParticle, MpiPeriodicParticleIDBase::particle, DPMBase::particleHandler, periodicGhostList_, PROCESSOR_ID, MpiPeriodicParticleIDBase::realPeriodicComplexity, sendTargetList_, BaseParticle::setInPeriodicDomain(), BaseParticle::setPeriodicComplexity(), BaseParticle::setPeriodicGhostParticle(), shiftParticle(), MpiPeriodicParticleIDBase::targetPeriodicComplexity, and VERBOSE.
Referenced by finaliseNewParticleTransmission().
void PeriodicBoundaryHandler::processLocalInteractionData | ( | std::vector< BaseParticle * > & | newParticles | ) |
Process the interaction data for local ghosts.
Newly added ghost particles also need their interactions. This function adds the interactions to the correct ghost particles. The interaction data send over MPI only contains the ID's of the particles so a search has to be performed to obtain the particle pointers. For the ghost particles we use the newParticle list that contains all newly added ghost particles. For the other particle an hgrid search is performed. Finally when the two interactables are found the data is copied from the data vector. Note: because these ghost particles are local, the data is actually never send.
[in] | newParticles | A list containing the newly added ghost particles |
References BaseHandler< BasePeriodicBoundary >::getDPMBase(), InteractionHandler::getInteractionDetails(), BaseParticle::getInteractionWith(), BaseWall::getInteractionWith(), BaseHandler< T >::getObjectById(), DPMBase::hGridGetInteractingParticleList(), constants::i, interactionDataSend_, DPMBase::interactionHandler, logger, numberOfNewInteractionsSend_, PROCESSOR_ID, sendTargetList_, BaseInteraction::setMPIInteraction(), VERBOSE, and DPMBase::wallHandler.
Referenced by finaliseNewParticleTransmission().
void PeriodicBoundaryHandler::processPeriodicParticles | ( | ) |
Creates a periodioc particle ID for book keeping and moves the ID to the correct list.
Periodic particles that have a copy somewhere else create an ID for book keeping This function also flags the particle being in the periodic domain such that it is ignored when finding new periodic particles.
References constants::i, newPeriodicParticleList_, MpiPeriodicParticleIDBase::particle, periodicParticleList_, sendTargetList_, and BaseParticle::setInPeriodicDomain().
Referenced by finaliseNewParticleTransmission().
void PeriodicBoundaryHandler::processReceivedGhostParticleData | ( | int | targetIndex, |
std::vector< BaseParticle * > & | newParticles | ||
) |
Processes the received ghost data, creates a ghost particle and does some book keeping.
When processors have received new ghost particle data they have to be processed. First the periodic complexity of the ghost is determined. Secondly the ghost is created and given the correct flags and position and is added to the simulation. Thirdly a periodicGhost ID is created for book keeping purposes. A newParticle list is tracking the newly added ghost particles for a later step, processing the interactions.
[in] | targetIndex | The index in the receiveTargetList which indicates where the data is coming from |
[in] | newParticles | A list to which new ghost particles are added. |
References ParticleHandler::addGhostObject(), computePeriodicComplexity(), copyDataFromMPIParticleToParticle(), BaseHandler< BasePeriodicBoundary >::getDPMBase(), BaseHandler< T >::getLastObject(), BaseInteractable::getPosition(), BaseHandler< BasePeriodicBoundary >::getSize(), logger, MPISphericalParticle::newParticle(), numberOfNewPeriodicGhostParticlesReceive_, MpiPeriodicParticleIDBase::particle, DPMBase::particleHandler, periodicGhostComplexityReceive_, periodicGhostList_, periodicGhostParticleReceive_, MpiPeriodicParticleIDBase::realPeriodicComplexity, receiveTargetList_, BaseParticle::setInPeriodicDomain(), setMPIFlags(), BaseParticle::setPeriodicComplexity(), BaseParticle::setPeriodicGhostParticle(), shiftParticle(), and VERBOSE.
Referenced by finaliseNewParticleTransmission().
void PeriodicBoundaryHandler::processReceivedInteractionData | ( | int | targetIndex, |
std::vector< BaseParticle * > & | newParticles | ||
) |
Process the received interaction data.
Newly added ghost particles also need their interactions. This function adds the interactions to the correct ghost particles. The interaction data send over MPI only contains the ID's of the particles so a search has to be performed to obtain the particle pointers. For the ghost particles we use the newParticle list that contains all newly added ghost particles. For the other particle an hgrid search is performed. Finally when the two interactables are found the data is copied from the data vector.
[in] | targetIndex | The index in the receiveTargetList which indicates where the data is coming from |
[in] | newParticles | A list containing the newly added ghost particles |
References BaseHandler< BasePeriodicBoundary >::getDPMBase(), InteractionHandler::getInteractionDetails(), BaseParticle::getInteractionWith(), BaseInteractable::getInteractionWith(), BaseHandler< T >::getObjectById(), DPMBase::hGridGetInteractingParticleList(), constants::i, interactionDataReceive_, DPMBase::interactionHandler, numberOfNewInteractionsReceive_, and DPMBase::wallHandler.
Referenced by finaliseNewParticleTransmission().
|
overridevirtual |
Pure virtual function needs implementation, but it does nothing for the periodicBoudnaryHandler.
The periodic boundary handler does not need to read anything, it will be reconstructed.
Implements BaseHandler< BasePeriodicBoundary >.
void PeriodicBoundaryHandler::setInteractionDistance | ( | Mdouble | interactionDistance | ) |
Sets the interaction distance.
This distance determines when a particle starts to interact with a periodic boundary
[in] | interactionDistance | The distance from a boundary when a particle starts to interact with it. |
References interactionDistance_.
Referenced by DPMBase::read(), and DPMBase::updateGhostGrid().
void PeriodicBoundaryHandler::setMPIFlags | ( | BaseParticle * | particle | ) |
Sets the MPIParticle and isMPIParticle flags of a given particle.
Mixed particles that are in periodic and mpi domains, PM-particles can create ghosts of themselves PGM and PMG and additionally PGMG-particles. These last particles can't be created both by the periodic routines and the paralle routines and therefore the design choice is that these fully depend on the periodic routines. The update of their MPI flags such as isInMPIDomain and isMPIParticle is handled by this function.
[in] | particle | A particle that receives the correct MPI flags |
References getMPIFlags(), BaseParticle::setInMPIDomain(), and BaseParticle::setMPIParticle().
Referenced by processReceivedGhostParticleData(), and updateParticleStatus().
void PeriodicBoundaryHandler::shiftParticle | ( | BaseParticle * | particle | ) |
Shifts the position of the particle based on its current periodic complexity.
\detail This function shifts the position of the particle with respect to the periodic boundaries based on the periodic complexity it currently has. Note that some boundaries such as the angular periodic boundary do not only shift the position, but also the velocity. In that sense this function name is a bit of a misnomer.
[in] | particle | The particle that shifts position (and possibly other properties) |
References BaseParticle::getPeriodicComplexity().
Referenced by findTargetProcessor(), processLocalGhostParticles(), processReceivedGhostParticleData(), and updateParticles().
void PeriodicBoundaryHandler::shiftParticle | ( | BaseParticle * | particle, |
const std::vector< int > & | complexity | ||
) |
Shifts the position of the particle based on a given periodic complexity.
\detail This function shifts the position of the particle with respect to the periodic boundaries based on a given periodic complexity. Note that some boundaries such as the angular periodic boundary do not only shift the position, but also the velocity. In that sense this function name is a bit of a misnomer.
[in] | particle | The particle that shifts position (and possibly other properties) |
[in] | complexity | The periodic complexity that determines how the particle is shifted |
References BasePeriodicBoundary::shiftPosition().
void PeriodicBoundaryHandler::updateMaserParticle | ( | BaseParticle * | particle | ) |
Updates the maser flag of particles leaving the maser.
When a periodic particle changes complexity and remains real, there is a possibility the particle moved over a maser boundary. If that is indeed the case then flag the particle as being not a maser particle
[in,out] | particle | The particle that needs to check the isMaserParticle flag |
References BaseHandler< BasePeriodicBoundary >::getDPMBase(), BaseObject::getId(), BaseHandler< T >::getNextId(), BaseParticle::getPeriodicComplexity(), BaseInteractable::getPosition(), BaseHandler< BasePeriodicBoundary >::getSize(), BaseHandler< T >::increaseId(), BaseParticle::isMaserParticle(), logger, DPMBase::particleHandler, BaseObject::setId(), BaseParticle::setMaserParticle(), VERBOSE, and Vec3D::X.
Referenced by updateParticleStatus().
void PeriodicBoundaryHandler::updateParticles | ( | ) |
Updates position/velocity and periodic complexity of ghost particles.
This function updates the position/velocity and periodic complexity of ghost particles. There are two versions of update, a local and a global one. The local one can update the particles through pointers, as the periodic particle is located ont he same processor as the ghost. The local version has received data from other processors which is stored in the corresponding vectors
References computePeriodicComplexity(), BaseInteractable::getAngularVelocity(), BaseHandler< BasePeriodicBoundary >::getDPMBase(), BaseObject::getId(), Vec3D::getLengthSquared(), BaseInteractable::getOrientation(), BaseParticle::getPeriodicComplexity(), BaseInteractable::getPosition(), BaseParticle::getPreviousPeriodicComplexity(), BaseParticle::getPreviousPosition(), BaseHandler< BasePeriodicBoundary >::getSize(), BaseInteractable::getVelocity(), DPMBase::hGridUpdateMove(), constants::i, logger, NUMBER_OF_PROCESSORS, BaseHandler< BasePeriodicBoundary >::objects_, MpiPeriodicParticleIDBase::otherParticle, MpiPeriodicParticleIDBase::particle, periodicGhostList_, PROCESSOR_ID, BaseInteractable::setAngularVelocity(), BaseInteractable::setOrientation(), BaseParticle::setPeriodicComplexity(), BaseInteractable::setPosition(), BaseParticle::setPreviousPeriodicComplexity(), BaseParticle::setPreviousPosition(), BaseInteractable::setVelocity(), shiftParticle(), mathsFunc::sign(), updatePositionDataReceive_, and updateVelocityDataReceive_.
Referenced by finalisePositionAndVelocityUpdate().
void PeriodicBoundaryHandler::updateParticleStatus | ( | std::set< BaseParticle * > & | particlesToBeDeleted | ) |
Updates the status of periodic particles and ghost particles.
This function updates the status of the particles based on the periodic complexity of the particles. this is beneficial as no round-off errors are made due to the shift in position. If a particle changes it's periodic complexity it is either removed or turned into a real particle. The real particle will be re-introduced in a later step. Particles that need to be deleted will be stored in a vector as these particles might also need to be flushed from the Domain.h lists.
[in,out] | particlesToBeDeleted | List of particles that will need to be removed from the simulation |
References MPIContainer::broadcast(), checkChanged(), checkIsReal(), computePeriodicComplexity(), ERROR, BaseHandler< BasePeriodicBoundary >::getDPMBase(), BaseObject::getId(), getMPIFlags(), BaseHandler< T >::getNextId(), MPIContainer::getNumberOfProcessors(), BaseParticle::getPeriodicComplexity(), BaseInteractable::getPosition(), BaseParticle::getPreviousPeriodicComplexity(), BaseHandler< BasePeriodicBoundary >::getSize(), constants::i, MPIContainer::Instance(), BaseParticle::isInMPIDomain(), BaseParticle::isMPIParticle(), logger, BaseHandler< BasePeriodicBoundary >::objects_, MpiPeriodicParticleIDBase::particle, DPMBase::particleHandler, periodicGhostList_, periodicParticleList_, BaseParticle::setInMPIDomain(), BaseParticle::setInPeriodicDomain(), setMPIFlags(), BaseHandler< T >::setNextId(), BaseParticle::setPeriodicGhostParticle(), updateMaserParticle(), and VERBOSE.
Referenced by updateStatus().
void PeriodicBoundaryHandler::updateStatus | ( | std::set< BaseParticle * > & | particlesToBeDeleted | ) |
Updates the positions/velocity of ghost particles and accordingly the status of these particles.
\detail This function updates the status of periodic particles and periodic ghost particles. This is done in two steps. The first step is to update the ghost particles with the position of their corresponding real particles. Based on this new position their status will be updated. Occasionally a particle needs to be removed and because this particle might also be listed in the communication boundaries, it will be deleted after those lists have been flushed.
[in] | particlesToBeDeleted | A list of particles that need to be deleted, but can't yet be deleted to avoid segmentation faults |
References finalisePositionAndVelocityUpdate(), preparePositionAndVelocityUpdate(), and updateParticleStatus().
Referenced by DPMBase::performGhostParticleUpdate().
|
private |
Stores the interaction data that is going to be received.
Referenced by finaliseNewParticleTransmission(), performNewParticleTransmission(), and processReceivedInteractionData().
|
private |
Stores the interaction data that is going to be send.
Referenced by collectInteractionData(), finaliseNewParticleTransmission(), performNewParticleTransmission(), and processLocalInteractionData().
|
private |
The interaction distance between a position and the boundary for which particles start to participate with a boundary or not.
Referenced by computePeriodicComplexity(), getInteractionDistance(), operator=(), PeriodicBoundaryHandler(), and setInteractionDistance().
|
private |
A list that stores the new interactions that have to be send to target processor, corresponding to sendTargetList_
Referenced by collectInteractionData(), finaliseNewParticleTransmission(), and findNewInteractions().
|
private |
A vector the size of the number of processors, each entry containing a vector of newly found periodic particles that need to be send to other processors
Referenced by collectGhostParticleData(), communicateTargetDomains(), finaliseNewParticleTransmission(), findNewInteractions(), findNewParticle(), initialise(), processLocalGhostParticles(), and processPeriodicParticles().
|
private |
Stores the number of new interactions to be received from target processor corresponding to receiveTargetList_.
Referenced by communicateNumberOfNewParticlesAndInteractions(), finaliseNewParticleTransmission(), performNewParticleTransmission(), and processReceivedInteractionData().
|
private |
Stores the number of new interactions to be send to target processor corresponding to sendTargetList_.
Referenced by collectInteractionData(), communicateNumberOfNewParticlesAndInteractions(), finaliseNewParticleTransmission(), findNewInteractions(), performNewParticleTransmission(), and processLocalInteractionData().
|
private |
A vector that stores how many new ghost particles will be received from other processors.
Referenced by communicateNumberOfNewParticlesAndInteractions(), finaliseNewParticleTransmission(), performNewParticleTransmission(), and processReceivedGhostParticleData().
|
private |
A vector that stores how many particles are going to be send to other processors.
Referenced by collectGhostParticleData(), communicateNumberOfNewParticlesAndInteractions(), communicateTargetDomains(), finaliseNewParticleTransmission(), performNewParticleTransmission(), and processLocalGhostParticles().
|
private |
Data container for periodic complexity that is being received from other processors.
Referenced by finaliseNewParticleTransmission(), performNewParticleTransmission(), and processReceivedGhostParticleData().
|
private |
Data container for periodic complexity that is being send to other processors.
Referenced by collectGhostParticleData(), finaliseNewParticleTransmission(), and performNewParticleTransmission().
|
private |
A vector the size of the number of processors, each entry containing a vector of ghost periodioc particle ID's to keep track of periodic ghost particles and their corresponding real particles.
Referenced by cleanCommunicationLists(), clearCommunicationLists(), flushParticles(), getNumberOfPeriodicGhostParticles(), getNumberOfTruePeriodicGhostParticles(), initialise(), preparePositionAndVelocityUpdate(), processLocalGhostParticles(), processReceivedGhostParticleData(), updateParticles(), and updateParticleStatus().
|
private |
Data container for particles that are being received from other processors.
Referenced by finaliseNewParticleTransmission(), performNewParticleTransmission(), and processReceivedGhostParticleData().
|
private |
Data container for particles that are being send to other processors.
Referenced by collectGhostParticleData(), finaliseNewParticleTransmission(), and performNewParticleTransmission().
|
private |
A vector the size of the number of processors, each entry containing a vector of periodic particle ID's to keep track of periodic particles and their corresponding ghosts.
Referenced by cleanCommunicationLists(), clearCommunicationLists(), flushParticles(), initialise(), preparePositionAndVelocityUpdate(), processPeriodicParticles(), and updateParticleStatus().
|
private |
A list that keeps track which target processors the current processor is receiving new particles from.
Referenced by communicateNumberOfNewParticlesAndInteractions(), communicateTargetDomains(), finaliseNewParticleTransmission(), performNewParticleTransmission(), and processReceivedGhostParticleData().
|
private |
A list that keeps track to which targets this processor is sending new particles to.
Referenced by collectGhostParticleData(), collectInteractionData(), communicateNumberOfNewParticlesAndInteractions(), communicateTargetDomains(), finaliseNewParticleTransmission(), findNewInteractions(), performNewParticleTransmission(), processLocalGhostParticles(), processLocalInteractionData(), and processPeriodicParticles().
|
private |
Data container for position data that is being received from other processors.
Referenced by finalisePositionAndVelocityUpdate(), preparePositionAndVelocityUpdate(), and updateParticles().
|
private |
Data container for position data that is being send to other processors.
Referenced by finalisePositionAndVelocityUpdate(), and preparePositionAndVelocityUpdate().
|
private |
Data container for velocity data that is being received from other processors.
Referenced by finalisePositionAndVelocityUpdate(), preparePositionAndVelocityUpdate(), and updateParticles().
|
private |
Data container for velocity data that is being send to other processors.
Referenced by finalisePositionAndVelocityUpdate(), and preparePositionAndVelocityUpdate().