Skip to content
Snippets Groups Projects
Commit 6f526f5f authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

rewritten extraction of dirichletNodes in DirichletBC

parent 18a5b967
No related branches found
No related tags found
No related merge requests found
#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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment