Skip to content

Commit 1189496

Browse files
PProfizigithub-actions[bot]
authored andcommitted
update generated code
1 parent a983d6c commit 1189496

File tree

8 files changed

+302
-6
lines changed

8 files changed

+302
-6
lines changed

doc/source/_static/dpf_operators.html

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from .extract_time_freq import extract_time_freq
1919
from .fc_get_attribute import fc_get_attribute
2020
from .field import field
21+
from .field_clone_to_shell_layer import field_clone_to_shell_layer
2122
from .field_get_attribute import field_get_attribute
2223
from .field_to_fc import field_to_fc
2324
from .fields_container import fields_container

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class change_shell_layers(Operator):
3434
mesh: MeshedRegion or MeshesContainer, optional
3535
Mesh support of the input fields_container, in case it does not have one defined. If the fields_container contains mixed shell/solid results, the mesh is required (either by connecting this pin or in the support).
3636
merge: bool, optional
37-
For shell/solid mixed fields, group in the same field all solids and shells (false by default).
37+
For fields with mixed shell layers (solid/shell elements with heterogeneous shell layers), group all of them in the same field (false by default).
3838
3939
Returns
4040
-------
@@ -125,7 +125,7 @@ def _spec() -> Specification:
125125
name="merge",
126126
type_names=["bool"],
127127
optional=True,
128-
document=r"""For shell/solid mixed fields, group in the same field all solids and shells (false by default).""",
128+
document=r"""For fields with mixed shell layers (solid/shell elements with heterogeneous shell layers), group all of them in the same field (false by default).""",
129129
),
130130
},
131131
map_output_pin_spec={
@@ -279,7 +279,7 @@ def mesh(self) -> Input:
279279
def merge(self) -> Input:
280280
r"""Allows to connect merge input to the operator.
281281
282-
For shell/solid mixed fields, group in the same field all solids and shells (false by default).
282+
For fields with mixed shell layers (solid/shell elements with heterogeneous shell layers), group all of them in the same field (false by default).
283283
284284
Returns
285285
-------
Lines changed: 295 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,295 @@
1+
"""
2+
field_clone_to_shell_layer
3+
4+
Autogenerated DPF operator classes.
5+
"""
6+
7+
from __future__ import annotations
8+
9+
from warnings import warn
10+
from ansys.dpf.core.dpf_operator import Operator
11+
from ansys.dpf.core.inputs import Input, _Inputs
12+
from ansys.dpf.core.outputs import Output, _Outputs
13+
from ansys.dpf.core.operators.specification import PinSpecification, Specification
14+
from ansys.dpf.core.config import Config
15+
from ansys.dpf.core.server_types import AnyServerType
16+
17+
18+
class field_clone_to_shell_layer(Operator):
19+
r"""Generates a Field from the Field in input 0 that has the same
20+
FieldDefinition with the exception of the shellLayers enum that is
21+
specified in input 1. The DataPointer is recomputed to the appropriate
22+
value. The Data of the output Field is 0.0 for all entities. Scoping can
23+
be shared or not based on the optional pin 2.
24+
25+
26+
Parameters
27+
----------
28+
field: Field
29+
shell_layer: int
30+
0: Top, 1: Bottom, 2: BottomTop, 3: Mid, 4: BottomTopMid.
31+
duplicate_scoping: bool, optional
32+
If true, a new scoping is computed for the output Field. If false, the input Field scoping is used. Default is false.
33+
34+
Returns
35+
-------
36+
field: Field
37+
38+
Examples
39+
--------
40+
>>> from ansys.dpf import core as dpf
41+
42+
>>> # Instantiate operator
43+
>>> op = dpf.operators.utility.field_clone_to_shell_layer()
44+
45+
>>> # Make input connections
46+
>>> my_field = dpf.Field()
47+
>>> op.inputs.field.connect(my_field)
48+
>>> my_shell_layer = int()
49+
>>> op.inputs.shell_layer.connect(my_shell_layer)
50+
>>> my_duplicate_scoping = bool()
51+
>>> op.inputs.duplicate_scoping.connect(my_duplicate_scoping)
52+
53+
>>> # Instantiate operator and connect inputs in one line
54+
>>> op = dpf.operators.utility.field_clone_to_shell_layer(
55+
... field=my_field,
56+
... shell_layer=my_shell_layer,
57+
... duplicate_scoping=my_duplicate_scoping,
58+
... )
59+
60+
>>> # Get output data
61+
>>> result_field = op.outputs.field()
62+
"""
63+
64+
def __init__(
65+
self,
66+
field=None,
67+
shell_layer=None,
68+
duplicate_scoping=None,
69+
config=None,
70+
server=None,
71+
):
72+
super().__init__(
73+
name="field::clone_to_shell_layer", config=config, server=server
74+
)
75+
self._inputs = InputsFieldCloneToShellLayer(self)
76+
self._outputs = OutputsFieldCloneToShellLayer(self)
77+
if field is not None:
78+
self.inputs.field.connect(field)
79+
if shell_layer is not None:
80+
self.inputs.shell_layer.connect(shell_layer)
81+
if duplicate_scoping is not None:
82+
self.inputs.duplicate_scoping.connect(duplicate_scoping)
83+
84+
@staticmethod
85+
def _spec() -> Specification:
86+
description = r"""Generates a Field from the Field in input 0 that has the same
87+
FieldDefinition with the exception of the shellLayers enum that is
88+
specified in input 1. The DataPointer is recomputed to the appropriate
89+
value. The Data of the output Field is 0.0 for all entities. Scoping can
90+
be shared or not based on the optional pin 2.
91+
"""
92+
spec = Specification(
93+
description=description,
94+
map_input_pin_spec={
95+
0: PinSpecification(
96+
name="field",
97+
type_names=["field"],
98+
optional=False,
99+
document=r"""""",
100+
),
101+
1: PinSpecification(
102+
name="shell_layer",
103+
type_names=["int32", "enum dataProcessing::EShellLayers"],
104+
optional=False,
105+
document=r"""0: Top, 1: Bottom, 2: BottomTop, 3: Mid, 4: BottomTopMid.""",
106+
),
107+
2: PinSpecification(
108+
name="duplicate_scoping",
109+
type_names=["bool"],
110+
optional=True,
111+
document=r"""If true, a new scoping is computed for the output Field. If false, the input Field scoping is used. Default is false.""",
112+
),
113+
},
114+
map_output_pin_spec={
115+
0: PinSpecification(
116+
name="field",
117+
type_names=["field"],
118+
optional=False,
119+
document=r"""""",
120+
),
121+
},
122+
)
123+
return spec
124+
125+
@staticmethod
126+
def default_config(server: AnyServerType = None) -> Config:
127+
"""Returns the default config of the operator.
128+
129+
This config can then be changed to the user needs and be used to
130+
instantiate the operator. The Configuration allows to customize
131+
how the operation will be processed by the operator.
132+
133+
Parameters
134+
----------
135+
server:
136+
Server with channel connected to the remote or local instance. When
137+
``None``, attempts to use the global server.
138+
139+
Returns
140+
-------
141+
config:
142+
A new Config instance equivalent to the default config for this operator.
143+
"""
144+
return Operator.default_config(
145+
name="field::clone_to_shell_layer", server=server
146+
)
147+
148+
@property
149+
def inputs(self) -> InputsFieldCloneToShellLayer:
150+
"""Enables to connect inputs to the operator
151+
152+
Returns
153+
--------
154+
inputs:
155+
An instance of InputsFieldCloneToShellLayer.
156+
"""
157+
return super().inputs
158+
159+
@property
160+
def outputs(self) -> OutputsFieldCloneToShellLayer:
161+
"""Enables to get outputs of the operator by evaluating it
162+
163+
Returns
164+
--------
165+
outputs:
166+
An instance of OutputsFieldCloneToShellLayer.
167+
"""
168+
return super().outputs
169+
170+
171+
class InputsFieldCloneToShellLayer(_Inputs):
172+
"""Intermediate class used to connect user inputs to
173+
field_clone_to_shell_layer operator.
174+
175+
Examples
176+
--------
177+
>>> from ansys.dpf import core as dpf
178+
>>> op = dpf.operators.utility.field_clone_to_shell_layer()
179+
>>> my_field = dpf.Field()
180+
>>> op.inputs.field.connect(my_field)
181+
>>> my_shell_layer = int()
182+
>>> op.inputs.shell_layer.connect(my_shell_layer)
183+
>>> my_duplicate_scoping = bool()
184+
>>> op.inputs.duplicate_scoping.connect(my_duplicate_scoping)
185+
"""
186+
187+
def __init__(self, op: Operator):
188+
super().__init__(field_clone_to_shell_layer._spec().inputs, op)
189+
self._field = Input(field_clone_to_shell_layer._spec().input_pin(0), 0, op, -1)
190+
self._inputs.append(self._field)
191+
self._shell_layer = Input(
192+
field_clone_to_shell_layer._spec().input_pin(1), 1, op, -1
193+
)
194+
self._inputs.append(self._shell_layer)
195+
self._duplicate_scoping = Input(
196+
field_clone_to_shell_layer._spec().input_pin(2), 2, op, -1
197+
)
198+
self._inputs.append(self._duplicate_scoping)
199+
200+
@property
201+
def field(self) -> Input:
202+
r"""Allows to connect field input to the operator.
203+
204+
Returns
205+
-------
206+
input:
207+
An Input instance for this pin.
208+
209+
Examples
210+
--------
211+
>>> from ansys.dpf import core as dpf
212+
>>> op = dpf.operators.utility.field_clone_to_shell_layer()
213+
>>> op.inputs.field.connect(my_field)
214+
>>> # or
215+
>>> op.inputs.field(my_field)
216+
"""
217+
return self._field
218+
219+
@property
220+
def shell_layer(self) -> Input:
221+
r"""Allows to connect shell_layer input to the operator.
222+
223+
0: Top, 1: Bottom, 2: BottomTop, 3: Mid, 4: BottomTopMid.
224+
225+
Returns
226+
-------
227+
input:
228+
An Input instance for this pin.
229+
230+
Examples
231+
--------
232+
>>> from ansys.dpf import core as dpf
233+
>>> op = dpf.operators.utility.field_clone_to_shell_layer()
234+
>>> op.inputs.shell_layer.connect(my_shell_layer)
235+
>>> # or
236+
>>> op.inputs.shell_layer(my_shell_layer)
237+
"""
238+
return self._shell_layer
239+
240+
@property
241+
def duplicate_scoping(self) -> Input:
242+
r"""Allows to connect duplicate_scoping input to the operator.
243+
244+
If true, a new scoping is computed for the output Field. If false, the input Field scoping is used. Default is false.
245+
246+
Returns
247+
-------
248+
input:
249+
An Input instance for this pin.
250+
251+
Examples
252+
--------
253+
>>> from ansys.dpf import core as dpf
254+
>>> op = dpf.operators.utility.field_clone_to_shell_layer()
255+
>>> op.inputs.duplicate_scoping.connect(my_duplicate_scoping)
256+
>>> # or
257+
>>> op.inputs.duplicate_scoping(my_duplicate_scoping)
258+
"""
259+
return self._duplicate_scoping
260+
261+
262+
class OutputsFieldCloneToShellLayer(_Outputs):
263+
"""Intermediate class used to get outputs from
264+
field_clone_to_shell_layer operator.
265+
266+
Examples
267+
--------
268+
>>> from ansys.dpf import core as dpf
269+
>>> op = dpf.operators.utility.field_clone_to_shell_layer()
270+
>>> # Connect inputs : op.inputs. ...
271+
>>> result_field = op.outputs.field()
272+
"""
273+
274+
def __init__(self, op: Operator):
275+
super().__init__(field_clone_to_shell_layer._spec().outputs, op)
276+
self._field = Output(field_clone_to_shell_layer._spec().output_pin(0), 0, op)
277+
self._outputs.append(self._field)
278+
279+
@property
280+
def field(self) -> Output:
281+
r"""Allows to get field output of the operator
282+
283+
Returns
284+
-------
285+
output:
286+
An Output instance for this pin.
287+
288+
Examples
289+
--------
290+
>>> from ansys.dpf import core as dpf
291+
>>> op = dpf.operators.utility.field_clone_to_shell_layer()
292+
>>> # Get the output from op.outputs. ...
293+
>>> result_field = op.outputs.field()
294+
"""
295+
return self._field

0 commit comments

Comments
 (0)