Hello,

In an old question about obtaining the node connectivity of a cell with a high order approximation space, 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.

Link: https://gitlab.com/petsc/petsc/-/blob/main/src/dm/impls/plex/plex.c?ref_type=heads#L2021

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.

The code (Fortran) looks something along these lines:

! Create a DM from the mesh file

  DM :: cdm
  PetscInt :: K, cdim, fedim
  PetscBool :: simplex
  PetscFE :: cfe
  PetscViewer :: viewer
  PetscErrorCode :: ierr

  PetsCallA(DMSetFromOptions(cdm, ierr))
  PetsCallA(DMGetDimension(cdm, cdim, ierr))
  PetsCallA(DMPlexSimplex(cdm, simplex, ierr))
  PetsCallA(PetscFECreateDefault(PETSC_COMM_WORLD, cdim, cdim, simplex, "ho_", K, cfe, ierr))
  PetsCallA(PetscFEGetDimension(cfe, fedim, ierr))

  PetsCallA(PetscViewerCreate(PETSC_COMM_WORLD, viewer, ierr))
  PetsCallA(PetscViewerDrawOpen(PETSC_COMM_WORLD, PETSC_NULL_CHARACTER, PETSC_NULL_CHARACTER, 100, 100, 800, 800, viewer, ierr))
  PetsCallA(PetscViewerSetFromOptions(viewer, ierr))    ! also using flag -draw_pause 5
  PetsCallA(DMView(cdm, viewer, ierr))
  [...]


With the following list of flags:

    -ho_petscspace_degree K
    -ho_petscdualspace_lagrange_node_type equispaced
    -ho_petscdualspace_lagrange_node_endpoints 1
    -dm_plex_high_order_view
    -options_left
                               
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.

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.

Regardless of the order "K", the mesh plotted with "DMView" is always the same, corresponding to the linear case.

Thank you.

Noam