<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi guys,<br>
I am trying to interpolate the R^d identity function with respect to
the velocity part<br>
of a Taylor-Hood basis. For this, I have added the lines<br>
<br>
BlockVector<FieldVector<double,dim> > lagrangeNodes;<br>
interpolate(taylorHoodBasis,
TypeTree::hybridTreePath(TypeTree::Indices::_0), lagrangeNodes,
[](FieldVector<double,dim> x){ return x; });<br>
<br>
into the stokes-taylorhood.cc example file.<br>
<br>
However, the code segfaults with a not-very-helpful backtrace.
valgrind, however, shows an 'invalid write'<br>
in interpolate (see below). Is this a bug or am I using the
hybridTreePath thingy wrong?<br>
<br>
Thanks,<br>
Oliver<br>
<br>
<title>Konsole output</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<br>
<title>Konsole output</title>
<div>
<span style="font-family:monospace"><span
style="font-weight:bold;color:#5454ff;background-color:#ffffff;">~/dune/dune-functions/build-cmake/examples</span><span
style="font-weight:bold;color:#ff5454;background-color:#ffffff;">(master)</span><span
style="font-weight:bold;color:#5454ff;background-color:#ffffff;">></span><span
style="color:#000000;background-color:#ffffff;"> valgrind
--db-attach=yes ./stokes-taylorhood </span><br>
==15716== <br>
==15716== Warning: --db-attach is a deprecated feature which
will be
<br>
==15716== removed in the next release. Use --vgdb-error=1
instead
<br>
==15716== <br>
==15716== Memcheck, a memory error detector
<br>
==15716== Copyright (C) 2002-2013, and GNU GPL'd, by Julian
Seward et al.
<br>
==15716== Using Valgrind-3.10.1 and LibVEX; rerun with -h for
copyright info
<br>
==15716== Command: ./stokes-taylorhood
<br>
==15716== <br>
==15716== Invalid write of size 8
<br>
==15716== at 0x45EC02: leaf<const
Dune::Functions::PQkNode<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>, <br>
(Dune::PartitionIteratorType)4u> >, 2, long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
unsigned int, 0ul<br>
>, long unsigned int> >,
Dune::TypeTree::DynamicTreePath> (interpolate.hh:147)
<br>
==15716== by 0x45EC02: apply<const
Dune::Functions::PQkNode<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>,<br>
(Dune::PartitionIteratorType)4u> >, 2, long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
unsigned int, 0u<br>
l>, long unsigned int> >&,
Dune::Functions::Imp::LocalInterpolateVisitor<Dune::Functions::DefaultGlobalBasis<Dune::Functions::TaylorHo<br>
odNodeFactory<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, std::array<l<br>
ong unsigned int, 2ul>, long unsigned int> >,
Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafGridViewTraits<c<br>
onst Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<l<br>
ong unsigned int, 0ul> > >,
Dune::Functions::DefaultNodeToRangeMap<Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::Defaul<br>
tLeafGridViewTraits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, long unsigned int,
Dune::TypeTree::HybridTreePath<std<br>
::integral_constant<long unsigned int, 0ul> > >
>,
Dune::Functions::HierarchicVectorWrapper<Dune::BlockVector<Dune::FieldVector<double<br>
, 2> > >&&,
Dune::Functions::LocalAnalyticGridViewFunction<Dune::FieldVector<double,
2>(Dune::FieldVector<double, 2>), Dune::GridView<<br>
Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, main(int, char**)::<lambda(Dune::FieldVec<br>
tor<double, 2>)>,
Dune::Functions::LocalDerivativeTraits<Dune::Functions::GridViewEntitySet<Dune::GridView<Dune::DefaultLeafGridViewTr<br>
aits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, 0>,
Dune::Functions::DefaultDerivativeTraits>::Traits>,
Dune::Functi<br>
ons::HierarchicVectorWrapper<const
Dune::Functions::Imp::AllTrueBitSetVector>&&>&,
Dune::TypeTree::MutableDynamicTreePath> (traversal.<br>
hh:76)
<br>
==15716== by 0x45EC02: apply<const
Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
Dun<br>
e::YaspGrid<2>, (Dune::PartitionIteratorType)4u> >,
long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
unsi<br>
gned int, 0ul> > >&,
Dune::Functions::Imp::LocalInterpolateVisitor<Dune::Functions::DefaultGlobalBasis<Dune::Functions::TaylorHoodNode<br>
Factory<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, std::array<long un<br>
signed int, 2ul>, long unsigned int> >,
Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
D<br>
une::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
un<br>
signed int, 0ul> > >,
Dune::Functions::DefaultNodeToRangeMap<Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafG<br>
ridViewTraits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, long unsigned int,
Dune::TypeTree::HybridTreePath<std::inte<br>
gral_constant<long unsigned int, 0ul> > > >,
Dune::Functions::HierarchicVectorWrapper<Dune::BlockVector<Dune::FieldVector<double,
2> ><br>
>&&,
Dune::Functions::LocalAnalyticGridViewFunction<Dune::FieldVector<double,
2>(Dune::FieldVector<double, 2>),
Dune::GridView<Dune::<br>
DefaultLeafGridViewTraits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, main(int,
char**)::<lambda(Dune::FieldVector<do<br>
uble, 2>)>,
Dune::Functions::LocalDerivativeTraits<Dune::Functions::GridViewEntitySet<Dune::GridView<Dune::DefaultLeafGridViewTraits<c<br>
onst Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, 0>,
Dune::Functions::DefaultDerivativeTraits>::Traits>,
Dune::Functions::H<br>
ierarchicVectorWrapper<const
Dune::Functions::Imp::AllTrueBitSetVector>&&>&,
Dune::TypeTree::MutableDynamicTreePath> (traversal.hh:130<br>
)
<br>
==15716== by 0x45EC02: apply<const
Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
Dun<br>
e::YaspGrid<2>, (Dune::PartitionIteratorType)4u> >,
long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
unsi<br>
gned int, 0ul> > >&,
Dune::Functions::Imp::LocalInterpolateVisitor<Dune::Functions::DefaultGlobalBasis<Dune::Functions::TaylorHoodNode<br>
Factory<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, std::array<long un<br>
signed int, 2ul>, long unsigned int> >,
Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
D<br>
une::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
un<br>
signed int, 0ul> > >,
Dune::Functions::DefaultNodeToRangeMap<Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafG<br>
ridViewTraits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, long unsigned int,
Dune::TypeTree::HybridTreePath<std::inte<br>
gral_constant<long unsigned int, 0ul> > > >,
Dune::Functions::HierarchicVectorWrapper<Dune::BlockVector<Dune::FieldVector<double,
2> ><br>
>&&,
Dune::Functions::LocalAnalyticGridViewFunction<Dune::FieldVector<double,
2>(Dune::FieldVector<double, 2>),
Dune::GridView<Dune::<br>
DefaultLeafGridViewTraits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, main(int,
char**)::<lambda(Dune::FieldVector<do<br>
uble, 2>)>,
Dune::Functions::LocalDerivativeTraits<Dune::Functions::GridViewEntitySet<Dune::GridView<Dune::DefaultLeafGridViewTraits<c<br>
onst Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, 0>,
Dune::Functions::DefaultDerivativeTraits>::Traits>,
Dune::Functions::H<br>
ierarchicVectorWrapper<const
Dune::Functions::Imp::AllTrueBitSetVector>&&>&>
(traversal.hh:41)
<br>
==15716== by 0x45EC02: applyToTree<const
Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafGridViewTraits<con<br>
st Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<lon<br>
g unsigned int, 0ul> > >&,
Dune::Functions::Imp::LocalInterpolateVisitor<Dune::Functions::DefaultGlobalBasis<Dune::Functions::TaylorHo<br>
odNodeFactory<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, std::array<l<br>
ong unsigned int, 2ul>, long unsigned int> >,
Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafGridViewTraits<c<br>
onst Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<l<br>
ong unsigned int, 0ul> > >,
Dune::Functions::DefaultNodeToRangeMap<Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::Defaul<br>
tLeafGridViewTraits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, long unsigned int,
Dune::TypeTree::HybridTreePath<std<br>
::integral_constant<long unsigned int, 0ul> > >
>,
Dune::Functions::HierarchicVectorWrapper<Dune::BlockVector<Dune::FieldVector<double<br>
, 2> > >&&,
Dune::Functions::LocalAnalyticGridViewFunction<Dune::FieldVector<double,
2>(Dune::FieldVector<double, 2>), Dune::GridView<<br>
Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, main(int, char**)::<lambda(Dune::FieldVec<br>
tor<double, 2>)>,
Dune::Functions::LocalDerivativeTraits<Dune::Functions::GridViewEntitySet<Dune::GridView<Dune::DefaultLeafGridViewTr<br>
aits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, 0>,
Dune::Functions::DefaultDerivativeTraits>::Traits>,
Dune::Functi<br>
ons::HierarchicVectorWrapper<const
Dune::Functions::Imp::AllTrueBitSetVector>&&>&>
(traversal.hh:188)
<br>
==15716== by 0x45EC02:
interpolateTreeSubset<Dune::Functions::DefaultGlobalBasis<Dune::Functions::TaylorHoodNodeFactory<Dune::GridV<br>
iew<Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>, (Dune::PartitionIteratorType)4u>
>, std::array<long unsigned int, 2ul>, l<br>
ong unsigned int> >,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
unsigned int, 0ul> >&, Dune::Functions::DefaultNodeToR<br>
angeMap<Dune::Functions::TaylorHoodVelocityTree<Dune::GridView<Dune::DefaultLeafGridViewTraits<const
Dune::YaspGrid<2>, (Dune::Partiti<br>
onIteratorType)4u> >, long unsigned int,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
unsigned int, 0ul> > > >, Dune::Bl<br>
ockVector<Dune::FieldVector<double, 2> >&,
main(int, char**)::<lambda(Dune::FieldVector<double,
2>)>&, Dune::Functions::Imp::AllTrueBi<br>
tSetVector> (interpolate.hh:226)
<br>
==15716== by 0x45EC02:
interpolate<Dune::Functions::DefaultGlobalBasis<Dune::Functions::TaylorHoodNodeFactory<Dune::GridView<Dune::<br>
DefaultLeafGridViewTraits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, std::array<long
unsigned int, 2ul>, long unsign<br>
ed int> >,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
unsigned int, 0ul> >&,
Dune::BlockVector<Dune::FieldVector<doubl<br>
e, 2> >&, main(int,
char**)::<lambda(Dune::FieldVector<double,
2>)>&, Dune::Functions::Imp::AllTrueBitSetVector>
(interpolate.hh:272)
<br>
==15716== by 0x45EC02:
interpolate<Dune::Functions::DefaultGlobalBasis<Dune::Functions::TaylorHoodNodeFactory<Dune::GridView<Dune::<br>
DefaultLeafGridViewTraits<const Dune::YaspGrid<2>,
(Dune::PartitionIteratorType)4u> >, std::array<long
unsigned int, 2ul>, long unsign<br>
ed int> >,
Dune::TypeTree::HybridTreePath<std::integral_constant<long
unsigned int, 0ul> >,
Dune::BlockVector<Dune::FieldVector<double<br>
, 2> >&, main(int,
char**)::<lambda(Dune::FieldVector<double, 2>)> >
(interpolate.hh:317)
<br>
==15716== by 0x45EC02: main (stokes-taylorhood.cc:277)
<br>
==15716== Address 0x7771a30 is 32 bytes before a block of size
128 in arena "client"
<br>
==15716== <br>
==15716== <br>
==15716== ---- Attach to debugger ? --- [Return/N/n/Y/y/C/c]
---- <br>
<br>
</span></div>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<br>
</body>
</html>