get_volumes#
- Geometry.get_volumes(return_as_list=False, quality=4)#
Get active volumes from MAPDL represented as a
pyvista.PolyData
object or a list ofpyvista.UnstructuredGrid
objects.- Parameters:
- quality
int
,optional
Quality of the mesh to display. Values are 1 (worst) to 10 (best).
- quality
- Returns:
pv.PolyData
orList
[pv.UnstructuredGrid
]pv.PolyData grouping all meshes representing the active surface volumes selected by
VSEL
. Ifreturn_as_list=True
, volumes are returned as a list ofpv.UnstructuredGrid
.
- Return type:
Examples
Return a single merged mesh.
>>> volume_mesh = mapdl.geometry.get_volumes(quality=3) >>> volume_mesh UnstructuredGrid (0x7f14add95ca0) N Cells: 24 N Points: 30 X Bounds: -2.000e+00, 2.000e+00 Y Bounds: 0.000e+00, 1.974e+00 Z Bounds: 5.500e-01, 5.500e-01 N Arrays: 4
Return a list of volumes as individual grids.
>>> volumes = mapdl.geometry.get_volumes(quality=3, return_as_list=True) >>> volumes [UnstructuredGrid (0x7f14add95040) N Cells: 12 N Points: 20 X Bounds: -2.000e+00, 2.000e+00 Y Bounds: 0.000e+00, 1.974e+00 Z Bounds: 0.000e+00, 0.000e+00 N Arrays: 4, UnstructuredGrid (0x7f14add95ca0) N Cells: 12 N Points: 20 X Bounds: -2.000e+00, 2.000e+00 Y Bounds: 0.000e+00, 1.974e+00 Z Bounds: 5.500e-01, 5.500e-01 N Arrays: 4, ...