From 33c122c5619bb380601003331a6d9479cc711791 Mon Sep 17 00:00:00 2001 From: Simon Praetorius <simon.praetorius@tu-dresden.de> Date: Mon, 1 Oct 2018 22:23:06 -0400 Subject: [PATCH] removed usage of hierarchic vector wrapper where not necessary --- src/amdis/DirichletBC.hpp | 7 ++----- test/DOFVectorTest.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/amdis/DirichletBC.hpp b/src/amdis/DirichletBC.hpp index 30960d34..feaaa011 100644 --- a/src/amdis/DirichletBC.hpp +++ b/src/amdis/DirichletBC.hpp @@ -11,7 +11,6 @@ #include <amdis/Output.hpp> #include <amdis/common/Concepts.hpp> #include <amdis/common/ValueCategory.hpp> -#include <amdis/linear_algebra/HierarchicWrapper.hpp> #include <amdis/utility/RangeType.hpp> #include <amdis/utility/TreeData.hpp> @@ -84,14 +83,12 @@ namespace AMDiS using Dune::Functions::interpolate; Dune::Hybrid::ifElse(std::is_same<RangeType_t<typename RowBasis::LocalView::Tree>, Range>{}, [&](auto id) { - auto rhsWrapper = hierarchicVectorWrapper(rhs.vector()); - interpolate(id(rowBasis), rhsWrapper, values_, dirichletNodes_); + interpolate(id(rowBasis), rhs, values_, dirichletNodes_); }); Dune::Hybrid::ifElse(std::is_same<RangeType_t<typename ColBasis::LocalView::Tree>, Range>{}, [&](auto id) { - auto solutionWrapper = hierarchicVectorWrapper(solution.vector()); - interpolate(id(colBasis), solutionWrapper, values_, dirichletNodes_); + interpolate(id(colBasis), solution, values_, dirichletNodes_); }); // subtract columns of dirichlet nodes from rhs diff --git a/test/DOFVectorTest.cpp b/test/DOFVectorTest.cpp index a1706a5b..30b89ccf 100644 --- a/test/DOFVectorTest.cpp +++ b/test/DOFVectorTest.cpp @@ -1,5 +1,8 @@ +#include "config.h" + #include <dune/common/filledarray.hh> #include <dune/grid/yaspgrid.hh> +#include <dune/functions/backends/concepts.hh> #include <dune/functions/functionspacebases/compositebasis.hh> #include <dune/functions/functionspacebases/powerbasis.hh> #include <dune/functions/functionspacebases/lagrangebasis.hh> @@ -23,10 +26,15 @@ void test_dofvector(B const& basis, DOFVector<B,T>& vec) auto m1 = std::max_element(std::begin(vec.vector()), std::end(vec.vector())); AMDIS_TEST( *m0 == T(0) ); AMDIS_TEST( *m1 == T(1) ); + + // DOFVector models the concept of a VectorBackend in Dune::Functions + static_assert(Dune::models<Dune::Functions::Concept::VectorBackend<B>, decltype(vec)>(), ""); } -int main() +int main(int argc, char** argv) { + Dune::MPIHelper::instance(argc, argv); + // create grid Dune::FieldVector<double, 2> L; L = 1.0; auto s = Dune::filledArray<2>(1); -- GitLab