Chapter 11
Mesh Files
11.1 File mesh data structure
The mesh data structure, output of a mesh generation algorithm, refers to the geometric data structure and in some
case to another mesh data structure.
In this case, the fields are
- Dimension (I)dim
- Vertices (I)NbOfVertices
( ((R)xij , j=1,dim ) , (I)Refϕiv , i=1 , NbOfVertices )
- Edges (I)NbOfEdges
(@@Vertexi1 , @@Vertexi2 , (I)Refϕie , i=1 , NbOfEdges )
- Triangles (I)NbOfTriangles
((@@Vertexij , j=1,3 ), (I)Refϕit , i=1 , NbOfTriangles )
- Quadrilaterals (I)NbOfQuadrilaterals
((@@Vertexij , j=1,4 ), (I)Refϕit , i=1 , NbOfQuadrilaterals )
- Geometry
(C⋆)FileNameOfGeometricSupport
- VertexOnGeometricVertex
(I)NbOfVertexOnGeometricVertex
(@@Vertexi , @@Vertexigeo , i=1,NbOfVertexOnGeometricVertex )
- EdgeOnGeometricEdge
(I)NbOfEdgeOnGeometricEdge
(@@Edgei , @@Edgeigeo , i=1,NbOfEdgeOnGeometricEdge )
- CrackedEdges (I)NbOfCrackedEdges
(@@Edgei1 , @@Edgei2 , i=1 , NbOfCrackedEdges )
When the current mesh refers to a previous mesh, we have in addition
- MeshSupportOfVertices
(C⋆)FileNameOfMeshSupport
- VertexOnSupportVertex
(I)NbOfVertexOnSupportVertex
(@@Vertexi , @@Vertexisupp , i=1,NbOfVertexOnSupportVertex )
- VertexOnSupportEdge
(I)NbOfVertexOnSupportEdge
(@@Vertexi , @@Edgeisupp , (R)uisupp , i=1,NbOfVertexOnSupportEdge )
- VertexOnSupportTriangle
(I)NbOfVertexOnSupportTriangle
(@@Vertexi , @@Triaisupp , (R)uisupp , (R)visupp ,
i=1 , NbOfVertexOnSupportTriangle )
- VertexOnSupportQuadrilaterals
(I)NbOfVertexOnSupportQuadrilaterals
(@@Vertexi , @@Quadisupp , (R)uisupp , (R)visupp ,
i=1 , NbOfVertexOnSupportQuadrilaterals )
11.2 bb File type for Store Solutions
The file is formatted such that:
2 nbsol nbv 2
where
- nbsol is a integer equal to the number of solutions.
- nbv is a integer equal to the number of vertex .
- Uij is a real equal the value of the i solution at vertex j on the associated mesh background if
read file, generated if write file.
11.3 BB File Type for Store Solutions
The file is formatted such that:
2 n typesol1 ... typesoln nbv 2
where
- n is a integer equal to the number of solutions
- typesolk, type of the solution number k, is
- typesolk = 1 the solution k is scalar (1 value per vertex)
- typesolk = 2 the solution k is vectorial (2 values per unknown)
- typesolk = 3 the solution k is a 2×2 symmetric matrix (3 values per vertex)
- typesolk = 4 the solution k is a 2×2 matrix (4 values per vertex)
- nbv is a integer equal to the number of vertices
- Uijk is a real equal to the value of the component i of the solution k at vertex j on the associated
mesh background if read file, generated if write file.
11.4 Metric File
A metric file can be of two types, isotropic or anisotropic.
the isotropic file is such that
nbv 1
hi ∀i
{1,...,nbv}
where
- nbv is a integer equal to the number of vertices.
- hi is the wanted mesh size near the vertex i on background mesh, the metric is
i = hi-2Id,
where Id is the identity matrix.
The metric anisotrope
nbv 3
a11i,a21i,a22i ∀i
{1,...,nbv}
where
- nbv is a integer equal to the number of vertices,
- a11i, a12i, a22i is metric
i =
which define the wanted mesh size in a vicinity
of the vertex i such that h in direction u
2 is equal to |u|∕
, where ⋅ is the dot
product in
2, and |⋅| is the classical norm.
11.5 List of AM_FMT, AMDBA Meshes
The mesh is only composed of triangles and can be defined with the help of the following two integers and
four arrays:
-
nbt
-
is the number of triangles.
-
nbv
-
is the number of vertices.
-
nu(1:3,1:nbt)
-
is an integer array giving the three vertex numbers
counterclockwise for each triangle.
-
c(1:2,nbv)
-
is a real array giving the two coordinates of each vertex.
-
refs(nbv)
-
is an integer array giving the reference numbers of the vertices.
-
reft(nbv)
-
is an integer array giving the reference numbers of the triangles.
AM_FMT Files
In fortran the am_fmt files are read as follows:
open(1,file='xxx.am_fmt',form='formatted',status='old')
read (1,⋆) nbv,nbt
read (1,⋆) ((nu(i,j),i=1,3),j=1,nbt)
read (1,⋆) ((c(i,j),i=1,2),j=1,nbv)
read (1,⋆) ( reft(i),i=1,nbt)
read (1,⋆) ( refs(i),i=1,nbv)
close(1)
AM Files
In fortran the am files are read as follows:
open(1,file='xxx.am',form='unformatted',status='old')
read (1,⋆) nbv,nbt
read (1) ((nu(i,j),i=1,3),j=1,nbt),
& ((c(i,j),i=1,2),j=1,nbv),
& ( reft(i),i=1,nbt),
& ( refs(i),i=1,nbv)
close(1)
AMDBA Files
In fortran the amdba files are read as follows:
open(1,file='xxx.amdba',form='formatted',status='old')
read (1,⋆) nbv,nbt
read (1,⋆) (k,(c(i,k),i=1,2),refs(k),j=1,nbv)
read (1,⋆) (k,(nu(i,k),i=1,3),reft(k),j=1,nbt)
close(1)
msh Files
First, we add the notions of boundary edges
-
nbbe
-
is the number of boundary edge.
-
nube(1:2,1:nbbe)
-
is an integer array giving the two vertex numbers
-
refbe(1:nbbe)
-
is an integer array giving the two vertex numbers
In fortran the msh files are read as follows:
open(1,file='xxx.msh',form='formatted',status='old')
read (1,⋆) nbv,nbt,nbbe
read (1,⋆) ((c(i,k),i=1,2),refs(k),j=1,nbv)
read (1,⋆) ((nu(i,k),i=1,3),reft(k),j=1,nbt)
read (1,⋆) ((ne(i,k),i=1,2), refbe(k),j=1,nbbe)
close(1)
ftq Files
In fortran the ftq files are read as follows:
open(1,file='xxx.ftq',form='formatted',status='old')
read (1,⋆) nbv,nbe,nbt,nbq
read (1,⋆) (k(j),(nu(i,j),i=1,k(j)),reft(j),j=1,nbe)
read (1,⋆) ((c(i,k),i=1,2),refs(k),j=1,nbv)
close(1)
where if k(j) = 3 then the element j is a triangle and if k = 4 the the element j is a quadrilateral.