27 #ifndef PERIODICBOUNDARYHANDLER_H
28 #define PERIODICBOUNDARYHANDLER_H
79 std::string
getName()
const override;
94 void updateStatus(std::set<BaseParticle*>& ghostParticlesToBeDeleted);
150 void generateGhosts(std::vector<std::vector<int> >& list, std::vector<int> periodicComplexity,
151 std::vector<int>& complexity,
int level);
201 bool checkChanged(std::vector<int> previousComplexity, std::vector<int> complexity);
268 void flushParticles(std::set<BaseParticle*>& particlesToBeFlushed);
std::vector< MpiPeriodicParticleID * > PeriodicList
Definition: PeriodicBoundaryHandler.h:36
std::vector< MpiPeriodicGhostParticleID * > PeriodicGhostList
Definition: PeriodicBoundaryHandler.h:37
Container to store the pointers to all objects that one creates in a simulation.
Definition: BaseHandler.h:51
Definition: BaseParticle.h:54
Definition: BasePeriodicBoundary.h:41
Container to store pointers to all BasePeriodicBoundary objects.
Definition: PeriodicBoundaryHandler.h:46
void performActionsBeforeAddingParticles()
Actions that boundaries perform before adding new periodic/ghost particles.
Definition: PeriodicBoundaryHandler.cc:1794
void updateMaserParticle(BaseParticle *particle)
Updates the maser flag of particles leaving the maser.
Definition: PeriodicBoundaryHandler.cc:1864
void addObject(BasePeriodicBoundary *P) override
Adds a BasePeriodicBoundary to the PeriodicBoundaryHandler.
Definition: PeriodicBoundaryHandler.cc:90
std::vector< std::vector< MPIParticlePosition > > updatePositionDataReceive_
Data container for position data that is being received from other processors.
Definition: PeriodicBoundaryHandler.h:373
std::vector< PeriodicList > periodicParticleList_
A vector the size of the number of processors, each entry containing a vector of periodic particle ID...
Definition: PeriodicBoundaryHandler.h:417
void cleanCommunicationLists()
Definition: PeriodicBoundaryHandler.cc:1772
Mdouble interactionDistance_
The interaction distance between a position and the boundary for which particles start to participate...
Definition: PeriodicBoundaryHandler.h:314
void processLocalInteractionData(std::vector< BaseParticle * > &newParticles)
Process the interaction data for local ghosts.
Definition: PeriodicBoundaryHandler.cc:692
void setMPIFlags(BaseParticle *particle)
Sets the MPIParticle and isMPIParticle flags of a given particle.
Definition: PeriodicBoundaryHandler.cc:443
void initialise()
Initialises the communication list vectors as they can not be determined on compile time.
Definition: PeriodicBoundaryHandler.cc:1787
void communicateTargetDomains()
Creats a list of send and receive targets for periodic/ghost particles.
Definition: PeriodicBoundaryHandler.cc:1394
std::vector< void * > interactionDataSend_
Stores the interaction data that is going to be send.
Definition: PeriodicBoundaryHandler.h:393
PeriodicBoundaryHandler operator=(const PeriodicBoundaryHandler &rhs)
Assignment operator, copies only the vector of BasePeriodicBoundary and sets the other variables to 0...
Definition: PeriodicBoundaryHandler.cc:66
void shiftParticle(BaseParticle *particle)
Shifts the position of the particle based on its current periodic complexity.
Definition: PeriodicBoundaryHandler.cc:170
std::vector< int > numberOfNewPeriodicGhostParticlesReceive_
A vector that stores how many new ghost particles will be received from other processors.
Definition: PeriodicBoundaryHandler.h:332
void prepareNewParticleTransmission()
Initial preparation work for sending ghost particles.
Definition: PeriodicBoundaryHandler.cc:1490
std::vector< int > numberOfNewPeriodicGhostParticlesSend_
A vector that stores how many particles are going to be send to other processors.
Definition: PeriodicBoundaryHandler.h:338
void communicateNumberOfNewParticlesAndInteractions()
Communicate the number of new particles and interactions to target processors.
Definition: PeriodicBoundaryHandler.cc:1448
void processPeriodicParticles()
Creates a periodioc particle ID for book keeping and moves the ID to the correct list.
Definition: PeriodicBoundaryHandler.cc:782
~PeriodicBoundaryHandler() override
Destructor, it destructs the PeriodicBoundaryHandler and all BasePeriodicBoundary it contains.
Definition: PeriodicBoundaryHandler.cc:78
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.
Definition: PeriodicBoundaryHandler.cc:465
void flushPeriodicParticles(std::set< BaseParticle * > &particlesToBeDeleted)
Flushes periodioc particles that need to be deleted from the periodic lists.
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.
Definition: PeriodicBoundaryHandler.cc:401
void performNewParticleTransmission()
Collects and sends the ghost particle data.
Definition: PeriodicBoundaryHandler.cc:1505
unsigned int getNumberOfPeriodicGhostParticles()
Returns the number of particles that are flagged is periodicGhostParticle.
Definition: PeriodicBoundaryHandler.cc:357
bool checkIfAddNewParticle(BaseParticle *particle)
Definition: PeriodicBoundaryHandler.cc:1885
std::vector< int > computePeriodicComplexity(Vec3D position)
Computes the periodic complexity based on a given position.
Definition: PeriodicBoundaryHandler.cc:282
std::vector< std::vector< BaseInteraction * > > newInteractionList_
Definition: PeriodicBoundaryHandler.h:410
Mdouble getNumberOfTruePeriodicGhostParticles()
Returns the number of particles that are flagged as periodicGhostParticles, but not as MPIParticles.
Definition: PeriodicBoundaryHandler.cc:373
void updateStatus(std::set< BaseParticle * > &ghostParticlesToBeDeleted)
Updates the positions/velocity of ghost particles and accordingly the status of these particles.
Definition: PeriodicBoundaryHandler.cc:151
std::vector< void * > interactionDataReceive_
Stores the interaction data that is going to be received.
Definition: PeriodicBoundaryHandler.h:398
std::vector< PeriodicList > newPeriodicParticleList_
Definition: PeriodicBoundaryHandler.h:405
void addNewParticles()
Adds new particles to the periodic particle lists.
Definition: PeriodicBoundaryHandler.cc:300
bool checkChanged(std::vector< int > previousComplexity, std::vector< int > complexity)
checks of two periodic complexities differ
Definition: PeriodicBoundaryHandler.cc:1012
std::vector< std::vector< MPIParticlePosition > > updatePositionDataSend_
Data container for position data that is being send to other processors.
Definition: PeriodicBoundaryHandler.h:378
void processReceivedInteractionData(int targetIndex, std::vector< BaseParticle * > &newParticles)
Process the received interaction data.
Definition: PeriodicBoundaryHandler.cc:615
void preparePositionAndVelocityUpdate()
Collects the position and velocity data from periodic boundaries.
Definition: PeriodicBoundaryHandler.cc:1628
int findTargetProcessor(const std::vector< int > &complexity)
For a given complexity this function returns the target processor.
Definition: PeriodicBoundaryHandler.cc:1250
Mdouble getInteractionDistance()
Returns the interaction distance.
Definition: PeriodicBoundaryHandler.cc:137
void findNewInteractions()
Finds interactions that accompany future ghost particles.
Definition: PeriodicBoundaryHandler.cc:1343
void updateParticles()
Updates position/velocity and periodic complexity of ghost particles.
Definition: PeriodicBoundaryHandler.cc:860
std::vector< std::vector< int > > periodicGhostComplexityReceive_
Data container for periodic complexity that is being received from other processors.
Definition: PeriodicBoundaryHandler.h:363
void collectInteractionData()
Collects interaction data into an MPI data structure.
Definition: PeriodicBoundaryHandler.cc:528
void addNewParticle(BaseParticle *particle)
Adds a new particle to the periodic list.
Definition: PeriodicBoundaryHandler.cc:333
void clearCommunicationLists()
Removes all ghost particles and bookkeeping for a fresh start.
Definition: PeriodicBoundaryHandler.cc:1807
PeriodicBoundaryHandler()
Default constructor, it creates an empty PeriodicBoundaryHandler.
Definition: PeriodicBoundaryHandler.cc:42
std::vector< std::vector< MPIParticleVelocity > > updateVelocityDataReceive_
Data container for velocity data that is being received from other processors.
Definition: PeriodicBoundaryHandler.h:383
void processReceivedGhostParticleData(int targetIndex, std::vector< BaseParticle * > &newParticles)
Processes the received ghost data, creates a ghost particle and does some book keeping.
Definition: PeriodicBoundaryHandler.cc:560
std::vector< std::vector< MPIParticle > > periodicGhostParticleSend_
Data container for particles that are being send to other processors.
Definition: PeriodicBoundaryHandler.h:358
void finaliseNewParticleTransmission()
creates the ghost particles and performs some bookkeeping to keep track of them
Definition: PeriodicBoundaryHandler.cc:1586
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 boun...
void readAndAddObject(std::istream &is) override
Pure virtual function needs implementation, but it does nothing for the periodicBoudnaryHandler.
Definition: PeriodicBoundaryHandler.cc:109
std::string getName() const override
Returns the name of the handler, namely the string "PeriodicBoundaryHandler".
Definition: PeriodicBoundaryHandler.cc:117
void processLocalGhostParticles(std::vector< BaseParticle * > &newParticles)
Creates ghost particles of periodic particles that are located on the same processor.
Definition: PeriodicBoundaryHandler.cc:805
void findNewParticles()
Loops over all particles in the simulation to check if they need to be added to the periodic lists.
Definition: PeriodicBoundaryHandler.cc:1328
std::vector< std::vector< MPIParticle > > periodicGhostParticleReceive_
Data container for particles that are being received from other processors.
Definition: PeriodicBoundaryHandler.h:353
void cleanCommunicationList(std::vector< MpiPeriodicParticleIDBase * > &list)
Removes the nullptr's from a communication list.
Definition: PeriodicBoundaryHandler.cc:1759
void updateParticleStatus(std::set< BaseParticle * > &particlesToBeDeleted)
Updates the status of periodic particles and ghost particles.
Definition: PeriodicBoundaryHandler.cc:1036
bool checkIsReal(std::vector< int > complexity)
checks if a periodic complexity is real
Definition: PeriodicBoundaryHandler.cc:988
std::vector< int > receiveTargetList_
A list that keeps track which target processors the current processor is receiving new particles from...
Definition: PeriodicBoundaryHandler.h:320
std::vector< int > numberOfNewInteractionsSend_
Stores the number of new interactions to be send to target processor corresponding to sendTargetList_...
Definition: PeriodicBoundaryHandler.h:343
std::vector< PeriodicGhostList > periodicGhostList_
A vector the size of the number of processors, each entry containing a vector of ghost periodioc part...
Definition: PeriodicBoundaryHandler.h:424
std::vector< std::vector< MPIParticleVelocity > > updateVelocityDataSend_
Data container for velocity data that is being send to other processors.
Definition: PeriodicBoundaryHandler.h:388
void setInteractionDistance(Mdouble interactionDistance)
Sets the interaction distance.
Definition: PeriodicBoundaryHandler.cc:128
void flushParticles(std::set< BaseParticle * > &particlesToBeFlushed)
Removes particles from the periodiocParticleList_ and periociGhostList_.
Definition: PeriodicBoundaryHandler.cc:1705
std::vector< std::vector< int > > periodicGhostComplexitySend_
Data container for periodic complexity that is being send to other processors.
Definition: PeriodicBoundaryHandler.h:368
std::vector< int > numberOfNewInteractionsReceive_
Stores the number of new interactions to be received from target processor corresponding to receiveTa...
Definition: PeriodicBoundaryHandler.h:348
void finalisePositionAndVelocityUpdate()
Communicates position and velocity data from periodic boundaries and updates ghost particles.
Definition: PeriodicBoundaryHandler.cc:1692
std::vector< int > sendTargetList_
A list that keeps track to which targets this processor is sending new particles to.
Definition: PeriodicBoundaryHandler.h:326
void findNewParticle(BaseParticle *particle)
Checks if a particle is in the periodic domain, but are not flagged as being in the periodic domain.
Definition: PeriodicBoundaryHandler.cc:1271
void collectGhostParticleData()
Collects ghost particle data that needs to be be sent to other processors.
Definition: PeriodicBoundaryHandler.cc:497
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73