diff --git a/doc/source/_static/dpf_operators.html b/doc/source/_static/dpf_operators.html index 9b8fb9afa30..05bb6f293fd 100644 --- a/doc/source/_static/dpf_operators.html +++ b/doc/source/_static/dpf_operators.html @@ -6182,11 +6182,24 @@

Configurating operators

region id (integer) or vector of region ids (vector) or region scoping (scoping) of the model (region corresponds to zone for Fluid results or part for LSDyna results).

(for Fluid results only) LabelSpace with combination of zone, phases or species ids

Outputs

Configurations

Scripting

Changelog

metadata: element types provider

Description

Reads element types data from the result files contained in the streams or data sources.

-
Version 0.0.0

Supported file types

Inputs

Element Type ids to recover used by the solver. If not set, all available element types to be recovered.

+
    +
  • If the output is a GenericDataContainer, its class_name is ElementTypesProperties and it contains the following property fields:
      +
    • element_routine_number: Element routine number. E.g 186 for SOLID186.
    • +
    • keyopts: Element type option keys.
    • +
    • kdofs: DOF/node for this element type. This is a bit mapping.
    • +
    • nodelm: Number of nodes for this element type.
    • +
    • nodfor: Number of nodes per element having nodal forces.
    • +
    • nodstr: Number of nodes per element having nodal stresses.
    • +
    • new_gen_element: Element of new generation.
    • +
    +
  • +
  • If the output is a PropertyField, it contains the 200 possible ElementTypesProperties for each solver element type id. These properties are in the order documented in ansys/customize/include/echprm.inc and have the meaning documented in ansys/customize/include/elccmt.inc.
  • +
+
Version 0.1.0

Supported file types

Inputs

Element Type ids to recover used by the solver. If not set, all available element types are recovered.

Result file container allowed to be kept open to cache data.

Result file path container, used if no streams are set.

-

Outputs

The generic_data_container has a class_name: ElementTypesProperties. It contains the following property fields: element_routine_number: Element routine number. E.g 186 for SOLID186, keyopts: Element type option keys, kdofs: DOF/node for this element type.This is a bit mapping, nodelm: Number of nodes for this element type, nodfor: Number of nodes per element having nodal forces, nodstr: Number of nodes per element having nodal stresses, new_gen_element: Element of new generation.

-

Configurations

Scripting

Changelog

utility: delegate to operator

Description

Delegate the run to an Operator instantiated by the name in input (forwards all the input of this Operator to the sub Operator).

+

Get the output as a GenericDataContainer (pin value 1, default) or as a PropertyField (pin value 2).

+

Outputs

Configurations

Scripting

Changelog

utility: delegate to operator

Description

Delegate the run to an Operator instantiated by the name in input (forwards all the input of this Operator to the sub Operator).

Version 0.0.0

Inputs

Outputs

inputs

Configurations

Scripting

Changelog

result: acceleration Y

Description

Read/compute nodal accelerations Y component of the vector (2nd component) by calling the readers defined by the datasources.

Version 0.0.0

Supported file types

Inputs

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.

@@ -10911,26 +10924,7 @@

Configurating operators

If connected, this pin allows you to extract the result only on the selected shell layer(s). The available values are: 0: Top, 1: Bottom, 2: TopBottom, 3: Mid, 4: TopBottomMid.

Compute mid nodes (when available) by averaging the neighbour corner nodes. Default: True

If this pin is set to true, the output fields container splits the ENF by degree of freedom ("dof" label, 0 for translation, 1 for rotation, 2 for temperature) and derivative order ("derivative_order" label, 0 for stiffness terms, 1 for damping terms and 2 for inertial terms). Default is false.

-

Outputs

Configurations

Scripting

Changelog

result: compute total strain Z

Description

Computes the strain from a displacement field. -Only SOLID185 (B-Bar, Simplified Enhanced Strain, Enhanced Strain formulations), SOLID186 (Full Integration) & SOLID187 elements are supported. -Layered elements are not supported. -Thermal strains are not supported. -Only one value of material properties are allowed per element for isotropic and orthotropic elasticity. Material nonlinearity is not supported -Only linear analysis are supported without On Demand Expansion. -All coordinates are global coordinates. -Euler Angles need to be included in the database. -Get the ZZ normal component (22 component).

-
Version 0.0.0

Inputs

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.. Will only be used if no displacement input is given (will be applied on displacement operator).

-

The element scoping on which the result is computed.

