walberla::pe::MPIRigidBodyTrait Class Reference

Detailed Description

Base class for a specialization of the RigidBodyTrait class template for MPI parallel solvers.

This class adds functionality to track which process owns the rigid body and which processes have remote copies of the body in case it is owned by this process.

#include <MPIRigidBodyTrait.h>

Public Types

using ShadowOwnersIterator = ShadowOwners::iterator
 Iterator over the connected processes. More...
 
using ConstShadowOwnersIterator = ShadowOwners::const_iterator
 ConstIterator over the connected processes. More...
 
using SizeType = size_t
 

Public Member Functions

Constructor
 MPIRigidBodyTrait ()
 Default implementation of the MPIRigidBodyTrait constructor. More...
 
Destructor
virtual ~MPIRigidBodyTrait ()=default
 
Get functions
OwnergetOwner ()
 Returns the rank of the owner process. More...
 
const OwnergetOwner () const
 
void setOwner (const Owner &owner)
 Returns the rank of the owner process. More...
 
shadow owners functions
void registerShadowOwner (const Owner &owner)
 Registering a new remote process the rigid body is contained in. More...
 
void deregisterShadowOwner (const Owner &owner)
 Deregistering a remote process from the rigid body. More...
 
bool isShadowOwnerRegistered (const Owner &owner) const
 Checks whether the given remote process is registered with the rigid body. More...
 
bool hasShadowOwners () const
 Returns whether any processes are registered with the rigid body. More...
 
ShadowOwnersIterator beginShadowOwners ()
 Returns an iterator to the first remote process the rigid body is contained in. More...
 
ConstShadowOwnersIterator beginShadowOwners () const
 
ShadowOwnersIterator endShadowOwners ()
 Returns an iterator just past the last process the rigid body is contained in. More...
 
ConstShadowOwnersIterator endShadowOwners () const
 
SizeType sizeShadowOwners () const
 Returns the number of registered processes. More...
 
void clearShadowOwners ()
 Removing all registered remote processes from the rigid body. More...
 
cache information functions
void setBlockState (const BlockID &id)
 
void unsetBlockState (const BlockID &id)
 
bool getBlockState (const BlockID &id) const
 
size_t getBlockStateSize () const
 
void clearBlockStates ()
 

Protected Types

using ShadowOwners = std::vector< Owner >
 Vector for remote MPI processes the rigid body is contained in. More...
 
using BlockStates = std::set< BlockID >
 Stores the information if neighbor block knows about object. More...
 

Private Attributes

Member variables
ShadowOwners shadowOwners_
 Vector of all processes the rigid body intersects with. More...
 
BlockStates blockStates_
 
Owner owner_
 Rank of the process owning the rigid body. More...
 

Member Typedef Documentation

◆ BlockStates

Stores the information if neighbor block knows about object.

◆ ConstShadowOwnersIterator

using walberla::pe::MPIRigidBodyTrait::ConstShadowOwnersIterator = ShadowOwners::const_iterator

ConstIterator over the connected processes.

◆ ShadowOwners

using walberla::pe::MPIRigidBodyTrait::ShadowOwners = std::vector<Owner>
protected

Vector for remote MPI processes the rigid body is contained in.

◆ ShadowOwnersIterator

Iterator over the connected processes.

◆ SizeType

Constructor & Destructor Documentation

◆ MPIRigidBodyTrait()

walberla::pe::MPIRigidBodyTrait::MPIRigidBodyTrait ( )
inlineexplicit

Default implementation of the MPIRigidBodyTrait constructor.

Parameters
bodyThe body ID of this rigid body.

◆ ~MPIRigidBodyTrait()

virtual walberla::pe::MPIRigidBodyTrait::~MPIRigidBodyTrait ( )
virtualdefault

Member Function Documentation

◆ beginShadowOwners() [1/2]

MPIRigidBodyTrait::ConstShadowOwnersIterator walberla::pe::MPIRigidBodyTrait::beginShadowOwners ( )
inline

Returns an iterator to the first remote process the rigid body is contained in.

Returns
Iterator to the first remote process.

