walberla::pde::Dirichlet< Stencil_T, flag_t > Class Template Reference

Detailed Description

template<typename Stencil_T, typename flag_t>
class walberla::pde::Dirichlet< Stencil_T, flag_t >

Dirichlet boundary handling for PDEs.

This boundary condition imposes a Dirichlet condition with arbitrary values on a PDE. It does so by modifying the right-hand side and the stencil field. Anything that has internal copies of the stencil field (e.g. the multigrid V-cycle's coarsened stencils) is responsible for updating its copies when boundary conditions are changed.

Template Parameters
Stencil_TThe stencil used for the discrete operator
flag_tThe integer type used by the flag field

#include <Dirichlet_withDx.h>

+ Inheritance diagram for walberla::pde::Dirichlet< Stencil_T, flag_t >:

Classes

class  DirichletBC
 

Public Member Functions

 Dirichlet (const BoundaryUID &boundaryUID, const FlagUID &uid, Field_T *const rhsField, const StencilField_T *const stencilField, StencilField_T *const adaptBCStencilField, FlagField< flag_t > *const flagField)
 Creates a Dirichlet boundary. More...
 
void pushFlags (std::vector< FlagUID > &uids) const
 
void beforeBoundaryTreatment () const
 
void afterBoundaryTreatment ()
 
template<typename Buffer_T >
void packCell (Buffer_T &buffer, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z) const
 
template<typename Buffer_T >
void registerCell (Buffer_T &buffer, const flag_t, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z)
 
void registerCell (const flag_t, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const BoundaryConfiguration &dirichletBC)
 
void registerCells (const flag_t, const CellInterval &cells, const BoundaryConfiguration &dirichletBC)
 
template<typename CellIterator >
void registerCells (const flag_t, const CellIterator &begin, const CellIterator &end, const BoundaryConfiguration &dirichletBC)
 
void unregisterCell (const flag_t, const cell_idx_t nx, const cell_idx_t ny, const cell_idx_t nz)
 
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)
 Treat one direction by adapting RHS according to Dirichlet boundary value. More...
 
const real_tgetValue (const cell_idx_t x, cell_idx_t y, cell_idx_t z) const
 
 Dirichlet (const BoundaryUID &boundaryUID, const FlagUID &uid, Field_T *const rhsField, const StencilField_T *const stencilField, StencilField_T *const adaptBCStencilField, FlagField< flag_t > *const flagField, const StructuredBlockStorage &blocks)
 
void pushFlags (std::vector< FlagUID > &uids) const
 
void beforeBoundaryTreatment () const
 
void afterBoundaryTreatment ()
 
template<typename Buffer_T >
void packCell (Buffer_T &buffer, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z) const
 
template<typename Buffer_T >
void registerCell (Buffer_T &buffer, const flag_t, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z)
 
void registerCell (const flag_t, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z, const BoundaryConfiguration &dirichletBC)
 
void registerCells (const flag_t, const CellInterval &cells, const BoundaryConfiguration &dirichletBC)
 
template<typename CellIterator >
void registerCells (const flag_t, const CellIterator &begin, const CellIterator &end, const BoundaryConfiguration &dirichletBC)
 
void unregisterCell (const flag_t, const cell_idx_t x, const cell_idx_t y, const cell_idx_t z)
 
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)
 
const real_tgetValue (const cell_idx_t x, cell_idx_t y, cell_idx_t z) const
 
- Public Member Functions inherited from walberla::boundary::Boundary< flag_t >
 Boundary (const BoundaryUID &boundaryUID)
 
void setMask (const flag_t mask)
 
flag_t getMask () const
 
const BoundaryUIDgetUID () const
 

Static Public Member Functions

static shared_ptr< DirichletBCcreateConfiguration (const Config::BlockHandle &config)
 
static shared_ptr< DirichletBCcreateConfiguration (const Config::BlockHandle &config)
 

Static Public Attributes

static const bool threadsafe = false
 

Private Types

typedef GhostLayerField< real_t, 1 > Field_T
 
typedef GhostLayerField< real_t, Stencil_T::Size > StencilField_T
 
typedef GhostLayerField< real_t, 1 > Field_T
 
typedef GhostLayerField< real_t, Stencil_T::Size > StencilField_T
 

Private Attributes

const FlagUID uid_
 
const flag_t formerDirichlet_
 
uint_t numDirtyCells_
 
Field_T *const rhsField_
 
shared_ptr< Field_TdirichletBC_
 
const StencilField_T *const stencilField_
 
StencilField_T *const adaptBCStencilField_
 
FlagField< flag_t > *const flagField_
 
std::array< real_t, Stencil_T::Q > dx_
 