-

Optional if a mesh or a data_sources have been connected. Required if no displacement input have been connected.

-

Optional if a mesh or a streams_container have been connected, or if the displacement's field has a mesh support. Required if no displacement input have been connected.

-

Whether to extrapolate the data from the integration points to the nodes.

-

Whether to use nonlinear geometry or nonlinear material (1 = large strain, 2 = hyperelasticity).

-

The underlying mesh. Optional if a data_sources or a streams_container have been connected, or if the displacement's field has a mesh support.

-

Average the Elemental Nodal result to the requested location.

-

Field/or fields container containing only the displacement field (nodal). If none specified, read displacements from result file using the data_sources.

-

Outputs

The computed result fields container (elemental nodal).

-

Configurations

Scripting

Changelog

result: structural temperature

Description

Read/compute element structural nodal temperatures by calling the readers defined by the datasources.

+

Outputs

Configurations

Scripting

Changelog

result: structural temperature

Description

Read/compute element structural nodal temperatures by calling the readers defined by the datasources.

  • The 'requested_location' and 'mesh_scoping' inputs are processed to see if they need scoping transposition or result averaging. The resulting output fields have a 'Nodal', 'ElementalNodal' or 'Elemental' location.
  • Once the need for averaging has been detected, the behavior of the combined connection of the 'split_shells' and 'shell_layer' pins is:
  • @@ -11073,7 +11067,7 @@

    Configurating operators

If connected, this pin allows you to extract the result only on the selected shell layer(s). The available values are: 0: Top, 1: Bottom, 2: TopBottom, 3: Mid, 4: TopBottomMid.

Compute mid nodes (when available) by averaging the neighbour corner nodes. Default: True

Outputs

Configurations

Scripting

Changelog

metadata: result info provider

Description

Reads the result information, such as available results or unit systems from the results files contained in the streams or data sources.

-
Version 0.0.0

Supported file types

Inputs

streams (result file container) (optional)

+
Version 0.0.0

Supported file types

Inputs

streams (result file container) (optional)

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

Outputs

Configurations

Scripting

Changelog

filter: band pass (timescoping)

Description

The band pass filter returns all the values above (but not equal to) the minimum threshold value and below (but not equal to) the maximum threshold value in input.

Version 0.0.0

Inputs

A minimum threshold scalar or a field containing one value is expected.

@@ -15094,7 +15088,26 @@

Configurating operators

Average the Elemental Nodal result to the requested location.

Field/or fields container containing only the displacement field (nodal). If none specified, read displacements from result file using the data_sources.

Outputs

The computed result fields container (elemental nodal).

-

Configurations

Scripting

Changelog

result: compute total strain XY

Description

Computes the strain from a displacement field. +

Configurations

Scripting

Changelog

result: compute total strain Z

Description

Computes the strain from a displacement field. +Only SOLID185 (B-Bar, Simplified Enhanced Strain, Enhanced Strain formulations), SOLID186 (Full Integration) & SOLID187 elements are supported. +Layered elements are not supported. +Thermal strains are not supported. +Only one value of material properties are allowed per element for isotropic and orthotropic elasticity. Material nonlinearity is not supported +Only linear analysis are supported without On Demand Expansion. +All coordinates are global coordinates. +Euler Angles need to be included in the database. +Get the ZZ normal component (22 component).

+
Version 0.0.0

Inputs

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.. Will only be used if no displacement input is given (will be applied on displacement operator).

+

The element scoping on which the result is computed.

+

Optional if a mesh or a data_sources have been connected. Required if no displacement input have been connected.

+

Optional if a mesh or a streams_container have been connected, or if the displacement's field has a mesh support. Required if no displacement input have been connected.

+

Whether to extrapolate the data from the integration points to the nodes.

+

Whether to use nonlinear geometry or nonlinear material (1 = large strain, 2 = hyperelasticity).

+

The underlying mesh. Optional if a data_sources or a streams_container have been connected, or if the displacement's field has a mesh support.

+

Average the Elemental Nodal result to the requested location.

+

Field/or fields container containing only the displacement field (nodal). If none specified, read displacements from result file using the data_sources.

+

Outputs

The computed result fields container (elemental nodal).

+

Configurations

Scripting

Changelog

result: compute total strain XY

Description

