old bbox: ((0.0, 1.0), (0.0, 1.0), (0.0, 1.0))
PetscFE Object: P2 1 MPI processes
type: basic
Basic Finite Element in 3 dimensions with 3 components
PetscSpace Object: P2 1 MPI processes
type: sum
Space in 3 variables with 3 components, size 30
Sum space of 3 concatenated subspaces (all identical)
PetscSpace Object: sum component (sumcomp_) 1 MPI processes
type: poly
Space in 3 variables with 1 components, size 10
Polynomial space of degree 2
PetscDualSpace Object: P2 1 MPI processes
type: lagrange
Dual space with 3 components, size 30
Continuous Lagrange dual space
Quadrature of order 5 on 27 points (dim 3)
new bbox: ((-6.530133708576188e-17, 36.30670832662781), (-3.899962995254311e-17, 36.2406171632539), (-8.8036464152166e-17, 36.111577025012224))```
By the way, for the original DG coordinates, where can I find the relation of the closure and the order of the dofs for the cell?
Thanks!
Zongze
On Thu, Jun 16, 2022 at 12:06 PM Zongze Yang <yangzongze@gmail.com> wrote:在 2022年6月16日,23:22,Matthew Knepley <knepley@gmail.com> 写道:On Thu, Jun 16, 2022 at 11:11 AM Zongze Yang <yangzongze@gmail.com> wrote:Hi, if I load a `gmsh` file with second-order elements, the coordinates will be stored in a DG-P2 space. After obtaining the coordinates of a cell, how can I map the coordinates to vertex and edge?By default, they are stored as P2, not DG.I checked the coordinates vector, and found the dogs only defined on cell other than vertex and edge, so I said they are stored as DG.Then the function DMPlexVecGetClosure seems return the coordinates in lex order.Some code in reading gmsh file reads that1756: if (isSimplex) continuity = PETSC_FALSE; /* XXX FIXME Requires DMPlexSetClosurePermutationLexicographic() */
1758: GmshCreateFE(comm, NULL, isSimplex, continuity, nodeType, dim, coordDim, order, &fe)
The continuity is set to false for simplex.
Oh, yes. That needs to be fixed. For now, you can just project it to P2 if you want usingThanks,MattThanks,ZongzeYou can ask for the coordinates of a vertex or an edge directly usingby giving the vertex or edge point. You can get all the coordinates on a cell, in the closure order, usingThanks,MattBelow is some code load the gmsh file, I want to know the relation between `cl` and `cell_coords`.```import firedrake as fd
import numpy as np
# Load gmsh file (2rd)
plex = fd.mesh._from_gmsh('test-fd-load-p2-rect.msh')
cs, ce = plex.getHeightStratum(0)
cdm = plex.getCoordinateDM()
csec = dm.getCoordinateSection()
coords_gvec = dm.getCoordinates()
for i in range(cs, ce):
cell_coords = cdm.getVecClosure(csec, coords_gvec, i)
print(f'coordinates for cell {i} :\n{cell_coords.reshape([-1, 3])}')
cl = dm.getTransitiveClosure(i)
print('closure:', cl)
break```Best wishes,Zongze--What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener--What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener