File Structure
The COMSOL Multiphysics native data file format has a global version number, so that it is possible to revise the whole structure. The first entry in each file is the file format, indicated by two integers. The first integer is the major file version and the second is referred to as the minor file version. For the current version, the first two entries in a file is 0 1.
The following sections describe the file structure of the supported version.
File Version 0.1
After the file version, the file contains three groups of data:
A number of tags stored as strings, which are used so that objects can refer to each other.
A number of types, which are strings that can be used in serializing the object. The types are currently not used by the COMSOL Multiphysics software.
 Objects, where each object starts with the header 0 0 1, followed by a string that defines which type of object that follows.
Example
When using model.mesh(<tag>).export(<filename>) or Mesh > Export to save a COMSOL mesh, the tag equals the variable name (m1), the type is set to obj (but this is not used), and the file contains the serialization of the mesh object, including point coordinates and element data of the mesh. In this case, the file also contains a selection object. See some of the entries in Serializable Classes for more examples of COMSOL Multiphysics native text data file content.
# Created by COMSOL Multiphysics.
 
# Major & minor version
0 1
2 # number of tags
# Tags
5 mesh1
10 mesh1_sel1
2 # number of types
# Types
3 obj
3 obj
 
# --------- Object 0 ----------
 
0 0 1
4 Mesh # class
8 # version
3 # sdim
 
# Include geometric model
1
 
# Geometric model
 
4 # Number of geometric entities per dimension
14
15
6
0
 
1 # Voids are labeled
 
1 # Number of finite voids
 
6 # Up and down domains for boundaries
0 -1
0 -1
0 -1
0 -1
0 -1
0 -1
 
3 # Isolated edges in domains
0 0
6 -1
13 0
 
2 # Isolated vertices in domains
6 -1
13 0
 
 
# Mesh data
 
514 # number of mesh vertices
 
# Mesh vertex coordinates
0.92206542189421015 0.91795822469634891 1
1 0.9220130709632427 0.91794866649210038
0.91012354689345587 0.81224942182395221 1
# --------- Object 1 ----------
 
0 0 1
9 Selection # class
0 # Version
7 Outer boundaries # Label
5 mesh1 # Geometry/mesh tag
2 # Dimension
6 # Number of entities
# Entities
0
1
2
3
4
5