<div dir="ltr"><div dir="ltr">On Wed, Dec 10, 2025 at 8:14 AM Noam T. via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>Hello,</span><div><br></div><div><span>In an old question about obtaining the node connectivity of a cell with a high order approximation space,</span></div></blockquote><div><br></div><div>This is the misunderstanding here. What I implemented was visualization for meshes with high order _coordinate_ spaces. I am "guaranteed" that this will work because I know that coordinates are discretized with Lagrange spaces. I did not do this for approximation spaces because I can't guarantee this.</div><div><br></div><div>We could do the same thing for approximation spaces, and I would be happy to help you factor it out. In general, I would need to figure out the smallest DG space containing the approximation space (don't know how to do yet, but possible), then project to that first and start the descent as before.</div><div><br></div><div>  Thanks,</div><div><br></div><div>      Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><span> the use of the flag "-dm_plex_high_order_view"  for visualization purposes was brought up, as a way to refine the grid down to linear space. </span></div><div><br></div><div><span>Link: <a rel="noreferrer nofollow noopener" href="https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/dm/impls/plex/plex.c?ref_type=heads*L2021__;Iw!!G_uCfscf7eWS!ZZVaar4OGVdTXOAAjkEadcw-CAZUpAAzibpD_2SKpRupYG4oxSH-W7u5necsgTYDii6v-1kjfV4aqsllxL9XI_hK2YITfNz-$" target="_blank">https://gitlab.com/petsc/petsc/-/blob/main/src/dm/impls/plex/plex.c?ref_type=heads#L2021</a></span></div><div><br></div><div><span>I'm trying to make use of this flag to see the refinement, but I see no difference with higher order approximations.  Perhaps I am misunderstanding its use? I thought that by using it, one could see a "subdivision" of each element. Say, a single triangle, FE approximation space order 2 (3 corner nodes, 3 mid-edge nodes), would be refined into e.g. 4 linear triangles.</span></div><div><br></div><div><span>The code (Fortran) looks something along these lines:</span></div><div style="font-family:Arial,sans-serif;font-size:14px;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span><br></span></div><div style="font-family:Arial,sans-serif;font-size:14px;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span><span>! Create a DM from the mesh file</span><br><span></span><br></span></div><div></div><span></span><div><span>  DM :: cdm</span></div><div><span>  PetscInt :: K, cdim, fedim</span></div><div><span>  PetscBool :: simplex</span></div><div><span>  PetscFE :: cfe</span></div><div><span>  PetscViewer :: viewer</span></div><div><span>  PetscErrorCode :: ierr</span></div><div><br></div><div><span>  PetsCallA(DMSetFromOptions(cdm, ierr))</span></div><div><span>  PetsCallA(DMGetDimension(cdm, cdim, ierr))</span></div><div><span>  PetsCallA(DMPlexSimplex(cdm, simplex, ierr))</span></div><div><span>  PetsCallA(PetscFECreateDefault(PETSC_COMM_WORLD, cdim, cdim, simplex, "ho_", K, cfe, ierr))</span></div><div><span>  PetsCallA(PetscFEGetDimension(cfe, fedim, ierr))</span></div><div><br></div><div><span>  PetsCallA(PetscViewerCreate(PETSC_COMM_WORLD, viewer, ierr))</span></div><div><span>  PetsCallA(PetscViewerDrawOpen(PETSC_COMM_WORLD, PETSC_NULL_CHARACTER, PETSC_NULL_CHARACTER, 100, 100, 800, 800, viewer, ierr))</span></div><div><span>  PetsCallA(PetscViewerSetFromOptions(viewer, ierr))    ! also using flag -draw_pause 5</span></div><div><span>  PetsCallA(DMView(cdm, viewer, ierr))</span></div><div><span>  [...]</span></div><span></span><div><br></div><div><br></div><div><span>With the following list of flags:</span></div><div><br></div><div><span></span></div><span>    -ho_petscspace_degree K</span><div><span>    -ho_petscdualspace_lagrange_node_type equispaced</span></div><div><span>    -ho_petscdualspace_lagrange_node_endpoints 1</span></div><div><span>    -dm_plex_high_order_view</span></div><div><span>    -options_left</span></div><div><span>                               </span></div><div><span>Using "-options_left" shows that "there are no unused options"; so "-dm_plex_high_order_view" is used somehow; it is at least required for the call to "DMPlexCreateHighOrderSurrogate_Internal" within the "draw" functions.</span></div><div><br></div><div><span>From the CoordinateDM I can see the additional nodes created for the higher order approximation (e.g. mid-edge, mid-face nodes), so it seems the FE space is correct.</span></div><div><br></div><div><span>Regardless of the order "K", the mesh plotted with "DMView" is always the same, corresponding to the linear case. </span></div><div><br></div><div><span>Thank you.</span></div><div><br></div><div><span>Noam</span></div><span></span></blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!ekDGozJlgGi9X5H88PnWzpu8atTA6FPYDxbKBZbEfCAjP3O-HlOcRx5bJdDfiII0H3rwmPSpEjZTG1crZ2Aa$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>