2d meshes and orientation

44 views
Skip to first unread message

Konrad Simon

unread,
Apr 5, 2021, 5:33:40 AM4/5/21
to deal.II User Group
Dear deal.ii community,

I stumbled over something in 2d meshes that confuses me a bit. Supoose I have 2 squares (a left and a right one) sharing one edge. If everything is fine all lines and faces have standard orientation, i.e., line_orientation==true and face_orientation==true for all lines and faces. Note that lines and faces are NOT the same geometric entity here since their orientation is determined differently (faces have normals and lines have tangents).

Now, if I rotate the right square by 90 degrees I get (on the shared edge) non-matching face normals but all line orientations do match.

If I rotate the right square by 180 degrees I get (on the shared edge) non-matching face normals and non-matching line orientations.

If I rotate the right square by 270 degrees I get (on the shared edge) matching face normals and non-matching line orientations.

This is at least my intuition. When I query these information for each rotation case I see that my intuition is confirmed for lines but the face orientations are always true.

Is this a bug?

I am asking because it seems that 2d RaviartThomas elements (which make use of face normals) are broken for some edge cases (3d RT I could fix).

Best,
Konrad

Wolfgang Bangerth

unread,
Apr 5, 2021, 11:53:15 PM4/5/21
to dea...@googlegroups.com
It's possible this is indeed a bug. In most cases, we run the 2d meshes
through the mesh orienter, so we rarely see 2d meshes that are not correctly
oriented and it wouldn't surprise me if we have the kind of bug you describe
where things almost but not quite work correctly.

The questions then are (i) where does this need to be fixed, and (ii) how many
tests fail if we apply the fix? One of the things I learned (and I think you
did as well) is that for bugs in these kinds of layers, it is quite possible
that one ends up with 100 failing tests and then it takes a *lot* of work to
look through all of these to figure out whether the new output is correct or
not. But then, as mentioned above, it's also possible that only one or two
tests fail because we almost never see these kinds of meshes.

Best
W.

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

Konrad Simon

unread,
Apr 6, 2021, 2:53:58 AM4/6/21
to deal.II User Group
Dear Wolfgang,

On Tuesday, April 6, 2021 at 5:53:15 AM UTC+2 Wolfgang Bangerth wrote:
It's possible this is indeed a bug. In most cases, we run the 2d meshes
through the mesh orienter, so we rarely see 2d meshes that are not correctly
oriented and it wouldn't surprise me if we have the kind of bug you describe
where things almost but not quite work correctly.

I see. Many thanks for the input. This is my impression as well. These things rarely happen in 2d.
One example would be simple periodic meshes which cause line orientations not to match (this case is caught). In more
complicated scenarios involving periodicity and rotations of faces it can happen though that lines do match but normals do not.


The questions then are (i) where does this need to be fixed, and (ii) how many
tests fail if we apply the fix? One of the things I learned (and I think you
did as well) is that for bugs in these kinds of layers, it is quite possible
that one ends up with 100 failing tests and then it takes a *lot* of work to
look through all of these to figure out whether the new output is correct or
not. But then, as mentioned above, it's also possible that only one or two
tests fail because we almost never see these kinds of meshes.

Sound worth trying. Please see also this new PR which is work in progress.
Reply all
Reply to author
Forward
0 new messages