walberla::mesa_pd::domain::BlockForestDomain Class Reference

#include <BlockForestDomain.h>

+ Inheritance diagram for walberla::mesa_pd::domain::BlockForestDomain:

Classes

struct  Subdomain
 

Public Member Functions

 BlockForestDomain (const std::shared_ptr< blockforest::BlockForest > &blockForest)
 
void refresh ()
 If the BlockForest is changed this function has to be called in order to update all interal caches! More...
 
bool isContainedInProcessSubdomain (const uint_t rank, const Vec3 &pt) const override
 Is the point pt located inside the subdomain of the process with rank rank? More...
 
bool isContainedInLocalSubdomain (const Vec3 &pt, const real_t &radius) const override
 Is the sphere located inside the local subdomain? More...
 
bool isContainedInProcessSubdomain (const Vec3 &pt, const real_t &radius) const
 Is the sphere defined by pt and radius completely inside the local subdomin? More...
 
int findContainingProcessRank (const Vec3 &pt) const override
 Find the process rank which is responsible for pt. More...
 
void periodicallyMapToDomain (Vec3 &pt) const override
 Map the point pt periodically into the global domain. More...
 
std::vector< uint_tgetNeighborProcesses () const override
 Returns a vector of ranks from all neighboring processes. More...
 
bool intersectsWithProcessSubdomain (const uint_t rank, const Vec3 &pt, const real_t &radius) const override
 Does the sphere defined by pt and radius intersect with the subdomain of process rank? More...
 
void correctParticlePosition (Vec3 &pt) const override
 Correct the particle position in regard to the local subdomain. More...
 
const math::AABBgetUnionOfLocalAABBs () const
 
size_t getNumLocalAABBs () const
 
size_t getNumNeighborSubdomains () const
 
size_t getNumNeighborProcesses () const
 
- Public Member Functions inherited from walberla::mesa_pd::domain::IDomain
virtual ~IDomain ()=default
 

Private Member Functions

bool isInsideGlobalDomain (const Vec3 &pt, const real_t &radius) const
 

Private Attributes

std::shared_ptr< blockforest::BlockForestblockForest_
 
int ownRank_ = -1
 
std::array< bool, 3 > periodic_
 
std::vector< math::AABBlocalAABBs_
 
math::AABB unionOfLocalAABBs_
 
std::vector< SubdomainneighborSubdomains_
 
std::vector< uint_tneighborProcesses_
 

Constructor & Destructor Documentation

walberla::mesa_pd::domain::BlockForestDomain::BlockForestDomain ( const std::shared_ptr< blockforest::BlockForest > &  blockForest)
Postcondition
neighborSubdomains_ is sorted by rank

Member Function Documentation

void walberla::mesa_pd::domain::BlockForestDomain::correctParticlePosition ( Vec3 pt) const
overridevirtual

Correct the particle position in regard to the local subdomain.

Implements walberla::mesa_pd::domain::IDomain.

int walberla::mesa_pd::domain::BlockForestDomain::findContainingProcessRank ( const Vec3 pt) const
overridevirtual

Find the process rank which is responsible for pt.

Attention
No global information is required, just check local process and adjacent processes (periodicity!).
Precondition
pt will be always inside the global domain.
Returns
Returns the process rank or -1 if cannot be found within next neighbors.

Implements walberla::mesa_pd::domain::IDomain.

std::vector< uint_t > walberla::mesa_pd::domain::BlockForestDomain::getNeighborProcesses ( ) const
overridevirtual

Returns a vector of ranks from all neighboring processes.

Implements walberla::mesa_pd::domain::IDomain.

size_t walberla::mesa_pd::domain::BlockForestDomain::getNumLocalAABBs ( ) const
inline
size_t walberla::mesa_pd::domain::BlockForestDomain::getNumNeighborProcesses ( ) const
inline
size_t walberla::mesa_pd::domain::BlockForestDomain::getNumNeighborSubdomains ( ) const
inline
const math::AABB& walberla::mesa_pd::domain::BlockForestDomain::getUnionOfLocalAABBs ( ) const
inline
bool walberla::mesa_pd::domain::BlockForestDomain::intersectsWithProcessSubdomain ( const uint_t  rank,
const Vec3 pt,
const real_t radius 
) const
overridevirtual

Does the sphere defined by pt and radius intersect with the subdomain of process rank?

Parameters
ptcenter of the sphere
radiusradius of the sphere
Returns
If you have no information about the specified process return false.

Implements walberla::mesa_pd::domain::IDomain.

bool walberla::mesa_pd::domain::BlockForestDomain::isContainedInLocalSubdomain ( const Vec3 ,
const real_t  
) const
overridevirtual

Is the sphere located inside the local subdomain?

Attention
This function is used for an early out. Therefore returning true has to be correct, returning false can also be wrong.

Reimplemented from walberla::mesa_pd::domain::IDomain.

bool walberla::mesa_pd::domain::BlockForestDomain::isContainedInProcessSubdomain ( const uint_t  rank,
const Vec3 pt 
) const
overridevirtual

Is the point pt located inside the subdomain of the process with rank rank?

Attention
This function is supposed to check the local subdomain and next neighbor subdomains (periodicity). No global check is required!
Returns
If you have no information about the specified process return false.

Implements walberla::mesa_pd::domain::IDomain.

bool walberla::mesa_pd::domain::BlockForestDomain::isContainedInProcessSubdomain ( const Vec3 pt,
const real_t radius 
) const

Is the sphere defined by pt and radius completely inside the local subdomin?

Attention
Also take into account periodicity!
Parameters
ptcenter of the sphere
radiusradius of the sphere
bool walberla::mesa_pd::domain::BlockForestDomain::isInsideGlobalDomain ( const Vec3 pt,
const real_t radius 
) const
private
void walberla::mesa_pd::domain::BlockForestDomain::periodicallyMapToDomain ( Vec3 pt) const
overridevirtual

Map the point pt periodically into the global domain.

Postcondition
pt has to be located inside the global domain

Implements walberla::mesa_pd::domain::IDomain.

void walberla::mesa_pd::domain::BlockForestDomain::refresh ( )

If the BlockForest is changed this function has to be called in order to update all interal caches!

Updates the local caches for local and neighbor AABBs.

Postcondition
neighborSubdomains_ is sorted by rank

Member Data Documentation

std::shared_ptr<blockforest::BlockForest> walberla::mesa_pd::domain::BlockForestDomain::blockForest_
private
std::vector<math::AABB> walberla::mesa_pd::domain::BlockForestDomain::localAABBs_
private
std::vector<uint_t> walberla::mesa_pd::domain::BlockForestDomain::neighborProcesses_
private
std::vector<Subdomain> walberla::mesa_pd::domain::BlockForestDomain::neighborSubdomains_
private
int walberla::mesa_pd::domain::BlockForestDomain::ownRank_ = -1
private
std::array< bool, 3 > walberla::mesa_pd::domain::BlockForestDomain::periodic_
private
math::AABB walberla::mesa_pd::domain::BlockForestDomain::unionOfLocalAABBs_
private

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