Main Content

FEMesh

Description

An FEMesh object contains a description of the finite element mesh. The toolbox stores a mesh in the Mesh property of an fegeometry and PDEModel object and in the Geometry.Mesh property of an femodel object.

Generate a mesh for your model using the generateMesh function.

Properties

expand all

Mesh nodes, specified as a matrix. Nodes is a D-by-Nn matrix, where D is the number of geometry dimensions (2 or 3), and Nn is the number of nodes in the mesh. Each column of Nodes contains the x, y, and in 3-D, z coordinates for that mesh node.

2-D meshes have nodes at the mesh triangle corners for linear elements, and at the corners and edge midpoints for "quadratic" elements. 3-D meshes have nodes at tetrahedral vertices, and the "quadratic" elements have additional nodes at the center points of each edge. See Mesh Data.

Data Types: double

Mesh elements, specified as an M-by-Ne matrix, where Ne is the number of elements in the mesh, and M is:

  • 3 for 2-D triangles with "linear" GeometricOrder

  • 6 for 2-D triangles with "quadratic" GeometricOrder

  • 4 for 3-D tetrahedra with "linear" GeometricOrder

  • 10 for 3-D tetrahedra with "quadratic" GeometricOrder

Each column in Elements contains the indices of the nodes for that mesh element.

Data Types: double

Target maximum mesh element size, specified as a positive real number. The maximum mesh element size is the length of the longest edge in the mesh. The generateMesh Hmax name-value pair sets the target maximum size at the time it creates the mesh. generateMesh can occasionally create a mesh with some elements that exceed MaxElementSize by a few percent.

Data Types: double

Target minimum mesh element size, specified as a positive real number. The minimum mesh element size is the length of the shortest edge in the mesh. The Hmin name-value pair passed to the generateMesh function sets the target minimum size the at the time it creates the mesh. generateMesh can occasionally create a mesh with some elements that are smaller than MinElementSize.

Data Types: double

Mesh growth rate, specified as a scalar strictly between 1 and 2.

Data Types: double

Element polynomial order, specified as 'linear' or 'quadratic'. See Elements or Mesh Data.

Data Types: char

Object Functions

meshQualityEvaluate shape quality of mesh elements
findElementsFind mesh elements in specified region
findNodesFind mesh nodes in specified region
areaArea of 2-D mesh elements
volumeVolume of 3-D mesh elements
meshToPet[p,e,t] representation of FEMesh data

Examples

collapse all

Generate the default 2-D mesh for the L-shaped geometry.

Create a fegeometry object representing the L-shaped geometry.

gm = fegeometry(@lshapeg);

Generate the default mesh for the geometry.

gm = generateMesh(gm);

View the mesh.

pdemesh(gm)

Figure contains an axes object. The axes object contains 2 objects of type line.

Create a mesh that is finer than the default.

Create an femodel object and include the BracketTwoHoles geometry.

model = femodel(Geometry="BracketTwoHoles.stl");

Generate a default mesh for comparison.

model = generateMesh(model);

View the mesh.

pdemesh(model)

Figure contains an axes object. The hidden axes object contains 5 objects of type quiver, text, patch.

Create a mesh with target maximum element size 5.

model = generateMesh(model,Hmax=5);

View the mesh.

pdemesh(model)

Figure contains an axes object. The hidden axes object contains 5 objects of type quiver, text, patch.

Version History

Introduced in R2015a