Skip to content
Snippets Groups Projects
Commit fa750962 authored by graeser's avatar graeser
Browse files

Use istlVectorBackend() instead of HierarchicVectorWrapper in stokes-taylorhood.cc

parent d165ee26
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment