Finite Element Domain Decomposition Library
FEDDLib
Loading...
Searching...
No Matches
FEDD::BCBuilder< SC, LO, GO, NO > Class Template Reference

This class is responsible for setting the boundary conditions into the system and rhs. More...

#include <BCBuilder_decl.hpp>

Public Types

typedef unsigned UN
 
typedef Teuchos::RCP< Domain< SC, LO, GO, NO > > DomainPtr_Type
 
typedef Matrix< SC, LO, GO, NO > Matrix_Type
 
typedef Teuchos::RCP< Matrix_TypeMatrixPtr_Type
 
typedef BlockMatrix< SC, LO, GO, NO > BlockMatrix_Type
 
typedef Teuchos::RCP< BlockMatrix_TypeBlockMatrixPtr_Type
 
typedef Matrix_Type::Map_Type Map_Type
 
typedef Matrix_Type::MapPtr_Type MapPtr_Type
 
typedef Matrix_Type::MapConstPtr_Type MapConstPtr_Type
 
typedef MultiVector< SC, LO, GO, NO > MultiVector_Type
 
typedef Teuchos::RCP< MultiVector_TypeMultiVectorPtr_Type
 
typedef Teuchos::RCP< const MultiVector_TypeMultiVectorConstPtr_Type
 
typedef BlockMultiVector< SC, LO, GO, NO > BlockMultiVector_Type
 
typedef Teuchos::RCP< BlockMultiVector_TypeBlockMultiVectorPtr_Type
 
typedef FE< SC, LO, GO, NO > FEFac_Type
 
typedef Teuchos::RCP< FEFac_TypeFEFacPtr_Type
 
typedef boost::function< void(double *x, double *res, double t, const double *parameters)> BC_func_Type
 

Public Member Functions

void addBC (BC_func_Type funcBC, int flag, int block, const DomainPtr_Type &domain, std::string type, int dofs)
 Adding Boundary Condition.
 
void addBC (BC_func_Type funcBC, int flag, int block, const DomainPtr_Type &domain, std::string type, int dofs, vec_dbl_Type &parameter_vec)
 Adding Boundary Condition with extra parameters.
 
void addBC (BC_func_Type funcBC, int flag, int block, const DomainPtr_Type &domain, std::string type, int dofs, vec_dbl_Type &parameter_vec, MultiVectorConstPtr_Type &externalSol)
 Adding Boundary Condition with extra parameters and vector values (i.e. when the inflow of a region is computed)
 
void set (const BlockMatrixPtr_Type &blockMatrix, const BlockMultiVectorPtr_Type &b, double t=0.) const
 Setting bundary condtions to problem.
 
void setRHS (const BlockMultiVectorPtr_Type &blockMV, double t=0.) const
 Setting boundary conditions to (block)vector.
 
void setBCMinusVector (const BlockMultiVectorPtr_Type &outBlockMV, const BlockMultiVectorPtr_Type &substractBlockMV, double t=0.) const
 
void setVectorMinusBC (const BlockMultiVectorPtr_Type &outBlockMV, const BlockMultiVectorPtr_Type &substractBlockMV, double t=0.) const
 
void setDirichletBoundaryFromExternal (Teuchos::ArrayRCP< SC > &values, LO index, int loc, double time, std::string type, Teuchos::ArrayRCP< SC > valuesSubstract=Teuchos::null) const
 
void setAllDirichletZero (const BlockMultiVectorPtr_Type &blockMV) const
 
void setSystem (const BlockMatrixPtr_Type &blockMatrix) const
 Set boundary conditions to system.
 
void setDirichletBC (const MatrixPtr_Type &matrix, int loc, int blockRow, bool isDiagonalBlock) const
 
void setLocalRowOne (const MatrixPtr_Type &matrix, LO localNode, UN dofsPerNode, int loc) const
 
void setLocalRowZero (const MatrixPtr_Type &matrix, LO localNode, UN dofsPerNode, int loc) const
 
bool blockHasDirichletBC (int block) const
 
bool blockHasDirichletBC (int block, int &loc) const
 
bool findFlag (LO flag, int block, int &loc) const
 
int dofsPerNodeAtBlock (int block)
 

Detailed Description

template<class SC = default_sc, class LO = default_lo, class GO = default_go, class NO = default_no>
class FEDD::BCBuilder< SC, LO, GO, NO >

This class is responsible for setting the boundary conditions into the system and rhs.

Template Parameters
SCThe scalar type. So far, this is always double, but having it as a template parameter would allow flexibily, e.g., for using complex instead
LOThe local ordinal type. The is the index type for local indices
GOThe global ordinal type. The is the index type for global indices
NOThe Kokkos Node type. This would allow for performance portibility when using Kokkos. Currently, this is not used.

When we define our test/example we add boundary conditions to the BCBuilder. These conditions match the geometry flags to boundary functions (i.e. zeroDirchlet).

Then, when 'setSystem()' or 'setRhs()' is called, the boundary conditiones are set according to the set boundary conditions.

These boundary conditions are limited to dirichlet boundary conditions.

BC Builder contains all boundary condition information of current problem.

Member Function Documentation

◆ addBC() [1/3]

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::addBC ( BC_func_Type funcBC,
int flag,
int block,
const DomainPtr_Type & domain,
std::string type,
int dofs )

