generateMesh
Create triangular or tetrahedral mesh
Syntax
Description
creates a mesh for the geometry stored in the fegeometry = generateMesh(fegeometry)fegeometry
object. The toolbox stores the mesh in the Geometry.Mesh
property.
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.
creates a mesh for the geometry stored in the mesh = generateMesh(model)model object. The
toolbox stores the mesh in the Mesh property of
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.
___ = 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
Name-Value Arguments
Output Arguments
Tips
generateMeshcan 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.generateMeshuses 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 ofHminandHmax.If you specify local sizes for regions near each other,
generateMeshuses 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,generateMeshignoresHminin those localities.If you specify local sizes larger than
Hmax,generateMeshignores the specified local sizes.Hmaxis not exceeded anywhere in the mesh.






