Import
Import mesh from a file or from another meshing sequence. You can import a mesh from a COMSOL Multiphysics native file. In 3D you can also import meshes from NASTRAN, STL, or VRML files. In 2D you can also import 2D meshes from NASTRAN (the third coordinate must then be the same for all mesh points).
Syntax
model.component(<ctag>).mesh(<tag>).create(<ftag>,"Import");
model.component(<ctag>).mesh(<tag>).feature(<ftag>).set(property,<value>);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).getType(property);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).importData();
Description
Use model.component(<ctag>).mesh(<tag>).create(<ftag>,"Import") to import a mesh into a sequence without a corresponding geometry. It is only possible to use this feature when the geometry sequence is empty. If the sequence already contains a mesh, the imported mesh is added to the existing mesh.
Use model.component(<ctag>).mesh(<tag>).feature(<ftag>).importData() to import the file again.
The following mesh formats are supported:
.nas | .bdf | .dat
The following properties are available:
on | off
all | mesh
auto | minimal | detectfaces | manual
Boundary partitioning algorithm. detectfaces is only available in 3D, and manual is only available in 2D.
on | off
on | off
on | off
on | off
file | sequence | native | nastran | stlvrml
Absolute tolerance for STL import, when stltoltype is set to absolute.
Relative tolerance for STL import, when stltoltype is set to relative.
auto | relative | absolute
The properties stltolabs, stltolrel, and stltoltype are only used for import of STL files.
The properties linearelem, materialsplit, and data are only used for import of NASTRAN files. The properties selcreation and allowshellpartition are only used when materialsplit is on.
linearelem specifies if the elements in the NASTRAN or COMSOL Multiphysics file are imported as linear elements. If the value is on all imported elements are linear. Otherwise, the order of the imported elements is determined from the order of the elements in the file. The default value is off.
materialsplit determines if material data in the file is used (if available) to determine the domain partitioning of the domain elements. If the value is off all domain elements in the imported mesh belongs to the same domain if possible. The default value is off.
If you set facepartition to minimal, the operation keeps the original partition from the file (if any), adding minimal partitioning in order to satisfy topological requirements.
If you set facepartition to manual, you can use the following properties. If you set any of these properties without setting facepartition to manual, the operation automatically switches facepartition to manual.
on | off
The following properties are available in 3D when facepartition is set to detectfaces:
on | off
on | off
on | off
on | off
auto | relative | absolute
Minimum absolute edge length, if minlengthtype = absolute.
The table below specifies the supported NASTRAN bulk data entries.
The NASTRAN bulk data format uses reduced second-order elements; that is, the center node on quadrilateral mesh faces (quadNode) and the center node of hexahedral elements (hexNode) are missing. Importing a NASTRAN mesh with second-order elements, COMSOL Multiphysics interpolates the coordinates of these missing node points from the surrounding node points using the following formulas: quadNode = 0.5*quadEdgeNodes - 0.25*quadCornerNodes, where quadEdgeNodes is the sum of the coordinates of the surrounding 4 edge nodes and quadCornerNodes is the sum of the coordinates of the surrounding 4 corner nodes, and hexNode = 0.25*hexEdgeNodes-0.25*hexCornerNodes, where hexEdgeNodes is the sum of the coordinates of the surrounding 12 edge nodes and hexCornerNodes is the sum of the coordinates of the surrounding 8 corner nodes.
The Import feature does not handle NASTRAN files in free field format where the data fields are separated by blanks.
Compatibility
The elemsplit property from earlier versions is no longer available from version 5.3.
For 3D meshing sequences, the setting manual of the property facepartition in the mesh Import feature, as well as all the properties associated with this setting, are deprecated as of COMSOL 5.1 and may be removed in a future version. In COMSOL 5.1, these properties are still available with unchanged behavior for backward compatibility.
See Also
Ball, Box, CreateVertex, DeleteEntities, DetectFaces, JoinEntities, LogicalExpression