volume
Volume of 3-D mesh elements
Description
Examples
Volume of 3-D Mesh
Generate a 3-D mesh and find its volume.
Create a PDE model.
model = createpde;
Import and plot the geometry.
importGeometry(model,"BracketWithHole.stl");
pdegplot(model)
Generate a mesh and plot it.
mesh = generateMesh(model); figure pdemesh(model)
Compute the volume of the entire mesh.
mv = volume(mesh)
mv = 8.0244e-04
Volume of Individual Elements of 3-D Mesh
Generate a 3-D mesh and find the volume of each element.
Create a PDE model.
model = createpde;
Import and plot the geometry.
importGeometry(model,"BracketWithHole.stl");
pdegplot(model)
Generate a mesh and plot it.
mesh = generateMesh(model); figure pdemesh(model)
Compute the volume of the entire mesh and the volume of each individual element of the mesh. Display the volumes of the first 5 elements.
[va,vi] = volume(mesh); vi(1:5)
ans = 1×5
10-6 ×
0.3801 0.4653 0.1624 0.4345 0.1729
Total Volume of Group of Elements
Find the combined volume of a group of elements of a 3-D mesh.
Create a PDE model.
model = createpde;
Import and plot the geometry.
importGeometry(model,"BracketWithHole.stl");
pdegplot(model)
Generate a mesh and plot it.
mesh = generateMesh(model); figure pdemesh(model)
Evaluate the shape quality of the mesh elements and find the elements with the quality values less than 0.5.
Q = meshQuality(mesh); elemIDs = find(Q < 0.5);
Compute the total volume of these elements.
mv05 = volume(mesh,elemIDs)
mv05 = 1.4865e-07
Find how much of the total mesh volume belongs to these elements. Return the result as a percentage.
mv05_percent = mv05/volume(mesh)*100
mv05_percent = 0.0185
Input Arguments
mesh
— Mesh object
Mesh
property of a PDEModel
object | output of generateMesh
Mesh object, specified as the Mesh
property of a PDEModel
object or as the
output of generateMesh
.
Example: model.Mesh
elements
— Element IDs
positive integer | matrix of positive integers
Element IDs, specified as a positive integer or a matrix of positive integers.
Example: [10 68 81 97 113 130 136 164]
Output Arguments
V
— Volume
positive number
Volume of the entire mesh or the combined volume of the specified elements of the mesh, returned as a positive number.
VE
— Volume of individual elements
row vector of positive numbers
Volume of individual elements, returned as a row vector of positive numbers.
Version History
Introduced in R2018a
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)