<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Dear Thomas,<div class=""><br class=""></div><div class="">AFAIK the default implementation expects a flat vector, i.e. the entries can’t be blocked into a FieldVector<double,3>.</div><div class=""><br class=""></div><div class="">You can pass a custom VTKFunction instead that knows how to handle the nested type.</div><div class="">For example there is a possible implementation in Dumux (<a href="https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/io/vtkfunction.hh" class="">https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/io/vtkfunction.hh</a>)</div><div class="">I don’t know if that’s too complicated for your needs.</div><div class=""><br class=""></div><div class="">There might be a solution with dune-functions. I’m not sure...</div><div class=""><br class=""></div><div class="">Best wishes,</div><div class="">Timo</div><div class=""><br class=""><div class="">
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;">-- <br class="">_________________________________________________</div><div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class="">Timo Koch                                      phone: +49 711 685 64676<br class="">IWS, Universität Stuttgart                  fax:   +49 711 685 60430<br class="">Pfaffenwaldring 61         <a href="mailto:timo.koch@iws.uni-stuttgart.de" class="">email: timo.koch@iws.uni-stuttgart.de</a><br class="">D-70569 Stuttgart             url: <a href="http://www.iws.uni-stuttgart.de/en/lh2/" class="">www.iws.uni-stuttgart.de/en/lh2/</a><br class="">_________________________________________________</div>
</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 14. Apr 2020, at 10:14, HELFER Thomas 202608 <<a href="mailto:thomas.helfer@cea.fr" class="">thomas.helfer@cea.fr</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear all,<br class=""><br class="">I have written a small elastic example. However, I wish to export my displacement field to VTK, <br class="">However, the following call to `addVertexData` fails (error message below):<br class=""><br class="">Dune::VTKWriter<GridView> vtkWriter(gv);<br class="">vtkWriter.addVertexData(x, "solution", 3);<br class=""><br class="">where x is an instance of Dune::BlockVector<Dune::FieldVector<double, dime>>. The third parameter<br class="">of the method is probably not relevant here.<br class=""><br class="">I would be grateful if someone could tell what I missed.<br class=""><br class="">Regards,<br class=""><br class="">Thomas Helfer<br class=""><br class="">[ 75%] Building CXX object src/CMakeFiles/dune-mgis-elasticity-test.dir/dune-mgis-elasticity-test.cc.o<br class="">In file included from /home/th202608/codes/dune/2.7/install/include/dune/grid/io/file/vtk/vtkwriter.hh:29,<br class="">                 from /home/th202608/codes/dune/2.7/tests/dune-mgis/src/<a href="http://dune-mgis-elasticity-test.cc:24" class="">dune-mgis-elasticity-test.cc:24</a>:<br class="">/home/th202608/codes/dune/2.7/install/include/dune/grid/io/file/vtk/function.hh: In instantiation of 'double Dune::P1VTKFunction<GV, V>::evaluate(int, const Entity&, const Dune::FieldVector<typename Dune::VTKFunction<GV>::ctype, #'using_decl' not supported by dump_expr#<expression error> >&) const [with GV = Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<3> > >; V = Dune::BlockVector<Dune::FieldVector<double, 3> >; Dune::P1VTKFunction<GV, V>::Entity = Dune::Entity<0, 3, const Dune::YaspGrid<3>, Dune::YaspEntity>; Dune::P1VTKFunction<GV, V>::Base = Dune::VTKFunction<Dune::GridView<Dune::DefaultLeafGridViewTraits<const Dune::YaspGrid<3> > > >; typename Dune::VTKFunction<GV>::ctype = double]':<br class="">/home/th202608/codes/dune/2.7/install/include/dune/grid/io/file/vtk/function.hh:235:12:   required from here<br class="">/home/th202608/codes/dune/2.7/install/include/dune/grid/io/file/vtk/function.hh:243:25: error: use of deleted function 'Dune::FieldVector<K, 1>& Dune::FieldVector<K, 1>::operator=(const Dune::FieldVector<T, N>&) [with T = double; int N = 3; K = double]'<br class="">  243 |         cornerValues[i] = v[mapper.subIndex(e,i,dim)*ncomps_+mycomp_];<br class="">      |         ~~~~~~~~~~~~~~~~^~~~<br class="">In file included from /home/th202608/codes/dune/2.7/install/include/dune/grid/common/grid.hh:15,<br class="">                 from /home/th202608/codes/dune/2.7/install/include/dune/grid/yaspgrid.hh:20,<br class="">                 from /home/th202608/codes/dune/2.7/tests/dune-mgis/src/<a href="http://dune-mgis-elasticity-test.cc:14" class="">dune-mgis-elasticity-test.cc:14</a>:<br class="">/home/th202608/codes/dune/2.7/install/include/dune/common/fvector.hh:352:18: note: declared here<br class="">  352 |     FieldVector& operator=(const FieldVector<T, N>&) = delete;<br class=""><br class="">_______________________________________________<br class="">Dune mailing list<br class=""><a href="mailto:Dune@lists.dune-project.org" class="">Dune@lists.dune-project.org</a><br class="">https://lists.dune-project.org/mailman/listinfo/dune</div></div></blockquote></div><br class=""></div></body></html>