Issues with step-1 and step-2

89 views
Skip to first unread message

ankit tyagi

unread,
Apr 13, 2022, 12:35:45 AM4/13/22
to deal.II User Group
The grid-2 in step-1, produced without color by using:

GridOutFlags::Svg svg_flags;
svg_flags.coloring = svg_flags.Coloring::none;
svg_flags.label_level_number = false;
svg_flags.label_cell_index = false;
grid_out.set_flags(svg_flags);

shows some spurious connections at every refinement. The problem goes away, or is hidden, when format is eps. PFA grid-2.svg and grid-2.eps.

The same problem is more clearly visible in step-2 when mesh is printed with gnuplot using the code given in "Possibilities for extension". PFA grid-2.pdf.
grid-2.pdf
grid-2.eps
grid-2.svg

Wolfgang Bangerth

unread,
Apr 13, 2022, 11:31:04 AM4/13/22
to dea...@googlegroups.com
Ankit:
This is basically the same issue as here:

https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#in-my-graphical-output-the-solution-appears-discontinuous-at-hanging-nodes

The edges of cells are shown as straight lines, even though internally they
are curved. The geometry really does not have holes, but it is visualized as
if it had.

Best
W.


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

ankit tyagi

unread,
Apr 14, 2022, 12:25:22 AM4/14/22
to deal.II User Group
According the the github link, this can happen when using higher order elements. But here it just the visualization of mesh. Is there a way to make the mesh visualization faithful to the actual topology? Why is this problem not visible in eps format?

Thanks,
Ankit

Wolfgang Bangerth

unread,
Apr 14, 2022, 12:59:35 PM4/14/22
to dea...@googlegroups.com
On 4/13/22 22:25, ankit tyagi wrote:
> According the the github link, this can happen when using higher order
> elements. But here it just the visualization of mesh. Is there a way to make
> the mesh visualization faithful to the actual topology? Why is this problem
> not visible in eps format?

The description at the link is not complete, this can also happen if (as in
step-1/2) you have curved manifolds. I should update the description there.

In order to make the mesh visualization faithful, you'd have to have a way to
actually plot edges of the mesh as curved lines. You can do this "sort of" in
VTK output (see the DataOut::build_patches() function documentation) but it's
still only a quadratic approximation and so the difference between lines at
hanging nodes will simply be smaller, but not necessarily zero, if you have
non-polynomial mappings. I believe that the GridOut::write_gnuplot() function
can also show lines as a number of small line segments. Short of this, no file
format I know of can produce a faithful representation.

(About eps: I believe that it also doesn't produce a faithful representation,
though the error may be small enough that the issue is not visible.)

Wolfgang Bangerth

unread,
Apr 15, 2022, 12:36:41 PM4/15/22
to dea...@googlegroups.com
On 4/13/22 22:25, ankit tyagi wrote:
> According the the github link, this can happen when using higher order elements.

I updated the page, see here now:
https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#in-my-graphical-output-the-solution-appears-discontinuous-at-hanging-nodes

ankit tyagi

unread,
Apr 16, 2022, 11:40:46 PM4/16/22
to deal.II User Group
I think the issue is different here. PFA three files corresponding to
a coarser version of grid-2 mesh. First is the original coarse mesh,
second with single refinement, and third with two refinements. The
first refinement doesn't cause any issue, but second does. In the
first refinement, all cells are inner cells, so appropriate changes
are made to all the boundaries. But in the second refinement, there
are outer cells and inner cells, and only the inner cells are
refined. This causes a contradiction, because the outer and inner
cells share a boundary: the middle circle. Because of refinement of
inner cells, they get a new outer boundary, but the outer cells retain
their inner boundary, creating discontinuities at the middle circle.

This point is further proved if we change the refinement strategy to
the one mentioned in the "Possibilities for extensions" section.  This
time, all the cells with center lying on the positive y side,
are refined . Even though boundaries are still curved, it causes no
issue. PFA "grid-3-coarse.svg" and full code also.
grid-3-coarse.svg
grid-2-norefine.svg
grid-2-single-refine.svg
grid-2-double-refine.svg
step-1.cc

Wolfgang Bangerth

unread,
Apr 18, 2022, 11:35:42 AM4/18/22
to dea...@googlegroups.com
On 4/16/22 21:40, ankit tyagi wrote:
> *** Caution: EXTERNAL Sender ***
>
> I think the issue is different here. PFA three files corresponding to
> a coarser version of grid-2 mesh. First is the original coarse mesh,
> second with single refinement, and third with two refinements. The
> first refinement doesn't cause any issue, but second does. In the
> first refinement, all cells are inner cells, so appropriate changes
> are made to all the boundaries. But in the second refinement, there
> are outer cells and inner cells, and only the inner cells are
> refined. This causes a contradiction, because the outer and inner
> cells share a boundary: the middle circle. Because of refinement of
> inner cells, they get a new outer boundary, but the outer cells retain
> their inner boundary, creating discontinuities at the middle circle.
>
> This point is further proved if we change the refinement strategy to
> the one mentioned in the "Possibilities for extensions" section.  This
> time, all the cells with center lying on the positive y side,
> are refined . Even though boundaries are still curved, it causes no
> issue. PFA "grid-3-coarse.svg" and full code also.

I see no contradiction to my earlier statements. The only edges that are
affected by the use of a curved manifold description are the ones that are in
circumferential direction, and in your pictures, these are exactly the ones
that have the funny appearance. The manifold is chosen in such a way that all
radial edges are in fact straight, and so whenever there is a hanging node
along such an edge, the two child edges geometrically cover the parent edge
exactly.

ankit tyagi

unread,
Apr 18, 2022, 2:42:38 PM4/18/22
to deal.II User Group
Sorry for pestering you, but why does this not happen in "grid-2-single-refine.svg" and "grid-3-coarse.svg"?

Wolfgang Bangerth

unread,
Apr 18, 2022, 4:01:25 PM4/18/22
to dea...@googlegroups.com
On 4/18/22 12:42, ankit tyagi wrote:
> Sorry for pestering you, but why does this not happen in
> "grid-2-single-refine.svg" and "grid-3-coarse.svg"?

Neither of these have hanging nodes on circumferential edges. The
problem only happens because (i) the output plots both the parent and
child edges, (ii) edges are shown as straight lines even though
internally that is not guaranteed to be so, (iii) for circumferential
edges, the edges really are curved, and so the midpoint of the parent
edge is not actually at the midpoint of the straight line shown.

ankit tyagi

unread,
Apr 19, 2022, 6:52:05 AM4/19/22
to deal.II User Group
Thank you so much. I think I got it now. Just one last thing. If the output stops plotting the parent edge, and plots only the child edges, the visual discrepancy can be avoided. Right? Will that be a problem in some other way?

Wolfgang Bangerth

unread,
Apr 19, 2022, 9:47:28 AM4/19/22
to dea...@googlegroups.com
On 4/19/22 04:52, ankit tyagi wrote:
> Thank you so much. I think I got it now. Just one last thing. If the output
> stops plotting the parent edge, and plots only the child edges, the visual
> discrepancy can be avoided. Right? Will that be a problem in some other way?

Yes, one could only show the child edges. That would avoid the graphical
confusion, but they too are not a true depiction of what is happening
internally, and it would make the large cell look like a pentagon. I think
that there is no good solution.

But if you wanted to implement an option for only showing the small edges, we
would gladly accept a patch!
Reply all
Reply to author
Forward
0 new messages