get_volumes#

LegacyGeometry.get_volumes(return_as_list=False, quality=4)#

Get active volumes from MAPDL represented as a pyvista.PolyData object or a list of pyvista.UnstructuredGrid objects.

Parameters:
qualityint, optional

Quality of the mesh to display. Values are 1 (worst) to 10 (best).

Returns:
pv.PolyData or List[pv.UnstructuredGrid]

pv.PolyData grouping all meshes representing the active surface volumes selected by VSEL. If return_as_list=True, volumes are returned as a list of pv.UnstructuredGrid.

Return type:

Union[List[PolyData], PolyData]

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,
...