Computes the strain from a displacement field. Only SOLID185 (B-Bar, Simplified Enhanced Strain, Enhanced Strain formulations), SOLID186 (Full Integration) & SOLID187 elements are supported. Layered elements are not supported. Thermal strains are not supported. diff --git a/src/ansys/dpf/core/operators/metadata/element_types_provider.py b/src/ansys/dpf/core/operators/metadata/element_types_provider.py index 9c85d5abf75..d9d8de9977f 100644 --- a/src/ansys/dpf/core/operators/metadata/element_types_provider.py +++ b/src/ansys/dpf/core/operators/metadata/element_types_provider.py @@ -10,6 +10,7 @@ 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 @@ -17,22 +18,34 @@ class element_types_provider(Operator): r"""Reads element types data from the result files contained in the streams - or data sources. + or data sources. - If the output is a GenericDataContainer, its + class_name is ElementTypesProperties and it contains the following + property fields: - element_routine_number: Element routine number. E.g + 186 for SOLID186. - keyopts: Element type option keys. - kdofs: DOF/node + for this element type. This is a bit mapping. - nodelm: Number of nodes + for this element type. - nodfor: Number of nodes per element having + nodal forces. - nodstr: Number of nodes per element having nodal + stresses. - new_gen_element: Element of new generation. - If the output + is a PropertyField, it contains the 200 possible ElementTypesProperties + for each solver element type id. These properties are in the order + documented in ansys/customize/include/echprm.inc and have the meaning + documented in ansys/customize/include/elccmt.inc. Parameters ---------- solver_element_types_ids: int, optional - Element Type ids to recover used by the solver. If not set, all available element types to be recovered. + Element Type ids to recover used by the solver. If not set, all available element types are recovered. streams: StreamsContainer, optional Result file container allowed to be kept open to cache data. data_sources: DataSources Result file path container, used if no streams are set. + output_type: int, optional + Get the output as a GenericDataContainer (pin value 1, default) or as a PropertyField (pin value 2). Returns ------- - element_types_data: GenericDataContainer - The generic_data_container has a class_name: ElementTypesProperties. It contains the following property fields: element_routine_number: Element routine number. E.g 186 for SOLID186, keyopts: Element type option keys, kdofs: DOF/node for this element type.This is a bit mapping, nodelm: Number of nodes for this element type, nodfor: Number of nodes per element having nodal forces, nodstr: Number of nodes per element having nodal stresses, new_gen_element: Element of new generation. + element_types_data: GenericDataContainer or PropertyField Examples -------- @@ -48,12 +61,15 @@ class element_types_provider(Operator): >>> op.inputs.streams.connect(my_streams) >>> my_data_sources = dpf.DataSources() >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_output_type = int() + >>> op.inputs.output_type.connect(my_output_type) >>> # Instantiate operator and connect inputs in one line >>> op = dpf.operators.metadata.element_types_provider( ... solver_element_types_ids=my_solver_element_types_ids, ... streams=my_streams, ... data_sources=my_data_sources, + ... output_type=my_output_type, ... ) >>> # Get output data @@ -65,6 +81,7 @@ def __init__( solver_element_types_ids=None, streams=None, data_sources=None, + output_type=None, config=None, server=None, ): @@ -77,11 +94,24 @@ def __init__( self.inputs.streams.connect(streams) if data_sources is not None: self.inputs.data_sources.connect(data_sources) + if output_type is not None: + self.inputs.output_type.connect(output_type) @staticmethod def _spec() -> Specification: description = r"""Reads element types data from the result files contained in the streams -or data sources. +or data sources. - If the output is a GenericDataContainer, its +class_name is ElementTypesProperties and it contains the following +property fields: - element_routine_number: Element routine number. E.g +186 for SOLID186. - keyopts: Element type option keys. - kdofs: DOF/node +for this element type. This is a bit mapping. - nodelm: Number of nodes +for this element type. - nodfor: Number of nodes per element having +nodal forces. - nodstr: Number of nodes per element having nodal +stresses. - new_gen_element: Element of new generation. - If the output +is a PropertyField, it contains the 200 possible ElementTypesProperties +for each solver element type id. These properties are in the order +documented in ansys/customize/include/echprm.inc and have the meaning +documented in ansys/customize/include/elccmt.inc. """ spec = Specification( description=description, @@ -90,7 +120,7 @@ def _spec() -> Specification: name="solver_element_types_ids", type_names=["int32", "vector"], optional=True, - document=r"""Element Type ids to recover used by the solver. If not set, all available element types to be recovered.""", + document=r"""Element Type ids to recover used by the solver. If not set, all available element types are recovered.""", ), 3: PinSpecification( name="streams", @@ -104,13 +134,19 @@ def _spec() -> Specification: optional=False, document=r"""Result file path container, used if no streams are set.""", ), + 200: PinSpecification( + name="output_type", + type_names=["int32"], + optional=True, + document=r"""Get the output as a GenericDataContainer (pin value 1, default) or as a PropertyField (pin value 2).""", + ), }, map_output_pin_spec={ 0: PinSpecification( name="element_types_data", - type_names=["generic_data_container"], + type_names=["generic_data_container", "property_field"], optional=False, - document=r"""The generic_data_container has a class_name: ElementTypesProperties. It contains the following property fields: element_routine_number: Element routine number. E.g 186 for SOLID186, keyopts: Element type option keys, kdofs: DOF/node for this element type.This is a bit mapping, nodelm: Number of nodes for this element type, nodfor: Number of nodes per element having nodal forces, nodstr: Number of nodes per element having nodal stresses, new_gen_element: Element of new generation.""", + document=r"""""", ), }, ) @@ -174,6 +210,8 @@ class InputsElementTypesProvider(_Inputs): >>> op.inputs.streams.connect(my_streams) >>> my_data_sources = dpf.DataSources() >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_output_type = int() + >>> op.inputs.output_type.connect(my_output_type) """ def __init__(self, op: Operator): @@ -188,12 +226,16 @@ def __init__(self, op: Operator): element_types_provider._spec().input_pin(4), 4, op, -1 ) self._inputs.append(self._data_sources) + self._output_type = Input( + element_types_provider._spec().input_pin(200), 200, op, -1 + ) + self._inputs.append(self._output_type) @property def solver_element_types_ids(self) -> Input: r"""Allows to connect solver_element_types_ids input to the operator. - Element Type ids to recover used by the solver. If not set, all available element types to be recovered. + Element Type ids to recover used by the solver. If not set, all available element types are recovered. Returns ------- @@ -252,6 +294,27 @@ def data_sources(self) -> Input: """ return self._data_sources + @property + def output_type(self) -> Input: + r"""Allows to connect output_type input to the operator. + + Get the output as a GenericDataContainer (pin value 1, default) or as a PropertyField (pin value 2). + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.metadata.element_types_provider() + >>> op.inputs.output_type.connect(my_output_type) + >>> # or + >>> op.inputs.output_type(my_output_type) + """ + return self._output_type + class OutputsElementTypesProvider(_Outputs): """Intermediate class used to get outputs from @@ -267,27 +330,19 @@ class OutputsElementTypesProvider(_Outputs): def __init__(self, op: Operator): super().__init__(element_types_provider._spec().outputs, op) - self._element_types_data = Output( - element_types_provider._spec().output_pin(0), 0, op + self.element_types_data_as_generic_data_container = Output( + _modify_output_spec_with_one_type( + element_types_provider._spec().output_pin(0), "generic_data_container" + ), + 0, + op, ) - self._outputs.append(self._element_types_data) - - @property - def element_types_data(self) -> Output: - r"""Allows to get element_types_data output of the operator - - The generic_data_container has a class_name: ElementTypesProperties. It contains the following property fields: element_routine_number: Element routine number. E.g 186 for SOLID186, keyopts: Element type option keys, kdofs: DOF/node for this element type.This is a bit mapping, nodelm: Number of nodes for this element type, nodfor: Number of nodes per element having nodal forces, nodstr: Number of nodes per element having nodal stresses, new_gen_element: Element of new generation. - - Returns - ------- - output: - An Output instance for this pin. - - Examples - -------- - >>> from ansys.dpf import core as dpf - >>> op = dpf.operators.metadata.element_types_provider() - >>> # Get the output from op.outputs. ... - >>> result_element_types_data = op.outputs.element_types_data() - """ - return self._element_types_data + self._outputs.append(self.element_types_data_as_generic_data_container) + self.element_types_data_as_property_field = Output( + _modify_output_spec_with_one_type( + element_types_provider._spec().output_pin(0), "property_field" + ), + 0, + op, + ) + self._outputs.append(self.element_types_data_as_property_field) diff --git a/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll b/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll index 7ab18282b51..ca419268924 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 232c32013c8..e3486f282ae 100644 Binary files a/src/ansys/dpf/gatebin/DPFClientAPI.dll and b/src/ansys/dpf/gatebin/DPFClientAPI.dll differ