Additional Inherited Members

- Protected Attributes inherited from walberla::boundary::Boundary< flag_t >
const BoundaryUID boundaryUID_
 
flag_t mask_
 
bool maskSet_
 

Member Typedef Documentation

◆ Field_T [1/2]

template<typename Stencil_T , typename flag_t >
typedef GhostLayerField< real_t, 1 > walberla::pde::Dirichlet< Stencil_T, flag_t >::Field_T
private

◆ Field_T [2/2]

template<typename Stencil_T , typename flag_t >
typedef GhostLayerField< real_t, 1 > walberla::pde::Dirichlet< Stencil_T, flag_t >::Field_T
private

◆ StencilField_T [1/2]

template<typename Stencil_T , typename flag_t >
typedef GhostLayerField< real_t, Stencil_T::Size > walberla::pde::Dirichlet< Stencil_T, flag_t >::StencilField_T
private

◆ StencilField_T [2/2]

template<typename Stencil_T , typename flag_t >
typedef GhostLayerField< real_t, Stencil_T::Size > walberla::pde::Dirichlet< Stencil_T, flag_t >::StencilField_T
private

Constructor & Destructor Documentation

◆ Dirichlet() [1/2]

template<typename Stencil_T , typename flag_t >
walberla::pde::Dirichlet< Stencil_T, flag_t >::Dirichlet ( const BoundaryUID &  boundaryUID,
const FlagUID &  uid,
Field_T *const  rhsField,
const StencilField_T *const  stencilField,
StencilField_T *const  adaptBCStencilField,
FlagField< flag_t > *const  flagField 
)
inline

Creates a Dirichlet boundary.

Parameters
boundaryUIDthe UID of the boundary condition
uidthe UID of the flag that marks cells with this boundary condition
rhsFieldpointer to the right-hand side field, which will be adapted by this boundary condition
stencilFieldpointer to the operator stencil field. It should contain the stencil weights that don't take into account the boundary conditions.
adaptBCStencilFieldpointer to the operator stencil field that will be adapted by this boundary condition. Initially, this field needs to contain the same values as stencilField. This is the stencil field that should be passed to the actual PDE solver.
flagFieldpointer to the flag field

◆ Dirichlet() [2/2]

template<typename Stencil_T , typename flag_t >
walberla::pde::Dirichlet< Stencil_T, flag_t >::Dirichlet ( const BoundaryUID &  boundaryUID,
const FlagUID &  uid,
Field_T *const  rhsField,
const StencilField_T *const  stencilField,
StencilField_T *const  adaptBCStencilField,
FlagField< flag_t > *const  flagField,
const StructuredBlockStorage blocks 
)
inline

Member Function Documentation

