1. Description

The Comsol Model File MPHTXT is a text based format developed by Comsol and used by the software Comsol Multiphysics, simulation tool for electrical, mechanical, fluid flow, and chemical applications.

The main features of this format are:

  • It can store several serializable objects like meshes, geometries, etc.
  • It can store piecewise meshes, each piece is called record, and it is a separate part of the mesh with its own numbering.
  • It can save hybrid meshes, that is, meshes that contain a several types of finite elements.
  • It can store parameter dependant data at nodes or on elements.
  • The global indexing of nodes, edges, faces and elements are defined by integers.
  • The vertex coordinates and parameter values are defined by floats of double precision.

2. Features supported by feconv

FEconv only supports MPHTXT mesh files with version 0.1 containing serializable mesh objects. Moreover, the version of the serializable object Mesh must be 2 or 4.

Finite element types

The MPHTXT format describes a lot of different types of finite elements. In the following table you can see the finite elements allowed by FEconv and its description in PMH.

MPHTXT descriptor MPHTXT name FE type
edg Edge element Edge Lagrange P1
tri Triangular element Triangle Lagrange P1
quad Quadrilateral element Quadrilateral Lagrange P1
tet Tetrahedral element Tetrahedron Lagrange P1
prism Prism element Pentahedron Lagrange P1
hex Hexahedal element Hexahedron Lagrange P1
edg2 Edge element (P2) Edge Lagrange P2
tri2 Triangular element (P2) Triangle Lagrange P2
quad2 Quadrilateral element (P2*) Quadrilateral Lagrange P2
tet2 Tetrahedral element (P2) Tetrahedron Lagrange P2
hex2 Hexahedral element (P2*) Hexahedron Lagrange P2

* Note that second order quadrangles and hexahedrons contain nodes on the barycenter of each face and element. FEconv translates this kind of element to a Lagrange P2 element ignoring the nodes on the barycenter when reading MPHTXT files. Feconv calculate this nodes during MPHTXT file writing.

Local order of nodes

The local order of nodes in each element respect the following rules:

a)

Edge Lagrange P1.

b)

Triangle Lagrange P1.

c)

Quadrilateral Lagrange P1.

d)

Tetrahedron Lagrange P1.

e)

Hexahedron Lagrange P1.

f)

Pentahedron Lagrange P1.

g)

Edge Lagrange P2.

h)

Triangle Lagrange P2.

i)

Quadrilateral P2*.

j)

Tetrahedron Lagrange P2.

k)

Hexahedron P2*.

Figure 1: Local order of nodes on MPH elements.

3. File structure

The MPHTXT file format has a global version number. The first entry in each file is the file format, indicating the major and minor file version by two integers.

After the file version, the file contains a number of tags, stored as strings wich gives an identification for each record stored in the file.

Then the number of types and, optionally, the serializable object identifiers of this types.

Finally, MPHTXT file contains objects with the serialized data in the file. The data contained in each object are space dimension, coordinates, element types and connectivities among others. You can see a summary of this data in Figure 4, obtained from the COMSOL manual.

By convention, MPHTXT files store strings preceding them by their length. Everything following a # is ignored.

Figure 4: Data contained in MPH objects.