Adding the manifold ID to a DataOutFaces<dim>

20 views
Skip to first unread message

Bruno Blais

unread,
Apr 8, 2020, 9:39:48 PM4/8/20
to deal.II User Group
Dear all, 
I hope you are well.
I am currently working extensively with adaptive mesh refinement and I feel the need to output the 2D boundary surface of my 3D mesh (thus a dim=2, spacedim=3 type of problem)
I have realized there is an amazing Data out object that exists  DataOutFaces<dim> which does exactly what I need.
I have figured out how to attach data to it and how to write parallel vtu files with it. However, I would like to add a data to this DataOutFace that would give out the manifold number (or the boundary id) of my boundary condition. However, since this DataOutFace only contains face of the surface, I am really unsure how to iterate on this structure.
I saw that there is a first_face() and next_face() function that should allow me to iterate over the face. However, this structure appears to be an std::pair and from this point I am confused as to how to use it.
Could somebody point me in the right direction? I have looked online, but it seems this class is not used extensively.

Thank you very much for your help,
Bruno

Jean-Paul Pelteret

unread,
Apr 9, 2020, 6:45:24 PM4/9/20
to dea...@googlegroups.com
Hi Bruno,

I haven’t used this class before, and admittedly haven’t gone digging too deep for examples of where its used. But here are a few examples (one tutorial and a couple from the test suite) that may be able to guide you in the right direction. At first glance, its seems to work more-or-less like the normal DataOut class.

I hope that this helps you a little.
Best,
Jean-Paul

-- 
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/2effdbf6-a7e7-45f7-89cb-528865285460%40googlegroups.com.

Jean-Paul Pelteret

unread,
Apr 9, 2020, 7:00:43 PM4/9/20
to dea...@googlegroups.com
Sorry, I hit send too soon. It might be possible to use a PostProcessorScalar to extract the manifold ID from the cell that the post-processor is actively working on, and return that value as the outputted “computed_quantities". Then you don’t need to worry about any of the iterating yourself. But I’m not quite sure if you can get it to colour each face as a single manifold ID (as it might interpolate the values between adjacent faces). That said, I would be surprised if this were not somehow possible to do, since we allow the cell material ID to be output as a cell constant value.

Maybe someone else on the mailing list knows more about this class, and could provide more hints?

Wolfgang Bangerth

unread,
Apr 9, 2020, 7:10:54 PM4/9/20
to dea...@googlegroups.com
On 4/9/20 5:00 PM, Jean-Paul Pelteret wrote:
> Sorry, I hit send too soon. It might be possible to use a PostProcessorScalar
> to extract the manifold ID from the cell that the post-processor is actively
> working on, and return that value as the outputted “computed_quantities". Then
> you don’t need to worry about any of the iterating yourself.

Yes, that's the way I would have used.


> But I’m not quite
> sure if you can get it to colour each face as a single manifold ID (as it
> might interpolate the values between adjacent faces). That said, I would be
> surprised if this were not somehow possible to do, since we allow the cell
> material ID to be output as a cell constant value.

For DataOutFaces, you get a different data record for each face. So you should
definitely be able to plot individual faces of the same cell with different
colors.

Best
W.

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

Reply all
Reply to author
Forward
0 new messages