glvis icon indicating copy to clipboard operation
glvis copied to clipboard

Support variable order spaces

Open rw-anderson opened this issue 3 years ago • 7 comments

A gridfunction on a p-refined space does not visualize properly - it appears the enriched elements show up as their original order. How difficult would it be to visualize a variable order space?

rw-anderson avatar Feb 02 '22 16:02 rw-anderson

There is some code to deal with this, not in the main MFEM or glvis library, see ProlongToMaxOrder for example in miniapps/gslib/findpts.cpp: https://github.com/mfem/mfem/blob/a96065ed1802ee95e7a33ee749b2ae4a6e4a6de6/miniapps/gslib/findpts.cpp#L46

dylan-copeland avatar Feb 02 '22 16:02 dylan-copeland

Can we add this ☝️ to mfem proper and call it automatically in glvis when needed?

tzanio avatar Feb 02 '22 16:02 tzanio

We thought about it in the recent PR https://github.com/mfem/mfem/pull/2766 which added this code. This "experimental" function is for L2 or H1 spaces. It would need to be generalized for arbitrary spaces, so we would need to think about whether that can be done in general. If there are spaces (e.g. ND, RT) that do not work, we may need to check the type with MFEM_VERIFY to prevent misuse.

dylan-copeland avatar Feb 02 '22 16:02 dylan-copeland

Projecting to max order seems like a workaround, but expensive if the space is highly locally enriched. Would rendering each element in its native order be too difficult?

rw-anderson avatar Feb 02 '22 18:02 rw-anderson

The first issue is that FiniteElementSpace::Save (which is used to send data to GLVis) does not support variable orders yet -- it is probably not too hard to add this. This also needs to be supported in FiniteElementSpace::Load.

With these two methods implemented properly we can try GLVis and see if there are any issues there.

v-dobrev avatar Feb 02 '22 18:02 v-dobrev

Did anyone tried making this work? cc: @rw-anderson @dylan-copeland I need it for another project so figured I would check before I work on it.

kmittal2 avatar May 22 '23 17:05 kmittal2

@kmittal2 I am not aware of any work to support this, aside from ProlongToMaxOrder in miniapps/gslib/findpts.cpp, which has always worked for the examples I've seen so far but could be expensive for large enough meshes.

dylan-copeland avatar May 22 '23 18:05 dylan-copeland