Dear Jie,

Your query relates to this FAQ post 
<https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#i-get-an-exception-in-virtual-dealiisubscriptorsubscriptor-that-makes-no-sense-to-me>.
 You’ll likely find that DataOut is holding a pointer to the 
DataPostprocessorTensor, and the post processor is going out of scope (so being 
removed from the stack) before DataOut. So I think that if you switch the order 
of construction of these two objects, ie.
> StrainPostprocessor<dim> strain;
> DataOut<dim> data;
> …

then this would probably fix the problem.

Best,
J-P


> On 07 Sep 2017, at 03:56, Jie Cheng <chengjieh...@gmail.com> wrote:
> 
> Hi Wolfgang
> 
> I tried DataPostprocessorTensor as soon as the commits merged in. It is easy 
> to use, I really like it! Thank you! Unfortunately there is still a bug that 
> I couldn't figure out, which is basically the same as my previous post: after 
> successfully writing the output, the program aborts with the following 
> message:
> 
> --------------------------------------------------------
> An error occurred in line <104> of file 
> </home/jie/dealii/source/base/subscriptor.cc> in function
>     void dealii::Subscriptor::check_no_subscribers() const
> The violated condition was: 
>     counter == 0
> Additional information: 
>     (none)
> 
> Stacktrace:
> -----------
> #0  /home/jie/dealii-latest/lib/libdeal_II.g.so.9.0.0-pre: 
> dealii::Subscriptor::check_no_subscribers() const
> #1  /home/jie/dealii-latest/lib/libdeal_II.g.so.9.0.0-pre: 
> dealii::Subscriptor::~Subscriptor()
> #2  /home/jie/dealii-latest/lib/libdeal_II.g.so.9.0.0-pre: 
> dealii::DataPostprocessor<2>::~DataPostprocessor()
> #3  ./main: IFEM::LinearElasticSolver<2>::output(unsigned int) const
> #4  ./main: 
> IFEM::LinearElasticSolver<2>::runStatics(std::__cxx11::basic_string<char, 
> std::char_traits<char>, std::allocator<char> > const&)
> #5  ./main: main
> --------------------------------------------------------
> 
> Aborted (core dumped)
> 
> This looks like the early destruction bug in step 6, but I couldn't think of 
> any similar mistake in my program. I basically copied your 
> StrainPostprocessor class in data_out_postprocessor_tensor_01.cc, and used it 
> like this:
> 
>     std::vector<DataComponentInterpretation::DataComponentInterpretation>
>       interpretation(dim, 
> DataComponentInterpretation::component_is_part_of_vector);
>     data.add_data_vector(this->dofHandler, this->solution,
>       std::vector<std::string>(dim, "displacement"), interpretation);
>     StrainPostprocessor<dim> strain;
>     data.add_data_vector(this->dofHandler, this->solution, strain);
>     
>     data.build_patches();
>     data.write_vtu(out);
> 
>  
> Thanks
> Jie
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> <http://www.dealii.org/>
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> <https://groups.google.com/d/forum/dealii?hl=en>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to dealii+unsubscr...@googlegroups.com 
> <mailto:dealii+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to