 |
revision: v0.14
|
Go to the documentation of this file.
74 explicit Domain(std::vector<unsigned> globalMeshIndex);
101 void read(std::istream& is)
override;
106 void write(std::ostream& os)
const override;
111 std::string
getName()
const override;
121 void setBounds(std::vector<double> domainLeft, std::vector<double> domainRight,
bool computeMiddle);
322 void updateParticles(std::set<BaseParticle*>& ghostParticlesToBeDeleted);
370 T* receiveData,
unsigned receiveCount,
371 T* sendData,
unsigned sendCount,
unsigned localIndexNeighbour)
379 if (receiveCount != 0)
402 void updateStatus(std::set<BaseParticle*>& ghostParticlesToBeDeleted);
int globalIndex_
Global index of the domain in the mesh.
Definition: Domain.h:469
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...
Definition: BaseParticle.cc:678
void * createMPIInteractionDataArray(unsigned int numberOfInteractions) const
creates an empty MPIInteractionDataArray
Definition: InteractionHandler.cc:214
std::vector< std::vector< MPIParticle > > boundaryParticleDataReceive_
Container that keeps a list of MPIParticles that are being received by this domain.
Definition: Domain.h:547
Direction
An enum that indicates the direction in Cartesian coordinates.
Definition: GeneralDefine.h:77
std::vector< std::vector< MPIParticleVelocity > > updateVelocityDataSend_
Container that keeps a list of MPIParticleVelocities that are being send to other domains.
Definition: Domain.h:562
std::vector< unsigned > getGlobalMeshIndex()
Gets the global mesh index of the domain.
Definition: Domain.cc:355
std::vector< std::vector< BaseParticle * > > boundaryParticleList_
A list of boundary particles in the communication zone that are ghost particles on other domains.
Definition: Domain.h:502
void preparePositionAndVelocityUpdate()
Function that sends particle position and velocity data for ghost particles to other processors.
Definition: Domain.cc:1460
std::vector< unsigned > numberOfParticlesSend_
Counter that keeps track of the number of particles that are being send to other domains.
Definition: Domain.h:522
void cleanCommunicationList(std::vector< BaseParticle * > &list)
Removes nullptr's from a given particle list.
Definition: Domain.cc:1757
void finalisePositionAndVelocityUpdate(std::set< BaseParticle * > &ghostParticlesToBeDeleted)
processes position and velocity data for ghost particles
Definition: Domain.cc:1501
void setCommunicationComplexity(unsigned complexity)
Set the communication complexity of the particle.
Definition: BaseParticle.cc:190
bool isInGreaterDomain(BaseParticle *particle)
Check to see if a given particle is in the current domain or in neighbouring communication zones.
Definition: Domain.cc:420
void processReceivedBoundaryParticleData(unsigned index, std::vector< BaseParticle * > &newParticles)
Function that copies the mpi data format of a base particle to a real particle and adds it to the par...
Definition: Domain.cc:941
DomainHandler * domainHandler_
Pointer to the domain's DomainHandler container.
Definition: Domain.h:448
@ PARTICLE_DATA
Definition: MpiContainer.h:79
void read(std::istream &is) override
This function does nothing.
Definition: Domain.cc:186
void updateStatus(std::set< BaseParticle * > &ghostParticlesToBeDeleted)
Updates particles that are not in the current domain and communicates newly added particles.
Definition: Domain.cc:1633
Container to store Interaction objects.
Definition: InteractionHandler.h:44
void collectBoundaryParticleData(int localIndex)
collects the data of a particle that has to be communicated to other processors
Definition: Domain.cc:909
void findNewMPIParticle(BaseParticle *particle)
Function that check if a given particle should be added to the communication lists.
Definition: Domain.cc:800
void finaliseBoundaryDataTransmission()
This function processes the transmitted data.
Definition: Domain.cc:1262
Mdouble getComponent(int index) const
Returns the requested component of this Vec3D.
Definition: Vector.cc:194
bool isInCommunicationZone(BaseParticle *particle)
Check if the particle is in the communication zone of the current domain.
Definition: Domain.cc:441
@ YAXIS
Definition: GeneralDefine.h:78
Basic class for walls.
Definition: BaseWall.h:48
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
std::vector< unsigned > globalMeshIndex_
Vector containing the global mesh indices i,j,k.
Definition: Domain.h:474
void deleteMPIInteractionDataArray(void *dataArray)
deletes an MPIInteractionDataArray
Definition: InteractionHandler.cc:230
static BaseParticle * newParticle()
Definition: MpiDataClass.cc:157
std::vector< int > boundaryList_
A list of indices of all the active boundaries.
Definition: Domain.h:497
std::vector< void * > interactionDataReceive_
Container that keeps a void array of all the interaction data that is being received by this domain,...
Definition: Domain.h:577
Mdouble X
the vector components
Definition: Vector.h:65
#define MAX_PROC
Definition: GeneralDefine.h:51
void updateParticles(std::set< BaseParticle * > &ghostParticlesToBeDeleted)
This step updates all communication lists and particles in the communication zone.
Definition: Domain.cc:1308
std::vector< std::vector< BaseParticle * > > newBoundaryParticleList_
Array that queues particles that need to be transmitted.
Definition: Domain.h:512
T * getObjectById(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:565
int getGlobalIndex()
Gets the global index of the domain.
Definition: Domain.cc:346
bool isInInnerDomain(BaseParticle *particle)
Check if the particle is in the current domain but not in the communication zone.
Definition: Domain.cc:430
void disableBoundary(unsigned localIndex)
Disables a boundary of the domain with a neighbouring domain.
Definition: Domain.cc:378
bool inBoundary(BaseParticle *particle, int localIndex)
Definition: Domain.cc:578
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle and sets the particleHandler and species.
Definition: MpiDataClass.cc:105
void flushParticlesFromList(std::vector< BaseParticle * > &list, std::set< BaseParticle * > &toBeDeletedList)
Particles that are going to be deleted from the simulation are flushed out of a give communcation bou...
Definition: Domain.cc:1708
void cleanCommunicationLists()
Removes nullptrs from boundaryParticleList_ and boundaryParticleListNeighbour_.
Definition: Domain.cc:1742
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.
Definition: MpiContainer.h:221
Vec3D getMiddle() const
Gives the middle of the domain.
Definition: Domain.cc:1733
std::vector< std::vector< MPIParticlePosition > > updatePositionDataReceive_
Container that keeps a list of MPIParticlePositions that are being received by this domain.
Definition: Domain.h:557
Container to store all Domain.
Definition: DomainHandler.h:47
@ PARTICLE
Definition: MpiContainer.h:67
void updateVelocity()
Updates MPI particle velocity at the half-time step.
Definition: Domain.cc:1648
void setInMPIDomain(bool flag)
Flags the status of the particle if wether it is in the communication zone or not.
Definition: BaseParticle.cc:275
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
@ INTERACTION_COUNT
Definition: MpiContainer.h:83
void collectInteractionData(int localIndex)
Collects the data of an interaction that has to be communicated to other processors.
Definition: Domain.cc:924
Defines the basic properties that a interactable object can have.
Definition: BaseInteractable.h:55
int getRank()
Gets the rank associated with the assigned processorID.
Definition: Domain.cc:328
virtual Domain * copy() const
Function that creates a copy of this current domain, using the copy constructor.
Definition: Domain.cc:175
virtual void hGridUpdateMove(BaseParticle *, Mdouble)
Definition: DPMBase.cc:1924
Vec3D middle_
Middle of the closed domain.
Definition: Domain.h:463
void constructor()
contructor of a domain
Definition: Domain.cc:133
std::string getName() const override
Returns the name of the object.
Definition: Domain.cc:207
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
void addNewParticles()
Initialises the MPIParticles by communicating newly found particles.
Definition: Domain.cc:1588
Data class to send a particle force over MPI.
Definition: MpiDataClass.h:114
int getLocalIndex(int i, int j, int k)
return the local index of a domain given local mesh indices i,j and k
Definition: Domain.cc:498
std::vector< unsigned > numNewInteractionsSend_
Counter that keeps track of the number of interactions that are being send to other domains.
Definition: Domain.h:532
@ VELOCITY_DATA
Definition: MpiContainer.h:82
bool isInNewBoundaryParticleList(BaseParticle *object, int localIndex) const
Definition: Domain.cc:809
std::vector< int > localIndexToProcessorList_
look-up table to get the processor of the domain given a local domain index
Definition: Domain.h:486
bool containsParticle(BaseParticle *particle, Mdouble offset=0.0)
Check to see if a given particle is within the current domain.
Definition: Domain.cc:400
void finaliseVelocityUpdate()
Processes particle velocity data for ghost particles.
Definition: Domain.cc:1557
void setComponent(int index, double val)
Sets the requested component of this Vec3D to the requested value.
Definition: Vector.cc:217
void performBoundaryDataTransmission()
Collects data to be transmitted and then performs the transmission of the data.
Definition: Domain.cc:1221
Vec3D getMax() const
Definition: DPMBase.h:643
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:57
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
Definition: LiquidFilmParticle.h:36
std::vector< unsigned > numNewInteractionsReceive_
Counter that keeps track of the number of interactions that are being received by this domain.
Definition: Domain.h:537
void addGhostObject(int fromPrcessor, int toProcessor, BaseParticle *p)
Adds a ghost particle located at fromProcessor to toProcessor.
Definition: ParticleHandler.cc:283
std::vector< bool > getActiveBoundaryList()
Returns a list of boundaries that are active in mpi communication.
Definition: Domain.cc:387
void setRank(int rank)
Sets the rank associated with the assigned processorID.
Definition: Domain.cc:301
void updateParticleVelocity(int localIndex)
Updates the velocity of particles which are flagged as MPIParticles.
Definition: Domain.cc:1441
unsigned int getNumberOfMPIParticles()
Obtains the number of particles in the particleHandler that are MPIParticles.
Definition: Domain.cc:1664
std::vector< unsigned > getNumberOfDomains()
Gets the number of domains in the domain handler.
Definition: DomainHandler.cc:287
void setBounds(std::vector< double > domainLeft, std::vector< double > domainRight, bool computeMiddle)
Sets the domain bounds.
Definition: Domain.cc:268
@ XAXIS
Definition: GeneralDefine.h:78
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
@ PARTICLE_COUNT
Definition: MpiContainer.h:78
std::vector< std::vector< MPIParticle > > boundaryParticleDataSend_
Container that keeps a list of MPIParticles that are being send to other domains.
Definition: Domain.h:542
@ VELOCITY
Definition: MpiContainer.h:67
void createLookUpTable()
Create a look up table between local index system to global index system.
Definition: Domain.cc:451
std::vector< bool > activeBoundaryList_
A list of flags corresponding to an inactive or active boundary.
Definition: Domain.h:491
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
std::vector< int > getLocalIndexInverse(int localMeshIndex)
Definition: Domain.cc:515
void setGlobalMeshIndex(std::vector< unsigned > globalMeshIndex)
Sets the global mesh index of theh domain.
Definition: Domain.cc:365
std::vector< void * > interactionDataSend_
Container that keeps a void array of all the interaction data that are being send to other domains,...
Definition: Domain.h:572
unsigned int getNumberOfTrueMPIParticles()
Obtains the number of particles in the particleHandler that are MPIParticles, but NOT periodic partic...
Definition: Domain.cc:1679
void setMPIParticle(bool flag)
Flags the mpi particle status.
Definition: BaseParticle.cc:185
@ INTERACTION_DATA
Definition: MpiContainer.h:84
void write(std::ostream &os) const override
This function does nothing.
Definition: Domain.cc:197
@ POSITION
Definition: MpiContainer.h:67
@ INTERACTION
Definition: MpiContainer.h:67
The simulation can be subdivided into Domain's used in parallel code.
Definition: Domain.h:64
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1405
@ ZAXIS
Definition: GeneralDefine.h:78
void addParticle(BaseParticle *particle)
Initialises a single particle which is added during the simulation.
Definition: Domain.cc:1610
std::vector< std::vector< MPIParticlePosition > > updatePositionDataSend_
Container that keeps a list of MPIParticlePositions that are being send to other domains.
Definition: Domain.h:552
std::vector< unsigned > numberOfParticlesReceive_
Counter that keeps track of the number of particles that are being received by this domain.
Definition: Domain.h:527
void sync()
Process all pending asynchronous communication requests before continuing.
Definition: MpiContainer.h:152
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
Definition: InteractionHandler.cc:248
Mdouble Y
Definition: Vector.h:65
Data class to send a particle over MPI.
Definition: MpiDataClass.h:81
void setRange(Direction direction, Mdouble min, Mdouble max)
Sets the domain range in a given direction.
Definition: Domain.cc:219
void flushParticles(std::set< BaseParticle * > &toBeDeletedList)
Particles that are going to be deleted from the simulation are flushed out of the communication bound...
Definition: Domain.cc:1698
bool isInMPIDomain()
Indicates if the particle is in the communication zone of the mpi domain.
Definition: BaseParticle.cc:270
int rank_
Rank of the domain which identifies to which processor it belongs.
Definition: Domain.h:582
std::vector< double > domainMax_
Maximum domain bounds in the x,y and z direction.
Definition: Domain.h:458
MPIParticle copyDataFromParticleToMPIParticle(BaseParticle *p)
Copies data from a SuperQuadricParticle to an MPIParticle class and returns this.
Definition: MpiDataClass.cc:124
BaseParticle * findParticleInList(unsigned int identification, std::vector< BaseParticle * > particleList)
Searches for a particle with a specific id in a list of particles.
Definition: Domain.cc:529
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.
Definition: MpiContainer.h:171
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
It is an abstract base class due to the purely virtual functions declared below. Even if the function...
Definition: BaseObject.h:51
const int intMax
Definition: GeneralDefine.h:45
std::vector< double > domainMin_
Minimum domain bounds in the x,y and z direction.
Definition: Domain.h:453
void processReceivedInteractionData(unsigned index, std::vector< BaseParticle * > &newParticles)
Processes the received interactions from newly added mpi particles
Definition: Domain.cc:999
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
void processSentBoundaryParticles(unsigned index)
Bookkeep the newly send particles.
Definition: Domain.cc:977
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
void setPreviousPosition(const Vec3D &pos)
Sets the particle's position in the previous time step.
Definition: BaseParticle.cc:602
void setHandler(DomainHandler *handler)
Sets the domainHandler.
Definition: Domain.cc:337
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:725
void addParticlesToLists(BaseParticle *particle, std::vector< std::vector< BaseParticle * > > &list)
Function that adds the particles to the approriate boundary list.
Definition: Domain.cc:701
std::vector< int > localIndexToGlobalIndexTable_
look-up table to get the global index given a local domain index
Definition: Domain.h:480
Definition: BaseParticle.h:54
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.h:316
std::vector< std::vector< MPIParticleVelocity > > updateVelocityDataReceive_
Container that keeps a list of MPIParticleVelocities that are being received by this domain.
Definition: Domain.h:567
Vec3D getMin() const
Definition: DPMBase.h:637
Domain()
Default Domain constructor.
Definition: Domain.cc:48
void findNewMPIInteractions()
Finds interactions that have to be send over to another domain.
Definition: Domain.cc:824
void sendAndReceiveMPIData(MercuryMPITag tag, MercuryMPIType type, T *receiveData, unsigned receiveCount, T *sendData, unsigned sendCount, unsigned localIndexNeighbour)
Function that sends transmissionData/positionData/velocityData to other processors.
Definition: Domain.h:369
void debugInformation()
Definition: Domain.cc:1096
void sendAndReceiveCount(MercuryMPITag tag, unsigned &countReceive, unsigned &countSend, unsigned localIndexNeighbour)
A symmetric communication between two domains exchanging a send/recieve count.
Definition: Domain.cc:1119
std::vector< double > getDomainMax()
Gets the maximum domain bounds.
Definition: Domain.cc:319
Data class to send a particle velocity over MPI.
Definition: MpiDataClass.h:103
std::vector< std::vector< BaseInteraction * > > newInteractionList_
Array that queues interactions that need to be transmitted.
Definition: Domain.h:517
MPIParticlePosition copyPositionFrom(BaseParticle *particle)
Copies the position from a particle to an MPIParticlePosition class.
Definition: MpiDataClass.cc:174
Data class to send a particle position over MPI.
Definition: MpiDataClass.h:90
void prepareBoundaryDataTransmission()
Prepares the MPI transmission of particle and interaction data from particles in particleHandler.
Definition: Domain.cc:1146
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
virtual void hGridGetInteractingParticleList(BaseParticle *obj, std::vector< BaseParticle * > &list)
Creates a list of neighbour particles obtained from the hgrid.
Definition: DPMBase.h:961
MPIParticleVelocity copyVelocityFrom(BaseParticle *particle)
Copies the velocity from a particle to an MPIParticleVelocity class.
Definition: MpiDataClass.cc:190
~Domain() override
Destructor, destroys the domain.
Definition: Domain.cc:121
virtual BaseInteraction * getInteractionWith(BaseParticle *P, unsigned timeStamp, InteractionHandler *interactionHandler)=0
Returns the interaction between this object and a given BaseParticle.
Mdouble getInteractionDistance()
Gets the interaction distance of the domain handler.
Definition: DomainHandler.cc:324
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
MercuryMPIType
An enum that indicates what type of data is being send over MPI.
Definition: MpiContainer.h:66
Mdouble Z
Definition: Vector.h:65
bool isPeriodicGhostParticle() const
Indicates if this particle is a ghost in the periodic boundary.
Definition: BaseParticle.cc:291
virtual void setMPIInteraction(void *interactionDataArray, unsigned int index, bool resetPointers)
Definition: BaseInteraction.cc:859
void updateParticlePosition(int localIndex)
Updates the position of particles which are flagged as MPIParticles.
Definition: Domain.cc:1412
MercuryMPITag
An enum that facilitates the creation of unique communication tags in the parallel code.
Definition: MpiContainer.h:77
DomainHandler * getHandler() const
Gets the domainHandler.
Definition: Domain.cc:1578
Mdouble getSumOfInteractionRadii(const BaseParticle *particle) const
returns the sum of the radii plus the interactionDistance
Definition: BaseParticle.h:379
const Mdouble inf
Definition: GeneralDefine.h:44
unsigned getCommunicationComplexity()
Obtains the communication complexity of the particle.
Definition: BaseParticle.cc:195
std::vector< double > getDomainMin()
Gets the minimum domain bounds.
Definition: Domain.cc:310
Mdouble getLengthSquared() const
Calculates the squared length of this Vec3D: .
Definition: Vector.cc:184
@ POSITION_DATA
Definition: MpiContainer.h:80
std::vector< std::vector< BaseParticle * > > boundaryParticleListNeighbour_
a list of ghost particles on the current domain, which are real on the neighbour domain
Definition: Domain.h:507
void disableBoundaries()
disables all domain boundaries that have no neighbour
Definition: Domain.cc:597
std::vector< int > findNearbyBoundaries(BaseParticle *particle, Mdouble offset=0)
This function finds if a given particle is close to a given boundary.
Definition: Domain.cc:554
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1425
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
void findNewMPIParticles(const ParticleHandler &particleHandler)
Function that finds new particles in the particle handler that should be added to the communication l...
Definition: Domain.cc:786
virtual bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const =0
Pure virtual function that computes the distance of a BaseParticle to this wall and returns the norma...
void prepareVelocityUpdate()
Function that sends particle velocity data for ghost particles.
Definition: Domain.cc:1529
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:76
static MPIContainer & Instance()
fetch the instance to be used for communication
Definition: MpiContainer.h:134