Skip to content

Commit 3c4555a

Browse files
Update generated code for DPF 261_daily on main (#2775)
Co-authored-by: PProfizi <100710998+PProfizi@users.noreply.github.com>
1 parent e376ef1 commit 3c4555a

File tree

14 files changed

+317
-45
lines changed

14 files changed

+317
-45
lines changed

doc/source/_static/dpf_operators.html

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

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ class force_summation(Operator):
4747
Type of force to be processed (0: Total forces (static, damping, and inertia)., 1 (default): Static forces, 2: Damping forces, 3: Inertia forces)
4848
spoint: Field or FieldsContainer, optional
4949
Field or fields container of the coordinates of the point used for moment summations. Defaults to (0,0,0).
50+
scoping_filter: int, optional
51+
Selected set of nodes.
52+
53+
- 0 (default): Sum all nodal forces for all selected nodes, excluding contact elements
54+
- 1: Sum all nodal forces for contact nodes only.
55+
- 2: Sum all nodal forces for all selected nodes, including contact elements.
56+
5057
5158
Outputs
5259
-------
@@ -79,6 +86,8 @@ class force_summation(Operator):
7986
>>> op.inputs.force_type.connect(my_force_type)
8087
>>> my_spoint = dpf.Field()
8188
>>> op.inputs.spoint.connect(my_spoint)
89+
>>> my_scoping_filter = int()
90+
>>> op.inputs.scoping_filter.connect(my_scoping_filter)
8291
8392
>>> # Instantiate operator and connect inputs in one line
8493
>>> op = dpf.operators.averaging.force_summation(
@@ -89,6 +98,7 @@ class force_summation(Operator):
8998
... data_sources=my_data_sources,
9099
... force_type=my_force_type,
91100
... spoint=my_spoint,
101+
... scoping_filter=my_scoping_filter,
92102
... )
93103
94104
>>> # Get output data
@@ -109,6 +119,7 @@ def __init__(
109119
data_sources=None,
110120
force_type=None,
111121
spoint=None,
122+
scoping_filter=None,
112123
config=None,
113124
server=None,
114125
):
@@ -133,6 +144,8 @@ def __init__(
133144
self.inputs.force_type.connect(force_type)
134145
if spoint is not None:
135146
self.inputs.spoint.connect(spoint)
147+
if scoping_filter is not None:
148+
self.inputs.scoping_filter.connect(scoping_filter)
136149

137150
@staticmethod
138151
def _spec() -> Specification:
@@ -186,6 +199,17 @@ def _spec() -> Specification:
186199
optional=True,
187200
document=r"""Field or fields container of the coordinates of the point used for moment summations. Defaults to (0,0,0).""",
188201
),
202+
9: PinSpecification(
203+
name="scoping_filter",
204+
type_names=["int32"],
205+
optional=True,
206+
document=r"""Selected set of nodes.
207+
208+
- 0 (default): Sum all nodal forces for all selected nodes, excluding contact elements
209+
- 1: Sum all nodal forces for contact nodes only.
210+
- 2: Sum all nodal forces for all selected nodes, including contact elements.
211+
""",
212+
),
189213
},
190214
map_output_pin_spec={
191215
0: PinSpecification(
@@ -294,6 +318,8 @@ class InputsForceSummation(_Inputs):
294318
>>> op.inputs.force_type.connect(my_force_type)
295319
>>> my_spoint = dpf.Field()
296320
>>> op.inputs.spoint.connect(my_spoint)
321+
>>> my_scoping_filter = int()
322+
>>> op.inputs.scoping_filter.connect(my_scoping_filter)
297323
"""
298324

299325
def __init__(self, op: Operator):
@@ -326,6 +352,10 @@ def __init__(self, op: Operator):
326352
force_summation._spec().input_pin(6), 6, op, -1
327353
)
328354
self._inputs.append(self._spoint)
355+
self._scoping_filter: Input[int] = Input(
356+
force_summation._spec().input_pin(9), 9, op, -1
357+
)
358+
self._inputs.append(self._scoping_filter)
329359

330360
@property
331361
def time_scoping(self) -> Input[Scoping]:
@@ -474,6 +504,32 @@ def spoint(self) -> Input[Field | FieldsContainer]:
474504
"""
475505
return self._spoint
476506

507+
@property
508+
def scoping_filter(self) -> Input[int]:
509+
r"""Allows to connect scoping_filter input to the operator.
510+
511+
Selected set of nodes.
512+
513+
- 0 (default): Sum all nodal forces for all selected nodes, excluding contact elements
514+
- 1: Sum all nodal forces for contact nodes only.
515+
- 2: Sum all nodal forces for all selected nodes, including contact elements.
516+
517+
518+
Returns
519+
-------
520+
input:
521+
An Input instance for this pin.
522+
523+
Examples
524+
--------
525+
>>> from ansys.dpf import core as dpf
526+
>>> op = dpf.operators.averaging.force_summation()
527+
>>> op.inputs.scoping_filter.connect(my_scoping_filter)
528+
>>> # or
529+
>>> op.inputs.scoping_filter(my_scoping_filter)
530+
"""
531+
return self._scoping_filter
532+
477533

478534
class OutputsForceSummation(_Outputs):
479535
"""Intermediate class used to get outputs from

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

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ class force_summation_psd(Operator):
4949
5050
Outputs
5151
-------
52-
force_accumulation: FieldsContainer
53-
Returns the sum of forces for the 1-sigma displacement solution on the scoped nodes/elements.
5452
moment_accumulation: FieldsContainer
5553
Returns the sum of moments for the 1-sigma displacement solution on the scoped nodes/elements.
5654
forces_on_nodes: FieldsContainer
@@ -93,7 +91,6 @@ class force_summation_psd(Operator):
9391
... )
9492
9593
>>> # Get output data
96-
>>> result_force_accumulation = op.outputs.force_accumulation()
9794
>>> result_moment_accumulation = op.outputs.moment_accumulation()
9895
>>> result_forces_on_nodes = op.outputs.forces_on_nodes()
9996
>>> result_moments_on_nodes = op.outputs.moments_on_nodes()
@@ -186,12 +183,6 @@ def _spec() -> Specification:
186183
),
187184
},
188185
map_output_pin_spec={
189-
0: PinSpecification(
190-
name="force_accumulation",
191-
type_names=["fields_container"],
192-
optional=False,
193-
document=r"""Returns the sum of forces for the 1-sigma displacement solution on the scoped nodes/elements.""",
194-
),
195186
1: PinSpecification(
196187
name="moment_accumulation",
197188
type_names=["fields_container"],
@@ -470,18 +461,13 @@ class OutputsForceSummationPsd(_Outputs):
470461
>>> from ansys.dpf import core as dpf
471462
>>> op = dpf.operators.averaging.force_summation_psd()
472463
>>> # Connect inputs : op.inputs. ...
473-
>>> result_force_accumulation = op.outputs.force_accumulation()
474464
>>> result_moment_accumulation = op.outputs.moment_accumulation()
475465
>>> result_forces_on_nodes = op.outputs.forces_on_nodes()
476466
>>> result_moments_on_nodes = op.outputs.moments_on_nodes()
477467
"""
478468

479469
def __init__(self, op: Operator):
480470
super().__init__(force_summation_psd._spec().outputs, op)
481-
self._force_accumulation: Output[FieldsContainer] = Output(
482-
force_summation_psd._spec().output_pin(0), 0, op
483-
)
484-
self._outputs.append(self._force_accumulation)
485471
self._moment_accumulation: Output[FieldsContainer] = Output(
486472
force_summation_psd._spec().output_pin(1), 1, op
487473
)
@@ -495,26 +481,6 @@ def __init__(self, op: Operator):
495481
)
496482
self._outputs.append(self._moments_on_nodes)
497483

498-
@property
499-
def force_accumulation(self) -> Output[FieldsContainer]:
500-
r"""Allows to get force_accumulation output of the operator
501-
502-
Returns the sum of forces for the 1-sigma displacement solution on the scoped nodes/elements.
503-
504-
Returns
505-
-------
506-
output:
507-
An Output instance for this pin.
508-
509-
Examples
510-
--------
511-
>>> from ansys.dpf import core as dpf
512-
>>> op = dpf.operators.averaging.force_summation_psd()
513-
>>> # Get the output from op.outputs. ...
514-
>>> result_force_accumulation = op.outputs.force_accumulation()
515-
"""
516-
return self._force_accumulation
517-
518484
@property
519485
def moment_accumulation(self) -> Output[FieldsContainer]:
520486
r"""Allows to get moment_accumulation output of the operator

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from .forward_field import forward_field
3131
from .forward_fields_container import forward_fields_container
3232
from .forward_meshes_container import forward_meshes_container
33+
from .get_operators import get_operators
3334
from .hdf5dpf_workglow_provider import hdf5dpf_workglow_provider
3435
from .html_doc import html_doc
3536
from .incremental_concatenate_as_fc import incremental_concatenate_as_fc

0 commit comments

Comments
 (0)