◆ afterBoundaryTreatment() [1/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::afterBoundaryTreatment ( )

◆ afterBoundaryTreatment() [2/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::afterBoundaryTreatment

◆ beforeBoundaryTreatment() [1/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::beforeBoundaryTreatment ( ) const
inline

◆ beforeBoundaryTreatment() [2/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::beforeBoundaryTreatment ( ) const
inline

◆ createConfiguration() [1/2]

template<typename Stencil_T , typename flag_t >
static shared_ptr<DirichletBC> walberla::pde::Dirichlet< Stencil_T, flag_t >::createConfiguration ( const Config::BlockHandle config)
inlinestatic

◆ createConfiguration() [2/2]

template<typename Stencil_T , typename flag_t >
static shared_ptr<DirichletBC> walberla::pde::Dirichlet< Stencil_T, flag_t >::createConfiguration ( const Config::BlockHandle config)
inlinestatic

◆ getValue() [1/2]

template<typename Stencil_T , typename flag_t >
const real_t& walberla::pde::Dirichlet< Stencil_T, flag_t >::getValue ( const cell_idx_t  x,
cell_idx_t  y,
cell_idx_t  z 
) const
inline

◆ getValue() [2/2]

template<typename Stencil_T , typename flag_t >
const real_t& walberla::pde::Dirichlet< Stencil_T, flag_t >::getValue ( const cell_idx_t  x,
cell_idx_t  y,
cell_idx_t  z 
) const
inline

◆ packCell() [1/2]

template<typename Stencil_T , typename flag_t >
template<typename Buffer_T >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::packCell ( Buffer_T &  buffer,
const cell_idx_t  x,
const cell_idx_t  y,
const cell_idx_t  z 
) const
inline

◆ packCell() [2/2]

template<typename Stencil_T , typename flag_t >
template<typename Buffer_T >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::packCell ( Buffer_T &  buffer,
const cell_idx_t  x,
const cell_idx_t  y,
const cell_idx_t  z 
) const
inline

◆ pushFlags() [1/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::pushFlags ( std::vector< FlagUID > &  uids) const
inline

◆ pushFlags() [2/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::pushFlags ( std::vector< FlagUID > &  uids) const
inline

◆ registerCell() [1/4]

template<typename Stencil_T , typename flag_t >
template<typename Buffer_T >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::registerCell ( Buffer_T &  buffer,
const  flag_t,
const cell_idx_t  x,
const cell_idx_t  y,
const cell_idx_t  z 
)
inline

◆ registerCell() [2/4]

template<typename Stencil_T , typename flag_t >
template<typename Buffer_T >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::registerCell ( Buffer_T &  buffer,
const  flag_t,
const cell_idx_t  x,
const cell_idx_t  y,
const cell_idx_t  z 
)
inline

◆ registerCell() [3/4]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::registerCell ( const  flag_t,
const cell_idx_t  x,
const cell_idx_t  y,
const cell_idx_t  z,
const BoundaryConfiguration dirichletBC 
)
inline

◆ registerCell() [4/4]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::registerCell ( const  flag_t,
const cell_idx_t  x,
const cell_idx_t  y,
const cell_idx_t  z,
const BoundaryConfiguration dirichletBC 
)
inline

◆ registerCells() [1/4]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::registerCells ( const  flag_t,
const CellInterval cells,
const BoundaryConfiguration dirichletBC 
)
inline

◆ registerCells() [2/4]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::registerCells ( const  flag_t,
const CellInterval cells,
const BoundaryConfiguration dirichletBC 
)
inline

◆ registerCells() [3/4]

template<typename Stencil_T , typename flag_t >
template<typename CellIterator >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::registerCells ( const  flag_t,
const CellIterator &  begin,
const CellIterator &  end,
const BoundaryConfiguration dirichletBC 
)
inline

◆ registerCells() [4/4]

template<typename Stencil_T , typename flag_t >
template<typename CellIterator >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::registerCells ( const  flag_t,
const CellIterator &  begin,
const CellIterator &  end,
const BoundaryConfiguration dirichletBC 
)
inline

◆ treatDirection() [1/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::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 
)
inline

◆ treatDirection() [2/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::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 
)
inline

Treat one direction by adapting RHS according to Dirichlet boundary value.

◆ unregisterCell() [1/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::unregisterCell ( const  flag_t,
const cell_idx_t  nx,
const cell_idx_t  ny,
const cell_idx_t  nz 
)

◆ unregisterCell() [2/2]

template<typename Stencil_T , typename flag_t >
void walberla::pde::Dirichlet< Stencil_T, flag_t >::unregisterCell ( const  flag_t,
const cell_idx_t  x,
const cell_idx_t  y,
const cell_idx_t  z 
)

Member Data Documentation

◆ adaptBCStencilField_

template<typename Stencil_T , typename flag_t >
StencilField_T *const walberla::pde::Dirichlet< Stencil_T, flag_t >::adaptBCStencilField_
private

◆ dirichletBC_

template<typename Stencil_T , typename flag_t >
shared_ptr< Field_T > walberla::pde::Dirichlet< Stencil_T, flag_t >::dirichletBC_
private

◆ dx_

template<typename Stencil_T , typename flag_t >
std::array<real_t, Stencil_T::Q> walberla::pde::Dirichlet< Stencil_T, flag_t >::dx_
private

◆ flagField_

template<typename Stencil_T , typename flag_t >
FlagField< flag_t > *const walberla::pde::Dirichlet< Stencil_T, flag_t >::flagField_
private

◆ formerDirichlet_

template<typename Stencil_T , typename flag_t >
const flag_t walberla::pde::Dirichlet< Stencil_T, flag_t >::formerDirichlet_
private

◆ numDirtyCells_

template<typename Stencil_T , typename flag_t >
uint_t walberla::pde::Dirichlet< Stencil_T, flag_t >::numDirtyCells_
private

◆ rhsField_

template<typename Stencil_T , typename flag_t >
Field_T *const walberla::pde::Dirichlet< Stencil_T, flag_t >::rhsField_
private

◆ stencilField_

template<typename Stencil_T , typename flag_t >
const StencilField_T *const walberla::pde::Dirichlet< Stencil_T, flag_t >::stencilField_
private

◆ threadsafe

template<typename Stencil_T , typename flag_t >
static const bool walberla::pde::Dirichlet< Stencil_T, flag_t >::threadsafe = false
static

◆ uid_

template<typename Stencil_T , typename flag_t >
const FlagUID walberla::pde::Dirichlet< Stencil_T, flag_t >::uid_
private

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