Skip to content

Commit 9dfab54

Browse files
Update generated code for DPF 261_daily on main (#2677)
Co-authored-by: PProfizi <[email protected]>
1 parent 7bc7a1a commit 9dfab54

File tree

7 files changed

+142
-33
lines changed

7 files changed

+142
-33
lines changed

doc/source/_static/dpf_operators.html

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

src/ansys/dpf/core/operators/compression/quantization.py

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@
1616

1717

1818
class quantization(Operator):
19-
r"""Applies scaling to precision to all the values from field input, then
20-
rounding to the unit.
19+
r"""Scales a field to a given precision threshold, then rounds all the
20+
values to the unit.
2121
2222
2323
Parameters
2424
----------
2525
input_field: Field
26-
Input field
27-
threshold: float
28-
Threshold (precision) desired.
26+
Field to quantize.
27+
threshold: float or Field
28+
Precision threshold desired.
29+
Case double : the threshold is applied on all the input field.
30+
Case field with one value : the threshold is applied on all the input field.
31+
Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field.
32+
Case field with the same number of values than the input field : quantization is performed component-wise.
33+
2934
3035
Returns
3136
-------
@@ -66,8 +71,8 @@ def __init__(self, input_field=None, threshold=None, config=None, server=None):
6671

6772
@staticmethod
6873
def _spec() -> Specification:
69-
description = r"""Applies scaling to precision to all the values from field input, then
70-
rounding to the unit.
74+
description = r"""Scales a field to a given precision threshold, then rounds all the
75+
values to the unit.
7176
"""
7277
spec = Specification(
7378
description=description,
@@ -76,13 +81,18 @@ def _spec() -> Specification:
7681
name="input_field",
7782
type_names=["field"],
7883
optional=False,
79-
document=r"""Input field""",
84+
document=r"""Field to quantize.""",
8085
),
8186
1: PinSpecification(
8287
name="threshold",
83-
type_names=["double"],
88+
type_names=["double", "field"],
8489
optional=False,
85-
document=r"""Threshold (precision) desired.""",
90+
document=r"""Precision threshold desired.
91+
Case double : the threshold is applied on all the input field.
92+
Case field with one value : the threshold is applied on all the input field.
93+
Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field.
94+
Case field with the same number of values than the input field : quantization is performed component-wise.
95+
""",
8696
),
8797
},
8898
map_output_pin_spec={
@@ -165,7 +175,7 @@ def __init__(self, op: Operator):
165175
def input_field(self) -> Input:
166176
r"""Allows to connect input_field input to the operator.
167177
168-
Input field
178+
Field to quantize.
169179
170180
Returns
171181
-------
@@ -186,7 +196,12 @@ def input_field(self) -> Input:
186196
def threshold(self) -> Input:
187197
r"""Allows to connect threshold input to the operator.
188198
189-
Threshold (precision) desired.
199+
Precision threshold desired.
200+
Case double : the threshold is applied on all the input field.
201+
Case field with one value : the threshold is applied on all the input field.
202+
Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field.
203+
Case field with the same number of values than the input field : quantization is performed component-wise.
204+
190205
191206
Returns
192207
-------

src/ansys/dpf/core/operators/compression/quantization_fc.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,25 @@
1616

1717

1818
class quantization_fc(Operator):
19-
r"""Applies scaling to precision to all the values from fields container
20-
input, then rounding to the unit.
19+
r"""Scales all the fields of a fields container to a given precision
20+
threshold, then rounds all the values to the unit.
2121
2222
2323
Parameters
2424
----------
2525
input_fc: FieldsContainer
26-
Input fields container
26+
Fields container to be quantized.
2727
threshold: float or Field or FieldsContainer
28-
Threshold (precision) desired.
28+
Precision threshold desired.
29+
Case double : the threshold is applied on all the fields of the input fields container.
30+
Case field with one, numComp or input size values : the threshold is used for each field of the input fields container.
31+
Case fields container : the corresponding threshold field is found by matching label.
32+
2933
3034
Returns
3135
-------
3236
output_fc: FieldsContainer
33-
Scaled and rounded fields container
37+
Quantized fields container.
3438
3539
Examples
3640
--------
@@ -66,8 +70,8 @@ def __init__(self, input_fc=None, threshold=None, config=None, server=None):
6670

6771
@staticmethod
6872
def _spec() -> Specification:
69-
description = r"""Applies scaling to precision to all the values from fields container
70-
input, then rounding to the unit.
73+
description = r"""Scales all the fields of a fields container to a given precision
74+
threshold, then rounds all the values to the unit.
7175
"""
7276
spec = Specification(
7377
description=description,
@@ -76,21 +80,25 @@ def _spec() -> Specification:
7680
name="input_fc",
7781
type_names=["fields_container"],
7882
optional=False,
79-
document=r"""Input fields container""",
83+
document=r"""Fields container to be quantized.""",
8084
),
8185
1: PinSpecification(
8286
name="threshold",
8387
type_names=["double", "field", "fields_container"],
8488
optional=False,
85-
document=r"""Threshold (precision) desired.""",
89+
document=r"""Precision threshold desired.
90+
Case double : the threshold is applied on all the fields of the input fields container.
91+
Case field with one, numComp or input size values : the threshold is used for each field of the input fields container.
92+
Case fields container : the corresponding threshold field is found by matching label.
93+
""",
8694
),
8795
},
8896
map_output_pin_spec={
8997
0: PinSpecification(
9098
name="output_fc",
9199
type_names=["fields_container"],
92100
optional=False,
93-
document=r"""Scaled and rounded fields container""",
101+
document=r"""Quantized fields container.""",
94102
),
95103
},
96104
)
@@ -165,7 +173,7 @@ def __init__(self, op: Operator):
165173
def input_fc(self) -> Input:
166174
r"""Allows to connect input_fc input to the operator.
167175
168-
Input fields container
176+
Fields container to be quantized.
169177
170178
Returns
171179
-------
@@ -186,7 +194,11 @@ def input_fc(self) -> Input:
186194
def threshold(self) -> Input:
187195
r"""Allows to connect threshold input to the operator.
188196
189-
Threshold (precision) desired.
197+
Precision threshold desired.
198+
Case double : the threshold is applied on all the fields of the input fields container.
199+
Case field with one, numComp or input size values : the threshold is used for each field of the input fields container.
200+
Case fields container : the corresponding threshold field is found by matching label.
201+
190202
191203
Returns
192204
-------
@@ -225,7 +237,7 @@ def __init__(self, op: Operator):
225237
def output_fc(self) -> Output:
226238
r"""Allows to get output_fc output of the operator
227239
228-
Scaled and rounded fields container
240+
Quantized fields container.
229241
230242
Returns
231243
-------

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class compute_invariant_terms_motion(Operator):
3333
field_coordinates: Field
3434
coordinates of all nodes
3535
nod:
36+
phi_ortho: FieldsContainer, optional
37+
Orthonormalizated modes transformation
3638
3739
Returns
3840
-------
@@ -78,6 +80,8 @@ class compute_invariant_terms_motion(Operator):
7880
>>> op.inputs.field_coordinates.connect(my_field_coordinates)
7981
>>> my_nod = dpf.()
8082
>>> op.inputs.nod.connect(my_nod)
83+
>>> my_phi_ortho = dpf.FieldsContainer()
84+
>>> op.inputs.phi_ortho.connect(my_phi_ortho)
8185
8286
>>> # Instantiate operator and connect inputs in one line
8387
>>> op = dpf.operators.result.compute_invariant_terms_motion(
@@ -87,6 +91,7 @@ class compute_invariant_terms_motion(Operator):
8791
... model_data=my_model_data,
8892
... field_coordinates=my_field_coordinates,
8993
... nod=my_nod,
94+
... phi_ortho=my_phi_ortho,
9095
... )
9196
9297
>>> # Get output data
@@ -117,6 +122,7 @@ def __init__(
117122
model_data=None,
118123
field_coordinates=None,
119124
nod=None,
125+
phi_ortho=None,
120126
config=None,
121127
server=None,
122128
):
@@ -137,6 +143,8 @@ def __init__(
137143
self.inputs.field_coordinates.connect(field_coordinates)
138144
if nod is not None:
139145
self.inputs.nod.connect(nod)
146+
if phi_ortho is not None:
147+
self.inputs.phi_ortho.connect(phi_ortho)
140148

141149
@staticmethod
142150
def _spec() -> Specification:
@@ -182,6 +190,12 @@ def _spec() -> Specification:
182190
optional=False,
183191
document=r"""""",
184192
),
193+
6: PinSpecification(
194+
name="phi_ortho",
195+
type_names=["fields_container"],
196+
optional=True,
197+
document=r"""Orthonormalizated modes transformation""",
198+
),
185199
},
186200
map_output_pin_spec={
187201
0: PinSpecification(
@@ -356,6 +370,8 @@ class InputsComputeInvariantTermsMotion(_Inputs):
356370
>>> op.inputs.field_coordinates.connect(my_field_coordinates)
357371
>>> my_nod = dpf.()
358372
>>> op.inputs.nod.connect(my_nod)
373+
>>> my_phi_ortho = dpf.FieldsContainer()
374+
>>> op.inputs.phi_ortho.connect(my_phi_ortho)
359375
"""
360376

