diff --git a/src/amdis/DirichletBC.inc.hpp b/src/amdis/DirichletBC.inc.hpp index 4fcaf888fac8e546355d5a6b59bcb21fe1643cc6..8f4fe3750c62984c61803f26431f50ebc0104730 100644 --- a/src/amdis/DirichletBC.inc.hpp +++ b/src/amdis/DirichletBC.inc.hpp @@ -1,5 +1,6 @@ #pragma once +#include <dune/functions/functionspacebases/boundarydofs.hh> #include <dune/functions/functionspacebases/interpolate.hh> #include <dune/functions/functionspacebases/subspacebasis.hh> #include <amdis/LinearAlgebra.hpp> @@ -13,8 +14,13 @@ namespace AMDiS void DirichletBC<WorldVector, Range>::initImpl( RowBasis const& rowBasis, Dune::TypeTree::LeafNodeTag) { - using Dune::Functions::interpolate; - interpolate(rowBasis, dirichletNodes_, predicate_); + using Dune::Functions::forEachBoundaryDOF; + using LV = typename RowBasis::LocalView; + using I = typename RowBasis::GridView::Intersection; + dirichletNodes_.resize(rowBasis.dimension()); + forEachBoundaryDOF(rowBasis, [&](int localIndex, LV const& localView, I const& intersection) { + dirichletNodes_[localView.index(localIndex)] = predicate_(intersection.geometry().center()); + }); } template <class WorldVector, class Range>