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

◆ BlockForestDomain()

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

Member Function Documentation

◆ correctParticlePosition()

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.

◆ findContainingProcessRank()

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.

◆ getNeighborProcesses()

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.

◆ getNumLocalAABBs()

size_t walberla::mesa_pd::domain::BlockForestDomain::getNumLocalAABBs ( ) const
inline

◆ getNumNeighborProcesses()

size_t walberla::mesa_pd::domain::BlockForestDomain::getNumNeighborProcesses ( ) const
inline

◆ getNumNeighborSubdomains()

size_t walberla::mesa_pd::domain::BlockForestDomain::getNumNeighborSubdomains ( ) const
inline

◆ getUnionOfLocalAABBs()

const math::AABB& walberla::mesa_pd::domain::BlockForestDomain::getUnionOfLocalAABBs ( ) const
inline

◆ intersectsWithProcessSubdomain()

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.

◆ isContainedInLocalSubdomain()

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.

◆ isContainedInProcessSubdomain() [1/2]

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.

◆ isContainedInProcessSubdomain() [2/2]

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

◆ isInsideGlobalDomain()

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

◆ periodicallyMapToDomain()

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.

◆ refresh()

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

◆ blockForest_

std::shared_ptr<blockforest::BlockForest> walberla::mesa_pd::domain::BlockForestDomain::blockForest_
private

◆ localAABBs_

std::vector<math::AABB> walberla::mesa_pd::domain::BlockForestDomain::localAABBs_
private

◆ neighborProcesses_

std::vector<uint_t> walberla::mesa_pd::domain::BlockForestDomain::neighborProcesses_
private

◆ neighborSubdomains_

std::vector<Subdomain> walberla::mesa_pd::domain::BlockForestDomain::neighborSubdomains_
private

◆ ownRank_

int walberla::mesa_pd::domain::BlockForestDomain::ownRank_ = -1
private

◆ periodic_

std::array< bool, 3 > walberla::mesa_pd::domain::BlockForestDomain::periodic_
private

◆ unionOfLocalAABBs_

math::AABB walberla::mesa_pd::domain::BlockForestDomain::unionOfLocalAABBs_
private

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