Exporting Meshes
You can export a mesh to a COMSOL Multiphysics file (.mphbin for a binary file format or .mphtxt for a text file format), to a NASTRAN® file (.nas, .bdf, .nastran, or .dat), or to a sectionwise text format.
To open the Export window for exporting meshes, from the Mesh toolbar, click Export (), or right-click the Mesh node and select Export () from the menu.
Export
Select a file type among the available formats in the File type list and enter a filename including the path in the Filename field (or click Browse to specify the filename).
Click Export to export a mesh to the specified file. A confirmation message appears in the Messages window.
Exporting to a COMSOL Multiphysics File
If you export a mesh to a COMSOL Multiphysics binary (*.mphbin) or text (*.mphtxt) file, you specify the type of elements to export using the Domain elements, Boundary elements, Edge elements (available in 3D), and Vertex elements (available in 2D and 3D) check boxes under Data to export. By selecting the Geometric entity information check box, the export operation also writes information on the corresponding geometric entity index for each element to the file. Select the Selections check box to also include selections that are defined on the current geometry in the mesh export. Such selections can then be included when importing a mesh. Select the Export as second-order elements check box (2D and 3D only) to export the mesh including second-order elements. If you export a generated mesh that contains linear elements, the mesh to export is extended into a quadratic mesh with second-order elements.
Exporting to a NASTRAN File
If you export a 2D or 3D mesh to a NASTRAN file, you specify the type of elements to export using the Domain elements and Boundary elements (available in 3D) check boxes. By selecting the Geometric entity information check box, the export operation also writes information on each element’s corresponding geometric entity index to the corresponding property identification field of the resulting NASTRAN file.
Under Output settings, use the Field format list to specify if the output NASTRAN file should be stored in the small field format (single precision), large field format (double precision), or free field format (comma separated). Select the Export as linear elements check box to export the linear element information only. By default, second-order elements (serendipity elements) are exported if second-order elements are available. Second-order elements are available for meshes generated in COMSOL Multiphysics and for imported meshes already containing second-order elements.
Exporting to a Sectionwise File
You can export a 2D or 3D mesh to a sectionwise text file (*,txt). The sectionwise file contains a simplex partitioning of nonsimplex elements. Second-order information is ignored. The exported files include the following header: % Model: Untitled.mph
% Version: COMSOL 5.6.0.263
% Date: October 19 2020, 09:09
% Dimension: 3
% Nodes: 1375
% Elements: 6270
% Expressions: 0
% Description:
% Length unit: m
The number of expressions is 0, which means that the description becomes empty. After the header, the coordinate values for the mesh follow under % Coordinates.
The length unit is the only header field that is read, which is the case if imported to a Component or to a Mesh Part where the Use units check box is selected.
When you select Sectionwise file (*.txt) from the File type list, you can then select Domain (the default), Boundary, and Edge (3D only) from the a Geometry level list to determine the level of the exported mesh data.
When you export mesh to a sectionwise file from a Mesh node under a Component or from a Mesh Part node where the Use units check box is selected, the resulting file’s length unit will be determined from the length unit of the Geometry node in the Component or the Mesh Part node, respectively.
Exporting a 3D Mesh to an STL File
You can export a 3D mesh containing face elements to an STL file (stereolithography file) in the binary or text format. Because the STL format only supports triangles, the export operation writes two triangles (defining a quad split) to the STL file for each quad element in the mesh. Second-order elements are converted to first-order elements.
Exporting a 3D Mesh to a PLY File
You can export a 3D mesh containing face elements to a PLY file (Polygon File Format or Stanford Triangle Format file) in the binary or text format. Second-order elements are converted to first-order elements.
Exporting a 3D Mesh to a 3MF File
You can export a 3D mesh containing face elements to a 3MF file (3D Manufacturing Format file). From the Data to export list, select Entire boundary as a single 3MF surface object (the default) to export the entire surface mesh as one 3MF object of Surface type, or select Domains as separate 3MF model objects to export the surface mesh of each domain as a separate 3MF object of Model type and the remaining surface mesh, corresponding to the faces that are not adjacent to any domain, as a 3MF object of Surface type. Because the 3MF format only supports triangles, the export operation writes two triangles (defining a quad split) to the 3MF file for each quad element in the mesh. Second-order elements are converted to first-order elements.
There is also a mesh export option available under Results>Export (see Mesh (Export)). Use that mesh export if you have computed a solution and want to export the mesh from a deformed configuration or a (geometric) parameter configuration, for example. From the Mesh node under Results>Export you can also export the second-order element nodes used by the COMSOL Multiphysics solvers, which are not available in the mesh itself. When exporting the mesh under Results>Export, the COMSOL Multiphysics and STL (3D only) binary and text formats are available.