mesh:mesh to pyvista
Last update: 31.07.2026Version: 0.0.0
Description
Export a MeshedRegion in the pyVista format.
Inputs
This table lists the input pins for this operator. Input pins define the data that the operator requires to perform its operation. Some inputs are required, while others are optional and provide additional configuration. Each parameter is detailed in the sections that follow the table.
| Pin number | Name | Status | Expected type(s) |
|---|---|---|---|
| 2 | coordinates | field |
|
| 6 | as_linear | bool |
|
| 7 | mesh | Required | abstract_meshed_region |
| 60 | vtk_updated | bool |
|
| 200 | as_poly | bool |
coordinates (Pin 2)
- Required: No
- Expected type(s):
field
Node coordinates. If not set, the node coordinates of the mesh are employed.
as_linear (Pin 6)
- Required: No
- Expected type(s):
bool
Export a linear version of the mesh (quadratic surface elements do no include midside nodes). If not set, defaults to true.
mesh (Pin 7)
- Required: Yes
- Expected type(s):
abstract_meshed_region
mesh to export in pyVista format
vtk_updated (Pin 60)
- Required: No
- Expected type(s):
bool
True if the VTK version employed by pyVista is > VTK 9. Default true.
as_poly (Pin 200)
- Required: No
- Expected type(s):
bool
Export elements as polyhedrons (cell-face-node representation). Default false.
Outputs
This table lists the output pins for this operator. Output pins provide the results of the operator's computation and can be connected to inputs of other operators or retrieved for further processing. Each output is detailed in the sections that follow the table.
| Pin number | Name | Expected type(s) |
|---|---|---|
| 0 | nodes | field |
| 1 | cells | vector<int32> |
| 2 | cell_types | vector<int32> |
| 3 | offsets | vector<int32> |
nodes (Pin 0)
- Expected type(s):
field
Node coordinates double vector
cells (Pin 1)
- Expected type(s):
vector<int32>
Cell connectivity int vector
cell_types (Pin 2)
- Expected type(s):
vector<int32>
Cell types property int vector
offsets (Pin 3)
- Expected type(s):
vector<int32>
If vtk_updated=false, offsets int vector
Configurations
This operator supports configuration options that modify its behavior.
mutex
- Expected type(s):
bool - Default value: false
If this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads.
Scripting
This operator can be accessed through scripting interfaces using these identifiers.
Category: mesh
Plugin: vtk
Scripting name: None
Full name: None
Internal name: mesh_to_pyvista
License: None
Examples
These examples demonstrate how to use this operator in different programming environments. Each example shows how to instantiate the operator, connect the required inputs, and retrieve the output.
C++
#include "dpf_api.h"
ansys::dpf::Operator op("mesh_to_pyvista"); // operator instantiation
op.connect(2, my_coordinates);
op.connect(6, my_as_linear);
op.connect(7, my_mesh);
op.connect(60, my_vtk_updated);
op.connect(200, my_as_poly);
ansys::dpf::Field my_nodes = op.getOutput<ansys::dpf::Field>(0);
std::vector<int> my_cells = op.getOutput<std::vector<int>>(1);
std::vector<int> my_cell_types = op.getOutput<std::vector<int>>(2);
std::vector<int> my_offsets = op.getOutput<std::vector<int>>(3);
CPython
import ansys.dpf.core as dpf
op = dpf.operators.mesh.None() # operator instantiation
op.inputs.coordinates.connect(my_coordinates)
op.inputs.as_linear.connect(my_as_linear)
op.inputs.mesh.connect(my_mesh)
op.inputs.vtk_updated.connect(my_vtk_updated)
op.inputs.as_poly.connect(my_as_poly)
my_nodes = op.outputs.nodes()
my_cells = op.outputs.cells()
my_cell_types = op.outputs.cell_types()
my_offsets = op.outputs.offsets()
IPython
import mech_dpf
import Ans.DataProcessing as dpf
op = dpf.operators.mesh.None() # operator instantiation
op.inputs.coordinates.Connect(my_coordinates)
op.inputs.as_linear.Connect(my_as_linear)
op.inputs.mesh.Connect(my_mesh)
op.inputs.vtk_updated.Connect(my_vtk_updated)
op.inputs.as_poly.Connect(my_as_poly)
my_nodes = op.outputs.nodes.GetData()
my_cells = op.outputs.cells.GetData()
my_cell_types = op.outputs.cell_types.GetData()
my_offsets = op.outputs.offsets.GetData()
Changelog
- Version 0.0.0: Initial release.