361377
def __init__(self, op: Operator):
@@ -384,6 +400,10 @@ def __init__(self, op: Operator):
384400
compute_invariant_terms_motion._spec().input_pin(5), 5, op, -1
385401
)
386402
self._inputs.append(self._nod)
403+
self._phi_ortho = Input(
404+
compute_invariant_terms_motion._spec().input_pin(6), 6, op, -1
405+
)
406+
self._inputs.append(self._phi_ortho)
387407

388408
@property
389409
def rom_matrices(self) -> Input:
@@ -509,6 +529,27 @@ def nod(self) -> Input:
509529
"""
510530
return self._nod
511531

532+
@property
533+
def phi_ortho(self) -> Input:
534+
r"""Allows to connect phi_ortho input to the operator.
535+
536+
Orthonormalizated modes transformation
537+
538+
Returns
539+
-------
540+
input:
541+
An Input instance for this pin.
542+
543+
Examples
544+
--------
545+
>>> from ansys.dpf import core as dpf
546+
>>> op = dpf.operators.result.compute_invariant_terms_motion()
547+
>>> op.inputs.phi_ortho.connect(my_phi_ortho)
548+
>>> # or
549+
>>> op.inputs.phi_ortho(my_phi_ortho)
550+
"""
551+
return self._phi_ortho
552+
512553

513554
class OutputsComputeInvariantTermsMotion(_Outputs):
514555
"""Intermediate class used to get outputs from

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ class rom_data_provider(Operator):
5959
ids of master nodes
6060
meshed_region: MeshedRegion
6161
expanded meshed region.
62+
phi_ortho: FieldsContainer, optional
63+
Orthonormalized mode shape transformation
6264
6365
Examples
6466
--------
@@ -108,6 +110,7 @@ class rom_data_provider(Operator):
108110
>>> result_field_coordinates_and_euler_angles = op.outputs.field_coordinates_and_euler_angles()
109111
>>> result_nod = op.outputs.nod()
110112
>>> result_meshed_region = op.outputs.meshed_region()
113+
>>> result_phi_ortho = op.outputs.phi_ortho()
111114
"""
112115

113116
def __init__(
@@ -261,6 +264,12 @@ def _spec() -> Specification:
261264
optional=False,
262265
document=r"""expanded meshed region.""",
263266
),
267+
10: PinSpecification(
268+
name="phi_ortho",
269+
type_names=["fields_container"],
270+
optional=True,
271+
document=r"""Orthonormalized mode shape transformation""",
272+
),
264273
},
265274
)
266275
return spec
@@ -550,6 +559,7 @@ class OutputsRomDataProvider(_Outputs):
550559
>>> result_field_coordinates_and_euler_angles = op.outputs.field_coordinates_and_euler_angles()
551560
>>> result_nod = op.outputs.nod()
552561
>>> result_meshed_region = op.outputs.meshed_region()
562+
>>> result_phi_ortho = op.outputs.phi_ortho()
553563
"""
554564

