You can modify the mesh object of a meshing sequence via the data() method. Using this method you access a temporary object (
MeshData) storing mesh data. When you use the
data() method the first time the
MeshData object is empty. You can fill it with mesh data by using various set methods or by transferring mesh data from the mesh of the meshing sequence. Call the method
data().createMesh to construct a complete mesh from the
MeshData object and store it in the meshing sequence. If the geometry is not empty, the new mesh is checked to ensure that it matches the geometry. Thus, to create an arbitrary mesh, you need to create an empty geometry sequence and a corresponding empty meshing sequence and construct the mesh on the empty meshing sequence.
The MeshData object has the same access methods as the meshing sequence.
It is also possible to fill the MeshData object with mesh data from the mesh of a meshing sequence. To transfer the mesh from the current meshing sequence into the
MeshData object, use
To create a complete mesh from the MeshData object and store it in the sequence, use
Running the createMesh() method from provided, possibly incomplete, mesh data is equivalent to importing possibly incomplete mesh data from file. See
Importing Externally Generated Mesh Data in the
COMSOL Multiphysics Reference Manual for more information.