[Dune] Exporting displacement field to VTK

HELFER Thomas 202608 thomas.helfer at cea.fr
Tue Apr 14 10:14:51 CEST 2020


Dear all,

I have written a small elastic example. However, I wish to export my displacement field to VTK, 
However, the following call to `addVertexData` fails (error message below):

Dune::VTKWriter<GridView> vtkWriter(gv);
vtkWriter.addVertexData(x, "solution", 3);

where x is an instance of Dune::BlockVector<Dune::FieldVector<double, dime>>. The third parameter
of the method is probably not relevant here.

I would be grateful if someone could tell what I missed.

Regards,

Thomas Helfer

[ 75%] Building CXX object src/CMakeFiles/dune-mgis-elasticity-test.dir/dune-mgis-elasticity-test.cc.o
In file included from /home/th202608/codes/dune/2.7/install/include/dune/grid/io/file/vtk/vtkwriter.hh:29,
                 from /home/th202608/codes/dune/2.7/tests/dune-mgis/src/dune-mgis-elasticity-test.cc:24:
/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]':
/home/th202608/codes/dune/2.7/install/include/dune/grid/io/file/vtk/function.hh:235:12:   required from here
/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]'
  243 |         cornerValues[i] = v[mapper.subIndex(e,i,dim)*ncomps_+mycomp_];
      |         ~~~~~~~~~~~~~~~~^~~~
In file included from /home/th202608/codes/dune/2.7/install/include/dune/grid/common/grid.hh:15,
                 from /home/th202608/codes/dune/2.7/install/include/dune/grid/yaspgrid.hh:20,
                 from /home/th202608/codes/dune/2.7/tests/dune-mgis/src/dune-mgis-elasticity-test.cc:14:
/home/th202608/codes/dune/2.7/install/include/dune/common/fvector.hh:352:18: note: declared here
  352 |     FieldVector& operator=(const FieldVector<T, N>&) = delete;




More information about the Dune mailing list