◆ beginShadowOwners() [2/2]

ConstShadowOwnersIterator walberla::pe::MPIRigidBodyTrait::beginShadowOwners ( ) const
inline

◆ clearBlockStates()

void walberla::pe::MPIRigidBodyTrait::clearBlockStates ( )
inline

◆ clearShadowOwners()

void walberla::pe::MPIRigidBodyTrait::clearShadowOwners ( )
inline

Removing all registered remote processes from the rigid body.

Returns
void

This function clears all references to remote processes the rigid body may be contained in.

◆ deregisterShadowOwner()

void walberla::pe::MPIRigidBodyTrait::deregisterShadowOwner ( const Owner owner)
inline

Deregistering a remote process from the rigid body.

Parameters
ownerThe remote process to be deregistered from the rigid body.
Returns
void

This function deregisters the given remote process from the rigid body. This call has linear complexity.

◆ endShadowOwners() [1/2]

MPIRigidBodyTrait::ConstShadowOwnersIterator walberla::pe::MPIRigidBodyTrait::endShadowOwners ( )
inline

Returns an iterator just past the last process the rigid body is contained in.

Returns
Iterator just past the last remote process.

◆ endShadowOwners() [2/2]

ConstShadowOwnersIterator walberla::pe::MPIRigidBodyTrait::endShadowOwners ( ) const
inline

◆ getBlockState()

bool walberla::pe::MPIRigidBodyTrait::getBlockState ( const BlockID id) const
inline

◆ getBlockStateSize()

size_t walberla::pe::MPIRigidBodyTrait::getBlockStateSize ( ) const
inline

◆ getOwner() [1/2]

const Owner & walberla::pe::MPIRigidBodyTrait::getOwner ( )
inline

Returns the rank of the owner process.

Returns
The rank of the owner process.

If not yet set by the collision system this function returns -1.

◆ getOwner() [2/2]

const Owner& walberla::pe::MPIRigidBodyTrait::getOwner ( ) const
inline

◆ hasShadowOwners()

bool walberla::pe::MPIRigidBodyTrait::hasShadowOwners ( ) const
inline

Returns whether any processes are registered with the rigid body.

Returns
true if at least one process is registered with the rigid body, false if not.

◆ isShadowOwnerRegistered()

bool walberla::pe::MPIRigidBodyTrait::isShadowOwnerRegistered ( const Owner owner) const
inline

Checks whether the given remote process is registered with the rigid body.

Parameters
ownerThe remote process that possibly registered with the rigid body.
Returns
true if the given process is registered with the rigid body, false if not.

This call has linear complexity.

◆ registerShadowOwner()

void walberla::pe::MPIRigidBodyTrait::registerShadowOwner ( const Owner owner)
inline

Registering a new remote process the rigid body is contained in.

Parameters
ownerThe remote process to be registered with the rigid body.
Returns
void

This function registers the given remote process with the rigid body. In case the process is already registered, it is not registered again. This call has linear complexity.

◆ setBlockState()

void walberla::pe::MPIRigidBodyTrait::setBlockState ( const BlockID id)
inline

◆ setOwner()

void walberla::pe::MPIRigidBodyTrait::setOwner ( const Owner owner)
inline

Returns the rank of the owner process.

Returns
The rank of the owner process.

If not yet set by the collision system this function returns -1.

◆ sizeShadowOwners()

MPIRigidBodyTrait::SizeType walberla::pe::MPIRigidBodyTrait::sizeShadowOwners ( ) const
inline

Returns the number of registered processes.

Returns
The number of registered processes.

◆ unsetBlockState()

void walberla::pe::MPIRigidBodyTrait::unsetBlockState ( const BlockID id)
inline

Member Data Documentation

◆ blockStates_

BlockStates walberla::pe::MPIRigidBodyTrait::blockStates_
private

◆ owner_

Owner walberla::pe::MPIRigidBodyTrait::owner_
private

Rank of the process owning the rigid body.

◆ shadowOwners_

ShadowOwners walberla::pe::MPIRigidBodyTrait::shadowOwners_
private

Vector of all processes the rigid body intersects with.


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