Dear Jie,

I'm glad to hear that you managed to find a solution to your problem and 
for posting what it was. Two quick points:
1. There's actually another add_data_vector() 
<https://www.dealii.org/8.5.0/doxygen/deal.II/classDataOut__DoFData.html#a4bce7f46c9ad03ecdd71a86d47f8fb11>
 
member function of DataOut that takes in another DoFHandler as an argument, 
so you could compute the stress fields using another DoFHandler, with 
another DataComponentInterpretation etc. This will help remedy your last 
concern, because you will have only as many components as you need.
2. You might want to consider solving for the smoothed stress fields via 
global L2-smoothing rather than manual averaging. To the best of my 
understanding, it should produce a more accurate representation of the 
stress field than your approach. This should also be a relatively 
inexpensive operation because solving the linear system only involves 
inverting a mass matrix. 

Regards,
Jean-Paul

On Thursday, August 24, 2017 at 5:13:29 AM UTC+2, Jie Cheng wrote:
>
> Update:
>
> I switched to my old trick of nodal averaging method: take the average of 
> the values at quadrature points, then add this average to the vertex dofs. 
> And if a vertex is shared by n cells, divide the values at the related dofs 
> by n.
> I am happy with the results because they look quite smooth.
>
> The only concern is that: for a stress component, say Sxx, appears in my 
> resulting vtu files as Sxx_0, Sxx_1 (in 2D) because the variable Sxx is a 
> vector of size n_dofs as required by the add_data_vector function. Is there 
> a way to get rid of the unnecessary duplicates? Essentially I want Sxx to 
> be a vector of size n_vertices.
>
> Thank you
> Jie
>
>
>

-- 
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