7#include <amdis/Boundary.hpp>
8#include <amdis/BoundaryCondition.hpp>
9#include <amdis/BoundarySubset.hpp>
10#include <amdis/common/Concepts.hpp>
11#include <amdis/common/TypeTraits.hpp>
12#include <amdis/typetree/RangeType.hpp>
13#include <amdis/typetree/TreePath.hpp>
36 template <
class Basis,
class RowPath,
class ColPath,
class ValueGr
idFct>
39 using GridView =
typename Basis::GridView;
40 using Intersection =
typename GridView::Intersection;
42 using Domain =
typename GridView::template Codim<0>::Geometry::GlobalCoordinate;
43 using Range = TYPEOF(std::declval<ValueGridFct>()(std::declval<Domain>()));
48 DirichletBC(B&& basis, RowPath
const& row, ColPath
const& col,
50 : basis_{wrap_or_share(FWD(basis))}
53 , boundarySubset_(std::move(boundarySubset))
54 , valueGridFct_(std::move(values))
60 :
DirichletBC(FWD(basis), makeTreePath(), makeTreePath(),
61 std::move(boundarySubset), std::move(values))
78 template <
class Mat,
class Sol,
class Rhs>
79 void apply(Mat& matrix, Sol& solution, Rhs& rhs,
bool symmetric =
false);
81 template <
class,
class,
class>
85 std::shared_ptr<Basis const> basis_;
91 std::vector<typename Basis::MultiIndex> rowIndices_;
92 std::vector<typename Basis::MultiIndex> colIndices_;
98 template <
class B,
class Row,
class Col,
class Values,
class Basis = Underlying_t<B>,
99 REQUIRES(Concepts::GlobalBasis<Basis>)>
100 DirichletBC(B
const&, Row
const&, Col
const&, BoundarySubset<typename Basis::GridView::Intersection>, Values
const&)
101 -> DirichletBC<Basis, Row, Col, Underlying_t<Values>>;
104 template <
class B,
class Values,
class Basis = Underlying_t<B>,
105 REQUIRES(Concepts::GlobalBasis<Basis>)>
106 DirichletBC(B
const&, BoundarySubset<typename Basis::GridView::Intersection>, Values
const&)
107 -> DirichletBC<Basis,TYPEOF(makeTreePath()),TYPEOF(makeTreePath()), Underlying_t<Values>>;
111#include "DirichletBC.inc.hpp"
Class defining a subset of a domain boundary.
Definition BoundarySubset.hpp:24
Implements a boundary condition of Dirichlet-type.
Definition DirichletBC.hpp:38
void init()
Definition DirichletBC.inc.hpp:18
void apply(Mat &matrix, Sol &solution, Rhs &rhs, bool symmetric=false)
Apply dirichlet BC to matrix and vector.
Definition DirichletBC.inc.hpp:81
DirichletBC(B &&basis, RowPath const &row, ColPath const &col, BoundarySubset< Intersection > boundarySubset, ValueGridFct values)
Make a DirichletBC from a basis with treepath arguments.
Definition DirichletBC.hpp:48
DirichletBC(B &&basis, BoundarySubset< Intersection > boundarySubset, ValueGridFct values)
Make a DirichletBC from a global basis.
Definition DirichletBC.hpp:59
Implements a symmetric Dirichlet boundary condition.
Definition SymmetricDirichletBC.hpp:35