DomainHandler Class Referencefinal

Container to store all Domain. More...

#include <DomainHandler.h>

+ Inheritance diagram for DomainHandler:

Public Member Functions

 DomainHandler ()
 Default constructor, it creates an empty DomainHandler. More...
 
 DomainHandler (const DomainHandler &DH)
 Constructor that copies all Domain it contains. More...
 
DomainHandleroperator= (const DomainHandler &rhs)
 Assignment operator. More...
 
 ~DomainHandler () final
 Destructor, it destructs the DomainHandler and all Domain it contains. More...
 
void createMesh (std::vector< Mdouble > &simulationMin, std::vector< Mdouble > &simulationMax, std::vector< unsigned > &numberOfDomains, bool open)
 Creates a Cartesian square mesh in 3D. More...
 
void createDomains (std::vector< Mdouble > domainMin, std::vector< Mdouble > domainMax, std::vector< unsigned > &globalMeshIndex, std::vector< unsigned > &numberOfDomains, int dimCounter, std::vector< Mdouble > &meshSize, bool open)
 Recursive function that creates the domains for a 3D mesh. More...
 
void addObject (Domain *D) final
 Adds a Domain to the DomainHandler. More...
 
void readAndAddObject (std::istream &is) final
 reads a domain object More...
 
void readOldObject (std::istream &is)
 reads an old domain object More...
 
std::string getName () const final
 returns the name of the class More...
 
void setCurrentDomainIndex (unsigned int index)
 This sets a domain to the processor. More...
 
DomaingetCurrentDomain ()
 Gets the domain assigned to the processor. More...
 
const DomaingetCurrentDomain () const
 
unsigned int getCurrentDomainIndex () const
 Gets the domain index assigned to the processor. More...
 
void setNumberOfDomains (std::vector< unsigned > &numberOfdomains)
 Sets the number of domains in the domain handler. More...
 
std::vector< unsignedgetNumberOfDomains ()
 Gets the number of domains in the domain handler. More...
 
void setInteractionDistance (Mdouble interactionDistance)
 Sets the interaction distance of the domain handler. More...
 
Mdouble getInteractionDistance ()
 Gets the interaction distance of the domain handler. More...
 
int getParticleDomainGlobalIndex (BaseParticle *particle)
 
int getParticleProcessor (int globalIndex)
 
DomaingetParticleDomain (int globalIndex)
 
void updateStatus (std::set< BaseParticle * > &particlesToBeDeleted)
 
void updateVelocity ()
 
void addNewParticles ()
 
void initialise ()
 
- Public Member Functions inherited from BaseHandler< Domain >
 BaseHandler ()
 Default BaseHandler constructor, it creates an empty BaseHandler and assigns DPMBase_ to a null pointer. More...
 
 BaseHandler (const BaseHandler< Domain > &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< Domain > &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 (Domain *O)
 Adds an existing object to the BaseHandler without changing the id of the object. More...
 
virtual void addObject (Domain *object)
 Adds a new Object to the BaseHandler. More...
 
virtual void addGhostObject (Domain *O)
 Adds a new Object to the BaseHandler. called by the to avoid increasing the id. More...
 
void removeIf (const std::function< bool(Domain *)> cond)
 
virtual void removeObject (unsigned const int index)
 Removes an Object from the BaseHandler. More...
 
virtual void removeObjects (std::vector< unsigned int > indices)
 
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...
 
DomaingetObjectById (const unsigned int id)
 Gets a pointer to the Object at the specified index in the BaseHandler. More...
 
std::vector< Domain * > getObjectsById (const unsigned int id)
 Gets a vector of pointers to the objects with the specific id. More...
 
DomaingetObject (const unsigned int id)
 Gets a pointer to the Object at the specified index in the BaseHandler.
More...
 
const DomaingetObject (const unsigned int id) const
 Gets a constant pointer to the Object at the specified index in the BaseHandler. More...
 
DomaingetLastObject ()
 Gets a pointer to the last Object in this BaseHandler. More...
 
const DomaingetLastObject () 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 Domain &obj)
 Resizes the container to contain N elements. More...
 
