Closed GoogleCodeExporter closed 9 years ago
Hi Martin,
We realize that the documentation of high-order curved meshes in MFEM is
lacking, in particular with respect to the complexity of how to number the
nodes.
I have attached the simplest second order mesh of the canonical triangle,
tetrahedron, quadrilateral and hexahedron. Let me try to explain the format
with the quad-q2.mesh:
The first section of the file:
dimension
2
elements
1
1 3 0 1 2 3
boundary
4
1 1 0 1
1 1 1 2
1 1 2 3
1 1 3 0
vertices
4
describes only the "topological" structure of the mesh -- what are the elements
and the relationships between them. There are no coordinates here, it is just
elements as lists of vertices (which are identified by indices). In this
particular example we have one quadrilateral (geom type 3) with vertices 0, 1,
2, 3 and 4 boundary elements, which are the segments (geom type 1): 01, 12, 23,
30. The shape of the element (including the coordinates of its vertices), and
the curvature of its boundary segments are not specified yet.
This "topological description of the mesh", is all that we need in order to
define a finite element space on it. Specifically, if we associate locally some
finite element degrees of freedom with element vertices, edges, faces or
interiors, then we can identify the (unique) global degrees of freedom, since
we know which elements share vertices, edges and faces (as well as their
orientation).
This is how we define isoparametric meshes in MFEM: we just describe the
coordinates of the mesh notes as a GridFunction in a FiniteElementSpace based
on the topological description. In particular there is no issue with
discontinuous meshes - you just need a topologically disjoint mesh.
In the quad-q2.mesh file we use a Q2 finite element space with degrees of
freedom in the vertices, edge mid-points and the centers of the elements, and
the function in that space with the high-order node coordinates is:
nodes
FiniteElementSpace
FiniteElementCollection: Quadratic
VDim: 2
Ordering: 0
0
1
1
0
0.5
1
0.5
0
0.5
0
0
1
1
0
0.5
1
0.5
0.
This is a vector function and by default its ordering is x-coordinate first,
then y-coordinates. In other words the Q2 nodes in this example are:
(0,0), (1,0), (1,1) and (0,1) - the 4 vertices in counter-clockwise enumeration
(0.5,0), (1,0.5), (0.5,1), (0,0.5) - the 4 edge mid-points for edges from
vertices 01, 12, 23, and 30
(0.5,0.5) - the element center
Now, what is the numbering when we have more elements?
We first number the vertex-based degrees of freedom, visiting the elements in
order, using the above counter-clockwise enumeration, and skipping the already
numbered vertices.
We next number the edge-based degrees of freedom (i.e. those in the interior of
edges), visiting the elements in order, using the above local edge ordering,
and enumerating the degrees of freedom according to the direction of the edge
(again we skip a degree of freedom if it has already been numbered by another
element).
We next number the degrees of freedom associated with interiors of element
faces, following a similar pattern, and we finally enumerate the degrees of
freedom inside the elements.
Hopefully this makes sense. I will be happy to send you more examples of
simple meshes to clarify things.
Cheers,
Tzanio
Original comment by tzanio
on 31 Dec 2013 at 12:39
Attachments:
Original comment by tzanio
on 13 Mar 2014 at 10:05
Original issue reported on code.google.com by
Martin.V...@gmail.com
on 25 Dec 2013 at 12:00