nrefs
keyword argument in CellBasis.plot()
#907
Unanswered
gatling-nrl
asked this question in
Q&A
Replies: 1 comment 1 reply
-
There is no bullet proof solution for all elements. But for P1 it is relatively simple. I would stick to calling plot(mesh, u0, shading="gouraud") for fastest performance. It does not require any interpolation or refinement and thus is faster than any calls like basis.plot(...). I'm not quite sure why nrefs=0 is lying with gouraud but nrefs=1 should be enough in the case of P1. I need to take a look at nrefs=0 case with debugger to see what happens. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure I fully understand the plotting mechanics in 2D problems. But I'm not sure what it is that I'm not understanding. When trying to really get a handle on how plotting was working, I set
nrefs=0
. I thought that would keep me closest to actually solution, and not hide anything from me. In particular I restricted myself to the P1 elements because I thought gouraud shading would render it perfectly. But this is not so. After noticing some plots I didn't understand, I made the simplest case I could think of and sure enough, gouraud shading is lying to me whennrefs=0
. See below:Everything has converged around nrefs=6, even the shading type, which is reassuring... But I would have never predicted this kind of behavior for the P1 elements and the gouraud shading. Why, for P1, does nrefs have any effect at all? What is enough nrefs? It defaults to 4, but that can be an expensive refinement on some meshes. Is 4 even enough in all cases?
Certainly it is clear now that
nrefs=0
isn't the truth-revealing setting I thought it was, but I want to understand better why, and how to avoid misleading myself with CellBasis.plot() in the future.The plots were generated with code like this:
Maybe the issue come from the nature of the projection? I guess this is trying to project a heavyside step into P1 space, with the discontinuity located somewhere between the top and the middle, given the coarse nature of the mesh? And it seems that skfem is taking that to mean a linear ramp down from the top to the middle? .... or is that just the rendering? Fortunately, CellBasis.probes can at least answer that much... and it is indeed the projection.
The point here is, I want to feel confident the image rendered is faithful to the underlying data, and I want to know where is the danger in creating misleading plots. Are these problems only made worse with higher order or exotic elements?
Beta Was this translation helpful? Give feedback.
All reactions