const std::vector< Domain * >::const_iterator begin () const
 Gets the begin of the const_iterator over all Object in this BaseHandler. More...
 
const std::vector< Domain * >::iterator begin ()
 Gets the begin of the iterator over all BaseBoundary in this BaseHandler. More...
 
const std::vector< Domain * >::const_iterator end () const
 Gets the end of the const_iterator over all BaseBoundary in this BaseHandler. More...
 
const std::vector< Domain * >::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 (Domain *object, unsigned int id)
 
void increaseId ()
 
unsigned int getNextId ()
 
void setNextId (unsigned int id)
 
DPMBasegetDPMBase ()
 Gets the problem that is solved using this handler. More...
 
DPMBasegetDPMBase () 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

unsigned int currentDomainIndex_
 Index to the particular domain of this process. More...
 
std::vector< intglobalIndexToProcessorList_
 look-up table to find the processor of a domain given the globalIndex of the domain More...
 
std::vector< unsignednumberOfDomains_
 vector containing the number of domains in Cartesian direction More...
 
Mdouble interactionDistance_
 Interaction distance between a domain boundary and the communication zone boundary. More...
 

Additional Inherited Members

- Protected Attributes inherited from BaseHandler< Domain >
std::vector< Domain * > objects_
 The actual list of Object pointers. More...
 

Detailed Description

Container to store all Domain.

The DomainHandler is a container to store all Domain. It is implemented by a vector of pointers to domain. Additionally it also contains an index that points to the current domain of the processorID. Such that the processor knows which Domain it has to compute

Constructor & Destructor Documentation

◆ DomainHandler() [1/2]

DomainHandler::DomainHandler ( )

Default constructor, it creates an empty DomainHandler.

Constructor of the DomainHandler class. It creates and empty DomainHandler.

