generateMesh
Create triangular or tetrahedral mesh
Description
creates a mesh for the geometry stored in the mesh
= generateMesh(model
)model
object. The
toolbox stores the mesh in the Mesh
property of the structural,
thermal, electromagnetic model, or PDEModel
.
model
must contain a geometry. For details about creating a
geometry and including it in a model, see Geometry and Mesh and the
geometry functions listed there.
femodel = generateMesh(
creates
a mesh for the geometry stored in the femodel
)femodel
object. The
toolbox stores the mesh in the Geometry.Mesh
property. Assigning
the result to the model updates the mesh stored in the Geometry
property of the model.
___ = generateMesh(___,
modifies the mesh generation according to the Name,Value
)Name,Value
arguments. This syntax works with the model
and
femodel
arguments.
Examples
Input Arguments
Output Arguments
More About
Tips
generateMesh
can return slightly different meshes in different releases. For example, the number of elements in the mesh can change. Avoid writing code that relies on explicitly specified node and element IDs or node and element counts.generateMesh
uses the following set of rules when you specify local element sizes withHface
,Hedge
, orHvertex
. These rules are valid for both the default and custom values ofHmin
andHmax
.If you specify local sizes for regions near each other,
generateMesh
uses the minimum size. For example, if you specify size 1 on an edge and size 0.5 on one of its vertices, the function gradually reduces the element sizes in the proximity of that vertex.If you specify local sizes smaller than
Hmin
,generateMesh
ignoresHmin
in those localities.If you specify local sizes larger than
Hmax
,generateMesh
ignores the specified local sizes.Hmax
is not exceeded anywhere in the mesh.