output derived quanteties (gradients of vector valued solution like strain)

52 views
Skip to first unread message

Konrad Schneider

unread,
Mar 10, 2023, 9:41:18 AM3/10/23
to deal.II User Group
Dear Forum,
I tried to follow the instructions of the DataPostprocessorTensor class to output the gradient of a vector valued solution. Therefore I tried to adopt step-8. However, I am getting the following error message:

An error occurred in line <5640> of file </opt/dealii_build/source/base/data_out_base.cc> in function
    void dealii::DataOutBase::write_vtk(const std::vector<dealii::DataOutBase::Patch<dim, spacedim> >&, const std::vector<std::__cxx11::basic_string<char> >&, const std::vector<std::tuple<unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, dealii::DataComponentInterpretation::DataComponentInterpretation> >&, const dealii::DataOutBase::VtkFlags&, std::ostream&) [with int dim = 2; int spacedim = 2; std::ostream = std::basic_ostream<char>]
The violated condition was:
    std::get<3>(nonscalar_data_range) != DataComponentInterpretation::component_is_part_of_tensor
Additional information:
    You are trying to use functionality in deal.II that is currently not
    implemented. In many cases, this indicates that there simply didn't
    appear much of a need for it, or that the author of the original code
    did not have the time to implement a particular case. If you hit this
    exception, it is therefore worth the time to look into the code to
    find out whether you may be able to implement the missing
    functionality. If you do, please consider providing a patch to the
    deal.II development sources (see the deal.II website on how to
    contribute).

I am using deal.ii version 9.4 and am wondering what I did wrong here. Do you have any suggestions?
Best regards 
Konrad
step-8_with_strains.cpp

Wolfgang Bangerth

unread,
Mar 10, 2023, 2:35:09 PM3/10/23
to dea...@googlegroups.com
On 3/10/23 07:41, Konrad Schneider wrote:
>
> I am using deal.ii version 9.4 and am wondering what I did wrong here. Do you
> have any suggestions?

The VTK writer simply doesn't support writing tensor data. Use the VTU writer
instead.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Konrad Schneider

unread,
Mar 10, 2023, 3:05:48 PM3/10/23
to deal.II User Group
Thanks. That was too easy. How should one know this...
Actually in the documentation (https://www.dealii.org/current/doxygen/deal.II/classDataPostprocessorTensor.html) the command
 
data_out.write_vtk (output);

appears in the example. Maybe it should be changed to 

data_out.write_vtu (output);

Furthermore, may I suggest, that it might be of some value to add the data output of stresses to one of the elasticity tutorials (maybe add it to step-8), since evaluating stresses (especially von mises stresses) is one of the major tasks in "pure" solid mechanics plus there is this pitfall that we have to use the vtu-format for tensor data.

But thanks anyway for the quick response (again).

Best regards
Konrad

Wolfgang Bangerth

unread,
Mar 10, 2023, 5:00:04 PM3/10/23
to dea...@googlegroups.com
On 3/10/23 13:05, Konrad Schneider wrote:
> **
>
> Thanks. That was too easy. How should one know this...
> Actually in the documentation
> (https://www.dealii.org/current/doxygen/deal.II/classDataPostprocessorTensor.html) the command
> data_out.write_vtk (output);
>
> appears in the example. Maybe it should be changed to
>
> data_out.write_vtu (output);
>
> Furthermore, may I suggest, that it might be of some value to add the data
> output of stresses to one of the elasticity tutorials (maybe add it to
> step-8), since evaluating stresses (especially von mises stresses) is one of
> the major tasks in "pure" solid mechanics plus there is this pitfall that we
> have to use the vtu-format for tensor data.

Konrad,
yes, this had been pointed out a couple of months ago, and the current
developer documentation already points that out as well:
https://www.dealii.org/developer/doxygen/deal.II/classDataPostprocessorTensor.html

I've taken the liberty to also write a patch that makes the error message clearer:
https://github.com/dealii/dealii/pull/14875
Reply all
Reply to author
Forward
0 new messages