45 logger(
DEBUG,
"PeriodicBoundaryHandler::PeriodicBoundaryHandler() finished");
58 logger(
DEBUG,
"PeriodicBoundaryHandler::PeriodicBoundaryHandler(const PeriodicBoundaryHandler &BH) finished");
73 logger(
DEBUG,
"PeriodicBoundaryHandler PeriodicBoundaryHandler::operator =(const BoundaryHandler& rhs)");
85 logger(
DEBUG,
"PeriodicBoundaryHandler::~PeriodicBoundaryHandler() finished");
92 #ifdef MERCURY_USE_MPI
119 return "PeriodicBoundaryHandler";
185 int boundaryIndex = 0;
188 if (complexity[boundaryIndex] == -1)
215 periodicComplexity.resize(this->
getSize());
216 totalPeriodicComplexity = 0;
226 periodicComplexity[index] = 1;
227 totalPeriodicComplexity++;
229 else if (distance < 0)
232 periodicComplexity[index] = -1;
240 periodicComplexity[index] = -1;
245 periodicComplexity[index] = 1;
246 totalPeriodicComplexity++;
254 periodicComplexity[index] = -2;
258 periodicComplexity[index] = 2;
284 std::vector<int> periodicComplexity;
285 int totalPeriodicComplexity;
289 return periodicComplexity;
302 #ifdef MERCURY_USE_MPI
335 #ifdef MERCURY_USE_MPI
340 if (
getDPMBase()->getCurrentDomain()->containsParticle(particle))
359 unsigned int sum = 0;
378 int numberOfMPIParticles = 0;
379 for (
int pIndex = 0; pIndex < index.size(); pIndex++)
381 if (index[pIndex]->particle->isMPIParticle() ==
true)
383 numberOfMPIParticles++;
386 sum += (index.size() - numberOfMPIParticles);
410 isInMPIDomain =
false;
411 isMPIParticle =
false;
415 isInMPIDomain =
true;
416 isMPIParticle =
false;
424 isInMPIDomain =
true;
425 isMPIParticle =
true;
429 isInMPIDomain =
false;
430 isMPIParticle =
true;
447 getMPIFlags(particle, isInMPIDomain, isMPIParticle);
466 std::vector<int>& complexity,
int level)
472 list.push_back(complexity);
477 if (periodicComplexity[level - 1] == 1)
479 complexity[level - 1] = 1;
482 complexity[level - 1] = -1;
503 for (
int i = 0;
i < numberOfTargets;
i++)
513 for (
int k = 0; k <
getSize(); k++)
534 for (
int i = 0;
i < numberOfTargets;
i++)
540 unsigned int indexInteraction = 0;
573 std::vector<int> ghostPeriodicComplexity(
getSize());
574 for (
int k = 0; k <
getSize(); k++)
601 newParticles.push_back(pGhost);
620 unsigned int identificationP;
621 unsigned int identificationI;
622 bool isWallInteraction;
627 isWallInteraction, timeStamp);
635 if (particle->getId() == identificationP)
638 idOther = identificationI;
642 if (particle->getId() == identificationI)
645 idOther = identificationP;
651 if (isWallInteraction)
661 std::vector<BaseParticle*> interactingParticleList;
668 if (p2->getId() == idOther)
701 unsigned int identificationP;
702 unsigned int identificationI;
703 bool isWallInteraction;
708 isWallInteraction, timeStamp);
716 if (particle->getId() == identificationP)
719 idOther = identificationI;
723 if (particle->getId() == identificationI)
726 idOther = identificationP;
732 if (isWallInteraction)
743 std::vector<BaseParticle*> interactingParticleList;
746 if (interactingParticleList.empty())
755 if (p2->getId() == idOther)
761 if (otherParticle ==
nullptr)
848 newParticles.push_back(pGhost);
871 if (numberOfParticles > 0)
885 for (
int p = 0; p < numberOfParticles; p++)
896 "Periodic particle lists are not in syc");
923 std::vector<int> previousRealPeriodicComplexity =
periodicGhostList_[
i][p]->realPeriodicComplexity;
926 std::vector<int> periodicComplexity(
getSize());
927 for (
int b = 0; b <
getSize(); b++)
930 * realPeriodicComplexity[b]
932 periodicComplexity[b] = sign * abs(realPeriodicComplexity[b]);
934 if (periodicComplexity[b] == -3)
936 periodicComplexity[b] = 1;
942 for (
int b = 0; b <
getSize(); b++)
944 objects_[b]->modifyGhostAfterCreation(pGhost, b);
965 if ((particle->isInPeriodicDomain()) && !(particle->isPeriodicGhostParticle()))
968 particle->setPreviousPeriodicComplexity(particle->getPeriodicComplexity());
969 std::vector<int> periodicComplexity;
970 int totalPeriodicComplexity;
973 for (
int b = 0; b <
getSize(); b++)
975 objects_[b]->modifyPeriodicComplexity(periodicComplexity, totalPeriodicComplexity, particle, b);
977 particle->setPeriodicComplexity(periodicComplexity);
1015 const std::vector<int> currentComplexity)
1017 bool changed =
false;
1019 for (
int i = 0;
i < currentComplexity.size();
i++)
1021 if (previousComplexity[
i] != currentComplexity[
i])
1043 std::set<MpiPeriodicParticleID*> deletePeriodicIDList;
1044 std::set<MpiPeriodicGhostParticleID*> deletePeriodicGhostIDList;
1045 std::set<BaseParticle*> specialUpdateParticleList;
1048 for (
int i = 0;
i < numberOfProcessors;
i++)
1054 for (
int p = 0; p < numberOfPeriodicParticles; p++)
1080 particlesToBeDeleted.insert(particle);
1084 deletePeriodicIDList.insert(ppid);
1097 getMPIFlags(particle, isInMPIDomain, isMPIParticle);
1100 if (isMPIParticleOld != isMPIParticle)
1103 deletePeriodicIDList.insert(ppid);
1113 deletePeriodicIDList.insert(ppid);
1121 for (
int p = 0; p < numberOfPeriodicGhostParticles; p++)
1136 if (isInMPIDomainOld)
1149 particlesToBeDeleted.insert(pGhost);
1150 deletePeriodicGhostIDList.insert(pgid);
1165 logger(
VERBOSE,
"PGMG moved out of domain: Deleting particle.");
1166 particlesToBeDeleted.insert(pGhost);
1167 deletePeriodicGhostIDList.insert(pgid);
1181 for (
int b = 0; b <
getSize(); b++)
1183 objects_[b]->modifyPeriodicComplexity(pc, tpc, pGhost, b);
1197 particlesToBeDeleted.insert(pGhost);
1213 particlesToBeDeleted.insert(pGhost);
1217 deletePeriodicGhostIDList.insert(pgid);
1225 for (
auto ppid_it : deletePeriodicIDList)
1230 for (
auto pgid_it : deletePeriodicGhostIDList)
1282 int totalPeriodicComplexity;
1283 std::vector<int> periodicComplexity;
1287 for (
int b = 0; b <
getSize(); b++)
1289 objects_[b]->modifyPeriodicComplexity(periodicComplexity, totalPeriodicComplexity, particle, b);
1296 std::vector<std::vector<int> > list(0);
1297 if (totalPeriodicComplexity > 0)
1306 for (
int i = 1;
i < list.size();
i++)
1319 logger(
VERBOSE,
"Adding a periodic particle with id % and real particle position: %",
1334 for (
auto particle_it =
getDPMBase()->particleHandler.begin();
1357 std::vector<BaseInteraction*> interactions = particle->
getInteractions();
1365 if (particle == particleP)
1399 #ifdef MERCURY_USE_MPI
1401 int numberOfTargetDomainsLocal = 0;
1406 numberOfTargetDomainsLocal++;
1413 std::vector<int> numberOfTargetDomains(NUMBER_OF_PROCESSORS);
1417 std::vector<int> receiveTargetList;
1420 if (numberOfTargetDomains[index] > 0)
1428 receiveTargetList.resize(numberOfTargetDomains[index], 0);
1433 for (
int i = 0;
i < receiveTargetList.size();
i++)
1519 for (
int i = 0;
i < numberOfTargetsReceive;
i++)
1531 for (
int i = 0;
i < numberOfTargetsSend;
i++)
1558 for (
int i = 0;
i < numberOfTargetsReceive;
i++)
1567 receiveCount, processor, tagReceive);
1577 if (receiveCount > 0)
1586 communicator.
sync();
1594 std::vector<BaseParticle*> newGhostParticles;
1600 std::vector<BaseParticle*> newGhostParticles;
1625 for (
auto&
i : newPeriodicParticleList_)
1638 for (
unsigned int i = 0;
i < numberOfProcessors;
i++)
1641 if (numberOfParticles > 0 &&
i != processorID)
1648 for (
unsigned int p = 0; p < numberOfParticles; p++)
1656 unsigned int count = numberOfParticles;
1657 unsigned int processor =
i;
1668 for (
int i = 0;
i < numberOfProcessors;
i++)
1671 if (numberOfParticles > 0 &&
i != processorID)
1678 int count = numberOfParticles;
1692 communicator.
sync();
1714 std::set<MpiPeriodicParticleIDBase*> toBeDeleted;
1715 for (
auto p_it : particlesToBeFlushed)
1723 if (p_it == p->particle)
1725 toBeDeleted.insert(p);
1738 if (p_it == p->particle)
1740 toBeDeleted.insert(p);
1749 for (
auto id_it : toBeDeleted)
1764 for (
int i = 0;
i < list.size();
i++)
1766 if (list[
i] ==
nullptr)
1768 list[
i] = list.back();
1818 for (
int j = 0; j <
i.size(); j++)
1827 for (
int j = 0; j <
i.size(); j++)
1836 std::set<BaseParticle*> toBeDeleted;
1839 if (particle->isPeriodicGhostParticle())
1841 toBeDeleted.insert(particle);
1845 particle->setInPeriodicDomain(
false);
1856 pH.removeGhostObject(particle->getIndex());
1873 for (
int b = 0; b <
getSize(); b++)
1879 logger(
VERBOSE,
"particle % with position % goes into outflow domain, new ID = %", particle->
getId(),
1883 particle->
setId(newID);
std::vector< int > numberOfNewInteractionsSend_
Stores the number of new interactions to be send to target processor corresponding to sendTargetList_...
This class contains all information and functions required for communication between processors...
std::vector< int > realPeriodicComplexity
void performNewParticleTransmission()
Collects and sends the ghost particle data.
unsigned int getId() const
Returns the unique identifier of any particular object.
void addNewParticle(BaseParticle *particle)
Adds a new particle to the periodic list.
bool isInInnerDomain(BaseParticle *particle)
Check if the particle is in the current domain but not in the communication zone. ...
std::vector< MpiPeriodicGhostParticleID * > PeriodicGhostList
std::vector< std::vector< int > > periodicGhostComplexityReceive_
Data container for periodic complexity that is being received from other processors.
bool isInPeriodicDomain() const
Indicates if the particle is in the periodic boundary communication zone.
void finalisePositionAndVelocityUpdate()
Communicates position and velocity data from periodic boundaries and updates ghost particles...
bool checkChanged(std::vector< int > previousComplexity, std::vector< int > complexity)
checks of two periodic complexities differ
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
static MPIContainer & Instance()
fetch the instance to be used for communication
Mdouble X
the vector components
Domain * getCurrentDomain()
Function that returns a pointer to the domain corresponding to the processor.
std::vector< MpiPeriodicParticleID * > PeriodicList
A spherical particle is the most simple particle used in MercuryDPM.
void setPreviousPeriodicComplexity(std::vector< int > complexity)
Set the previous periodic communication complexity of the paritcle.
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
virtual void hGridGetInteractingParticleList(BaseParticle *obj, std::vector< BaseParticle * > &list)
Creates a list of neighbour particles obtained from the hgrid.
bool isMaserParticle() const
Indicates if this particle belongs to the maser boundary.
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
void setInMPIDomain(bool flag)
Flags the status of the particle if wether it is in the communication zone or not.
void updateParticleStatus(std::set< BaseParticle * > &particlesToBeDeleted)
Updates the status of periodic particles and ghost particles.
virtual Mdouble getDistance(const BaseParticle &particle) const =0
Returns the distance between a particle and the closest boundary, required for any periodic boundary...
void communicateTargetDomains()
Creats a list of send and receive targets for periodic/ghost particles.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here...
void setDPMBase(DPMBase *DPMBase)
Sets the problem that is solved using this handler.
virtual void shiftPosition(BaseParticle *particle) const =0
Shifts the position (and velocity) of to the ghost particle.
void processLocalGhostParticles(std::vector< BaseParticle * > &newParticles)
Creates ghost particles of periodic particles that are located on the same processor.
void finaliseNewParticleTransmission()
creates the ghost particles and performs some bookkeeping to keep track of them
void * createMPIInteractionDataArray(unsigned int numberOfInteractions) const
creates an empty MPIInteractionDataArray
const std::vector< int > & getPreviousPeriodicComplexity() const
Sets the previous periodic communication complexity of the particle.
BaseInteraction * getInteractionWith(BaseParticle *P, unsigned timeStamp, InteractionHandler *interactionHandler) override
Checks if particle is in interaction with given particle P, and if so, returns vector of pointer to t...
T * getObjectById(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
std::vector< std::vector< int > > periodicGhostComplexitySend_
Data container for periodic complexity that is being send to other processors.
std::vector< std::vector< MPIParticleVelocity > > updateVelocityDataSend_
Data container for velocity data that is being send to other processors.
void updateMaserParticle(BaseParticle *particle)
Updates the maser flag of particles leaving the maser.
const std::complex< Mdouble > i
void flushParticles(std::set< BaseParticle * > &toBeDeletedList)
Particles that are going to be deleted from the simulation are flushed out of the communication bound...
std::enable_if< std::is_scalar< T >::value, void >::type receive(T &t, int from, int tag)
asynchronously receive a scalar from some other processor.
virtual BaseInteraction * getInteractionWith(BaseParticle *P, unsigned timeStamp, InteractionHandler *interactionHandler)=0
Returns the interaction between this object and a given BaseParticle.
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
void addGhostObject(int fromPrcessor, int toProcessor, BaseParticle *p)
Adds a ghost particle located at fromProcessor to toProcessor.
bool containsParticle(BaseParticle *particle, Mdouble offset=0.0)
Check to see if a given particle is within the current domain.
MpiPeriodicParticleIDBase MpiPeriodicParticleID
std::size_t getNumberOfProcessors() const
Get the total number of processors participating in this simulation.
Mdouble interactionDistance_
The interaction distance between a position and the boundary for which particles start to participate...
DomainHandler domainHandler
An object of the class DomainHandler which deals with parallel code.
std::vector< PeriodicList > newPeriodicParticleList_
Mdouble getNumberOfTruePeriodicGhostParticles()
Returns the number of particles that are flagged as periodicGhostParticles, but not as MPIParticles...
void flushParticles(std::set< BaseParticle * > &particlesToBeFlushed)
Removes particles from the periodiocParticleList_ and periociGhostList_.
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
bool isInGreaterDomain(BaseParticle *particle)
Check to see if a given particle is in the current domain or in neighbouring communication zones...
void findNewParticle(BaseParticle *particle)
Checks if a particle is in the periodic domain, but are not flagged as being in the periodic domain...
bool checkIsReal(std::vector< int > complexity)
checks if a periodic complexity is real
int sign(T val)
This is a sign function, it returns -1 for negative numbers, 1 for positive numbers and 0 for 0...
std::vector< int > numberOfNewInteractionsReceive_
Stores the number of new interactions to be received from target processor corresponding to receiveTa...
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorphism.
int findTargetProcessor(const std::vector< int > &complexity)
For a given complexity this function returns the target processor.
void findNewParticles()
Loops over all particles in the simulation to check if they need to be added to the periodic lists...
void setPeriodicHandler(PeriodicBoundaryHandler *periodicHandler)
Sets the periodicBoundaryHandler, required for parallel periodic boundaries.
BaseInteraction * getInteractionWith(BaseParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override
Returns the interaction between this wall and a given particle, nullptr if there is no interaction...
std::vector< std::vector< MPIParticle > > periodicGhostParticleSend_
Data container for particles that are being send to other processors.
std::vector< std::vector< MPIParticlePosition > > updatePositionDataReceive_
Data container for position data that is being received from other processors.
Stores information about interactions between two interactable objects; often particles but could be ...
void collectGhostParticleData()
Collects ghost particle data that needs to be be sent to other processors.
void performActionsBeforeAddingParticles()
Actions that boundaries perform before adding new periodic/ghost particles.
void initialise()
Initialises the communication list vectors as they can not be determined on compile time...
std::vector< void * > interactionDataReceive_
Stores the interaction data that is going to be received.
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.
void setMPIFlags(BaseParticle *particle)
Sets the MPIParticle and isMPIParticle flags of a given particle.
std::vector< std::vector< BaseInteraction * > > newInteractionList_
Container to store pointers to all BasePeriodicBoundary objects.
std::vector< int > numberOfNewPeriodicGhostParticlesReceive_
A vector that stores how many new ghost particles will be received from other processors.
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle and sets the particleHandler and species...
~PeriodicBoundaryHandler() override
Destructor, it destructs the PeriodicBoundaryHandler and all BasePeriodicBoundary it contains...
std::size_t getProcessorID()
Reduces a scalar on all processors to one scalar on a target processor.
void getInteractionDetails(void *interactionData, unsigned int index, unsigned int &identificationP, unsigned int &identificationI, bool &isWallInteraction, unsigned &timeStamp)
reads the basic interaction details from an MPIInteractionDataArray
void processLocalInteractionData(std::vector< BaseParticle * > &newParticles)
Process the interaction data for local ghosts.
void communicateNumberOfNewParticlesAndInteractions()
Communicate the number of new particles and interactions to target processors.
void findNewInteractions()
Finds interactions that accompany future ghost particles.
void processPeriodicParticles()
Creates a periodioc particle ID for book keeping and moves the ID to the correct list.
static BaseParticle * newParticle()
MPIParticle copyDataFromParticleToMPIParticle(BaseParticle *p)
Copies data from a SuperQuadricParticle to an MPIParticle class and returns this. ...
void cleanCommunicationLists()
Removes nullptrs from boundaryParticleList_ and boundaryParticleListNeighbour_.
bool isInMPIDomain()
Indicates if the particle is in the communication zone of the mpi domain.
PeriodicBoundaryHandler operator=(const PeriodicBoundaryHandler &rhs)
Assignment operator, copies only the vector of BasePeriodicBoundary and sets the other variables to 0...
void updateStatus(std::set< BaseParticle * > &ghostParticlesToBeDeleted)
Updates the positions/velocity of ghost particles and accordingly the status of these particles...
void setPreviousPosition(const Vec3D &pos)
Sets the particle's position in the previous time step.
void addNewParticles()
Adds new particles to the periodic particle lists.
unsigned int getNumberOfPeriodicGhostParticles()
Returns the number of particles that are flagged is periodicGhostParticle.
void shiftParticle(BaseParticle *particle)
Shifts the position of the particle based on its current periodic complexity.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
std::string getName() const override
Returns the name of the handler, namely the string "PeriodicBoundaryHandler".
Container to store Interaction objects.
void cleanCommunicationLists()
void collectInteractionData()
Collects interaction data into an MPI data structure.
std::vector< int > targetPeriodicComplexity
std::vector< PeriodicGhostList > periodicGhostList_
A vector the size of the number of processors, each entry containing a vector of ghost periodioc part...
std::vector< PeriodicList > periodicParticleList_
A vector the size of the number of processors, each entry containing a vector of periodic particle ID...
std::vector< std::vector< MPIParticlePosition > > updatePositionDataSend_
Data container for position data that is being send to other processors.
std::vector< int > periodicComplexity
std::vector< BasePeriodicBoundary * > objects_
The actual list of Object pointers.
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. ...
void processReceivedInteractionData(int targetIndex, std::vector< BaseParticle * > &newParticles)
Process the received interaction data.
bool checkIfAddNewParticle(BaseParticle *particle)
std::vector< int > numberOfNewPeriodicGhostParticlesSend_
A vector that stores how many particles are going to be send to other processors. ...
InteractionHandler interactionHandler
An object of the class InteractionHandler.
void setNextId(unsigned int id)
bool isPeriodicGhostParticle() const
Indicates if this particle is a ghost in the periodic boundary.
Container to store all BaseParticle.
#define NUMBER_OF_PROCESSORS
For the MPI communication routines this quantity is often required. defining this macro makes the cod...
std::vector< void * > interactionDataSend_
Stores the interaction data that is going to be send.
MPIParticlePosition copyPositionFrom(BaseParticle *particle)
Copies the position from a particle to an MPIParticlePosition class.
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
std::enable_if< std::is_scalar< T >::value, void >::type broadcast(T &t, int fromProcessor=0)
Broadcasts a scalar from the root to all other processors.
int getParticleDomainGlobalIndex(BaseParticle *particle)
void setMaserParticle(bool flag)
Flags the status of the particle if it belongs to the maser boundary or not.
const std::vector< int > & getPeriodicComplexity()
Obtains the periodic communication complexity of the particle.
The simulation can be subdivided into Domain's used in parallel code.
PeriodicBoundaryHandler()
Default constructor, it creates an empty PeriodicBoundaryHandler.
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
void sync()
Process all pending asynchronous communication requests before continuing.
void prepareNewParticleTransmission()
Initial preparation work for sending ghost particles.
std::enable_if< std::is_scalar< T >::value, void >::type send(T &t, int to, int tag)
Asynchronously send a scalar to some other processor.
Vec3D getMiddle() const
Gives the middle of the domain.
void updateParticles()
Updates position/velocity and periodic complexity of ghost particles.
Domain * getCurrentDomain()
Gets the domain assigned to the processor.
int getParticleProcessor(int globalIndex)
void setPeriodicComplexity(std::vector< int > complexity)
Set the periodic communication complexity of the particle.
Mdouble getInteractionDistance()
Returns the interaction distance.
const Vec3D & getPreviousPosition() const
Returns the particle's position in the previous time step.
bool isMPIParticle() const
Indicates if this particle is a ghost in the MPI domain.
void setMPIParticle(bool flag)
Flags the mpi particle status.
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
void setPeriodicGhostParticle(bool flag)
Flags the status of the particle to be a ghost in periodic boundary or not.
void readAndAddObject(std::istream &is) override
Pure virtual function needs implementation, but it does nothing for the periodicBoudnaryHandler.
std::vector< int > computePeriodicComplexity(Vec3D position)
Computes the periodic complexity based on a given position.
std::vector< std::vector< MPIParticleVelocity > > updateVelocityDataReceive_
Data container for velocity data that is being received from other processors.
Defines the basic properties that a interactable object can have.
void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
virtual void setMPIInteraction(void *interactionDataArray, unsigned int index, bool resetPointers)
virtual void hGridUpdateMove(BaseParticle *, Mdouble)
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
virtual void performActionsBeforeAddingParticles()
Actions that need to be performed before adding new ghost particles.
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
void addObject(BasePeriodicBoundary *P) override
Adds a BasePeriodicBoundary to the PeriodicBoundaryHandler.
BaseParticle * otherParticle
MPIParticleVelocity copyVelocityFrom(BaseParticle *particle)
Copies the velocity from a particle to an MPIParticleVelocity class.
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
void preparePositionAndVelocityUpdate()
Collects the position and velocity data from periodic boundaries.
void cleanCommunicationList(std::vector< MpiPeriodicParticleIDBase * > &list)
Removes the nullptr's from a communication list.
void setInPeriodicDomain(bool flag)
Flags the status of the particle wether it is in the periodic communication zone or not...
const Quaternion & getOrientation() const
Returns the orientation of this BaseInteractable.
void processReceivedGhostParticleData(int targetIndex, std::vector< BaseParticle * > &newParticles)
Processes the received ghost data, creates a ghost particle and does some book keeping.
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
std::vector< std::vector< MPIParticle > > periodicGhostParticleReceive_
Data container for particles that are being received from other processors.
MpiPeriodicParticleIDBase MpiPeriodicGhostParticleID
void clearCommunicationLists()
Removes all ghost particles and bookkeeping for a fresh start.
virtual bool isClosestToLeftBoundary(const Vec3D &position) const =0
Returns true if it is closer to the left boundary than the right boundary.
void setId(unsigned long id)
Assigns a unique identifier to each object in the handler (container) which remains constant even aft...
std::vector< int > receiveTargetList_
A list that keeps track which target processors the current processor is receiving new particles from...
std::vector< int > sendTargetList_
A list that keeps track to which targets this processor is sending new particles to.
void setInteractionDistance(Mdouble interactionDistance)
Sets the interaction distance.