1#ifndef BCBuilder_decl_hpp
2#define BCBuilder_decl_hpp
6#include "DefaultTypeDefs.hpp"
7#include "feddlib/core/FEDDCore.hpp"
8#include "feddlib/core/FE/Domain.hpp"
9#include "feddlib/core/FE/FE.hpp"
11#include "feddlib/core/LinearAlgebra/BlockMatrix.hpp"
12#include "feddlib/core/LinearAlgebra/BlockMultiVector.hpp"
14#include <boost/function.hpp>
44template <
class SC = default_sc,
class LO = default_lo,
class GO = default_go,
class NO = default_no>
51 typedef Teuchos::RCP<Domain<SC,LO,GO,NO> > DomainPtr_Type;
54 typedef Teuchos::RCP<Matrix_Type> MatrixPtr_Type;
57 typedef Teuchos::RCP<BlockMatrix_Type> BlockMatrixPtr_Type;
59 typedef typename Matrix_Type::Map_Type Map_Type;
60 typedef typename Matrix_Type::MapPtr_Type MapPtr_Type;
61 typedef typename Matrix_Type::MapConstPtr_Type MapConstPtr_Type;
64 typedef Teuchos::RCP<MultiVector_Type> MultiVectorPtr_Type;
65 typedef Teuchos::RCP<const MultiVector_Type> MultiVectorConstPtr_Type;
68 typedef Teuchos::RCP<BlockMultiVector_Type> BlockMultiVectorPtr_Type;
71 typedef Teuchos::RCP<FEFac_Type> FEFacPtr_Type;
73 typedef boost::function<void(
double* x,
double* res,
double t,
const double* parameters)> BC_func_Type;
87 void addBC(BC_func_Type funcBC,
int flag,
int block,
const DomainPtr_Type &domain, std::string type,
int dofs);
100 void addBC(BC_func_Type funcBC,
int flag,
int block,
const DomainPtr_Type &domain, std::string type,
int dofs, vec_dbl_Type& parameter_vec);
114 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);
121 void set(
const BlockMatrixPtr_Type &blockMatrix,
const BlockMultiVectorPtr_Type &b,
double t=0.)
const;
128 void setRHS(
const BlockMultiVectorPtr_Type &blockMV,
double t=0.)
const;
134 void setBCMinusVector(
const BlockMultiVectorPtr_Type &outBlockMV,
const BlockMultiVectorPtr_Type &substractBlockMV,
double t=0.)
const;
140 void setVectorMinusBC(
const BlockMultiVectorPtr_Type &outBlockMV,
const BlockMultiVectorPtr_Type &substractBlockMV,
double t=0.)
const;
153 void setDirichletBoundaryFromExternal(Teuchos::ArrayRCP<SC>& values, LO index,
int loc,
double time, std::string type, Teuchos::ArrayRCP<SC> valuesSubstract = Teuchos::null )
const;
160 void setDirichletBCScaled(
const MatrixPtr_Type &matrix,
int loc,
int blockRow,
bool isDiagonalBlock,
double eps=1.0)
const;
167 void setLocalRowEntry(
const MatrixPtr_Type &matrix, LO localNode, UN dofsPerNode,
int loc,
double eps)
const;
176 void setSystem(
const BlockMatrixPtr_Type &blockMatrix)
const;
187 void setDirichletBC(
const MatrixPtr_Type &matrix,
int loc,
int blockRow,
bool isDiagonalBlock)
const;
194 void setLocalRowOne(
const MatrixPtr_Type &matrix, LO localNode, UN dofsPerNode,
int loc)
const;
201 void setLocalRowZero(
const MatrixPtr_Type &matrix, LO localNode, UN dofsPerNode,
int loc)
const;
230 std::vector<BC_func_Type> vecBC_func_;
231 vec_int_Type vecFlag_;
232 vec_int_Type vecBlockID_;
233 std::vector<DomainPtr_Type> vecDomain_;
234 std::vector<std::string> vecBCType_;
235 vec_int_Type vecDofs_;
236 vec2D_dbl_Type vecBC_Parameters_;
237 std::vector<MultiVectorConstPtr_Type> vecExternalSol_;
238 mutable vec_dbl_ptr_Type resultPtr_;
239 mutable vec_dbl_ptr_Type pointPtr_;
240#ifdef BCBuilder_TIMER
241 TimePtr_Type SetSystemRowTimer_;
242 TimePtr_Type BlockRowHasDirichletTimer_;
243 TimePtr_Type FindFlagTimer_;
void setBCMinusVector(const BlockMultiVectorPtr_Type &outBlockMV, const BlockMultiVectorPtr_Type &substractBlockMV, double t=0.) const
Definition BCBuilder_def.hpp:238
void setVectorMinusBC(const BlockMultiVectorPtr_Type &outBlockMV, const BlockMultiVectorPtr_Type &substractBlockMV, double t=0.) const
Definition BCBuilder_def.hpp:354
void setRHS(const BlockMultiVectorPtr_Type &blockMV, double t=0.) const
Setting boundary conditions to (block)vector.
Definition BCBuilder_def.hpp:97
void set(const BlockMatrixPtr_Type &blockMatrix, const BlockMultiVectorPtr_Type &b, double t=0.) const
Setting bundary condtions to problem.
Definition BCBuilder_def.hpp:88
void setSystem(const BlockMatrixPtr_Type &blockMatrix) const
Set boundary conditions to system.
Definition BCBuilder_def.hpp:626
void addBC(BC_func_Type funcBC, int flag, int block, const DomainPtr_Type &domain, std::string type, int dofs)
Adding Boundary Condition.
Definition BCBuilder_def.hpp:42
void setLocalRowZero(const MatrixPtr_Type &matrix, LO localNode, UN dofsPerNode, int loc) const
Definition BCBuilder_def.hpp:832
void setDirichletBoundaryFromExternal(Teuchos::ArrayRCP< SC > &values, LO index, int loc, double time, std::string type, Teuchos::ArrayRCP< SC > valuesSubstract=Teuchos::null) const
Definition BCBuilder_def.hpp:208
void setSystemScaled(const BlockMatrixPtr_Type &blockMatrix, double eps=1.0) const
Set boundary conditions to system.
Definition BCBuilder_def.hpp:595
void setDirichletBC(const MatrixPtr_Type &matrix, int loc, int blockRow, bool isDiagonalBlock) const
Definition BCBuilder_def.hpp:762
void setAllDirichletZero(const BlockMultiVectorPtr_Type &blockMV) const
Definition BCBuilder_def.hpp:468
void addBC(BC_func_Type funcBC, int flag, int block, const DomainPtr_Type &domain, std::string type, int dofs, vec_dbl_Type ¶meter_vec)
Adding Boundary Condition with extra parameters.
Definition BCBuilder_def.hpp:58
bool blockHasDirichletBC(int block, int &loc) const
Definition BCBuilder_def.hpp:537
bool blockHasDirichletBC(int block) const
Definition BCBuilder_def.hpp:530
void addBC(BC_func_Type funcBC, int flag, int block, const DomainPtr_Type &domain, std::string type, int dofs, vec_dbl_Type ¶meter_vec, MultiVectorConstPtr_Type &externalSol)
Adding Boundary Condition with extra parameters and vector values (i.e. when the inflow of a region i...
Definition BCBuilder_def.hpp:73
void setDirichletBCScaled(const MatrixPtr_Type &matrix, int loc, int blockRow, bool isDiagonalBlock, double eps=1.0) const
Definition BCBuilder_def.hpp:684
bool findFlag(LO flag, int block, int &loc) const
Definition BCBuilder_def.hpp:566
void setLocalRowEntry(const MatrixPtr_Type &matrix, LO localNode, UN dofsPerNode, int loc, double eps) const
Definition BCBuilder_def.hpp:721
void setLocalRowOne(const MatrixPtr_Type &matrix, LO localNode, UN dofsPerNode, int loc) const
Definition BCBuilder_def.hpp:797
int dofsPerNodeAtBlock(int block)
Definition BCBuilder_def.hpp:857
Definition BlockMatrix_decl.hpp:23
Definition BlockMultiVector_decl.hpp:25
Definition FE_decl.hpp:48
Definition Matrix_decl.hpp:34
Definition MultiVector_decl.hpp:36
Adaptive Mesh Refinement.
Definition AdaptiveMeshRefinement_decl.hpp:33