diff --git a/doc/source/_static/dpf_operators.html b/doc/source/_static/dpf_operators.html index 3e847f9c42..4fb8bd0d47 100644 --- a/doc/source/_static/dpf_operators.html +++ b/doc/source/_static/dpf_operators.html @@ -5275,7 +5275,10 @@

Configurating operators

elemental nodal beam results are read if this pin is set to true (default is false)

Outputs

Configurations

Scripting

math: norm (fields container)

Description

Computes the element-wise L2 norm of the field elementary data. This process is applied on each field of the input fields container.

Inputs

Lp normalisation type, p = 1, 2, ...n - Default Lp=2

-

Outputs

Configurations

Scripting

mapping: prepare mapping workflow

Description

Generates a workflow that can map results from a support to another one.

+

Outputs

Configurations

Scripting

utility: property field get attribute

Description

A PropertyField in pin 0 and a property name (string) in pin 1 are expected in input.

+

Inputs

Accepted inputs are: 'time_freq_support', 'scoping' and 'header'.

+

Outputs

Property value.

+

Configurations

Scripting

mapping: prepare mapping workflow

Description

Generates a workflow that can map results from a support to another one.

Inputs

Radius size for the RBF filter

Outputs

Configurations

Scripting

math: sqrt (fields container)

Description

Computes element-wise sqrt(field1).

Inputs

field or fields container with only one field is expected

@@ -8339,7 +8342,10 @@

Configurating operators

Inputs

streams (result file container) (optional)

If the stream is null, retrieves the file path from the data sources.

Outputs

returns 'single_stage' or 'multi_stage' or an empty string for non cyclic model

-

Configurations

Scripting

metadata: material support provider

Description

Reads the material support.

+

Configurations

Scripting

utility: custom type field get attribute

Description

A CustomTypeField in pin 0 and a property name (string) in pin 1 are expected in input.

+

Inputs

Accepted inputs are: 'time_freq_support', 'scoping' and 'header'.

+

Outputs

Property value.

+

Configurations

Scripting

metadata: material support provider

Description

Reads the material support.

Inputs

Streams result file container (optional).

if the stream is null, get the file path from the data sources.

Outputs

Configurations

Scripting

scoping: on named selection

Description

provides a scoping at a given location based on a given named selection

@@ -8622,8 +8628,8 @@

Configurating operators

Value of the property to be set : vector of string or LabelSpace for "labels".

Outputs

Returns the modified FieldsContainer.

Configurations

Scripting

utility: field get attribute

Description

A Field in pin 0 and a property name (string) in pin 1 are expected in input.

-

Inputs

Accepted inputs are: 'time_freq_support' and 'scoping'.

-

Outputs

Property value.

+

Inputs

Accepted inputs are: 'time_freq_support', 'scoping' and 'header'.

+

Outputs

Property value.

Configurations

Scripting

min_max: time of min

Description

Evaluates time/frequency of minimum.

Inputs

Should use absolute value.

Do calculate amplitude.

