5 #include <dune/functions/functionspacebases/subentitydofs.hh> 7 #include <amdis/functions/Interpolate.hpp> 8 #include <amdis/LinearAlgebra.hpp> 12 template <
class B,
class V>
16 dirichletNodes_.assign(basis_.dimension(),
false);
18 auto localView = basis_.localView();
19 auto seDOFs = Dune::Functions::subEntityDOFs(basis_);
20 auto const& gridView = basis_.gridView();
21 for (
auto const& element : elements(gridView,
typename BackendTraits<B>::PartitionSet{})) {
22 if (element.hasBoundaryIntersections()) {
23 localView.bind(element);
24 for(
auto const& intersection: intersections(gridView, element))
25 if (intersection.boundary())
26 for(
auto localIndex: seDOFs.bind(localView,intersection))
27 dirichletNodes_[localView.index(localIndex)]
28 = dirichletNodes_[localView.index(localIndex)] || boundarySubset_(intersection);
35 template <
class B,
class V>
36 template <
class Mat,
class Sol,
class Rhs>
38 apply(Mat& matrix, Sol& solution, Rhs& rhs)
41 dirichletBC(matrix, solution, rhs, dirichletNodes_);
Definition: AdaptBase.hpp:6
void init()
Definition: DirichletBC.inc.hpp:14
void apply(Mat &matrix, Sol &solution, Rhs &rhs)
Apply dirichlet BC to matrix and vector.
Definition: DirichletBC.inc.hpp:38