diff --git a/doc/source/_static/dpf_operators.html b/doc/source/_static/dpf_operators.html index ee2042c0a6c..9abbc82295b 100644 --- a/doc/source/_static/dpf_operators.html +++ b/doc/source/_static/dpf_operators.html @@ -9458,10 +9458,13 @@
if this pin is set to 0, the classical ERP is computed, 1 the corrected ERP is computed (a mesh of one face has to be given in the pin 1) and 2 the enhanced ERP is computed. Default is 0. |
if this pin is set to true, the ERP level in dB is computed |
erp reference value. Default is 1E-12 - |
Applies scaling to precision to all the values from fields container input, then rounding to the unit.
-Input fields container - |
Threshold (precision) desired. - |
Scaled and rounded fields container + |
Scales all the fields of a fields container to a given precision threshold, then rounds all the values to the unit.
+Fields container to be quantized. + |
Precision threshold desired. +Case double : the threshold is applied on all the fields of the input fields container. +Case field with one, numComp or input size values : the threshold is used for each field of the input fields container. +Case fields container : the corresponding threshold field is found by matching label. + |
Quantized fields container. |
Read/compute element nodal component thermal strains ZZ normal component (22 component) by calling the readers defined by the datasources. Regarding the requested location and the input mesh scoping, the result location can be Nodal/ElementalNodal/Elemental.
time/freq values (use doubles or field), time/freq set ids (use ints or scoping) or time/freq step ids (use scoping with TimeFreq_steps location) required in output. To specify time/freq values at specific load steps, put a Field (and not a list) in input with a scoping located on "TimeFreq_steps". Linear time freq intrapolation is performed if the values are not in the result files and the data at the max time or freq is taken when time/freqs are higher than available time/freqs in result files. To get all data for all time/freq sets, connect an int with value -1. |
nodes or elements scoping required in output. The output fields will be scoped on these node or element IDs. To figure out the ordering of the fields data, look at their scoping IDs as they might not be ordered as the input scoping was. The scoping's location indicates whether nodes or elements are asked for. Using scopings container allows you to split the result fields container into domains @@ -14720,6 +14723,7 @@Configurating operators |
coordinates and euler angles of all nodes |
ids of master nodes |
expanded meshed region. + |
Orthonormalized mode shape transformation |
Read the presol generated file from mapdl.
filepath |
columns_to_read @@ -14819,7 +14823,8 @@Configurating operators |
FieldsContainers containing the lumped mass |
data describing the finite element model |
coordinates of all nodes - |
data describing the finite element model + |
Orthonormalizated modes transformation + |
data describing the finite element model |
FieldsContainers containing the mode shapes, which are CST and NOR for the cms method |
FieldsContainers containing the lumped mass |
coordinates and euler angles of all nodes @@ -15268,9 +15273,13 @@Configurating operators |
average the elemental nodal result to the requested location (default is nodal). |
if true, cyclic expansion is done. If false, it's ignored.. |
for multibody simulations, the stresses are averaged across bodies if true or not if false (default). - |
Applies scaling to precision to all the values from field input, then rounding to the unit.
-Input field - |
Threshold (precision) desired. + |
Scales a field to a given precision threshold, then rounds all the values to the unit.
+Field to quantize. + |
Precision threshold desired. +Case double : the threshold is applied on all the input field. +Case field with one value : the threshold is applied on all the input field. +Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field. +Case field with the same number of values than the input field : quantization is performed component-wise. |
Scaled and rounded field |
Computes the coefficients (=U*Sigma) and VT components from SVD.
Fields container with data to be compressed diff --git a/src/ansys/dpf/core/operators/compression/quantization.py b/src/ansys/dpf/core/operators/compression/quantization.py index 8a696aa4529..e20f3fbc529 100644 --- a/src/ansys/dpf/core/operators/compression/quantization.py +++ b/src/ansys/dpf/core/operators/compression/quantization.py @@ -16,16 +16,21 @@ class quantization(Operator): - r"""Applies scaling to precision to all the values from field input, then - rounding to the unit. + r"""Scales a field to a given precision threshold, then rounds all the + values to the unit. Parameters ---------- input_field: Field - Input field - threshold: float - Threshold (precision) desired. + Field to quantize. + threshold: float or Field + Precision threshold desired. + Case double : the threshold is applied on all the input field. + Case field with one value : the threshold is applied on all the input field. + Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field. + Case field with the same number of values than the input field : quantization is performed component-wise. + Returns ------- @@ -66,8 +71,8 @@ def __init__(self, input_field=None, threshold=None, config=None, server=None): @staticmethod def _spec() -> Specification: - description = r"""Applies scaling to precision to all the values from field input, then -rounding to the unit. + description = r"""Scales a field to a given precision threshold, then rounds all the +values to the unit. """ spec = Specification( description=description, @@ -76,13 +81,18 @@ def _spec() -> Specification: name="input_field", type_names=["field"], optional=False, - document=r"""Input field""", + document=r"""Field to quantize.""", ), 1: PinSpecification( name="threshold", - type_names=["double"], + type_names=["double", "field"], optional=False, - document=r"""Threshold (precision) desired.""", + document=r"""Precision threshold desired. +Case double : the threshold is applied on all the input field. +Case field with one value : the threshold is applied on all the input field. +Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field. +Case field with the same number of values than the input field : quantization is performed component-wise. +""", ), }, map_output_pin_spec={ @@ -165,7 +175,7 @@ def __init__(self, op: Operator): def input_field(self) -> Input: r"""Allows to connect input_field input to the operator. - Input field + Field to quantize. Returns ------- @@ -186,7 +196,12 @@ def input_field(self) -> Input: def threshold(self) -> Input: r"""Allows to connect threshold input to the operator. - Threshold (precision) desired. + Precision threshold desired. + Case double : the threshold is applied on all the input field. + Case field with one value : the threshold is applied on all the input field. + Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field. + Case field with the same number of values than the input field : quantization is performed component-wise. + Returns ------- diff --git a/src/ansys/dpf/core/operators/compression/quantization_fc.py b/src/ansys/dpf/core/operators/compression/quantization_fc.py index 8416485d398..db399c19df2 100644 --- a/src/ansys/dpf/core/operators/compression/quantization_fc.py +++ b/src/ansys/dpf/core/operators/compression/quantization_fc.py @@ -16,21 +16,25 @@ class quantization_fc(Operator): - r"""Applies scaling to precision to all the values from fields container - input, then rounding to the unit. + r"""Scales all the fields of a fields container to a given precision + threshold, then rounds all the values to the unit. Parameters ---------- input_fc: FieldsContainer - Input fields container + Fields container to be quantized. threshold: float or Field or FieldsContainer - Threshold (precision) desired. + Precision threshold desired. + Case double : the threshold is applied on all the fields of the input fields container. + Case field with one, numComp or input size values : the threshold is used for each field of the input fields container. + Case fields container : the corresponding threshold field is found by matching label. + Returns ------- output_fc: FieldsContainer - Scaled and rounded fields container + Quantized fields container. Examples -------- @@ -66,8 +70,8 @@ def __init__(self, input_fc=None, threshold=None, config=None, server=None): @staticmethod def _spec() -> Specification: - description = r"""Applies scaling to precision to all the values from fields container -input, then rounding to the unit. + description = r"""Scales all the fields of a fields container to a given precision +threshold, then rounds all the values to the unit. """ spec = Specification( description=description, @@ -76,13 +80,17 @@ def _spec() -> Specification: name="input_fc", type_names=["fields_container"], optional=False, - document=r"""Input fields container""", + document=r"""Fields container to be quantized.""", ), 1: PinSpecification( name="threshold", type_names=["double", "field", "fields_container"], optional=False, - document=r"""Threshold (precision) desired.""", + document=r"""Precision threshold desired. +Case double : the threshold is applied on all the fields of the input fields container. +Case field with one, numComp or input size values : the threshold is used for each field of the input fields container. +Case fields container : the corresponding threshold field is found by matching label. +""", ), }, map_output_pin_spec={ @@ -90,7 +98,7 @@ def _spec() -> Specification: name="output_fc", type_names=["fields_container"], optional=False, - document=r"""Scaled and rounded fields container""", + document=r"""Quantized fields container.""", ), }, ) @@ -165,7 +173,7 @@ def __init__(self, op: Operator): def input_fc(self) -> Input: r"""Allows to connect input_fc input to the operator. - Input fields container + Fields container to be quantized. Returns ------- @@ -186,7 +194,11 @@ def input_fc(self) -> Input: def threshold(self) -> Input: r"""Allows to connect threshold input to the operator. - Threshold (precision) desired. + Precision threshold desired. + Case double : the threshold is applied on all the fields of the input fields container. + Case field with one, numComp or input size values : the threshold is used for each field of the input fields container. + Case fields container : the corresponding threshold field is found by matching label. + Returns ------- @@ -225,7 +237,7 @@ def __init__(self, op: Operator): def output_fc(self) -> Output: r"""Allows to get output_fc output of the operator - Scaled and rounded fields container + Quantized fields container. Returns ------- diff --git a/src/ansys/dpf/core/operators/result/compute_invariant_terms_motion.py b/src/ansys/dpf/core/operators/result/compute_invariant_terms_motion.py index d699c4d0418..38a8e5b9c47 100644 --- a/src/ansys/dpf/core/operators/result/compute_invariant_terms_motion.py +++ b/src/ansys/dpf/core/operators/result/compute_invariant_terms_motion.py @@ -33,6 +33,8 @@ class compute_invariant_terms_motion(Operator): field_coordinates: Field coordinates of all nodes nod: + phi_ortho: FieldsContainer, optional + Orthonormalizated modes transformation Returns ------- @@ -78,6 +80,8 @@ class compute_invariant_terms_motion(Operator): >>> op.inputs.field_coordinates.connect(my_field_coordinates) >>> my_nod = dpf.() >>> op.inputs.nod.connect(my_nod) + >>> my_phi_ortho = dpf.FieldsContainer() + >>> op.inputs.phi_ortho.connect(my_phi_ortho) >>> # Instantiate operator and connect inputs in one line >>> op = dpf.operators.result.compute_invariant_terms_motion( @@ -87,6 +91,7 @@ class compute_invariant_terms_motion(Operator): ... model_data=my_model_data, ... field_coordinates=my_field_coordinates, ... nod=my_nod, + ... phi_ortho=my_phi_ortho, ... ) >>> # Get output data @@ -117,6 +122,7 @@ def __init__( model_data=None, field_coordinates=None, nod=None, + phi_ortho=None, config=None, server=None, ): @@ -137,6 +143,8 @@ def __init__( self.inputs.field_coordinates.connect(field_coordinates) if nod is not None: self.inputs.nod.connect(nod) + if phi_ortho is not None: + self.inputs.phi_ortho.connect(phi_ortho) @staticmethod def _spec() -> Specification: @@ -182,6 +190,12 @@ def _spec() -> Specification: optional=False, document=r"""""", ), + 6: PinSpecification( + name="phi_ortho", + type_names=["fields_container"], + optional=True, + document=r"""Orthonormalizated modes transformation""", + ), }, map_output_pin_spec={ 0: PinSpecification( @@ -356,6 +370,8 @@ class InputsComputeInvariantTermsMotion(_Inputs): >>> op.inputs.field_coordinates.connect(my_field_coordinates) >>> my_nod = dpf.() >>> op.inputs.nod.connect(my_nod) + >>> my_phi_ortho = dpf.FieldsContainer() + >>> op.inputs.phi_ortho.connect(my_phi_ortho) """ def __init__(self, op: Operator): @@ -384,6 +400,10 @@ def __init__(self, op: Operator): compute_invariant_terms_motion._spec().input_pin(5), 5, op, -1 ) self._inputs.append(self._nod) + self._phi_ortho = Input( + compute_invariant_terms_motion._spec().input_pin(6), 6, op, -1 + ) + self._inputs.append(self._phi_ortho) @property def rom_matrices(self) -> Input: @@ -509,6 +529,27 @@ def nod(self) -> Input: """ return self._nod + @property + def phi_ortho(self) -> Input: + r"""Allows to connect phi_ortho input to the operator. + + Orthonormalizated modes transformation + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.compute_invariant_terms_motion() + >>> op.inputs.phi_ortho.connect(my_phi_ortho) + >>> # or + >>> op.inputs.phi_ortho(my_phi_ortho) + """ + return self._phi_ortho + class OutputsComputeInvariantTermsMotion(_Outputs): """Intermediate class used to get outputs from diff --git a/src/ansys/dpf/core/operators/result/rom_data_provider.py b/src/ansys/dpf/core/operators/result/rom_data_provider.py index ffcb5a0a5c9..feaec2dea90 100644 --- a/src/ansys/dpf/core/operators/result/rom_data_provider.py +++ b/src/ansys/dpf/core/operators/result/rom_data_provider.py @@ -59,6 +59,8 @@ class rom_data_provider(Operator): ids of master nodes meshed_region: MeshedRegion expanded meshed region. + phi_ortho: FieldsContainer, optional + Orthonormalized mode shape transformation Examples -------- @@ -108,6 +110,7 @@ class rom_data_provider(Operator): >>> result_field_coordinates_and_euler_angles = op.outputs.field_coordinates_and_euler_angles() >>> result_nod = op.outputs.nod() >>> result_meshed_region = op.outputs.meshed_region() + >>> result_phi_ortho = op.outputs.phi_ortho() """ def __init__( @@ -261,6 +264,12 @@ def _spec() -> Specification: optional=False, document=r"""expanded meshed region.""", ), + 10: PinSpecification( + name="phi_ortho", + type_names=["fields_container"], + optional=True, + document=r"""Orthonormalized mode shape transformation""", + ), }, ) return spec @@ -550,6 +559,7 @@ class OutputsRomDataProvider(_Outputs): >>> result_field_coordinates_and_euler_angles = op.outputs.field_coordinates_and_euler_angles() >>> result_nod = op.outputs.nod() >>> result_meshed_region = op.outputs.meshed_region() + >>> result_phi_ortho = op.outputs.phi_ortho() """ def __init__(self, op: Operator): @@ -576,6 +586,8 @@ def __init__(self, op: Operator): self._outputs.append(self._nod) self._meshed_region = Output(rom_data_provider._spec().output_pin(9), 9, op) self._outputs.append(self._meshed_region) + self._phi_ortho = Output(rom_data_provider._spec().output_pin(10), 10, op) + self._outputs.append(self._phi_ortho) @property def rom_matrices(self) -> Output: @@ -774,3 +786,23 @@ def meshed_region(self) -> Output: >>> result_meshed_region = op.outputs.meshed_region() """ return self._meshed_region + + @property + def phi_ortho(self) -> Output: + r"""Allows to get phi_ortho output of the operator + + Orthonormalized mode shape transformation + + Returns + ------- + output: + An Output instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.rom_data_provider() + >>> # Get the output from op.outputs. ... + >>> result_phi_ortho = op.outputs.phi_ortho() + """ + return self._phi_ortho diff --git a/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll b/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll index 93aba1ba60a..75d3fd0e20e 100644 Binary files a/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll and b/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll differ diff --git a/src/ansys/dpf/gatebin/DPFClientAPI.dll b/src/ansys/dpf/gatebin/DPFClientAPI.dll index 310aacf4717..11334091881 100644 Binary files a/src/ansys/dpf/gatebin/DPFClientAPI.dll and b/src/ansys/dpf/gatebin/DPFClientAPI.dll differ |