555565
def __init__(self, op: Operator):
@@ -576,6 +586,8 @@ def __init__(self, op: Operator):
576586
self._outputs.append(self._nod)
577587
self._meshed_region = Output(rom_data_provider._spec().output_pin(9), 9, op)
578588
self._outputs.append(self._meshed_region)
589+
self._phi_ortho = Output(rom_data_provider._spec().output_pin(10), 10, op)
590+
self._outputs.append(self._phi_ortho)
579591

580592
@property
581593
def rom_matrices(self) -> Output:
@@ -774,3 +786,23 @@ def meshed_region(self) -> Output:
774786
>>> result_meshed_region = op.outputs.meshed_region()
775787
"""
776788
return self._meshed_region
789+
790+
@property
791+
def phi_ortho(self) -> Output:
792+
r"""Allows to get phi_ortho output of the operator
793+
794+
Orthonormalized mode shape transformation
795+
796+
Returns
797+
-------
798+
output:
799+
An Output instance for this pin.
800+
801+
Examples
802+
--------
803+
>>> from ansys.dpf import core as dpf
804+
>>> op = dpf.operators.result.rom_data_provider()
805+
>>> # Get the output from op.outputs. ...
806+
>>> result_phi_ortho = op.outputs.phi_ortho()
807+
"""
808+
return self._phi_ortho
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)