Skip to content

Commit a36f1f8

Browse files
Update generated code for DPF 251_test on master (#1641)
* update generated code * Update collection_grpcapi.py
1 parent 9e31a5b commit a36f1f8

15 files changed

+570
-70
lines changed

doc/source/_static/dpf_operators.html

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from .make_overall import make_overall
3737
from .make_producer_consumer_for_each_iterator import make_producer_consumer_for_each_iterator
3838
from .merge_any import merge_any
39+
from .merge_collections import merge_collections
3940
from .merge_data_tree import merge_data_tree
4041
from .merge_fields import merge_fields
4142
from .merge_fields_by_label import merge_fields_by_label

src/ansys/dpf/core/operators/utility/field_get_attribute.py

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from ansys.dpf.core.dpf_operator import Operator
99
from ansys.dpf.core.inputs import Input, _Inputs
1010
from ansys.dpf.core.outputs import Output, _Outputs
11+
from ansys.dpf.core.outputs import _modify_output_spec_with_one_type
1112
from ansys.dpf.core.operators.specification import PinSpecification, Specification
1213

1314

@@ -19,7 +20,8 @@ class field_get_attribute(Operator):
1920
----------
2021
field : Field
2122
property_name : str
22-
Accepted inputs are: 'time_freq_support'.
23+
Accepted inputs are: 'time_freq_support' and
24+
'scoping'.
2325
2426
2527
Examples
@@ -71,13 +73,14 @@ def _spec():
7173
name="property_name",
7274
type_names=["string"],
7375
optional=False,
74-
document="""Accepted inputs are: 'time_freq_support'.""",
76+
document="""Accepted inputs are: 'time_freq_support' and
77+
'scoping'.""",
7578
),
7679
},
7780
map_output_pin_spec={
7881
0: PinSpecification(
7982
name="property",
80-
type_names=["time_freq_support"],
83+
type_names=["time_freq_support", "scoping"],
8184
optional=False,
8285
document="""Property value.""",
8386
),
@@ -165,7 +168,8 @@ def field(self):
165168
def property_name(self):
166169
"""Allows to connect property_name input to the operator.
167170
168-
Accepted inputs are: 'time_freq_support'.
171+
Accepted inputs are: 'time_freq_support' and
172+
'scoping'.
169173
170174
Parameters
171175
----------
@@ -196,22 +200,19 @@ class OutputsFieldGetAttribute(_Outputs):
196200

197201
def __init__(self, op: Operator):
198202
super().__init__(field_get_attribute._spec().outputs, op)
199-
self._property = Output(field_get_attribute._spec().output_pin(0), 0, op)
200-
self._outputs.append(self._property)
201-
202-
@property
203-
def property(self):
204-
"""Allows to get property output of the operator
205-
206-
Returns
207-
----------
208-
my_property : TimeFreqSupport
209-
210-
Examples
211-
--------
212-
>>> from ansys.dpf import core as dpf
213-
>>> op = dpf.operators.utility.field_get_attribute()
214-
>>> # Connect inputs : op.inputs. ...
215-
>>> result_property = op.outputs.property()
216-
""" # noqa: E501
217-
return self._property
203+
self.property_as_time_freq_support = Output(
204+
_modify_output_spec_with_one_type(
205+
field_get_attribute._spec().output_pin(0), "time_freq_support"
206+
),
207+
0,
208+
op,
209+
)
210+
self._outputs.append(self.property_as_time_freq_support)
211+
self.property_as_scoping = Output(
212+
_modify_output_spec_with_one_type(
213+
field_get_attribute._spec().output_pin(0), "scoping"
214+
),
215+
0,
216+
op,
217+
)
218+
self._outputs.append(self.property_as_scoping)

0 commit comments

Comments
 (0)