Skip to content

Commit 82eced7

Browse files
update generated code (#1169)
Co-authored-by: rlagha <[email protected]>
1 parent a900a05 commit 82eced7

File tree

7 files changed

+244
-1
lines changed

7 files changed

+244
-1
lines changed

docs/source/_static/dpf_operators.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/ansys/dpf/core/operators/mesh/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from .mesh_to_graphics import mesh_to_graphics
2020
from .mesh_to_graphics_edges import mesh_to_graphics_edges
2121
from .mesh_to_pyvista import mesh_to_pyvista
22+
from .mesh_to_tetra import mesh_to_tetra
2223
from .meshes_provider import meshes_provider
2324
from .node_coordinates import node_coordinates
2425
from .points_from_coordinates import points_from_coordinates
Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
"""
2+
mesh_to_tetra
3+
=============
4+
Autogenerated DPF operator classes.
5+
"""
6+
from warnings import warn
7+
from ansys.dpf.core.dpf_operator import Operator
8+
from ansys.dpf.core.inputs import Input, _Inputs
9+
from ansys.dpf.core.outputs import Output, _Outputs
10+
from ansys.dpf.core.operators.specification import PinSpecification, Specification
11+
12+
13+
class mesh_to_tetra(Operator):
14+
"""Converts 3D meshes of arbitrary 3D element types into a tetrahedral
15+
mesh, output at pin (0). Non 3D elements are ignored. Scopings
16+
providing the mapping from resulting nodes & elements to their
17+
original ID in the input mesh are provided, output pins (1) & (2)
18+
respectively.
19+
20+
Parameters
21+
----------
22+
mesh : MeshedRegion
23+
Mesh with arbitrary element types.
24+
25+
26+
Examples
27+
--------
28+
>>> from ansys.dpf import core as dpf
29+
30+
>>> # Instantiate operator
31+
>>> op = dpf.operators.mesh.mesh_to_tetra()
32+
33+
>>> # Make input connections
34+
>>> my_mesh = dpf.MeshedRegion()
35+
>>> op.inputs.mesh.connect(my_mesh)
36+
37+
>>> # Instantiate operator and connect inputs in one line
38+
>>> op = dpf.operators.mesh.mesh_to_tetra(
39+
... mesh=my_mesh,
40+
... )
41+
42+
>>> # Get output data
43+
>>> result_mesh = op.outputs.mesh()
44+
>>> result_node_mapping = op.outputs.node_mapping()
45+
>>> result_element_mapping = op.outputs.element_mapping()
46+
"""
47+
48+
def __init__(self, mesh=None, config=None, server=None):
49+
super().__init__(name="mesh_to_tetra", config=config, server=server)
50+
self._inputs = InputsMeshToTetra(self)
51+
self._outputs = OutputsMeshToTetra(self)
52+
if mesh is not None:
53+
self.inputs.mesh.connect(mesh)
54+
55+
@staticmethod
56+
def _spec():
57+
description = """Converts 3D meshes of arbitrary 3D element types into a tetrahedral
58+
mesh, output at pin (0). Non 3D elements are ignored.
59+
Scopings providing the mapping from resulting nodes &amp;
60+
elements to their original ID in the input mesh are
61+
provided, output pins (1) &amp; (2) respectively."""
62+
spec = Specification(
63+
description=description,
64+
map_input_pin_spec={
65+
0: PinSpecification(
66+
name="mesh",
67+
type_names=["abstract_meshed_region"],
68+
optional=False,
69+
document="""Mesh with arbitrary element types.""",
70+
),
71+
},
72+
map_output_pin_spec={
73+
0: PinSpecification(
74+
name="mesh",
75+
type_names=["meshed_region"],
76+
optional=False,
77+
document="""Tetrahedralized mesh.""",
78+
),
79+
1: PinSpecification(
80+
name="node_mapping",
81+
type_names=["scoping"],
82+
optional=False,
83+
document="""Node mapping.""",
84+
),
85+
2: PinSpecification(
86+
name="element_mapping",
87+
type_names=["scoping"],
88+
optional=False,
89+
document="""Element mapping.""",
90+
),
91+
},
92+
)
93+
return spec
94+
95+
@staticmethod
96+
def default_config(server=None):
97+
"""Returns the default config of the operator.
98+
99+
This config can then be changed to the user needs and be used to
100+
instantiate the operator. The Configuration allows to customize
101+
how the operation will be processed by the operator.
102+
103+
Parameters
104+
----------
105+
server : server.DPFServer, optional
106+
Server with channel connected to the remote or local instance. When
107+
``None``, attempts to use the global server.
108+
"""
109+
return Operator.default_config(name="mesh_to_tetra", server=server)
110+
111+
@property
112+
def inputs(self):
113+
"""Enables to connect inputs to the operator
114+
115+
Returns
116+
--------
117+
inputs : InputsMeshToTetra
118+
"""
119+
return super().inputs
120+
121+
@property
122+
def outputs(self):
123+
"""Enables to get outputs of the operator by evaluating it
124+
125+
Returns
126+
--------
127+
outputs : OutputsMeshToTetra
128+
"""
129+
return super().outputs
130+
131+
132+
class InputsMeshToTetra(_Inputs):
133+
"""Intermediate class used to connect user inputs to
134+
mesh_to_tetra operator.
135+
136+
Examples
137+
--------
138+
>>> from ansys.dpf import core as dpf
139+
>>> op = dpf.operators.mesh.mesh_to_tetra()
140+
>>> my_mesh = dpf.MeshedRegion()
141+
>>> op.inputs.mesh.connect(my_mesh)
142+
"""
143+
144+
def __init__(self, op: Operator):
145+
super().__init__(mesh_to_tetra._spec().inputs, op)
146+
self._mesh = Input(mesh_to_tetra._spec().input_pin(0), 0, op, -1)
147+
self._inputs.append(self._mesh)
148+
149+
@property
150+
def mesh(self):
151+
"""Allows to connect mesh input to the operator.
152+
153+
Mesh with arbitrary element types.
154+
155+
Parameters
156+
----------
157+
my_mesh : MeshedRegion
158+
159+
Examples
160+
--------
161+
>>> from ansys.dpf import core as dpf
162+
>>> op = dpf.operators.mesh.mesh_to_tetra()
163+
>>> op.inputs.mesh.connect(my_mesh)
164+
>>> # or
165+
>>> op.inputs.mesh(my_mesh)
166+
"""
167+
return self._mesh
168+
169+
170+
class OutputsMeshToTetra(_Outputs):
171+
"""Intermediate class used to get outputs from
172+
mesh_to_tetra operator.
173+
174+
Examples
175+
--------
176+
>>> from ansys.dpf import core as dpf
177+
>>> op = dpf.operators.mesh.mesh_to_tetra()
178+
>>> # Connect inputs : op.inputs. ...
179+
>>> result_mesh = op.outputs.mesh()
180+
>>> result_node_mapping = op.outputs.node_mapping()
181+
>>> result_element_mapping = op.outputs.element_mapping()
182+
"""
183+
184+
def __init__(self, op: Operator):
185+
super().__init__(mesh_to_tetra._spec().outputs, op)
186+
self._mesh = Output(mesh_to_tetra._spec().output_pin(0), 0, op)
187+
self._outputs.append(self._mesh)
188+
self._node_mapping = Output(mesh_to_tetra._spec().output_pin(1), 1, op)
189+
self._outputs.append(self._node_mapping)
190+
self._element_mapping = Output(mesh_to_tetra._spec().output_pin(2), 2, op)
191+
self._outputs.append(self._element_mapping)
192+
193+
@property
194+
def mesh(self):
195+
"""Allows to get mesh output of the operator
196+
197+
Returns
198+
----------
199+
my_mesh : MeshedRegion
200+
201+
Examples
202+
--------
203+
>>> from ansys.dpf import core as dpf
204+
>>> op = dpf.operators.mesh.mesh_to_tetra()
205+
>>> # Connect inputs : op.inputs. ...
206+
>>> result_mesh = op.outputs.mesh()
207+
""" # noqa: E501
208+
return self._mesh
209+
210+
@property
211+
def node_mapping(self):
212+
"""Allows to get node_mapping output of the operator
213+
214+
Returns
215+
----------
216+
my_node_mapping : Scoping
217+
218+
Examples
219+
--------
220+
>>> from ansys.dpf import core as dpf
221+
>>> op = dpf.operators.mesh.mesh_to_tetra()
222+
>>> # Connect inputs : op.inputs. ...
223+
>>> result_node_mapping = op.outputs.node_mapping()
224+
""" # noqa: E501
225+
return self._node_mapping
226+
227+
@property
228+
def element_mapping(self):
229+
"""Allows to get element_mapping output of the operator
230+
231+
Returns
232+
----------
233+
my_element_mapping : Scoping
234+
235+
Examples
236+
--------
237+
>>> from ansys.dpf import core as dpf
238+
>>> op = dpf.operators.mesh.mesh_to_tetra()
239+
>>> # Connect inputs : op.inputs. ...
240+
>>> result_element_mapping = op.outputs.element_mapping()
241+
""" # noqa: E501
242+
return self._element_mapping
1 KB
Binary file not shown.
0 Bytes
Binary file not shown.
64 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)