walberla::boundary::Boundary< flag_t > Class Template Reference

Detailed Description

template<typename flag_t>
class walberla::boundary::Boundary< flag_t >

Base class for all boundary classes.

Every boundary class must be derived from this class and implement the following concept/member functions (for some exemplary implementations look at classes NoSlip, FreeSlip, UBB, or SimpleUBB in module lbm/boundary):

  1. "static shared_ptr<BoundaryConfiguration> createConfiguration( const Config::BlockHandle & config )" This function is used to extract parameters from a configuration file and pass them to the boundary condition. Meaning: This function defines how the parameter specification for this boundary condition must look like in the configuration file. If your boundary condition is stateless/does not need parameters, you can implement this function as follows: "{ return make_shared<BoundaryConfiguration>(); }" If you do need to pass parameters, these parameters must be implemented in terms of a derived class of "BoundaryConfiguration" (as an example, see class "UBB").
  2. "void pushFlags( std::vector< FlagUID >& uids )" This function receives (by reference) a vector and must insert (using push_back!) all FlagUIDs into this vector that mark cells as boundary cells that must be treated by this boundary condition.
  3. "void beforeBoundaryTreatment()" This function is called once before the boundary handler starts the boundary treatment. Of course, this function is called every time the boundary treatment of the boundary handler is triggered (normally once per time step).
  4. "void afterBoundaryTreatment()" Just like "beforeBoundaryTreatment", this function is called once after the boundary handler has finished the boundary treatment.
  5. "template< typename Buffer_T > void packCell( Buffer_T & buffer, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z )" This function is called every time a boundary cell that is handled by this boundary class is serialized. If the boundary condition stores additional parameters for the boundary cell (x,y,z) these parameters must be serialized and stored in the buffer "buffer". [5) serializes and 6) deserializes, both functions must match]
  6. "template< typename Buffer_T > void registerCell( Buffer_T & buffer, const flag_t flag, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z )" This function is called every time a boundary cell that is handled by this boundary class is deserialized. The flag which was set (must be part of this->mask_!), the cell (x,y,z), and a buffer that potentially stores parameters are passed. [5) serializes and 6) deserializes, both functions must match]
  7. "void registerCell( const flag_t flag, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const BoundaryConfiguration & parameter )" This function is called every time a boundary that is handled by this boundary class is set at the boundary handler. The flag which was set (must be part of this->mask_!), the cell (x,y,z), and a corresponding parameter are passed.
  8. "void registerCells( const flag_t flag, const CellInterval & cells, const BoundaryConfiguration & parameter )" Just like "registerCell", only this function is called if a boundary that is handled by this boundary class is set for each cell in a specific cell interval (-> "cells").
  9. "template< typename CellIterator > void registerCells( const flag_t flag, const CellIterator & begin, const CellIterator & end, const BoundaryConfiguration & parameter )" Just like the previous two functions, only this function is called if multiple boundary cells that are handled by this boundary class are set at the boundary handler using CellIterators (= iterators the dereference to type "Cell" - examples: iterators of classes CellVector, CellSet, ...).

"void unregisterCell( const flag_t flag, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z )" This function is called every time a boundary that is handled by this boundary class is removed at the boundary handler. The flag which was removed (must be part of this->mask_!) and the corresponding cell (x,y,z) are passed.

  1. "void treatDirection( const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const stencil::Direction dir, const cell_idx_t nx, const cell_idx_t ny, const cell_idx_t nz, const flag_t mask )" This function is called during boundary treatment, the parameters that are passed are as follows: Coming from cell (x,y,z) and going in direction "dir" the cell (nx,ny,nz) was reached. Cell (nx,ny,nz) is a boundary cell that is handled by this boundary class. All the flags that are currently set at cell (nx,ny,nz) in the flag field are passed via "mask".
  2. If the treatDirection member function is thread-safe, i.e., if this function can be called in parallel for different input parameters, you have to add the following constant static boolean member variable to your class: "static const bool threadsafe = true;"

    Every boundary class must call the constructor of "Boundary" which expects a BoundaryUID (all boundary conditions registered at the same boundary handler must have unique boundary UIDs).

#include <Boundary.h>

Public Member Functions

 Boundary (const BoundaryUID &boundaryUID)
 
void setMask (const flag_t mask)
 
flag_t getMask () const
 
const BoundaryUIDgetUID () const
 

Protected Attributes

const BoundaryUID boundaryUID_
 
flag_t mask_
 
bool maskSet_
 

Constructor & Destructor Documentation

template<typename flag_t >
walberla::boundary::Boundary< flag_t >::Boundary ( const BoundaryUID boundaryUID)
inline

Member Function Documentation

template<typename flag_t >
flag_t walberla::boundary::Boundary< flag_t >::getMask ( ) const
inline
template<typename flag_t >
const BoundaryUID& walberla::boundary::Boundary< flag_t >::getUID ( ) const
inline
template<typename flag_t >
void walberla::boundary::Boundary< flag_t >::setMask ( const flag_t  mask)
inline

Member Data Documentation

template<typename flag_t >
const BoundaryUID walberla::boundary::Boundary< flag_t >::boundaryUID_
protected
template<typename flag_t >
flag_t walberla::boundary::Boundary< flag_t >::mask_
protected
template<typename flag_t >
bool walberla::boundary::Boundary< flag_t >::maskSet_
protected

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