From 6f526f5f2882e7bf3890aa8768aeb4015acccf41 Mon Sep 17 00:00:00 2001 From: Simon Praetorius <simon.praetorius@tu-dresden.de> Date: Thu, 19 Jul 2018 15:06:22 +0200 Subject: [PATCH] rewritten extraction of dirichletNodes in DirichletBC --- src/amdis/DirichletBC.inc.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/amdis/DirichletBC.inc.hpp b/src/amdis/DirichletBC.inc.hpp index 4fcaf888..8f4fe375 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> -- GitLab