This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Are Face (and other) Indexes Deterministic?

+1 vote

When storing a 3D Mesh object in a File via

data_file = dolfin.File(filename)
data_file << mesh_3d

only the vertices and the cells are stored in filename.

However, there are plenty of other objects associated from these that can be inferred from the cells, such as faces and edges.

So, are the indices of these faces deterministic on reloading of the mesh file? If no, is there a better way to mark and serialize faces for later use? Is there possibly a way to store mesh attributes other than <vertices size="XXX"> and <cells size="YYY"> in the XML file?

asked Apr 10, 2014 by bossylobster FEniCS Novice (170 points)
edited Apr 10, 2014 by bossylobster

1 Answer

+1 vote
 
Best answer

This information can usually be recovered. Consider e.g. a triangle given by vertices a, b and c. These vertices may be written in (counter-)clockwise ordering, and you can define edges e_i always as the edge opposing vertex i, e.g., e_a is defined by the tuple of vertices (b,c) The same can be done for tetrahedrons etc. if the local ordering is defined. Details on the local indices of face/edge vertices etc. can be found in ufc_geometry.h in FFC where all the definitions are given.

answered Apr 10, 2014 by Christian Waluga FEniCS Expert (12,310 points)
selected Apr 10, 2014 by bossylobster

Thanks! I checked out the UFC user manual and it says

When the vertices have been numbered, the remaining mesh entities are
num- bered within each topological dimension based on a
lexicographical ordering of the corresponding ordered tuples of
non-incident vertices.

So it's exactly as you said, provided the vertices themselves are ordered.

...