Use model.mesh(<tag>).feature(<ftag>).selection() to specify the domain selection or the entire geometry. If you do not specify any selection the feature refines all triangular and tetrahedral elements in the mesh.
Use the boxcoord property to refine elements inside a bounding box. To define the bounding box, set the properties
xmin,
xmax,
ymin,
ymax, zmax, and zmin on the feature, where
(xmin,ymin,zmin) defines the lower-left corner, and
(xmax,ymax,zmax) defines the upper-right corner of the bounding box. The elements that have all its corner points in the bounding box are refined once.
boxcoord is automatically set to
on if one of the coordinates are set.
In 3D, the default refinement method is longest. The regular refinement method is only implemented for uniform refinements (that is, when all elements are refined).
By default, all elements are refined once. By using the element property, you can specify which elements are refined and the
numrefine property specifies how many times the elements is refined. If
numrefine is an integer, all refined elements are refined
numrefine times. If
numrefine is a vector, it must have the same length as the
element vector, and gives the number of refinements for each element.
Mesh two squares with free mesh. Refine the mesh on sq2 once and refine the elements inside a box in
sq1 twice.