From fa7509629161d1e75e4fe2cda8a2252b73d912ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@mi.fu-berlin.de> Date: Tue, 20 Mar 2018 23:08:57 +0100 Subject: [PATCH] Use istlVectorBackend() instead of HierarchicVectorWrapper in stokes-taylorhood.cc --- examples/stokes-taylorhood.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/examples/stokes-taylorhood.cc b/examples/stokes-taylorhood.cc index fb5c8ca..9a0670d 100644 --- a/examples/stokes-taylorhood.cc +++ b/examples/stokes-taylorhood.cc @@ -21,7 +21,7 @@ #include <dune/functions/functionspacebases/interpolate.hh> #include <dune/functions/functionspacebases/taylorhoodbasis.hh> -#include <dune/functions/functionspacebases/hierarchicvectorwrapper.hh> +#include <dune/functions/functionspacebases/istlvectorbackend.hh> #include <dune/functions/functionspacebases/powerbasis.hh> #include <dune/functions/functionspacebases/compositebasis.hh> #include <dune/functions/functionspacebases/lagrangebasis.hh> @@ -305,8 +305,9 @@ int main (int argc, char *argv[]) try // { rhs_assembly_begin } VectorType rhs; - typedef Dune::Functions::HierarchicVectorWrapper<VectorType, double> HierarchicVectorView; - HierarchicVectorView(rhs).resize(taylorHoodBasis); + auto rhsBackend = Dune::Functions::istlVectorBackend(rhs); + + rhsBackend.resize(taylorHoodBasis); rhs = 0; /*@\label{li:stokes_taylorhood_set_rhs_to_zero}@*/ // { rhs_assembly_end } @@ -336,14 +337,15 @@ int main (int argc, char *argv[]) try using namespace TypeTree::Indices; using BitVectorType = BlockVector<BlockVector<FieldVector<char,1> > >; - using HierarchicBitVectorView = Functions::HierarchicVectorWrapper<BitVectorType, char>; BitVectorType isBoundary; + auto isBoundaryBackend = Dune::Functions::istlVectorBackend(isBoundary); + for(int i=0; i<dim; ++i) { auto velocityComponentSpace = Functions::subspaceBasis(taylorHoodBasis, _0, i); - interpolate(velocityComponentSpace, HierarchicBitVectorView(isBoundary), boundaryIndicator); + interpolate(velocityComponentSpace, isBoundaryBackend, boundaryIndicator); } // { interpolate_boundary_predicate_end } @@ -352,9 +354,9 @@ int main (int argc, char *argv[]) try auto&& velocityDirichletData = [](Coordinate x)->VelocityRange { return {0.0, double(x[0] < 1e-8)};}; interpolate(Functions::subspaceBasis(taylorHoodBasis, _0), - HierarchicVectorView(rhs), + rhsBackend, velocityDirichletData, - HierarchicBitVectorView(isBoundary)); + isBoundaryBackend); // { interpolate_dirichlet_values_end } //////////////////////////////////////////// @@ -419,9 +421,9 @@ int main (int argc, char *argv[]) try using PressureRange = double; auto velocityFunction = Functions::makeDiscreteGlobalBasisFunction<VelocityRange>(Functions::subspaceBasis(taylorHoodBasis, _0), - HierarchicVectorView(x)); + Dune::Functions::istlVectorBackend(x)); auto pressureFunction = Functions::makeDiscreteGlobalBasisFunction<PressureRange>(Functions::subspaceBasis(taylorHoodBasis, _1), - HierarchicVectorView(x)); + Dune::Functions::istlVectorBackend(x)); ////////////////////////////////////////////////////////////////////////////////////////////// // Write result to VTK file -- GitLab