Skip to content

Commit 7d910e4

Browse files
Update generated code for DPF 261_daily on main (#2642)
Co-authored-by: PProfizi <[email protected]>
1 parent 05e0519 commit 7d910e4

File tree

7 files changed

+104
-77
lines changed

7 files changed

+104
-77
lines changed

doc/source/_static/dpf_operators.html

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

src/ansys/dpf/core/operators/averaging/force_summation.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ class force_summation(Operator):
2626
----------
2727
time_scoping: Scoping, optional
2828
default = all time steps
29-
nodal_scoping: Scoping, optional
30-
Nodal Scoping. Set of nodes in which elemental contribution forces will be accumulated (default = all nodes)
31-
elemental_scoping: Scoping, optional
32-
Elemental Scoping. Set of elements contributing to the force calcuation. (default = all elements)
29+
nodal_scoping: Scoping or ScopingsContainer, optional
30+
Nodal Scoping or Scopings Container with a single label. Set of nodes in which elemental contribution forces will be accumulated (default = all nodes)
31+
elemental_scoping: Scoping or ScopingsContainer, optional
32+
Elemental Scoping or Scopings Container with a single label. Set of elements contributing to the force calculation. (default = all elements)
3333
streams_container: StreamsContainer, optional
3434
Streams container. Optional if using data sources.
3535
data_sources: DataSources
3636
Data sources. Optional if using a streams container.
3737
force_type: int, optional
38-
Type of force to be processed (0 - default: Total forces (static, damping, and inertia)., 1: Static forces, 2: Damping forces, 3: Inertia forces)
39-
spoint: Field, optional
40-
Coordinate field of a point for moment summations. Defaults to (0,0,0).
38+
Type of force to be processed (0: Total forces (static, damping, and inertia)., 1 (default): Static forces, 2: Damping forces, 3: Inertia forces)
39+
spoint: Field or FieldsContainer, optional
40+
Field or fields container of the coordinates of the point used for moment summations. Defaults to (0,0,0).
4141
4242
Returns
4343
-------
@@ -139,15 +139,15 @@ def _spec() -> Specification:
139139
),
140140
1: PinSpecification(
141141
name="nodal_scoping",
142-
type_names=["scoping"],
142+
type_names=["scoping", "scopings_container"],
143143
optional=True,
144-
document=r"""Nodal Scoping. Set of nodes in which elemental contribution forces will be accumulated (default = all nodes)""",
144+
document=r"""Nodal Scoping or Scopings Container with a single label. Set of nodes in which elemental contribution forces will be accumulated (default = all nodes)""",
145145
),
146146
2: PinSpecification(
147147
name="elemental_scoping",
148-
type_names=["scoping"],
148+
type_names=["scoping", "scopings_container"],
149149
optional=True,
150-
document=r"""Elemental Scoping. Set of elements contributing to the force calcuation. (default = all elements)""",
150+
document=r"""Elemental Scoping or Scopings Container with a single label. Set of elements contributing to the force calculation. (default = all elements)""",
151151
),
152152
3: PinSpecification(
153153
name="streams_container",
@@ -165,13 +165,13 @@ def _spec() -> Specification:
165165
name="force_type",
166166
type_names=["int32"],
167167
optional=True,
168-
document=r"""Type of force to be processed (0 - default: Total forces (static, damping, and inertia)., 1: Static forces, 2: Damping forces, 3: Inertia forces)""",
168+
document=r"""Type of force to be processed (0: Total forces (static, damping, and inertia)., 1 (default): Static forces, 2: Damping forces, 3: Inertia forces)""",
169169
),
170170
6: PinSpecification(
171171
name="spoint",
172-
type_names=["field"],
172+
type_names=["field", "fields_container"],
173173
optional=True,
174-
document=r"""Coordinate field of a point for moment summations. Defaults to (0,0,0).""",
174+
document=r"""Field or fields container of the coordinates of the point used for moment summations. Defaults to (0,0,0).""",
175175
),
176176
},
177177
map_output_pin_spec={
@@ -325,7 +325,7 @@ def time_scoping(self) -> Input:
325325
def nodal_scoping(self) -> Input:
326326
r"""Allows to connect nodal_scoping input to the operator.
327327
328-
Nodal Scoping. Set of nodes in which elemental contribution forces will be accumulated (default = all nodes)
328+
Nodal Scoping or Scopings Container with a single label. Set of nodes in which elemental contribution forces will be accumulated (default = all nodes)
329329
330330
Returns
331331
-------
@@ -346,7 +346,7 @@ def nodal_scoping(self) -> Input:
346346
def elemental_scoping(self) -> Input:
347347
r"""Allows to connect elemental_scoping input to the operator.
348348
349-
Elemental Scoping. Set of elements contributing to the force calcuation. (default = all elements)
349+
Elemental Scoping or Scopings Container with a single label. Set of elements contributing to the force calculation. (default = all elements)
350350
351351
Returns
352352
-------
@@ -409,7 +409,7 @@ def data_sources(self) -> Input:
409409
def force_type(self) -> Input:
410410
r"""Allows to connect force_type input to the operator.
411411
412-
Type of force to be processed (0 - default: Total forces (static, damping, and inertia)., 1: Static forces, 2: Damping forces, 3: Inertia forces)
412+
Type of force to be processed (0: Total forces (static, damping, and inertia)., 1 (default): Static forces, 2: Damping forces, 3: Inertia forces)
413413
414414
Returns
415415
-------
@@ -430,7 +430,7 @@ def force_type(self) -> Input:
430430
def spoint(self) -> Input:
431431
r"""Allows to connect spoint input to the operator.
432432
433-
Coordinate field of a point for moment summations. Defaults to (0,0,0).
433+
Field or fields container of the coordinates of the point used for moment summations. Defaults to (0,0,0).
434434
435435
Returns
436436
-------

src/ansys/dpf/core/operators/averaging/force_summation_psd.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ class force_summation_psd(Operator):
2323
2424
Parameters
2525
----------
26-
nodal_scoping: Scoping, optional
27-
Nodal Scoping. Set of nodes in which elemental contribution forces will be accumulated. Defaults to all nodes.
28-
elemental_scoping: Scoping, optional
29-
Elemental Scoping. Set of elements contributing to the force calculation. Defaults to all elements.
26+
nodal_scoping: Scoping or ScopingsContainer, optional
27+
Nodal scoping or scopings container with a single label. Set of nodes in which elemental contribution forces will be accumulated. Defaults to all nodes.
28+
elemental_scoping: Scoping or ScopingsContainer, optional
29+
Elemental scoping or scopings container with a single label. Set of elements contributing to the force calculation. Defaults to all elements.
3030
streams: StreamsContainer, optional
3131
Streams container for RST and PSD files (optional if using data sources). The operator supports both a single RST file and two separate RST files. See data sources pin specifications for details on how to define the streams for both cases.
3232
data_sources: DataSources
3333
Data sources containing RST and PSD files (optional if using a streams container). The operator supports both a single RST file (containing both modal and PSD results) and two separate RST files (one for modal and one for PSD analyses).The data source containing modal results must be defined as an upstream data source.If using a single RST file for PSD and modal analysis, the RST file must be in an upstream data source.If using two separate RST files, only the modal RST must be in an upstream data source.
34-
spoint: Field, optional
35-
Coordinate field of a point for moment summations. Defaults to (0,0,0).
36-
abs_rel_key: Field, optional
34+
spoint: Field or FieldsContainer, optional
35+
Field or fields container of the coordinates of the point used for moment summations. Defaults to (0,0,0).
36+
abs_rel_key: int, optional
3737
Key to select the type of response: 0 for relative response (default) or 1 for absolute response.
3838
signif: float, optional
3939
Significance threshold, defaults to 0.0001. Any mode with a significance level above this value will be included in the combination.The significance level is defined as the modal covariance matrix term, divided by the maximum modal covariance matrix term.
@@ -67,7 +67,7 @@ class force_summation_psd(Operator):
6767
>>> op.inputs.data_sources.connect(my_data_sources)
6868
>>> my_spoint = dpf.Field()
6969
>>> op.inputs.spoint.connect(my_spoint)
70-
>>> my_abs_rel_key = dpf.Field()
70+
>>> my_abs_rel_key = int()
7171
>>> op.inputs.abs_rel_key.connect(my_abs_rel_key)
7272
>>> my_signif = float()
7373
>>> op.inputs.signif.connect(my_signif)
@@ -131,15 +131,15 @@ def _spec() -> Specification:
131131
map_input_pin_spec={
132132
1: PinSpecification(
133133
name="nodal_scoping",
134-
type_names=["scoping"],
134+
type_names=["scoping", "scopings_container"],
135135
optional=True,
136-
document=r"""Nodal Scoping. Set of nodes in which elemental contribution forces will be accumulated. Defaults to all nodes.""",
136+
document=r"""Nodal scoping or scopings container with a single label. Set of nodes in which elemental contribution forces will be accumulated. Defaults to all nodes.""",
137137
),
138138
2: PinSpecification(
139139
name="elemental_scoping",
140-
type_names=["scoping"],
140+
type_names=["scoping", "scopings_container"],
141141
optional=True,
142-
document=r"""Elemental Scoping. Set of elements contributing to the force calculation. Defaults to all elements.""",
142+
document=r"""Elemental scoping or scopings container with a single label. Set of elements contributing to the force calculation. Defaults to all elements.""",
143143
),
144144
3: PinSpecification(
145145
name="streams",
@@ -155,13 +155,13 @@ def _spec() -> Specification:
155155
),
156156
6: PinSpecification(
157157
name="spoint",
158-
type_names=["field"],
158+
type_names=["field", "fields_container"],
159159
optional=True,
160-
document=r"""Coordinate field of a point for moment summations. Defaults to (0,0,0).""",
160+
document=r"""Field or fields container of the coordinates of the point used for moment summations. Defaults to (0,0,0).""",
161161
),
162162
7: PinSpecification(
163163
name="abs_rel_key",
164-
type_names=["field"],
164+
type_names=["int32"],
165165
optional=True,
166166
document=r"""Key to select the type of response: 0 for relative response (default) or 1 for absolute response.""",
167167
),
@@ -263,7 +263,7 @@ class InputsForceSummationPsd(_Inputs):
263263
>>> op.inputs.data_sources.connect(my_data_sources)
264264
>>> my_spoint = dpf.Field()
265265
>>> op.inputs.spoint.connect(my_spoint)
266-
>>> my_abs_rel_key = dpf.Field()
266+
>>> my_abs_rel_key = int()
267267
>>> op.inputs.abs_rel_key.connect(my_abs_rel_key)
268268
>>> my_signif = float()
269269
>>> op.inputs.signif.connect(my_signif)
@@ -292,7 +292,7 @@ def __init__(self, op: Operator):
292292
def nodal_scoping(self) -> Input:
293293
r"""Allows to connect nodal_scoping input to the operator.
294294
295-
Nodal Scoping. Set of nodes in which elemental contribution forces will be accumulated. Defaults to all nodes.
295+
Nodal scoping or scopings container with a single label. Set of nodes in which elemental contribution forces will be accumulated. Defaults to all nodes.
296296
297297
Returns
298298
-------
@@ -313,7 +313,7 @@ def nodal_scoping(self) -> Input:
313313
def elemental_scoping(self) -> Input:
314314
r"""Allows to connect elemental_scoping input to the operator.
315315
316-
Elemental Scoping. Set of elements contributing to the force calculation. Defaults to all elements.
316+
Elemental scoping or scopings container with a single label. Set of elements contributing to the force calculation. Defaults to all elements.
317317
318318
Returns
319319
-------
@@ -376,7 +376,7 @@ def data_sources(self) -> Input:
376376
def spoint(self) -> Input:
377377
r"""Allows to connect spoint input to the operator.
378378
379-
Coordinate field of a point for moment summations. Defaults to (0,0,0).
379+
Field or fields container of the coordinates of the point used for moment summations. Defaults to (0,0,0).
380380
381381
Returns
382382
-------

src/ansys/dpf/core/operators/result/torque.py

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class torque(Operator):
2222
Parameters
2323
----------
2424
fields_container: FieldsContainer
25-
fields_container
26-
field: Field
27-
field
25+
Fields container containing the nodal forces.
26+
spoint: Field or FieldsContainer
27+
Field or fields container containing the summation points for each associated field on pin 0.
2828
2929
Returns
3030
-------
@@ -40,27 +40,41 @@ class torque(Operator):
4040
>>> # Make input connections
4141
>>> my_fields_container = dpf.FieldsContainer()
4242
>>> op.inputs.fields_container.connect(my_fields_container)
43-
>>> my_field = dpf.Field()
44-
>>> op.inputs.field.connect(my_field)
43+
>>> my_spoint = dpf.Field()
44+
>>> op.inputs.spoint.connect(my_spoint)
4545
4646
>>> # Instantiate operator and connect inputs in one line
4747
>>> op = dpf.operators.result.torque(
4848
... fields_container=my_fields_container,
49-
... field=my_field,
49+
... spoint=my_spoint,
5050
... )
5151
5252
>>> # Get output data
5353
>>> result_fields_container = op.outputs.fields_container()
5454
"""
5555

56-
def __init__(self, fields_container=None, field=None, config=None, server=None):
56+
def __init__(
57+
self,
58+
fields_container=None,
59+
spoint=None,
60+
config=None,
61+
server=None,
62+
field=None,
63+
):
5764
super().__init__(name="torque", config=config, server=server)
5865
self._inputs = InputsTorque(self)
5966
self._outputs = OutputsTorque(self)
6067
if fields_container is not None:
6168
self.inputs.fields_container.connect(fields_container)
62-
if field is not None:
63-
self.inputs.field.connect(field)
69+
if spoint is not None:
70+
self.inputs.spoint.connect(spoint)
71+
elif field is not None:
72+
warn(
73+
DeprecationWarning(
74+
f'Operator torque: Input name "field" is deprecated in favor of "spoint".'
75+
)
76+
)
77+
self.inputs.spoint.connect(field)
6478

6579
@staticmethod
6680
def _spec() -> Specification:
@@ -73,13 +87,14 @@ def _spec() -> Specification:
7387
name="fields_container",
7488
type_names=["fields_container"],
7589
optional=False,
76-
document=r"""fields_container""",
90+
document=r"""Fields container containing the nodal forces.""",
7791
),
7892
1: PinSpecification(
79-
name="field",
80-
type_names=["field"],
93+
name="spoint",
94+
type_names=["field", "fields_container"],
8195
optional=False,
82-
document=r"""field""",
96+
document=r"""Field or fields container containing the summation points for each associated field on pin 0.""",
97+
aliases=["field"],
8398
),
8499
},
85100
map_output_pin_spec={
@@ -147,22 +162,22 @@ class InputsTorque(_Inputs):
147162
>>> op = dpf.operators.result.torque()
148163
>>> my_fields_container = dpf.FieldsContainer()
149164
>>> op.inputs.fields_container.connect(my_fields_container)
150-
>>> my_field = dpf.Field()
151-
>>> op.inputs.field.connect(my_field)
165+
>>> my_spoint = dpf.Field()
166+
>>> op.inputs.spoint.connect(my_spoint)
152167
"""
153168

154169
def __init__(self, op: Operator):
155170
super().__init__(torque._spec().inputs, op)
156171
self._fields_container = Input(torque._spec().input_pin(0), 0, op, -1)
157172
self._inputs.append(self._fields_container)
158-
self._field = Input(torque._spec().input_pin(1), 1, op, -1)
159-
self._inputs.append(self._field)
173+
self._spoint = Input(torque._spec().input_pin(1), 1, op, -1)
174+
self._inputs.append(self._spoint)
160175

161176
@property
162177
def fields_container(self) -> Input:
163178
r"""Allows to connect fields_container input to the operator.
164179
165-
fields_container
180+
Fields container containing the nodal forces.
166181
167182
Returns
168183
-------
@@ -180,10 +195,10 @@ def fields_container(self) -> Input:
180195
return self._fields_container
181196

182197
@property
183-
def field(self) -> Input:
184-
r"""Allows to connect field input to the operator.
198+
def spoint(self) -> Input:
199+
r"""Allows to connect spoint input to the operator.
185200
186-
field
201+
Field or fields container containing the summation points for each associated field on pin 0.
187202
188203
Returns
189204
-------
@@ -194,11 +209,23 @@ def field(self) -> Input:
194209
--------
195210
>>> from ansys.dpf import core as dpf
196211
>>> op = dpf.operators.result.torque()
197-
>>> op.inputs.field.connect(my_field)
212+
>>> op.inputs.spoint.connect(my_spoint)
198213
>>> # or
199-
>>> op.inputs.field(my_field)
214+
>>> op.inputs.spoint(my_spoint)
200215
"""
201-
return self._field
216+
return self._spoint
217+
218+
def __getattr__(self, name):
219+
if name in ["field"]:
220+
warn(
221+
DeprecationWarning(
222+
f'Operator torque: Input name "{name}" is deprecated in favor of "spoint".'
223+
)
224+
)
225+
return self.spoint
226+
raise AttributeError(
227+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
228+
)
202229

203230

204231
class OutputsTorque(_Outputs):
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-240 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)