19 {
22  logger(DEBUG, "DomainHandler::DomainHandler() finished");
23 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ DEBUG
unsigned int currentDomainIndex_
Index to the particular domain of this process.
Definition: DomainHandler.h:140
Mdouble interactionDistance_
Interaction distance between a domain boundary and the communication zone boundary.
Definition: DomainHandler.h:155

References currentDomainIndex_, DEBUG, interactionDistance_, and logger.

◆ DomainHandler() [2/2]

DomainHandler::DomainHandler ( const DomainHandler DH)

Constructor that copies all Domain it contains.

Parameters
[in]DHThe DomainHandler that has to be copied.

This is not a copy constructor! It copies the DPMBase and all Domain, and sets the other variables to 0.

32 {
34  logger(DEBUG, "DomainHandler::DomainHandler(const DomainHandler &DH) finished");
35 }
void copyContentsFromOtherHandler(const BaseHandler< Domain > &BH)
Function that copies the contents (vector of pointers, maxObject_, nextId_, DPMBase_) from one handle...
Definition: BaseHandler.h:348

References BaseHandler< Domain >::copyContentsFromOtherHandler(), DEBUG, and logger.

◆ ~DomainHandler()

DomainHandler::~DomainHandler ( )
final

Destructor, it destructs the DomainHandler and all Domain it contains.

All Domain are destroyed, the DomainHandler afterwards.

57 {
58  logger(DEBUG, "DomainHandler::~DomainHandler() finished");
59 }

References DEBUG, and logger.

Member Function Documentation

◆ addNewParticles()

void DomainHandler::addNewParticles ( )
408 {
410 }
Domain * getCurrentDomain()
Gets the domain assigned to the processor.
Definition: DomainHandler.cc:228
void addNewParticles()
Initialises the MPIParticles by communicating newly found particles.
Definition: Domain.cc:1567

References Domain::addNewParticles(), and getCurrentDomain().

Referenced by DPMBase::performGhostParticleUpdate(), DPMBase::read(), and DPMBase::updateGhostGrid().

◆ addObject()

void DomainHandler::addObject ( Domain D)
final

Adds a Domain to the DomainHandler.

Parameters
[in]DA pointer to the Domain that has to be added.

Adds the object to the DomainHandler and sets the DomainHandler pointer in the Domain to this DomainHandler.

182 {
183  //Puts the particle in the Particle list
185  //set the particleHandler pointer
186  D->setHandler(this);
187 }
dominoes D
Definition: Domino.cpp:55
virtual void addObject(T *object)
Adds a new Object to the BaseHandler.
Definition: BaseHandler.h:412

References BaseHandler< T >::addObject(), and D.

◆ createDomains()

void DomainHandler::createDomains ( std::vector< Mdouble domainMin,
std::vector< Mdouble domainMax,
std::vector< unsigned > &  globalMeshIndex,
std::vector< unsigned > &  numberOfDomains,
int  dimCounter,
std::vector< Mdouble > &  meshSize,
bool  open 
)

Recursive function that creates the domains for a 3D mesh.

For a given dimension, dimCounter, compute the size of the domain, and accordingly create domains with the correct minimum and maximum value in the dimCounter-direction. When all bounds of a domain are set, i.e. dimCounter is zero, the domain is actually created.

Parameters
[in,out]domainMinThe minimum simulation values in Cartesian direction as input and the minimum domain values as output/input
[in]domainMaxThe maximum simulation values in Cartesian direction as input and the maximum domain values as output/input
[in]globalMeshIndexA Vector containing the mesh indices, i.e. (i,j,k) = (3,5,2)
[in]numberOfDomainsA vector containing the number of domains in Cartesian direction
[in]dimCounterThe dimension counter that keeps track in which direction the recursive function is working
[in]opendetermines if a domain boundary is open (inf) or closed
137 {
138  //
139  if (dimCounter == 0)
140  {
141  //Create a new domain
142  Domain domain(globalMeshIndex);
143  domain.setHandler(this);
144  const std::vector<double>& domainBoundMin = domainMin;
145  const std::vector<double>& domainBoundMax = domainMax;
146  domain.setBounds(domainBoundMin, domainBoundMax, true);
147  this->copyAndAddObject(domain);
148  }
149  else
150  {
151  dimCounter--;
152  //Compute size of a domain in the dimCounter'th direction.
153  Mdouble boundLeft = domainMin[dimCounter];
154  //Starting with the bound left, create the number of domains in the given dimCounter-direction
155  for (int i = 0; i < numberOfDomains[dimCounter]; i++)
156  {
157  globalMeshIndex[dimCounter] = i;
158  domainMin[dimCounter] = boundLeft + i * meshSize[dimCounter];
159  domainMax[dimCounter] = boundLeft + (i + 1) * meshSize[dimCounter];
160  if ((i == 0) && (open))
161  {
162  domainMin[dimCounter] = -constants::inf;
163  }
164 
165  if ((i == numberOfDomains[dimCounter] - 1) && (open))
166  {
167  domainMax[dimCounter] = constants::inf;
168  }
169 
170  //Start recursively a new createDomains function
171  createDomains(domainMin, domainMax, globalMeshIndex, numberOfDomains, dimCounter, meshSize, open);
172  }
173  }
174 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
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.
Definition: BaseHandler.h:360
void createDomains(std::vector< Mdouble > domainMin, std::vector< Mdouble > domainMax, std::vector< unsigned > &globalMeshIndex, std::vector< unsigned > &numberOfDomains, int dimCounter, std::vector< Mdouble > &meshSize, bool open)
Recursive function that creates the domains for a 3D mesh.
Definition: DomainHandler.cc:134
The simulation can be subdivided into Domain's used in parallel code.
Definition: Domain.h:42
const Mdouble inf
Definition: GeneralDefine.h:23
SteadyAxisymAdvectionDiffusion problem on rectangular domain
Definition: steady_axisym_advection_diffusion.cc:151

References BaseHandler< Domain >::copyAndAddObject(), domain, i, and constants::inf.

Referenced by createMesh().

◆ createMesh()

void DomainHandler::createMesh ( std::vector< Mdouble > &  simulationMin,
std::vector< Mdouble > &  simulationMax,
std::vector< unsigned > &  numberOfDomains,
bool  open 
)

Creates a Cartesian square mesh in 3D.

Creates a cartesian square mesh in 3D.

By default the number of domains should be 1 in each direction. The mesh creates the required 3D domains and then disables any domain boundaries that are not connected to another domain. Lookup tables are created between domains and ranks.

Parameters
[in]simulationMinThe minimum values of the simulation domain in cartesian coordinates
[in]simulationMaxThe maximum values of the simulation domain in cartesian coordinates
[in]numberOfDomainsThe number of domains in cartesian direction
[in]openDetermines if the boundary domains have infinite limits (true) or not (false)
73 {
74  //Clear the objects in the list, we're gonna make a new mesh, owyeah
75  objects_.clear();
76 
77  //Create the mesh
78  setNumberOfDomains(numberOfDomains);
79 
80  std::vector<unsigned> globalMeshIndex(3);
81  //Recursive function creating the domains
82  int dimCounter = 3;
83  //Compute the mesh size in each direction
84  std::vector<Mdouble> meshSize;
85  for (int d = 0; d < 3; d++)
86  {
87  meshSize.push_back((simulationMax[d] - simulationMin[d]) / numberOfDomains[d]);
88  }
89  //Create the domains
90  createDomains(simulationMin, simulationMax, globalMeshIndex, numberOfDomains, dimCounter, meshSize, open);
91 
92  //Create lookup tables
93  for (Domain* domain : objects_)
94  {
95  domain->setRank(domain->getGlobalIndex());
96  domain->createLookUpTable();
97  }
98 
99  //Disable boundaries that dont require communication
100  for (Domain* domain : objects_)
101  {
102  domain->disableBoundaries();
103  }
104 
105  //Output the result
106  std::string meshType;
107  if (open)
108  {
109  meshType = "open";
110  }
111  else
112  {
113  meshType = "closed";
114  }
115  if (PROCESSOR_ID == 0)
116  {
117  logger(INFO, "A simulation mesh has been created with % number of domains and % boundaries.", this->getSize(),
118  meshType);
119  }
120 }
#define PROCESSOR_ID
Definition: GeneralDefine.h:42
@ INFO
std::vector< Domain * > objects_
The actual list of Object pointers.
Definition: BaseHandler.h:283
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:663
void setNumberOfDomains(std::vector< unsigned > &numberOfdomains)
Sets the number of domains in the domain handler.
Definition: DomainHandler.cc:254
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References createDomains(), domain, BaseHandler< Domain >::getSize(), INFO, logger, BaseHandler< Domain >::objects_, PROCESSOR_ID, setNumberOfDomains(), and oomph::Global_string_for_annotation::string().

Referenced by DPMBase::decompose().

◆ getCurrentDomain() [1/2]

Domain * DomainHandler::getCurrentDomain ( )

Gets the domain assigned to the processor.

Returns a pointer to the active domain.

The active domain is the domain that was assigned to the processor

Returns
Pointer to a Domain on which the processor has to do computations
229 {
231 }
Domain * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:621

References currentDomainIndex_, and BaseHandler< Domain >::getObject().

Referenced by addNewParticles(), DPMBase::deleteGhostParticles(), PeriodicBoundaryHandler::findTargetProcessor(), DPMBase::getCurrentDomain(), PeriodicBoundaryHandler::getMPIFlags(), ParticleHandler::getNumberOfRealObjectsLocal(), DPMBase::insertGhostParticle(), DPMBase::mpiInsertParticleCheck(), DPMBase::mpiIsInCommunicationZone(), ForceLawsMPI2Test::printTime(), setInteractionDistance(), DPMBase::updateGhostGrid(), updateStatus(), and updateVelocity().

◆ getCurrentDomain() [2/2]

const Domain * DomainHandler::getCurrentDomain ( ) const

◆ getCurrentDomainIndex()

unsigned int DomainHandler::getCurrentDomainIndex ( ) const

Gets the domain index assigned to the processor.

Gets the Domain Index in the vector of the DomainHandler assigned to this processor

Returns
Index of a Domain on which the processor has to do computations
244 {
245  return currentDomainIndex_;
246 }

References currentDomainIndex_.

◆ getInteractionDistance()

Mdouble DomainHandler::getInteractionDistance ( )

Gets the interaction distance of the domain handler.

Gets the interaction distance of the communication zone.

The interaction distance is used to define how large the communication zone of the domains have to be. generally twice the size of the largest interaction radius

Returns
Returns the interaction distance of the communication zone
303 {
304  return interactionDistance_;
305 }

References interactionDistance_.

Referenced by Domain::findNearbyBoundaries(), Domain::isInGreaterDomain(), Domain::isInInnerDomain(), and DPMBase::updateGhostGrid().

◆ getName()

std::string DomainHandler::getName ( ) const
finalvirtual

returns the name of the class

Todo:
Still has to be implemented

Implements BaseHandler< Domain >.

209 {
210  return "DomainHandler";
211 }

◆ getNumberOfDomains()

std::vector< unsigned > DomainHandler::getNumberOfDomains ( )

Gets the number of domains in the domain handler.

The number of domains is given as a vector in the form of (nx,ny,nz) where nx,ny,nz are the number of domains in their respective direction

Returns
The number of domains in Cartesian direction
266 {
267  return numberOfDomains_;
268 }
std::vector< unsigned > numberOfDomains_
vector containing the number of domains in Cartesian direction
Definition: DomainHandler.h:150

References numberOfDomains_.

Referenced by Domain::createLookUpTable(), Domain::disableBoundaries(), and getParticleDomainGlobalIndex().

◆ getParticleDomain()

Domain * DomainHandler::getParticleDomain ( int  globalIndex)
Todo:
TW, Marnix should this be unsigned int?
393 {
394  return getObject(globalIndex);
395 }

References BaseHandler< Domain >::getObject().

◆ getParticleDomainGlobalIndex()

int DomainHandler::getParticleDomainGlobalIndex ( BaseParticle particle)
Todo:

MX: function under construction

TW, Marnix should this be unsigned int?

Todo:
MX: This function is still under development the goal of this function is to obtain the globalIndex of the domain the particle is located in
Todo:
this could possibly be stored in the domainHandler to save computational power
309 {
310  //Step 1: obtain values i,j,k by looking at the position
312  std::vector<int> decompositionVector(3);
313 
314  int i, j, k;
318 
319  //x-direction
320  if ((particle->getPosition().X - getDPMBase()->getXMin()) <= 0)
321  {
322  i = 0;
323  }
324  else
325  {
326  //Compute the relative domain cell it is in
327  i = floor((particle->getPosition().X - getDPMBase()->getXMin()) / dx);
328 
329  //Make sure we dont go over our number of domain bounds
330  if (i >= getDPMBase()->getNumberOfDomains()[0] - 1)
331  {
332  i = getDPMBase()->getNumberOfDomains()[0] - 1;
333  }
334  if (i < 0)
335  {
336  i = 0;
337  }
338  }
339 
340  //y-direction
341  if ((particle->getPosition().Y - getDPMBase()->getYMin()) <= 0)
342  {
343  j = 0;
344  }
345  else
346  {
347  j = floor((particle->getPosition().Y - getDPMBase()->getYMin()) / dy);
348 
349  //Make sure we dont go over our number of domain bounds
350  if (j >= getDPMBase()->getNumberOfDomains()[1] - 1)
351  {
352  j = getDPMBase()->getNumberOfDomains()[1] - 1;
353  }
354  if (i < 0)
355  {
356  j = 0;
357  }
358  }
359 
360  //z-direction
361  if ((particle->getPosition().Z - getDPMBase()->getZMin()) <= 0)
362  {
363  k = 0;
364  }
365  else
366  {
367  k = floor((particle->getPosition().Z - getDPMBase()->getZMin()) / dz);
368  //Make sure we dont go over our number of domain bounds
369  if (k >= getDPMBase()->getNumberOfDomains()[2] - 1)
370  {
371  k = getDPMBase()->getNumberOfDomains()[2] - 1;
372  }
373  if (k < 0)
374  {
375  k = 0;
376  }
377 
378  }
379 
380  //Step 2: obtain the processor number
381  int globalIndex = i +
382  getDPMBase()->getNumberOfDomains()[0] * j +
384  return globalIndex;
385 }
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:733
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:197
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:603
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:610
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:616
std::vector< unsigned > getNumberOfDomains()
returns the number of domains
Definition: DPMBase.cc:5369
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:622
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:634
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:628
std::vector< unsigned > getNumberOfDomains()
Gets the number of domains in the domain handler.
Definition: DomainHandler.cc:265
Mdouble Y
Definition: Kernel/Math/Vector.h:45
Mdouble Z
Definition: Kernel/Math/Vector.h:45
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45
char char char int int * k
Definition: level2_impl.h:374
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 floor(const bfloat16 &a)
Definition: BFloat16.h:643
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References Eigen::bfloat16_impl::floor(), BaseHandler< Domain >::getDPMBase(), getNumberOfDomains(), DPMBase::getNumberOfDomains(), BaseInteractable::getPosition(), DPMBase::getXMax(), DPMBase::getXMin(), DPMBase::getYMax(), DPMBase::getYMin(), DPMBase::getZMax(), DPMBase::getZMin(), i, j, k, Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by SubcriticalMaserBoundaryTEST::copyExtraParticles(), SubcriticalMaserBoundaryTEST::extendBottom(), and PeriodicBoundaryHandler::findTargetProcessor().

◆ getParticleProcessor()

int DomainHandler::getParticleProcessor ( int  globalIndex)
Todo:
TW, Marnix should this be unsigned int?
388 {
389  return globalIndex;//ToProcessorList_[globalIndex];
390 }

Referenced by SubcriticalMaserBoundaryTEST::copyExtraParticles(), SubcriticalMaserBoundaryTEST::extendBottom(), and PeriodicBoundaryHandler::findTargetProcessor().

◆ initialise()

void DomainHandler::initialise ( )
413 {
414  //Create a single domain
415  Domain domain;
416  domain.setHandler(this);
417  std::vector<double> domainBoundMin = {-constants::inf, -constants::inf, -constants::inf};
418  std::vector<double> domainBoundMax = {constants::inf, constants::inf, constants::inf};
419  domain.setBounds(domainBoundMin, domainBoundMax, false);
420  this->copyAndAddObject(domain);
422 }

References BaseHandler< Domain >::copyAndAddObject(), currentDomainIndex_, domain, and constants::inf.

Referenced by DPMBase::constructor(), and DPMBase::DPMBase().

◆ operator=()

DomainHandler & DomainHandler::operator= ( const DomainHandler rhs)

Assignment operator.

Parameters
[in]rhsThe DomainHandler on the right hand side of the assignment.

This is not a copy assignment operator! It copies the DPMBase and all Domain, and sets the other variables to 0.

43 {
44  if (this != &rhs)
45  {
46  clear();
48  }
49  logger(DEBUG, "DomainHandler DomainHandler::operator =(const DomainHandler& rhs)");
50  return *this;
51 }
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:536

References BaseHandler< Domain >::clear(), BaseHandler< Domain >::copyContentsFromOtherHandler(), DEBUG, and logger.

◆ readAndAddObject()

void DomainHandler::readAndAddObject ( std::istream &  is)
finalvirtual

reads a domain object

Todo:
Still has to be implemented

There is no need to read domain object, they can be computed easily

Implements BaseHandler< Domain >.

194 {
195 }

◆ readOldObject()

void DomainHandler::readOldObject ( std::istream &  is)

reads an old domain object

Todo:
Still has to be implemented

There is no need to read a domain object, they can be computed easily

202 {
203 }

◆ setCurrentDomainIndex()

void DomainHandler::setCurrentDomainIndex ( unsigned int  index)

This sets a domain to the processor.

Parameters
[in]indexAn integer to a Domain in the DomainHandler

Sets an index to a Domain in the DomainHandler which belongs to the current processor.

219 {
220  currentDomainIndex_ = index;
221 }

References currentDomainIndex_.

Referenced by DPMBase::decompose().

◆ setInteractionDistance()

void DomainHandler::setInteractionDistance ( Mdouble  interactionDistance)

Sets the interaction distance of the domain handler.

Sets the interaction distance of the domainHandler.

The interaction distance is used to define how large the communication zone of the domains have to be. generally twice the size of the largest interaction radius

Parameters
[in]interactionDistanceInteraction distance between domain boundary and communication zone boundary
278 {
279  //Update the interaction distance
280  interactionDistance_ = interactionDistance;
281 
282  //Check if the domainsize is not too small
284  logger.assert_always((domain->getDomainMax()[0] - domain->getDomainMin()[0]) > 2 * interactionDistance_,
285  "Size of the domain in x-direction is smaller than communication zone. Size: %, communication zone: %",
286  (domain->getDomainMax()[0] - domain->getDomainMin()[0]), 2 * interactionDistance_);
287  logger.assert_always((domain->getDomainMax()[1] - domain->getDomainMin()[1]) > 2 * interactionDistance_,
288  "Size of the domain in y-direction is smaller than communication zone. Size: %, communication zone: %",
289  (domain->getDomainMax()[1] - domain->getDomainMin()[1]), 2 * interactionDistance);
290  logger.assert_always((domain->getDomainMax()[2] - domain->getDomainMin()[2]) > 2 * interactionDistance_,
291  "Size of the domain in z-direction is smaller than communication zone. Size: %, communication zone: %",
292  (domain->getDomainMax()[2] - domain->getDomainMin()[2]), 2 * interactionDistance_);
293 }

References domain, getCurrentDomain(), interactionDistance_, and logger.

Referenced by DPMBase::read(), and DPMBase::updateGhostGrid().

◆ setNumberOfDomains()

void DomainHandler::setNumberOfDomains ( std::vector< unsigned > &  numberOfDomains)

Sets the number of domains in the domain handler.

The number of domains is given as a vector in the form of (nx,ny,nz) where nx,ny,nz are the number of domains in their respective direction

Parameters
[in}numberOfDomains the number of domains in Cartesian direction
255 {
256  numberOfDomains_ = numberOfDomains;
257 }

References numberOfDomains_.

Referenced by createMesh().

◆ updateStatus()

void DomainHandler::updateStatus ( std::set< BaseParticle * > &  particlesToBeDeleted)
398 {
399  getCurrentDomain()->updateStatus(particlesToBeDeleted);
400 }
void updateStatus(std::set< BaseParticle * > &ghostParticlesToBeDeleted)
Updates particles that are not in the current domain and communicates newly added particles.
Definition: Domain.cc:1612

References getCurrentDomain(), and Domain::updateStatus().

Referenced by DPMBase::performGhostParticleUpdate().

◆ updateVelocity()

void DomainHandler::updateVelocity ( )
403 {
405 }
void updateVelocity()
Updates MPI particle velocity at the half-time step.
Definition: Domain.cc:1627

References getCurrentDomain(), and Domain::updateVelocity().

Member Data Documentation

◆ currentDomainIndex_

unsigned int DomainHandler::currentDomainIndex_
private

Index to the particular domain of this process.

Referenced by DomainHandler(), getCurrentDomain(), getCurrentDomainIndex(), initialise(), and setCurrentDomainIndex().

◆ globalIndexToProcessorList_

std::vector<int> DomainHandler::globalIndexToProcessorList_
private

look-up table to find the processor of a domain given the globalIndex of the domain

◆ interactionDistance_

Mdouble DomainHandler::interactionDistance_
private

Interaction distance between a domain boundary and the communication zone boundary.

Referenced by DomainHandler(), getInteractionDistance(), and setInteractionDistance().

◆ numberOfDomains_

std::vector<unsigned> DomainHandler::numberOfDomains_
private

vector containing the number of domains in Cartesian direction

Referenced by getNumberOfDomains(), and setNumberOfDomains().


The documentation for this class was generated from the following files: