Commit 6f526f5f authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

rewritten extraction of dirichletNodes in DirichletBC

parent 18a5b967
Pipeline #1132 passed with stage
in 3 minutes and 8 seconds
#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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment