[petsc-users] coordinate degrees of freedom for 2nd-order gmsh mesh

Daniel R. Shapero shapero at uw.edu
Wed Jan 11 18:42:54 CST 2023


Hi all -- I'm trying to read in 2nd-order / piecewise quadratic meshes that
are generated by gmsh and I don't understand how the coordinates are stored
in the plex. I've been discussing this with Matt Knepley here
<https://github.com/firedrakeproject/firedrake/issues/982> as it pertains
to Firedrake but I think this is more an issue at the PETSc level.

This code
<https://gist.github.com/danshapero/a140daaf951ba58c48285ec29f5973cc> uses
gmsh to generate a 2nd-order mesh of the unit disk, read it into a DMPlex,
print out the number of cells in each depth stratum, and finally print a
view of the coordinate DM's section. The resulting mesh has 64 triangles,
104 edges, and 41 vertices. For 2nd-order meshes, I'd expected there to be
2 degrees of freedom at each node and 2 at each edge. The output is:

```
Depth strata: [(64, 105), (105, 209), (0, 64)]

PetscSection Object: 1 MPI process
  type not yet set
1 fields
  field 0 with 2 components
Process 0:
  (   0) dim 12 offset   0
  (   1) dim 12 offset  12
  (   2) dim 12 offset  24
...
  (  62) dim 12 offset 744
  (  63) dim 12 offset 756
  (  64) dim  0 offset 768
  (  65) dim  0 offset 768
...
  ( 207) dim  0 offset 768
  ( 208) dim  0 offset 768
  PetscSectionSym Object: 1 MPI process
    type: label
    Label 'depth'
    Symmetry for stratum value 0 (0 dofs per point): no symmetries
    Symmetry for stratum value 1 (0 dofs per point): no symmetries
    Symmetry for stratum value 2 (12 dofs per point):
      Orientation range: [-3, 3)
    Symmetry for stratum value -1 (0 dofs per point): no symmetries
```

The output suggests that there are 12 degrees of freedom in each triangle.
That would mean the coordinate field is discontinuous across cell
boundaries. Can someone explain what's going on? I tried reading the .msh
file but it's totally inscrutable to me. I'm happy to RTFSC if someone
points me in the right direction. Matt tells me that the coordinate field
should only be discontinuous if the mesh is periodic, but this mesh
shouldn't be periodic.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230111/cee770ae/attachment.html>


More information about the petsc-users mailing list