Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

pdemesh

Syntax

pdemesh(model)
pdemesh(model,u)
pdemesh(___,Name,Value)
pdemesh(p,e,t)
pdemesh(p,e,t,u)
h = pdemesh(___)

Description

example

pdemesh(model) plots the mesh contained in a 2-D or 3-D model object of type PDEModel.

example

pdemesh(model,u) plots solution data u as a 3-D plot. This syntax is valid only for 2-D geometry.

example

pdemesh(___,Name,Value) plots the mesh or solution data using any of the arguments in the previous syntaxes and one or more Name,Value pair arguments.

example

pdemesh(p,e,t) plots the mesh specified by the mesh data p,e,t.

example

pdemesh(p,e,t,u) plots PDE node or triangle data u using a mesh plot. The function plots the node data if u is a column vector , and triangle data if u is a row vector.

If you want to have more control over your mesh plot, use pdeplot or pdeplot3D instead of pdemesh.

h = pdemesh(___) returns handles to the graphics, using any of the arguments of the previous syntaxes.

Examples

collapse all

Create a mesh plot and display the node and element labels of the mesh.

Create a PDE model. Include the geometry of the built-in function lshapeg. Mesh the geometry.

model = createpde;
geometryFromEdges(model,@lshapeg);
generateMesh(model);

Plot the mesh.

pdemesh(model)

Display node labels.

pdemesh(model,'NodeLabels','on')

Use xlim and ylim to zoom in on particular nodes.

xlim([-0.4,0.4])
ylim([-0.4,0.4])

Display element labels.

pdemesh(model,'ElementLabels','on')
xlim([-0.4,0.4])
ylim([-0.4,0.4])

Apply boundary conditions, specify coefficients, and solve the PDE.

applyBoundaryCondition(model,'dirichlet','Edge',1:model.Geometry.NumEdges,'u',0);
specifyCoefficients(model,'m',0,...
                          'd',0,...
                          'c',1,...
                          'a',0,...
                          'f',1);
generateMesh(model);
results = solvepde(model)
u = results.NodalSolution;
results = 

  StationaryResults with properties:

    NodalSolution: [1177x1 double]
       XGradients: [1177x1 double]
       YGradients: [1177x1 double]
       ZGradients: []
             Mesh: [1x1 FEMesh]

Plot the solution at nodal locations by using pdemesh.

pdemesh(model,u)

The pdemesh function ignores NodeLabels and ElementLabels when you plot solution data as a 3-D plot.

Create a PDE model, include the geometry and mesh it.

model = createpde;
importGeometry(model,'Plate10x10x1.stl');
generateMesh(model,'Hmax',5);

Plot the mesh setting the transparency to 0.5.

pdemesh(model,'FaceAlpha',0.5)

Plot the mesh for the geometry of the L-shaped membrane.

[p,e,t] = initmesh('lshapeg');
[p,e,t] = refinemesh('lshapeg',p,e,t);
pdemesh(p,e,t)

Now solve Poisson's equation over the geometry defined by the L-shaped membrane. Use Dirichlet boundary conditions on , and plot the result.

u = assempde('lshapeb',p,e,t,1,0,1);
pdemesh(p,e,t,u)

Input Arguments

collapse all

PDE model, specified as a PDEModel object.

Example: model = createpde

PDE solution, specified as a vector or matrix.

Example: results = solvepde(model); u = results.NodalSolution; or u = assempde(model,c,a,f);

Mesh points, specified as a 2-by-Np matrix of points, where Np is the number of points in the mesh. For a description of the (p,e,t) matrices, see Mesh Data.

Typically, you use the p, e, and t data exported from the PDE Modeler app, or generated by initmesh or refinemesh.

Example: [p,e,t] = initmesh(gd)

Data Types: double

Mesh edges, specified as a 7-by-Ne matrix of edges, where Ne is the number of edges in the mesh. For a description of the (p,e,t) matrices, see Mesh Data.

Typically, you use the p, e, and t data exported from the PDE Modeler app, or generated by initmesh or refinemesh.

Example: [p,e,t] = initmesh(gd)

Data Types: double

Mesh triangles, specified as a 4-by-Nt matrix of triangles, where Nt is the number of triangles in the mesh. For a description of the (p,e,t) matrices, see Mesh Data.

Typically, you use the p, e, and t data exported from the PDE Modeler app, or generated by initmesh or refinemesh.

Example: [p,e,t] = initmesh(gd)

Data Types: double

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: pdemesh(model,'NodeLabels','on')

collapse all

Node labels, specified as the comma-separated pair consisting of 'NodeLabels' and 'off' or 'on'.

pdemesh ignores NodeLabels when you plot solution data as a 3-D plot.

Example: 'NodeLabels','on'

Data Types: char

Element labels, specified as the comma-separated pair consisting of 'ElementLabels' and 'off' or 'on'.

pdemesh ignores ElementLabels when you plot solution data as a 3-D plot.

Example: 'ElementLabels','on'

Data Types: char

Surface transparency for 3-D geometry, specified as the comma-separated pair consisting of 'FaceAlpha' and a real number from 0 through 1. The default value 1 indicates no transparency. The value 0 indicates complete transparency.

Example: 'FaceAlpha',0.5

Data Types: double

Output Arguments

collapse all

Handles to graphics objects, returned as a vector.

Introduced before R2006a

Was this topic helpful?