Size
Specify mesh size properties.
Syntax
model.component(<ctag>).mesh(<tag>).create(<ftag>,"Size");
model.component(<ctag>).mesh(<tag>).feature(<ftag>).selection();
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>).create(<ftag1>,"Size");
model.component(<ctag>).mesh(<tag>).feature(<ftag>).feature(<ftag1>).selection();
model.component(<ctag>).mesh(<tag>).feature(<ftag>).feature(<ftag1>).
    set(property,<value>);
model.component(<ctag>).mesh(<tag>).feature(<ftag>).feature(<ftag1>).getType(property);
Description
Use model.component(<ctag>).mesh(<tag>).create(<ftag>,"Size") to specify element size properties in the sequence. Use model.component(<ctag>).mesh(<tag>).feature(<ftag>).create(<ftag1>,"Size") to specify element size properties for the feature <ftag> that can be any of the types Edge, FreeQuad, FreeTri, FreeTet, Map, or Sweep.
Use model.component(<ctag>).mesh(<tag>).feature(<ftag>).selection() or model.component(<ctag>).mesh(<tag>).feature(<ftag>).feature(<ftag1>).selection() to specify the geometric entity selection. If you do not specify any selection the size feature is defined on all geometric entities. The selection is not available for the default size feature, tagged size.
The following properties are available:
on | off
Set custom to on to activate all mesh parameters.
Specifies automatic settings for all mesh parameters when custom is off. 1 is the finest and 9 is the coarsest predefined size setting.
0.3 | 0.6
on | off
1.3 | 1.5
on | off
on | off
on | off
on | off
cfd | default | plasma | semi | coarseadaptation
The property table specifies the physics for which the element size is calibrated.
Hauto is a nonnegative scalar. This value is used to set several mesh parameters in order to get a mesh of desired size. Smaller values of hauto generate finer meshes with more elements. The integers between 1 and 9 has a special interpretation; they correspond to the mesh settings Normal, Fine, Coarse, and so forth in COMSOL Multiphysics. The value 5 correspond to Normal. When you set the property hauto, all other properties are set to their default value, according to the following tables (for table set to default). Other noninteger values provide mesh parameters that are interpolated from the values in the tables.
The property hcurve is a real value that relates the mesh size to the curvature of the geometry boundaries. The Gaussian radius of curvature is multiplied by the hcurve factor to obtain the mesh size along the boundary. The specified hcurve is only used if hcurveactive is on, otherwise hcurve is taken from a preceding size feature in the sequence. In the default size feature, tagged size, hcurve is always active and there is no hcurveactive property.
The property hgrad tells how fast the element size — measured as the length of the longest edge of the element — can grow from a region with small elements to a region with larger elements. If two elements lie one unit length apart, the difference in element size can be at most hgrad. The specified hgrad is only used if hgradactive is on, otherwise hgrad is taken from a preceding size feature in the sequence. In the default size feature, hgrad is always active and there is no hcurvegrad property.
The hmax parameter controls the size of the elements in the mesh. The algorithm aims at creating a mesh where no element size exceeds hmax. The default hmax value is hmaxfact * maxdist, where maxdist is the longest axis parallel distance in the geometry. The specified hmax is only used if hmaxactive is on, otherwise hmax is taken from a preceding size feature in the sequence. In the default size feature, hmax is always active and there is no hmaxactive property.
You can use hmin to control the minimum size of the elements. The main purpose of this parameter is to prevent the generation of many small elements near small curved parts of the geometry. The default hmin value is hminfact * maxdist, where maxdist is the longest axis parallel distance in the geometry. The specified hmin is only used if hminactive is on, otherwise hmin is taken from a preceding size feature in the sequence. In the default size feature, hmin is always active and there is no hminactive property.
The hnarrow parameter controls the size of the elements in narrow regions. Increasing values of this property decrease the size of the elements in narrow regions. If the value of hnarrow is less than one, elements that are anisotropic in size might be generated in narrow regions. The specified hnarrow is only used if hnarrowactive is on, otherwise hnarrow is taken from a preceding size feature in the sequence. In the default size feature, hnarrow is always active and there is no hnarrowactive property.
The values of hauto, hcurve, hgrad, hmax, hmin, and hnarrow are positive real scalars, or strings that evaluate to positive real scalars, given the evaluation context provided by model.param().
It is not possible to specify coarser size settings on the boundary of a domain than on the domain. The finer settings on the domain is inherited by its boundaries and, in 3D, edges. A warning is issued when settings are overwritten by inheritance. If you need to create coarser mesh on a boundary, you should first mesh the boundary then add the finer size settings on the domain for the corresponding FreeTet, FreeTri, or FreeQuad operation.
See Also
Distribution, Scale, SizeExpression