Output cell variables as cell arrays in vtu files

24 views
Skip to first unread message

Jimmy Ho

unread,
Jul 27, 2020, 4:47:37 PM7/27/20
to deal.II User Group
Hi All,

I am trying to compute the average of integration point variables and store them as cell variables, and subsequently write them as cell arrays in the visualization. I used:

data_out.add_data_vector( cellData , "Name" , data_out.type_cell_data );

to force deal.ii to recognize that "cellData" should be interpreted as a cell-based data. When I read the vtu files generated by this program via ParaView, I found that although cellData looks like it is cell-based in the visualization (i.e., it is discontinuous over the cells), the data array itself is stored as a point array, so I couldn't use the Cell_Data_to_Point_Data filter to get a smoothed and continuous visualization. So, is there a way to write a cell-based data into cell arrays in vtu files?

Thanks a lot for any suggestions! Any help from the group is highly appreciated!

Best,
Jimmy

Wolfgang Bangerth

unread,
Jul 27, 2020, 4:55:41 PM7/27/20
to dea...@googlegroups.com
On 7/27/20 2:47 PM, Jimmy Ho wrote:
>
> data_out.add_data_vector( cellData , "Name" , data_out.type_cell_data );
>
> to force deal.ii to recognize that "cellData" should be interpreted as a
> cell-based data. When I read the vtu files generated by this program via
> ParaView, I found that although cellData looks like it is cell-based in the
> visualization (i.e., it is discontinuous over the cells), the data array
> itself is stored as a point array, so I couldn't use the
> Cell_Data_to_Point_Data filter to get a smoothed and continuous visualization.
> So, is there a way to write a cell-based data into cell arrays in vtu files?

No, all data produced by DataOut is point data. For cell-wise constants, it is
just written in a way that makes point data look piecewise constant.

You will have to find a different way to achieve what that filter does. What
does it do? Maybe we can suggest a way to achieve the same from within deal.II.

Best
W.


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

Jimmy Ho

unread,
Jul 27, 2020, 5:42:37 PM7/27/20
to deal.II User Group
Hi Dr. Bangerth,

Thanks a lot for your fast response!

That's good to know! The Cell_Data_to_Point_Data filter in ParaView averages the adjacent cell values and assign them to the nodes, which produces a smooth and continuous nodal solution field. I was planning on implementing the averaging scheme myself but I was just looking to see if ParaView already has this functionality.

In general, is there a built-in function from deal.ii that can performing nodal averaging? This can be very useful when someone tries to generate smooth and continuous visualization for integration point variables.

Thanks again for the help!

Best,
Jimmy

Jimmy Ho

unread,
Jul 28, 2020, 2:00:22 PM7/28/20
to deal.II User Group
Hi Dr. Bangerth,

Thanks a lot for pointing me to the right direction! That's what I am looking for!

Best,
Jimmy

On Monday, July 27, 2020 at 3:55:41 PM UTC-5, Wolfgang Bangerth wrote:
Reply all
Reply to author
Forward
0 new messages