Mesh
The mesh sequence is stored in the Mesh node. Several mesh sequences, also called mesh cases, can be created in the same model object.
1
Create a new mesh case for comp1:
mesh = comp1.mesh.create('mesh');
2
By default, the mesh sequence contains at least a size feature, which applies to all subsequent meshing operations. First create a link to the existing size feature. Then set the maximum element size hmax to mh and the minimum element size hmin to mh-mh/3. Set the curvature factor hcurve to 0.2:
size = mesh.feature('size');
size.set('hmax', 'mh');
size.set('hmin', 'mh-mh/3');
size.set('hcurve', '0.2');
3
mesh.feature.create('ftet', 'FreeTet');
4
mphrun(model,'mesh');
Now look in the COMSOL Desktop to see the resulting mesh in the graphics window.
5
mphmesh(model)