1. Description
The MSH extension is a mesh format associated with Ansys Fluent software, a multiphysics non linear solver. You can find the description of this format and a lot of information about this software in the Fluent User's Guide.
2. Features supported by feconv
MSH finite element types allowed in feconv
The MSH (Ansys) format describes a lot of different types of finite elements. The elements may have different descriptors, the meaning of these descriptors changes if these elements are in a cells section or in a faces section.
In the following table you can see the finite elements allowed in a Faces section and its meaning in FEconv.
MSH face descriptor | MSH face name | PMH FE type |
---|---|---|
0 | Mixed | - |
2 | Linear | Triangle Lagrange P1 |
3 | Triangular | Tetrahedron Lagrange P1 |
4 | Quadrilateral | Quadrilateral Lagrange P1 |
In the following table you can see the finite elements allowed in a Cell section and its meaning in FEconv.
MSH cell descriptor | MSH cell name | PMH FE type |
---|---|---|
0 | Mixed | - |
1 | Triangular | Triangle Lagrange P1 |
2 | Tetrahedral | Tetrahedron Lagrange P1 |
3 | Quadrilateral | Quadrilateral Lagrange P1 |
4 | Hexahedral | Hexahedron Lagrange P1 |
6 | Wedge | Wedge Lagrange P1 |
3. File structure
Here you can see the description of the supported sections of the MSH (Ansys) grid file. A grid file is a subset of a case file, containing only those sections pertaining to the grid.
These file are broken into several sections depending on the following guidelines:
- Each section is enclosed in parentheses and begins with an decimal integer indicating its type
- All groups of items are encosed in parentheses.
- Header information for lists of items is enclosed in separate sets of parentheses, preceding the items, which are in their own parentheses
Comments
Comment sections can appear anywhere in the file. Its recommended that each long section be preceded by a comment section explaining what is to follow.
The ID number for identifing a comment section is 0 (zero). A comment appear as:
(0 "comment text")
Dimensions
Header sections appear anywhere in the file (except within other sections). Its is typically on the first sections in the file and is for informational purposes only.
The ID number for identifing the header section is 1.It appears as:
(1 "FEconv ND 0.9.1")
Where N
is 2 or 3 depending on the dimension of the mesh.
Header
The ID number for identifing a dimensions section is 2. The dimensions of the grid is expressed as:
(2 ND)
Where N
is 2 or 3 depending on the dimension of the mesh.
Nodes
The ID number for identifing a node section is 10. A MSH (Ansys) mesh can contain several node sections.
A node section appears as:
(10 (zone-id first-index last-index type ND) ( x1 y1 z1 x2 y2 z2 ... ))
If zone-id
is zero, it provides the total number of nodes in the grid. In such case, first-index
will be one, last-index
will be the total number of nodes in hexadecimal, type
is meaningless, ND
is the dimension of the grid and there are no coordinates following.
If zone-id
is greater than zero, first-index
and last-index
are the indices of the nodes in the zone in hexadecimal, ND
is an optional argument that indicates the dimension, where ND
is 2 or 3. type
can be 0 for virtual nodes, 1 for any type and 2 for boundary nodes.
Cells
The ID number for identifing a cell section is 12. A MSH (Ansys) mesh can contain several cell sections.
A cell section appears as:
(12 (zone-id first-index last-index type element-type))
If zone-id
is zero, it provides the total number of cells in the grid. If last-index
is zero, then there are no cells in the grid, this is useful when the file contains only a surface mesh. The other data are ignored in this case.
Regular cell sections have no body, but they have a header of the same format where first-index and last-index indicate the range for the particular zone, type indicates whether the cell zone is an active zone (solid or fluid), or inactive zone. Active zones are represented with type=1, while inactive zones are represented with type=32.
If a zone is of mixed type it will have a body that lists the element type of each cell, as you can see in the following example:
(12 ( 9 1 3d 0 0) ( 1 1 1 3 3 1 1 3 1 ... ))
This example cell section is identified as zone 9 and has 61 cells (3d in hexadecimal), 3 triangles, 2 quadrilaterals, etc.
Faces
The ID number for identifing a face section is 13. A MSH (Ansys) mesh can contain several face sections.
A cell section appears as:
(13 (zone-id first-index last-index type element-type))
A zone-id
of zero indicates a declaration section with no body, and element-type
indicates the type of faces in that zone.
The body of a regular face section contains the grid connectivity, and each line appear as follows
n0 n1 n2 cr cl
Where n
are defining nodes fo the face, and c*
are the adjacent cells. The first cell, cr
, is the cell on the right side of the face and cl
is the cell on the left side. If there is no adjacent cell, then either cr
or cl
is zero. If it is a two-dimensional grid, n2
is omitted
Direction is determined by the right-hand rule.
If the face zone is of mixed type, the body of the section will include the face type and will appear as follows:
type n0 n1 n2 cr cl
Zones
Example
Here you can see an example of a 2D mesh with 7 quadrilateral elements:
(0 grid written by FEconv nodes: (10 (id start end type) (x y z ...)) faces: (13 (id start end type elemType) (v-0 v-1 .. v-n right-cell left-cell ...)) cells: (12 (id start end type elemtype)) zones: (45 (id type name)()) ) (2 2) (10 (0 1 9 0)) (12 (0 1 8 0)) (10 (1 1 9 1 2)( 0.49999998090615239 0.49999998090615239 2.2737367544323211E-016 1.0000000000000011 2.2737367544323211E-016 0.0000000000000000 2.2737367544323211E-016 0.50000000000000044 0.99999999999999911 -5.9685589803848419E-016 0.49999999999999972 -2.9842794901924210E-016 0.99999999999999933 1.0000000000000000 0.99999999999999922 0.49999999999999989 0.49999999999999978 1.0000000000000011 )) (13 (0 1 10 0)) (13 (2 1 2 3 2)( 9 2 6 0 7 9 8 0 )) (13 (3 3 4 3 2)( 3 6 1 0 6 5 7 0 )) (13 (4 5 6 3 2)( 2 4 6 0 4 3 3 0 )) (13 (5 7 8 3 2)( 5 8 7 0 8 7 8 0 )) (13 (6 9 10 2 2)( 1 3 1 3 4 1 2 3 6 1 1 5 1 8 4 5 1 9 2 4 9 4 2 6 6 8 5 7 8 9 4 8 )) (45 (2 wall wall1)()) (45 (3 wall wall2)()) (45 (4 wall wall3)()) (45 (5 wall wall4)()) (45 (6 interior interior5)()) (12 (7 1 8 1 1))