pdeviz
Syntax
Description
pdeviz(
creates a MeshData
,NodalData
)PDEVisualization
object and plots the data at the mesh nodes as
a surface plot. For details, see PDEVisualization Properties.
pdeviz(___,
customizes
the plot appearance using one or more Name,Value
)Name,Value
arguments. Use
name-value arguments with any combination of arguments from the previous syntaxes.
pdeviz(figure,___)
specifies the graphics container for
the PDEVisualization
object. For example, you can plot the object in
Figure 3 by specifying pdeviz(figure(3), ___)
.
Examples
Mesh and Solution of Structural Model
Use the pdeviz
function to create a PDE visualization object and plot it. Change the properties of this object to interact with the resulting plot.
Create an femodel
object for static structural analysis and include a beam geometry into the model.
model = femodel(AnalysisType="structuralStatic", ... Geometry="SquareBeam.stl");
Plot the geometry.
pdegplot(model.Geometry,FaceLabels="on",FaceAlpha=0.5)
Specify Young's modulus and Poisson's ratio.
model.MaterialProperties = ... materialProperties(PoissonsRatio=0.3, ... YoungsModulus=210E3);
Specify that face 6 is a fixed boundary.
model.FaceBC(6) = faceBC(Constraint="fixed");
Specify the surface traction for face 5.
model.FaceLoad(5) = faceLoad(SurfaceTraction=[0;0;-2]);
Generate a mesh and solve the problem.
model = generateMesh(model); structuralresults = solve(model);
Call pdeviz
with only the mesh data. This call creates a PDEVisualization
object and plots the mesh.
figure v = pdeviz(structuralresults.Mesh)
v = PDEVisualization with properties: MeshData: [1x1 FEMesh] NodalData: [0x1 double] MeshVisible: on Transparency: 1 Position: [0.1300 0.1100 0.6671 0.8150] Units: 'normalized' Use GET to show all properties
Update the plot by adding the von Mises stress as the NodalData
property of the PDEVisualization
object v. The plot now shows the von Mises stress and the mesh.
figure v.NodalData = structuralresults.VonMisesStress;
Update the plot by adding the displacement as the DeformationData
property of the PDEVisualization
object v. The plot shows the deformed shape with the von Mises stress.
figure v.DeformationData = structuralresults.Displacement;
Update the plot to hide the mesh.
figure
v.MeshVisible = "off";
Update the plot to hide the axes.
figure
v.AxesVisible = "off";
Input Arguments
MeshData
— Finite element mesh
FEMesh
object
Finite element mesh, specified as an FEMesh
object.
NodalData
— Data at mesh nodes
column vector
Data at mesh nodes, specified as a column vector.
Data Types: double
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: pdeviz(model.Mesh,results.NodalSolution,MeshVisible="on",DeformationData=results.Displacement)
Transparency
— Surface transparency
1
(default) | real number from 0
through 1
Surface transparency, specified as a real number from 0
through
1
. The default value 1
indicates no
transparency. The value 0
indicates complete transparency.
Data Types: double
MeshVisible
— Toggle to show mesh
"on"
| "off"
| on/off logical value
Toggle to show mesh, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A
value of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can
use the value of this argument as a logical value.
When plotting only the mesh, the default is "on"
. Otherwise,
the default is "off"
.
Data Types: char
| string
DeformationData
— Mesh deformation data
FEStruct
object | matrix | structure array
Mesh deformation data, specified as one of the following:
An
FEStruct
object with the propertiesux
,uy
, and, for a 3-D geometry,uz
A structure array with the fields
ux
,uy
, and, for a 3-D geometry,uz
A matrix with either two columns for a 2-D geometry or three columns for a 3-D geometry
DeformationScaleFactor
— Level of mesh deformation
nonnegative number
Level of mesh deformation, specified as a nonnegative number. Use this name-value
argument together with DeformationData
.
pdeviz
computes the default value of
DeformationScaleFactor
based on the mesh and the value of
DeformationData
.
Data Types: double
AxesVisible
— Toggle to hide or show axes
"on"
(default) | "off"
| on/off logical value
Toggle to hide or show axes, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A
value of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can
use the value of this argument as a logical value.
AxesColor
— Background color
RGB triplet | hexadecimal color code | "r"
| "g"
| "b"
Background color, specified as an RGB triplet, a hexadecimal color code, a color name, or a short name.
ColorbarVisible
— Colorbar visibility
"on"
(default) | on/off logical value
Colorbar visibility, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A
value of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can
use the value of this property as a logical value. The value is stored as an on/off
logical value of type matlab.lang.OnOffSwitchState
.
ColorLimits
— Color limits
two-element vector
Color limits, specified as a two-element vector of the form [min
max]
. The color limits indicate the color data values that map to the
first and last colors in the colormap.
Title
— Chart title
character vector | cell array of character vectors | string array | categorical array
Chart title, specified as a character vector, cell array of character vectors, string array, or categorical array.
Example: "My Title Text"
To create a multi-line title, specify a cell array of character vectors or a string array. Each element in the array corresponds to a line of text.
Example: {"My","Title"};
If you specify the title as a categorical array, MATLAB® uses the values in the array, not the categories.
If you create the chart using tabular data, the default chart has an autogenerated
title. If you do not want a title, specify ""
.
View
— Azimuth and elevation of view
[0 90]
(default) | two-element vector of the form [azimuth elevation]
Azimuth and elevation of view, specified as a two-element vector of the form
[azimuth elevation]
defined in degree units. Alternatively, use
the view
function to set the view.
Output Arguments
V
— Visualization container
handle
Visualization container, returned as a handle to the
PDEVisualization
object. For details, see PDEVisualization Properties.
Version History
Introduced in R2021a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)