diff --git a/src/ansys/dpf/core/operators/utility/__init__.py b/src/ansys/dpf/core/operators/utility/__init__.py index cbb8847794..b54711d50b 100644 --- a/src/ansys/dpf/core/operators/utility/__init__.py +++ b/src/ansys/dpf/core/operators/utility/__init__.py @@ -7,6 +7,7 @@ from .change_location import change_location from .change_shell_layers import change_shell_layers from .compute_time_scoping import compute_time_scoping +from .customtypefield_get_attribute import customtypefield_get_attribute from .default_value import default_value from .delegate_to_operator import delegate_to_operator from .ds_get_attribute import ds_get_attribute @@ -64,6 +65,7 @@ from .overlap_fields import overlap_fields from .producer_consumer_for_each import producer_consumer_for_each from .property_field import property_field +from .propertyfield_get_attribute import propertyfield_get_attribute from .python_generator import python_generator from .remote_operator_instantiate import remote_operator_instantiate from .remote_workflow_instantiate import remote_workflow_instantiate diff --git a/src/ansys/dpf/core/operators/utility/customtypefield_get_attribute.py b/src/ansys/dpf/core/operators/utility/customtypefield_get_attribute.py new file mode 100644 index 0000000000..253272cc7d --- /dev/null +++ b/src/ansys/dpf/core/operators/utility/customtypefield_get_attribute.py @@ -0,0 +1,252 @@ +""" +customtypefield_get_attribute + +Autogenerated DPF operator classes. +""" + +from __future__ import annotations + +from warnings import warn +from ansys.dpf.core.dpf_operator import Operator +from ansys.dpf.core.inputs import Input, _Inputs +from ansys.dpf.core.outputs import Output, _Outputs +from ansys.dpf.core.outputs import _modify_output_spec_with_one_type +from ansys.dpf.core.operators.specification import PinSpecification, Specification +from ansys.dpf.core.config import Config +from ansys.dpf.core.server_types import AnyServerType + + +class customtypefield_get_attribute(Operator): + r"""A CustomTypeField in pin 0 and a property name (string) in pin 1 are + expected in input. + + + Parameters + ---------- + custom_type_field: CustomTypeField + property_name: str + Accepted inputs are: 'time_freq_support', 'scoping' and 'header'. + + Returns + ------- + property: TimeFreqSupport or Scoping or DataTree + Property value. + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.utility.customtypefield_get_attribute() + + >>> # Make input connections + >>> my_custom_type_field = dpf.CustomTypeField() + >>> op.inputs.custom_type_field.connect(my_custom_type_field) + >>> my_property_name = str() + >>> op.inputs.property_name.connect(my_property_name) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.utility.customtypefield_get_attribute( + ... custom_type_field=my_custom_type_field, + ... property_name=my_property_name, + ... ) + + >>> # Get output data + >>> result_property = op.outputs.property() + """ + + def __init__( + self, custom_type_field=None, property_name=None, config=None, server=None + ): + super().__init__( + name="customtypefield::get_attribute", config=config, server=server + ) + self._inputs = InputsCustomtypefieldGetAttribute(self) + self._outputs = OutputsCustomtypefieldGetAttribute(self) + if custom_type_field is not None: + self.inputs.custom_type_field.connect(custom_type_field) + if property_name is not None: + self.inputs.property_name.connect(property_name) + + @staticmethod + def _spec() -> Specification: + description = r"""A CustomTypeField in pin 0 and a property name (string) in pin 1 are +expected in input. +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 0: PinSpecification( + name="custom_type_field", + type_names=["custom_type_field"], + optional=False, + document=r"""""", + ), + 1: PinSpecification( + name="property_name", + type_names=["string"], + optional=False, + document=r"""Accepted inputs are: 'time_freq_support', 'scoping' and 'header'.""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="property", + type_names=["time_freq_support", "scoping", "abstract_data_tree"], + optional=False, + document=r"""Property value.""", + ), + }, + ) + return spec + + @staticmethod + def default_config(server: AnyServerType = None) -> Config: + """Returns the default config of the operator. + + This config can then be changed to the user needs and be used to + instantiate the operator. The Configuration allows to customize + how the operation will be processed by the operator. + + Parameters + ---------- + server: + Server with channel connected to the remote or local instance. When + ``None``, attempts to use the global server. + + Returns + ------- + config: + A new Config instance equivalent to the default config for this operator. + """ + return Operator.default_config( + name="customtypefield::get_attribute", server=server + ) + + @property + def inputs(self) -> InputsCustomtypefieldGetAttribute: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsCustomtypefieldGetAttribute. + """ + return super().inputs + + @property + def outputs(self) -> OutputsCustomtypefieldGetAttribute: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsCustomtypefieldGetAttribute. + """ + return super().outputs + + +class InputsCustomtypefieldGetAttribute(_Inputs): + """Intermediate class used to connect user inputs to + customtypefield_get_attribute operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.utility.customtypefield_get_attribute() + >>> my_custom_type_field = dpf.CustomTypeField() + >>> op.inputs.custom_type_field.connect(my_custom_type_field) + >>> my_property_name = str() + >>> op.inputs.property_name.connect(my_property_name) + """ + + def __init__(self, op: Operator): + super().__init__(customtypefield_get_attribute._spec().inputs, op) + self._custom_type_field = Input( + customtypefield_get_attribute._spec().input_pin(0), 0, op, -1 + ) + self._inputs.append(self._custom_type_field) + self._property_name = Input( + customtypefield_get_attribute._spec().input_pin(1), 1, op, -1 + ) + self._inputs.append(self._property_name) + + @property + def custom_type_field(self) -> Input: + r"""Allows to connect custom_type_field input to the operator. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.utility.customtypefield_get_attribute() + >>> op.inputs.custom_type_field.connect(my_custom_type_field) + >>> # or + >>> op.inputs.custom_type_field(my_custom_type_field) + """ + return self._custom_type_field + + @property + def property_name(self) -> Input: + r"""Allows to connect property_name input to the operator. + + Accepted inputs are: 'time_freq_support', 'scoping' and 'header'. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.utility.customtypefield_get_attribute() + >>> op.inputs.property_name.connect(my_property_name) + >>> # or + >>> op.inputs.property_name(my_property_name) + """ + return self._property_name + + +class OutputsCustomtypefieldGetAttribute(_Outputs): + """Intermediate class used to get outputs from + customtypefield_get_attribute operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.utility.customtypefield_get_attribute() + >>> # Connect inputs : op.inputs. ... + >>> result_property = op.outputs.property() + """ + + def __init__(self, op: Operator): + super().__init__(customtypefield_get_attribute._spec().outputs, op) + self.property_as_time_freq_support = Output( + _modify_output_spec_with_one_type( + customtypefield_get_attribute._spec().output_pin(0), "time_freq_support" + ), + 0, + op, + ) + self._outputs.append(self.property_as_time_freq_support) + self.property_as_scoping = Output( + _modify_output_spec_with_one_type( + customtypefield_get_attribute._spec().output_pin(0), "scoping" + ), + 0, + op, + ) + self._outputs.append(self.property_as_scoping) + self.property_as_data_tree = Output( + _modify_output_spec_with_one_type( + customtypefield_get_attribute._spec().output_pin(0), "data_tree" + ), + 0, + op, + ) + self._outputs.append(self.property_as_data_tree) diff --git a/src/ansys/dpf/core/operators/utility/field_get_attribute.py b/src/ansys/dpf/core/operators/utility/field_get_attribute.py index 1a09da3662..958e24fbf9 100644 --- a/src/ansys/dpf/core/operators/utility/field_get_attribute.py +++ b/src/ansys/dpf/core/operators/utility/field_get_attribute.py @@ -25,11 +25,11 @@ class field_get_attribute(Operator): ---------- field: Field property_name: str - Accepted inputs are: 'time_freq_support' and 'scoping'. + Accepted inputs are: 'time_freq_support', 'scoping' and 'header'. Returns ------- - property: TimeFreqSupport or Scoping + property: TimeFreqSupport or Scoping or DataTree Property value. Examples @@ -82,13 +82,13 @@ def _spec() -> Specification: name="property_name", type_names=["string"], optional=False, - document=r"""Accepted inputs are: 'time_freq_support' and 'scoping'.""", + document=r"""Accepted inputs are: 'time_freq_support', 'scoping' and 'header'.""", ), }, map_output_pin_spec={ 0: PinSpecification( name="property", - type_names=["time_freq_support", "scoping"], + type_names=["time_freq_support", "scoping", "abstract_data_tree"], optional=False, document=r"""Property value.""", ), @@ -184,7 +184,7 @@ def field(self) -> Input: def property_name(self) -> Input: r"""Allows to connect property_name input to the operator. - Accepted inputs are: 'time_freq_support' and 'scoping'. + Accepted inputs are: 'time_freq_support', 'scoping' and 'header'. Returns ------- @@ -232,3 +232,11 @@ def __init__(self, op: Operator): op, ) self._outputs.append(self.property_as_scoping) + self.property_as_data_tree = Output( + _modify_output_spec_with_one_type( + field_get_attribute._spec().output_pin(0), "data_tree" + ), + 0, + op, + ) + self._outputs.append(self.property_as_data_tree) diff --git a/src/ansys/dpf/core/operators/utility/propertyfield_get_attribute.py b/src/ansys/dpf/core/operators/utility/propertyfield_get_attribute.py new file mode 100644 index 0000000000..f45c8787e5 --- /dev/null +++ b/src/ansys/dpf/core/operators/utility/propertyfield_get_attribute.py @@ -0,0 +1,252 @@ +""" +propertyfield_get_attribute + +Autogenerated DPF operator classes. +""" + +from __future__ import annotations + +from warnings import warn +from ansys.dpf.core.dpf_operator import Operator +from ansys.dpf.core.inputs import Input, _Inputs +from ansys.dpf.core.outputs import Output, _Outputs +from ansys.dpf.core.outputs import _modify_output_spec_with_one_type +from ansys.dpf.core.operators.specification import PinSpecification, Specification +from ansys.dpf.core.config import Config +from ansys.dpf.core.server_types import AnyServerType + + +class propertyfield_get_attribute(Operator): + r"""A PropertyField in pin 0 and a property name (string) in pin 1 are + expected in input. + + + Parameters + ---------- + property_field: PropertyField + property_name: str + Accepted inputs are: 'time_freq_support', 'scoping' and 'header'. + + Returns + ------- + property: TimeFreqSupport or Scoping or DataTree + Property value. + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.utility.propertyfield_get_attribute() + + >>> # Make input connections + >>> my_property_field = dpf.PropertyField() + >>> op.inputs.property_field.connect(my_property_field) + >>> my_property_name = str() + >>> op.inputs.property_name.connect(my_property_name) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.utility.propertyfield_get_attribute( + ... property_field=my_property_field, + ... property_name=my_property_name, + ... ) + + >>> # Get output data + >>> result_property = op.outputs.property() + """ + + def __init__( + self, property_field=None, property_name=None, config=None, server=None + ): + super().__init__( + name="propertyfield::get_attribute", config=config, server=server + ) + self._inputs = InputsPropertyfieldGetAttribute(self) + self._outputs = OutputsPropertyfieldGetAttribute(self) + if property_field is not None: + self.inputs.property_field.connect(property_field) + if property_name is not None: + self.inputs.property_name.connect(property_name) + + @staticmethod + def _spec() -> Specification: + description = r"""A PropertyField in pin 0 and a property name (string) in pin 1 are +expected in input. +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 0: PinSpecification( + name="property_field", + type_names=["property_field"], + optional=False, + document=r"""""", + ), + 1: PinSpecification( + name="property_name", + type_names=["string"], + optional=False, + document=r"""Accepted inputs are: 'time_freq_support', 'scoping' and 'header'.""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="property", + type_names=["time_freq_support", "scoping", "abstract_data_tree"], + optional=False, + document=r"""Property value.""", + ), + }, + ) + return spec + + @staticmethod + def default_config(server: AnyServerType = None) -> Config: + """Returns the default config of the operator. + + This config can then be changed to the user needs and be used to + instantiate the operator. The Configuration allows to customize + how the operation will be processed by the operator. + + Parameters + ---------- + server: + Server with channel connected to the remote or local instance. When + ``None``, attempts to use the global server. + + Returns + ------- + config: + A new Config instance equivalent to the default config for this operator. + """ + return Operator.default_config( + name="propertyfield::get_attribute", server=server + ) + + @property + def inputs(self) -> InputsPropertyfieldGetAttribute: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsPropertyfieldGetAttribute. + """ + return super().inputs + + @property + def outputs(self) -> OutputsPropertyfieldGetAttribute: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsPropertyfieldGetAttribute. + """ + return super().outputs + + +class InputsPropertyfieldGetAttribute(_Inputs): + """Intermediate class used to connect user inputs to + propertyfield_get_attribute operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.utility.propertyfield_get_attribute() + >>> my_property_field = dpf.PropertyField() + >>> op.inputs.property_field.connect(my_property_field) + >>> my_property_name = str() + >>> op.inputs.property_name.connect(my_property_name) + """ + + def __init__(self, op: Operator): + super().__init__(propertyfield_get_attribute._spec().inputs, op) + self._property_field = Input( + propertyfield_get_attribute._spec().input_pin(0), 0, op, -1 + ) + self._inputs.append(self._property_field) + self._property_name = Input( + propertyfield_get_attribute._spec().input_pin(1), 1, op, -1 + ) + self._inputs.append(self._property_name) + + @property + def property_field(self) -> Input: + r"""Allows to connect property_field input to the operator. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.utility.propertyfield_get_attribute() + >>> op.inputs.property_field.connect(my_property_field) + >>> # or + >>> op.inputs.property_field(my_property_field) + """ + return self._property_field + + @property + def property_name(self) -> Input: + r"""Allows to connect property_name input to the operator. + + Accepted inputs are: 'time_freq_support', 'scoping' and 'header'. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.utility.propertyfield_get_attribute() + >>> op.inputs.property_name.connect(my_property_name) + >>> # or + >>> op.inputs.property_name(my_property_name) + """ + return self._property_name + + +class OutputsPropertyfieldGetAttribute(_Outputs): + """Intermediate class used to get outputs from + propertyfield_get_attribute operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.utility.propertyfield_get_attribute() + >>> # Connect inputs : op.inputs. ... + >>> result_property = op.outputs.property() + """ + + def __init__(self, op: Operator): + super().__init__(propertyfield_get_attribute._spec().outputs, op) + self.property_as_time_freq_support = Output( + _modify_output_spec_with_one_type( + propertyfield_get_attribute._spec().output_pin(0), "time_freq_support" + ), + 0, + op, + ) + self._outputs.append(self.property_as_time_freq_support) + self.property_as_scoping = Output( + _modify_output_spec_with_one_type( + propertyfield_get_attribute._spec().output_pin(0), "scoping" + ), + 0, + op, + ) + self._outputs.append(self.property_as_scoping) + self.property_as_data_tree = Output( + _modify_output_spec_with_one_type( + propertyfield_get_attribute._spec().output_pin(0), "data_tree" + ), + 0, + op, + ) + self._outputs.append(self.property_as_data_tree) diff --git a/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll b/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll index 09d95569f0..0946d81a64 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 75754afa78..7534360372 100644 Binary files a/src/ansys/dpf/gatebin/DPFClientAPI.dll and b/src/ansys/dpf/gatebin/DPFClientAPI.dll differ diff --git a/src/ansys/dpf/gatebin/libAns.Dpf.GrpcClient.so b/src/ansys/dpf/gatebin/libAns.Dpf.GrpcClient.so index 899b932744..381c3cefc4 100644 Binary files a/src/ansys/dpf/gatebin/libAns.Dpf.GrpcClient.so and b/src/ansys/dpf/gatebin/libAns.Dpf.GrpcClient.so differ diff --git a/src/ansys/dpf/gatebin/libDPFClientAPI.so b/src/ansys/dpf/gatebin/libDPFClientAPI.so index 0d1044044f..5fa5a11641 100644 Binary files a/src/ansys/dpf/gatebin/libDPFClientAPI.so and b/src/ansys/dpf/gatebin/libDPFClientAPI.so differ