Main Content

pdegplot

Plot PDE geometry

Description

example

pdegplot(g)plots the geometry of a PDE problem, as described ing.

example

pdegplot(g,Name,Value)plots with additional options specified by one or moreName,Valuepair arguments.

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

Examples

collapse all

Plot the geometry of a region defined by a few simple shapes.

g = [2 1 1 1 1 1 1 1 1 4 4; -1 -0.6 -0.5 -0.4 -0.5 0.4 0.5 0.6 0.5 -1 0.17; 1 -0.5 -0.4 -0.5 -0.6 0.5 0.6 0.5 0.4 0.17 1; 0 -0.25 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 0 -0.74; 0 -0.35 -0.25 -0.15 -0.25 -0.35 -0.25 -0.15 -0.25 -0.74 0; 0 0 0 0 0 0 0 0 0 1 1; 1 1 1 1 1 1 1 1 1 0 0; 0 -0.5 -0.5 -0.5 -0.5 0.5 0.5 0.5 0.5 0 0; 0 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 -0.25 0 0; 0 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 1 1; 0 0 0 0 0 0 0 0 0 0.75 0.75; 0 0 0 0 0 0 0 0 0 0 0]; pdegplot(g)

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

View the vertex labels, edge labels, and the face label. Add space at the top of the plot to see the top edge clearly.

pdegplot(g,'VertexLabels','on','EdgeLabels','on','FaceLabels','on') ylim([-.8,.1])

Figure contains an axes object. The axes object contains 24 objects of type line, text.

Import a 3-D geometry file. Plot the geometry and turn on face labels. To see the labels on all faces of the geometry, set the transparency to 0.5.

model = createpde; importGeometry(model,'BracketWithHole.stl'); pdegplot(model,'FaceLabels','on','FaceAlpha',0.5)

Figure contains an axes object. The axes object contains 3 objects of type quiver, patch, line.

Import a 3-D geometry file. Plot the geometry and turn on cell labels.

model = createpde; importGeometry(model,'DampingMounts.stl'); pdegplot(model,'CellLabels','on')

Figure contains an axes object. The axes object contains 3 objects of type quiver, patch, line.

Input Arguments

collapse all

Geometry description, specified by one of the following:

Data Types:double|char|string|来电显示n_handle

Name-Value Arguments

Specify optional comma-separated pairs ofName,Valuearguments.Nameis the argument name andValueis the corresponding value.Namemust appear inside quotes. You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN.

Example:pdegplot(g,'FaceLabels','on')

The argumentSubdomainLabelsis not recommended. UseFaceLabelsfor both 2-D and 3-D geometries instead.

Vertex labels for 2-D or 3-D geometry, specified as'off'or'on'.

Example:'VertexLabels','on'

Data Types:char|string

2 d或3 d几何图形的边界边的标签, specified as'off'or'on'.

Example:'EdgeLabels','on'

Data Types:char|string

Boundary face labels for 2-D or 3-D geometry, specified as'off'or'on'.

Example:'FaceLabels','on'

Data Types:char|string

Cell labels for 3-D geometry, specified as'off'or'on'.

Example:'CellLabels','on'

Data Types:char|string

Surface transparency for 3-D geometry, specified as the comma-separated pair consisting of'FaceAlpha'and a real number from0through1. The default value1indicates no transparency. The value0indicates complete transparency.

Example:'FaceAlpha',0.5

Data Types:double

Output Arguments

collapse all

Handles to graphics objects, returned as a vector.

Alternative Functionality

应用程序

If you create 2-D geometry in the PDE Modeler app, you can view the geometry from Boundary Mode. To see the edge labels, selectBoundary > Show Edge Labels. To see the face labels, selectPDE > Show Subdomain Labels.

Introduced before R2006a