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

Detailed Description

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

Neumann boundary handling for PDEs.

This boundary condition imposes a Neumann 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 <Neumann.h>

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

Classes

class  NeumannBC
 

Public Member Functions

 Neumann (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)
 Creates a Neumann 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 &neumannBC)
 
void registerCells (const flag_t, const CellInterval &cells, const BoundaryConfiguration &neumannBC)
 
template<typename CellIterator >
void registerCells (const flag_t, const CellIterator &begin, const CellIterator &end, const BoundaryConfiguration &neumannBC)
 
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)
 Treat one direction by adapting RHS according to Neumann boundary value. More...
 
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< NeumannBCcreateConfiguration (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
 

Private Attributes

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

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

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

◆ StencilField_T

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

Constructor & Destructor Documentation

◆ Neumann()

template<typename Stencil_T , typename flag_t >
walberla::pde::Neumann< Stencil_T, flag_t >::Neumann ( 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

Creates a Neumann 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
blocks

Member Function Documentation

◆ afterBoundaryTreatment()

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

◆ beforeBoundaryTreatment()

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

◆ createConfiguration()

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

◆ getValue()

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

◆ packCell()

template<typename Stencil_T , typename flag_t >
template<typename Buffer_T >
void walberla::pde::Neumann< 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()

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

◆ registerCell() [1/2]

template<typename Stencil_T , typename flag_t >
template<typename Buffer_T >
void walberla::pde::Neumann< 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/2]

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

◆ registerCells() [1/2]

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

◆ registerCells() [2/2]

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

◆ treatDirection()

template<typename Stencil_T , typename flag_t >
void walberla::pde::Neumann< 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 Neumann boundary value.

◆ unregisterCell()

template<typename Stencil_T , typename flag_t >
void walberla::pde::Neumann< 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::Neumann< Stencil_T, flag_t >::adaptBCStencilField_
private

◆ dx_

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

◆ flagField_

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

◆ formerNeumann_

template<typename Stencil_T , typename flag_t >
const flag_t walberla::pde::Neumann< Stencil_T, flag_t >::formerNeumann_
private

◆ neumannBC_

template<typename Stencil_T , typename flag_t >
shared_ptr< Field_T > walberla::pde::Neumann< Stencil_T, flag_t >::neumannBC_
private

◆ numDirtyCells_

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

◆ rhsField_

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

◆ stencilField_

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

◆ threadsafe

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

◆ uid_

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

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