Adding Boundary Condition.

Parameters
funcBCfunction representing bc
flagflag corresponding to the funcBC
blockdiagonal block corresponding to the bc (i.e. in block systems like stokes equation)
domainfinite element space correspong to block
typeof bc. Dirichlet, Dirichlet_X ...
dofsdegrees of freedom of bc (i.e. 3 for a vector valued problem)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ addBC() [2/3]

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::addBC ( BC_func_Type funcBC,
int flag,
int block,
const DomainPtr_Type & domain,
std::string type,
int dofs,
vec_dbl_Type & parameter_vec )

Adding Boundary Condition with extra parameters.

Parameters
funcBCfunction representing bc
flagflag corresponding to the funcBC
blockdiagonal block corresponding to the bc (i.e. in block systems like stokes equation)
domainfinite element space correspong to block
typeof bc. Dirichlet, Dirichlet_X ...
dofsdegrees of freedom of bc (i.e. 3 for a vector valued problem)
parameter_vecvector containing different parameters for bc
Here is the call graph for this function:

◆ addBC() [3/3]

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::addBC ( BC_func_Type funcBC,
int flag,
int block,
const DomainPtr_Type & domain,
std::string type,
int dofs,
vec_dbl_Type & parameter_vec,
MultiVectorConstPtr_Type & externalSol )

Adding Boundary Condition with extra parameters and vector values (i.e. when the inflow of a region is computed)

Parameters
funcBCfunction representing bc
flagflag corresponding to the funcBC
blockdiagonal block corresponding to the bc (i.e. in block systems like stokes equation)
domainfinite element space correspong to block
typeof bc. Dirichlet, Dirichlet_X ...
dofsdegrees of freedom of bc (i.e. 3 for a vector valued problem)
parameter_vecvector containing different parameters for bc
externalSolvector with values for bc
Here is the call graph for this function:

◆ blockHasDirichletBC() [1/2]

template<class SC, class LO, class GO, class NO>
bool FEDD::BCBuilder< SC, LO, GO, NO >::blockHasDirichletBC ( int block) const
Parameters
block
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ blockHasDirichletBC() [2/2]

template<class SC, class LO, class GO, class NO>
bool FEDD::BCBuilder< SC, LO, GO, NO >::blockHasDirichletBC ( int block,
int & loc ) const
Parameters
block
loc
Returns
Here is the call graph for this function:

◆ dofsPerNodeAtBlock()

template<class SC, class LO, class GO, class NO>
int FEDD::BCBuilder< SC, LO, GO, NO >::dofsPerNodeAtBlock ( int block)
Parameters
block
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findFlag()

template<class SC, class LO, class GO, class NO>
bool FEDD::BCBuilder< SC, LO, GO, NO >::findFlag ( LO flag,
int block,
int & loc ) const
Parameters
flag
block
loc
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::set ( const BlockMatrixPtr_Type & blockMatrix,
const BlockMultiVectorPtr_Type & b,
double t = 0. ) const

Setting bundary condtions to problem.

Parameters
blockMatrixSystem matrix
brhs vector
t
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAllDirichletZero()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::setAllDirichletZero ( const BlockMultiVectorPtr_Type & blockMV) const
Parameters
blockMV
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBCMinusVector()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::setBCMinusVector ( const BlockMultiVectorPtr_Type & outBlockMV,
const BlockMultiVectorPtr_Type & substractBlockMV,
double t = 0. ) const
Parameters
outBlockMV
substractBlockMV
t
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDirichletBC()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::setDirichletBC ( const MatrixPtr_Type & matrix,
int loc,
int blockRow,
bool isDiagonalBlock ) const
Parameters
matrix
loc
blockRow
isDiagonalBlock
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDirichletBoundaryFromExternal()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::setDirichletBoundaryFromExternal ( Teuchos::ArrayRCP< SC > & values,
LO index,
int loc,
double time,
std::string type,
Teuchos::ArrayRCP< SC > valuesSubstract = Teuchos::null ) const
Parameters
values
index
loc
time
type
valuesSubstract
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLocalRowOne()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::setLocalRowOne ( const MatrixPtr_Type & matrix,
LO localNode,
UN dofsPerNode,
int loc ) const
Parameters
matrix
localNode
dofsPerNode
loc
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLocalRowZero()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::setLocalRowZero ( const MatrixPtr_Type & matrix,
LO localNode,
UN dofsPerNode,
int loc ) const
Parameters
matrix
localNode
dofsPerNode
loc
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRHS()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::setRHS ( const BlockMultiVectorPtr_Type & blockMV,
double t = 0. ) const

Setting boundary conditions to (block)vector.

Parameters
blockMVvector
t
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSystem()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::setSystem ( const BlockMatrixPtr_Type & blockMatrix) const

Set boundary conditions to system.

Parameters
blockMatrix
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVectorMinusBC()

template<class SC, class LO, class GO, class NO>
void FEDD::BCBuilder< SC, LO, GO, NO >::setVectorMinusBC ( const BlockMultiVectorPtr_Type & outBlockMV,
const BlockMultiVectorPtr_Type & substractBlockMV,
double t = 0. ) const
Parameters
outBlockMV
substractBlockMV
t
Here is the call graph for this function:
Here is the caller graph for this function:

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