[Dune] Exporting displacement field to VTK
HELFER Thomas 202608
thomas.helfer at cea.fr
Tue Apr 14 23:50:07 CEST 2020
Thanks for your answers.
I adapted Simon answers and it works great.
Thanks at lot.
Thomas
________________________________________
De : Dune [dune-bounces at lists.dune-project.org] de la part de Christian Engwer [christian.engwer at uni-muenster.de]
Envoyé : mardi 14 avril 2020 11:02
À : dune at lists.dune-project.org
Objet : Re: [Dune] Exporting displacement field to VTK
Hi Thomas,
> AFAIK the default implementation expects a flat vector, i.e. the entries can’t be blocked into a FieldVector<double,3>.
>
> You can pass a custom VTKFunction instead that knows how to handle the nested type.
> For example there is a possible implementation in Dumux (https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/io/vtkfunction.hh <https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/io/vtkfunction.hh>)
> I don’t know if that’s too complicated for your needs.
>
> There might be a solution with dune-functions. I’m not sure...
what you need to write yourself or what yuo can use depends on how yuo
implemented your discretization. All higherlevel discretization
modules offer functionality to interpret a coefficient vector as a
discrete function, which can then be visualized using VTK.
If you use `dune-functions` you can simply create `DiscreteGlobalBasisFunction` and pass this function to the VTKWriter (e.g. see dune/functions/functionspacebases/test/lagrangebasistest.cc).
If you are using `dune-pdelab` you can create a `driscreteGridViewFunction`, which follows the same interface as in `dune-functions`, so passing it to VTKWriter looks the same...
Best
Christian
_______________________________________________
Dune mailing list
Dune at lists.dune-project.org
https://lists.dune-project.org/mailman/listinfo/dune
More information about the Dune
mailing list