diff --git a/doc/source/_static/dpf_operators.html b/doc/source/_static/dpf_operators.html index acdd495d1e1..0f26d5b98dc 100644 --- a/doc/source/_static/dpf_operators.html +++ b/doc/source/_static/dpf_operators.html @@ -5455,7 +5455,16 @@

Configurating operators

Double/Vector of doubles/Field/FieldsContainer. When scoped on overall, same value(s) applied on all the data, when scoped elsewhere, corresponding values will be multiplied due to the scoping

Default is false. If set to true, output of scale is made dimensionless

Default is 0 use mkl. If set to 1, don't

-

Outputs

Configurations

Scripting

Changelog

math: sweeping phase

Description

Shifts the phase of a real and an imaginary field (in 0 and 1) of a given angle (in 3) of a unit (in 4). The resulting field is computed as field_out = real_field*cos(angle) - imaginary_field*sin(angle).

+

Outputs

Configurations

Scripting

Changelog

result: node orientations X

Description

Read/compute node euler angles X component of the vector (1st component) by calling the readers defined by the datasources.

+
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.

+

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

+

FieldsContainer already allocated modified inplace

+

result file container allowed to be kept open to cache data

+

result file path container, used if no streams are set

+

if true the field is rotated to global coordinate system (default true)

+

prevents from reading the mesh in the result files

+

if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1)

+

Outputs

Configurations

Scripting

Changelog

math: sweeping phase

Description

Shifts the phase of a real and an imaginary field (in 0 and 1) of a given angle (in 3) of a unit (in 4). The resulting field is computed as field_out = real_field*cos(angle) - imaginary_field*sin(angle).

Version 0.0.1

Inputs

field or fields container with only one field is expected

field or fields container with only one field is expected

String Unit. Supported values: "deg" or "rad". Default: "rad".

@@ -5694,7 +5703,7 @@

Configurating operators

-
Version 0.1.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.

+
Version 0.1.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.

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

Fields container already allocated modified inplace

result file container allowed to be kept open to cache data

@@ -6597,10 +6606,7 @@

Configurating operators

Outputs

Configurations

Scripting

Changelog

geo: integrate over elements

Description

Integration of an input field over mesh.

Version 0.0.0

Inputs

Integrate the input field over a specific scoping.

Mesh to integrate on. If not provided, the one from input field is employed.

-

Outputs

Configurations

Scripting

Changelog

utility: forward

Description

Return all the inputs as outputs.

-
Version 0.0.0

Inputs

any type of input

-

Outputs

same types as inputs

-

Configurations

Scripting

Changelog

result: compute total strain X

Description

Computes the strain from a displacement field. +

Outputs

Configurations

Scripting

Changelog

result: compute total strain X

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. @@ -6619,7 +6625,10 @@

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: plastic strain eqv

Description

Read/compute element nodal equivalent plastic strain by calling the readers defined by the datasources.

+

Configurations

Scripting

Changelog

utility: forward

Description

Return all the inputs as outputs.

+
Version 0.0.0

Inputs

any type of input

+

Outputs

same types as inputs

+

Configurations

Scripting

Changelog

result: plastic strain eqv

Description

Read/compute element nodal equivalent plastic strain 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:
  • @@ -10112,7 +10121,41 @@

    Configurating operators

requested location, default is Nodal

if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1)

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

-

Outputs

Configurations

Scripting

Changelog

result: temperature gradient

Description

Read/compute Temperature Gradient by calling the readers defined by the datasources.

+

Outputs

Configurations

Scripting

Changelog

result: node orientations

Description

Read/compute node euler angles 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.

+

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

+

Fields container already allocated modified inplace

+

result file container allowed to be kept open to cache data

+

result file path container, used if no streams are set

+

if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect.

+

prevents from reading the mesh in the result files

+

Outputs

Configurations

Scripting

Changelog

math: accumulation per scoping

Description

This operator calculates the sum and the percentage of total sum of the input fields container for each scoping of the scopings container.

+
Version 0.0.0

Inputs

Master scoping. All scopings in the Scopings Container will be intersected with this scoping.

+

The intersection between the of the first will be used.

+

Outputs

Configurations

Scripting

Changelog

result: node orientations Y

Description

Read/compute node euler angles Y component of the vector (2nd component) by calling the readers defined by the datasources.

+
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.

+

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

+

FieldsContainer already allocated modified inplace

+

result file container allowed to be kept open to cache data

+

result file path container, used if no streams are set

+

if true the field is rotated to global coordinate system (default true)

+

prevents from reading the mesh in the result files

+

if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1)

+

Outputs

Configurations

Scripting

Changelog

geo: cartesian to spherical coordinates

Description

Converts 3D field from cartesian coordinates to spherical coordinates.

+
Version 0.0.0

Inputs

Outputs

Configurations

Scripting

Changelog

result: global rigid body stopper energy (LSDyna)

Description

Read Global Rigid Body Stopper Energy (LSDyna) by calling the readers defined by the datasources.

+
Version 0.0.0

Supported file types

Inputs

result file container allowed to be kept open to cache data

+

result file path container, used if no streams are set

+

(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance

+

Outputs

Configurations

Scripting

Changelog

result: node orientations Z

Description

Read/compute node euler angles Z component of the vector (3rd component) by calling the readers defined by the datasources.

+
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.

+

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

+

FieldsContainer already allocated modified inplace

+

result file container allowed to be kept open to cache data

+

result file path container, used if no streams are set

+

if true the field is rotated to global coordinate system (default true)

+

prevents from reading the mesh in the result files

+

if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1)

+

Outputs

Configurations

Scripting

Changelog

result: temperature gradient

Description

Read/compute Temperature Gradient 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:
  • @@ -13316,14 +13359,7 @@

    Configurating operators

angle phi in degrees (default value 0.0), use if cyclic expansion is to be done.

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

result: compute stress

Description

Computes the stress from an elastic strain field. compute_total_strain limitations are applicable for stress computation

-
Version 0.0.0

Inputs

The element scoping on which the result is computed.

-

Needed to get mesh and material ids. Optional if a data_sources have been connected.

-

Needed to get mesh and material ids. Optional if a streams_container have been connected.

-

Average the Elemental Nodal result to the requested location.

-

Field/or fields container containing only the elastic strain field (element nodal).

-

Outputs

The computed result fields container (elemental nodal).

-

Configurations

Scripting

Changelog

result: raw displacement

Description

Read/compute U vector from the finite element problem KU=F by calling the readers defined by the datasources.

+

Outputs

Configurations

Scripting

Changelog

result: raw displacement

Description

Read/compute U vector from the finite element problem KU=F 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.

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

Fields container already allocated modified inplace

@@ -13819,12 +13855,7 @@

Configurating operators

(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance

Outputs

Configurations

Scripting

Changelog

math: matrix inverse

Description

Computes the complex matrix inverse for each field in the given fields container.

Version 0.0.0

Inputs

fields_container

-

Outputs

Configurations

Scripting

Changelog

geo: cartesian to spherical coordinates

Description

Converts 3D field from cartesian coordinates to spherical coordinates.

-
Version 0.0.0

Inputs

Outputs

Configurations

Scripting

Changelog

result: global rigid body stopper energy (LSDyna)

Description

Read Global Rigid Body Stopper Energy (LSDyna) by calling the readers defined by the datasources.

-
Version 0.0.0

Supported file types

Inputs

result file container allowed to be kept open to cache data

-

result file path container, used if no streams are set

-

(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance

-

Outputs

Configurations

Scripting

Changelog

result: global spring and damper energy (LSDyna)

Description

Read Global Spring and Damper Energy (LSDyna) by calling the readers defined by the datasources.

+

Outputs

Configurations

Scripting

Changelog

result: global spring and damper energy (LSDyna)

Description

Read Global Spring and Damper Energy (LSDyna) by calling the readers defined by the datasources.

Version 0.0.0

Supported file types

Inputs

result file container allowed to be kept open to cache data

result file path container, used if no streams are set

(LSDyna) Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance

@@ -14083,10 +14114,7 @@

Configurating operators

Outputs

Configurations

Scripting

Changelog

metadata: material support provider

Description

Reads the material support.

Version 0.0.0

Supported file types

Inputs

Streams result file container (optional).

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

-

Outputs

Configurations

Scripting

Changelog

math: accumulation per scoping

Description

This operator calculates the sum and the percentage of total sum of the input fields container for each scoping of the scopings container.

-
Version 0.0.0

Inputs

Master scoping. All scopings in the Scopings Container will be intersected with this scoping.

-

The intersection between the of the first will be used.

-

Outputs

Configurations

Scripting

Changelog

metadata: real constants provider

Description

Reads real constants from the result files contained in the streams or data sources.

+

Outputs

Configurations

Scripting

Changelog

metadata: real constants provider

Description

Reads real constants from the result files contained in the streams or data sources.

Version 0.0.0

Supported file types

Inputs

Real Constant ids to recover used by the solver. If not set, all available real constants to be recovered.

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

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

@@ -14363,9 +14391,9 @@

Configurating operators

Configurations

Scripting

Changelog

averaging: extend to mid nodes (field)

Description

Extends an Elemental Nodal or Nodal field defined on corner nodes to a field defined also on the mid nodes.

Version 0.0.0

Inputs

field or fields container with only one field is expected

Outputs

Configurations

Scripting

Changelog

utility: producer consumer for each

Description

Allows to write a loop over operators by connecting data to iterate and by requesting the incrementally output merged.The chain of Operators are split into a first part: the producers and a second part: the consumers. These 2 parts will run asynchronously on 2 threads.

-
Version 0.1.0

Inputs

The result of the make_producer_consumer_for_each_iterator operator.

+
Version 0.2.0

Inputs

The result of the make_producer_consumer_for_each_iterator operator.

output of the last operators of the workflow

-

Outputs

Configurations

Scripting

Changelog

mesh: mesh get attribute

Description

Uses the MeshedRegion APIs to return a given attribute of the mesh in input.

+

Outputs

Configurations

Scripting

Changelog

mesh: mesh get attribute

Description

Uses the MeshedRegion APIs to return a given attribute of the mesh in input.

Version 0.0.0

Inputs

Supported property names are: "connectivity", "reverse_connectivity", "mat", "faces_nodes_connectivity", "elements_faces_connectivity" (or any mesh's property field), "coordinates", "named_selection", "num_named_selections", "named_selection_names", "named_selection_locations", "node_scoping", "element_scoping", "face_scoping"...

Can be used to get a property at a given index, example: a named selection's number or by name, example: a named selection's name.

Outputs

Returns a property field for properties: "connectivity", "reverse_connectivity", "mat", "faces_nodes_connectivity", "elements_faces_connectivity" (or any mesh's property field), a field for property: "coordinates", a scoping for properties:"named_selection", "node_scoping", "element_scoping", "face_scoping", a string field for properties: "named_selection_names", "named_selection_locations" and an int for property: "num_named_selections".

@@ -15088,7 +15116,14 @@

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 Z

Description

Computes the strain from a displacement field. +

Configurations

Scripting

Changelog

result: compute stress

Description

Computes the stress from an elastic strain field. compute_total_strain limitations are applicable for stress computation

+
Version 0.0.0

Inputs

The element scoping on which the result is computed.

+

Needed to get mesh and material ids. Optional if a data_sources have been connected.

+

Needed to get mesh and material ids. Optional if a streams_container have been connected.

+

Average the Elemental Nodal result to the requested location.

+

Field/or fields container containing only the elastic strain field (element nodal).

+

Outputs

The computed result fields container (elemental nodal).

+

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. diff --git a/examples/05-file-IO/02-hdf5_serialize_and_read.py b/examples/05-file-IO/02-hdf5_serialize_and_read.py index 668f9b658f8..c629080fc67 100644 --- a/examples/05-file-IO/02-hdf5_serialize_and_read.py +++ b/examples/05-file-IO/02-hdf5_serialize_and_read.py @@ -162,7 +162,10 @@ ############################################################################### # compare first result at second time set: -fc_all_steps_first_step_first_res = res_deser_all_times_list[0].get_field_by_time_id(2) # set 1 +position_result = result_names_on_all_time_steps.index("result_U") +fc_all_steps_first_step_first_res = res_deser_all_times_list[position_result].get_field_by_time_id( + 2 +) # set 2 mesh_deser_all_times.plot(fc_all_steps_first_step_first_res) mesh_deser_set_per_set.plot(res_deser_set_per_set_list[num_res * 1 + 0]) diff --git a/src/ansys/dpf/core/available_result.py b/src/ansys/dpf/core/available_result.py index d59155a02d0..b251583726a 100644 --- a/src/ansys/dpf/core/available_result.py +++ b/src/ansys/dpf/core/available_result.py @@ -125,7 +125,7 @@ class AvailableResult: >>> transient = examples.download_transient_result() >>> model = dpf.Model(transient) >>> result_info = model.metadata.result_info - >>> res = result_info.available_results[0] + >>> res = result_info.available_results[1] >>> res.name 'displacement' >>> res.homogeneity diff --git a/src/ansys/dpf/core/operators/result/__init__.py b/src/ansys/dpf/core/operators/result/__init__.py index f7e38698912..90cd25dd985 100644 --- a/src/ansys/dpf/core/operators/result/__init__.py +++ b/src/ansys/dpf/core/operators/result/__init__.py @@ -234,6 +234,10 @@ from .nodal_rotational_velocity_Y import nodal_rotational_velocity_Y from .nodal_rotational_velocity_Z import nodal_rotational_velocity_Z from .nodal_to_global import nodal_to_global +from .node_orientations import node_orientations +from .node_orientations_X import node_orientations_X +from .node_orientations_Y import node_orientations_Y +from .node_orientations_Z import node_orientations_Z from .normal_contact_force import normal_contact_force from .normal_contact_moment import normal_contact_moment from .num_surface_status_changes import num_surface_status_changes diff --git a/src/ansys/dpf/core/operators/result/node_orientations.py b/src/ansys/dpf/core/operators/result/node_orientations.py new file mode 100644 index 00000000000..35f5c1bf810 --- /dev/null +++ b/src/ansys/dpf/core/operators/result/node_orientations.py @@ -0,0 +1,453 @@ +""" +node_orientations + +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.operators.specification import PinSpecification, Specification +from ansys.dpf.core.config import Config +from ansys.dpf.core.server_types import AnyServerType + + +class node_orientations(Operator): + r"""Read/compute node euler angles by calling the readers defined by the + datasources. + + + Parameters + ---------- + time_scoping: Scoping or int or float or Field, optional + 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. + mesh_scoping: ScopingsContainer or Scoping, optional + 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 + fields_container: FieldsContainer, optional + Fields container already allocated modified inplace + streams_container: 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 + bool_rotate_to_global: bool, optional + if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect. + mesh: MeshedRegion or MeshesContainer, optional + prevents from reading the mesh in the result files + + Returns + ------- + fields_container: FieldsContainer + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.result.node_orientations() + + >>> # Make input connections + >>> my_time_scoping = dpf.Scoping() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> my_mesh_scoping = dpf.ScopingsContainer() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> my_fields_container = dpf.FieldsContainer() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> my_streams_container = dpf.StreamsContainer() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_bool_rotate_to_global = bool() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> my_mesh = dpf.MeshedRegion() + >>> op.inputs.mesh.connect(my_mesh) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.result.node_orientations( + ... time_scoping=my_time_scoping, + ... mesh_scoping=my_mesh_scoping, + ... fields_container=my_fields_container, + ... streams_container=my_streams_container, + ... data_sources=my_data_sources, + ... bool_rotate_to_global=my_bool_rotate_to_global, + ... mesh=my_mesh, + ... ) + + >>> # Get output data + >>> result_fields_container = op.outputs.fields_container() + """ + + def __init__( + self, + time_scoping=None, + mesh_scoping=None, + fields_container=None, + streams_container=None, + data_sources=None, + bool_rotate_to_global=None, + mesh=None, + config=None, + server=None, + ): + super().__init__(name="EUL_NOD", config=config, server=server) + self._inputs = InputsNodeOrientations(self) + self._outputs = OutputsNodeOrientations(self) + if time_scoping is not None: + self.inputs.time_scoping.connect(time_scoping) + if mesh_scoping is not None: + self.inputs.mesh_scoping.connect(mesh_scoping) + if fields_container is not None: + self.inputs.fields_container.connect(fields_container) + if streams_container is not None: + self.inputs.streams_container.connect(streams_container) + if data_sources is not None: + self.inputs.data_sources.connect(data_sources) + if bool_rotate_to_global is not None: + self.inputs.bool_rotate_to_global.connect(bool_rotate_to_global) + if mesh is not None: + self.inputs.mesh.connect(mesh) + + @staticmethod + def _spec() -> Specification: + description = r"""Read/compute node euler angles by calling the readers defined by the +datasources. +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 0: PinSpecification( + name="time_scoping", + type_names=[ + "scoping", + "int32", + "vector", + "double", + "field", + "vector", + ], + optional=True, + document=r"""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.""", + ), + 1: PinSpecification( + name="mesh_scoping", + type_names=["scopings_container", "scoping"], + optional=True, + document=r"""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""", + ), + 2: PinSpecification( + name="fields_container", + type_names=["fields_container"], + optional=True, + document=r"""Fields container already allocated modified inplace""", + ), + 3: PinSpecification( + name="streams_container", + type_names=["streams_container"], + optional=True, + document=r"""result file container allowed to be kept open to cache data""", + ), + 4: PinSpecification( + name="data_sources", + type_names=["data_sources"], + optional=False, + document=r"""result file path container, used if no streams are set""", + ), + 5: PinSpecification( + name="bool_rotate_to_global", + type_names=["bool"], + optional=True, + document=r"""if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect.""", + ), + 7: PinSpecification( + name="mesh", + type_names=["abstract_meshed_region", "meshes_container"], + optional=True, + document=r"""prevents from reading the mesh in the result files""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="fields_container", + type_names=["fields_container"], + optional=False, + document=r"""""", + ), + }, + ) + 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="EUL_NOD", server=server) + + @property + def inputs(self) -> InputsNodeOrientations: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsNodeOrientations. + """ + return super().inputs + + @property + def outputs(self) -> OutputsNodeOrientations: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsNodeOrientations. + """ + return super().outputs + + +class InputsNodeOrientations(_Inputs): + """Intermediate class used to connect user inputs to + node_orientations operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> my_time_scoping = dpf.Scoping() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> my_mesh_scoping = dpf.ScopingsContainer() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> my_fields_container = dpf.FieldsContainer() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> my_streams_container = dpf.StreamsContainer() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_bool_rotate_to_global = bool() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> my_mesh = dpf.MeshedRegion() + >>> op.inputs.mesh.connect(my_mesh) + """ + + def __init__(self, op: Operator): + super().__init__(node_orientations._spec().inputs, op) + self._time_scoping = Input(node_orientations._spec().input_pin(0), 0, op, -1) + self._inputs.append(self._time_scoping) + self._mesh_scoping = Input(node_orientations._spec().input_pin(1), 1, op, -1) + self._inputs.append(self._mesh_scoping) + self._fields_container = Input( + node_orientations._spec().input_pin(2), 2, op, -1 + ) + self._inputs.append(self._fields_container) + self._streams_container = Input( + node_orientations._spec().input_pin(3), 3, op, -1 + ) + self._inputs.append(self._streams_container) + self._data_sources = Input(node_orientations._spec().input_pin(4), 4, op, -1) + self._inputs.append(self._data_sources) + self._bool_rotate_to_global = Input( + node_orientations._spec().input_pin(5), 5, op, -1 + ) + self._inputs.append(self._bool_rotate_to_global) + self._mesh = Input(node_orientations._spec().input_pin(7), 7, op, -1) + self._inputs.append(self._mesh) + + @property + def time_scoping(self) -> Input: + r"""Allows to connect time_scoping input to the operator. + + 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. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> # or + >>> op.inputs.time_scoping(my_time_scoping) + """ + return self._time_scoping + + @property + def mesh_scoping(self) -> Input: + r"""Allows to connect mesh_scoping input to the operator. + + 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 + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> # or + >>> op.inputs.mesh_scoping(my_mesh_scoping) + """ + return self._mesh_scoping + + @property + def fields_container(self) -> Input: + r"""Allows to connect fields_container input to the operator. + + Fields container already allocated modified inplace + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> # or + >>> op.inputs.fields_container(my_fields_container) + """ + return self._fields_container + + @property + def streams_container(self) -> Input: + r"""Allows to connect streams_container input to the operator. + + result file container allowed to be kept open to cache data + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> # or + >>> op.inputs.streams_container(my_streams_container) + """ + return self._streams_container + + @property + def data_sources(self) -> Input: + r"""Allows to connect data_sources input to the operator. + + result file path container, used if no streams are set + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> # or + >>> op.inputs.data_sources(my_data_sources) + """ + return self._data_sources + + @property + def bool_rotate_to_global(self) -> Input: + r"""Allows to connect bool_rotate_to_global input to the operator. + + if true the field is rotated to global coordinate system (default true). Please check your results carefully if 'false' is used for Elemental or ElementalNodal results averaged to the Nodes when adjacent elements do not share the same coordinate system, as results may be incorrect. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> # or + >>> op.inputs.bool_rotate_to_global(my_bool_rotate_to_global) + """ + return self._bool_rotate_to_global + + @property + def mesh(self) -> Input: + r"""Allows to connect mesh input to the operator. + + prevents from reading the mesh in the result files + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> op.inputs.mesh.connect(my_mesh) + >>> # or + >>> op.inputs.mesh(my_mesh) + """ + return self._mesh + + +class OutputsNodeOrientations(_Outputs): + """Intermediate class used to get outputs from + node_orientations operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> # Connect inputs : op.inputs. ... + >>> result_fields_container = op.outputs.fields_container() + """ + + def __init__(self, op: Operator): + super().__init__(node_orientations._spec().outputs, op) + self._fields_container = Output(node_orientations._spec().output_pin(0), 0, op) + self._outputs.append(self._fields_container) + + @property + def fields_container(self) -> Output: + r"""Allows to get fields_container output of the operator + + Returns + ------- + output: + An Output instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations() + >>> # Get the output from op.outputs. ... + >>> result_fields_container = op.outputs.fields_container() + """ + return self._fields_container diff --git a/src/ansys/dpf/core/operators/result/node_orientations_X.py b/src/ansys/dpf/core/operators/result/node_orientations_X.py new file mode 100644 index 00000000000..adf62119bd4 --- /dev/null +++ b/src/ansys/dpf/core/operators/result/node_orientations_X.py @@ -0,0 +1,494 @@ +""" +node_orientations_X + +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.operators.specification import PinSpecification, Specification +from ansys.dpf.core.config import Config +from ansys.dpf.core.server_types import AnyServerType + + +class node_orientations_X(Operator): + r"""Read/compute node euler angles X component of the vector (1st component) + by calling the readers defined by the datasources. + + + Parameters + ---------- + time_scoping: Scoping or int or float or Field, optional + 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. + mesh_scoping: ScopingsContainer or Scoping, optional + 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 + fields_container: FieldsContainer, optional + FieldsContainer already allocated modified inplace + streams_container: 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 + bool_rotate_to_global: bool, optional + if true the field is rotated to global coordinate system (default true) + mesh: MeshedRegion or MeshesContainer, optional + prevents from reading the mesh in the result files + read_cyclic: int, optional + if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1) + + Returns + ------- + fields_container: FieldsContainer + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.result.node_orientations_X() + + >>> # Make input connections + >>> my_time_scoping = dpf.Scoping() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> my_mesh_scoping = dpf.ScopingsContainer() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> my_fields_container = dpf.FieldsContainer() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> my_streams_container = dpf.StreamsContainer() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_bool_rotate_to_global = bool() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> my_mesh = dpf.MeshedRegion() + >>> op.inputs.mesh.connect(my_mesh) + >>> my_read_cyclic = int() + >>> op.inputs.read_cyclic.connect(my_read_cyclic) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.result.node_orientations_X( + ... time_scoping=my_time_scoping, + ... mesh_scoping=my_mesh_scoping, + ... fields_container=my_fields_container, + ... streams_container=my_streams_container, + ... data_sources=my_data_sources, + ... bool_rotate_to_global=my_bool_rotate_to_global, + ... mesh=my_mesh, + ... read_cyclic=my_read_cyclic, + ... ) + + >>> # Get output data + >>> result_fields_container = op.outputs.fields_container() + """ + + def __init__( + self, + time_scoping=None, + mesh_scoping=None, + fields_container=None, + streams_container=None, + data_sources=None, + bool_rotate_to_global=None, + mesh=None, + read_cyclic=None, + config=None, + server=None, + ): + super().__init__(name="EUL_NODX", config=config, server=server) + self._inputs = InputsNodeOrientationsX(self) + self._outputs = OutputsNodeOrientationsX(self) + if time_scoping is not None: + self.inputs.time_scoping.connect(time_scoping) + if mesh_scoping is not None: + self.inputs.mesh_scoping.connect(mesh_scoping) + if fields_container is not None: + self.inputs.fields_container.connect(fields_container) + if streams_container is not None: + self.inputs.streams_container.connect(streams_container) + if data_sources is not None: + self.inputs.data_sources.connect(data_sources) + if bool_rotate_to_global is not None: + self.inputs.bool_rotate_to_global.connect(bool_rotate_to_global) + if mesh is not None: + self.inputs.mesh.connect(mesh) + if read_cyclic is not None: + self.inputs.read_cyclic.connect(read_cyclic) + + @staticmethod + def _spec() -> Specification: + description = r"""Read/compute node euler angles X component of the vector (1st component) +by calling the readers defined by the datasources. +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 0: PinSpecification( + name="time_scoping", + type_names=[ + "scoping", + "int32", + "vector", + "double", + "field", + "vector", + ], + optional=True, + document=r"""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.""", + ), + 1: PinSpecification( + name="mesh_scoping", + type_names=["scopings_container", "scoping"], + optional=True, + document=r"""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""", + ), + 2: PinSpecification( + name="fields_container", + type_names=["fields_container"], + optional=True, + document=r"""FieldsContainer already allocated modified inplace""", + ), + 3: PinSpecification( + name="streams_container", + type_names=["streams_container"], + optional=True, + document=r"""result file container allowed to be kept open to cache data""", + ), + 4: PinSpecification( + name="data_sources", + type_names=["data_sources"], + optional=False, + document=r"""result file path container, used if no streams are set""", + ), + 5: PinSpecification( + name="bool_rotate_to_global", + type_names=["bool"], + optional=True, + document=r"""if true the field is rotated to global coordinate system (default true)""", + ), + 7: PinSpecification( + name="mesh", + type_names=["abstract_meshed_region", "meshes_container"], + optional=True, + document=r"""prevents from reading the mesh in the result files""", + ), + 14: PinSpecification( + name="read_cyclic", + type_names=["enum dataProcessing::ECyclicReading", "int32"], + optional=True, + document=r"""if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1)""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="fields_container", + type_names=["fields_container"], + optional=False, + document=r"""""", + ), + }, + ) + 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="EUL_NODX", server=server) + + @property + def inputs(self) -> InputsNodeOrientationsX: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsNodeOrientationsX. + """ + return super().inputs + + @property + def outputs(self) -> OutputsNodeOrientationsX: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsNodeOrientationsX. + """ + return super().outputs + + +class InputsNodeOrientationsX(_Inputs): + """Intermediate class used to connect user inputs to + node_orientations_X operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> my_time_scoping = dpf.Scoping() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> my_mesh_scoping = dpf.ScopingsContainer() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> my_fields_container = dpf.FieldsContainer() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> my_streams_container = dpf.StreamsContainer() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_bool_rotate_to_global = bool() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> my_mesh = dpf.MeshedRegion() + >>> op.inputs.mesh.connect(my_mesh) + >>> my_read_cyclic = int() + >>> op.inputs.read_cyclic.connect(my_read_cyclic) + """ + + def __init__(self, op: Operator): + super().__init__(node_orientations_X._spec().inputs, op) + self._time_scoping = Input(node_orientations_X._spec().input_pin(0), 0, op, -1) + self._inputs.append(self._time_scoping) + self._mesh_scoping = Input(node_orientations_X._spec().input_pin(1), 1, op, -1) + self._inputs.append(self._mesh_scoping) + self._fields_container = Input( + node_orientations_X._spec().input_pin(2), 2, op, -1 + ) + self._inputs.append(self._fields_container) + self._streams_container = Input( + node_orientations_X._spec().input_pin(3), 3, op, -1 + ) + self._inputs.append(self._streams_container) + self._data_sources = Input(node_orientations_X._spec().input_pin(4), 4, op, -1) + self._inputs.append(self._data_sources) + self._bool_rotate_to_global = Input( + node_orientations_X._spec().input_pin(5), 5, op, -1 + ) + self._inputs.append(self._bool_rotate_to_global) + self._mesh = Input(node_orientations_X._spec().input_pin(7), 7, op, -1) + self._inputs.append(self._mesh) + self._read_cyclic = Input(node_orientations_X._spec().input_pin(14), 14, op, -1) + self._inputs.append(self._read_cyclic) + + @property + def time_scoping(self) -> Input: + r"""Allows to connect time_scoping input to the operator. + + 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. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> # or + >>> op.inputs.time_scoping(my_time_scoping) + """ + return self._time_scoping + + @property + def mesh_scoping(self) -> Input: + r"""Allows to connect mesh_scoping input to the operator. + + 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 + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> # or + >>> op.inputs.mesh_scoping(my_mesh_scoping) + """ + return self._mesh_scoping + + @property + def fields_container(self) -> Input: + r"""Allows to connect fields_container input to the operator. + + FieldsContainer already allocated modified inplace + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> # or + >>> op.inputs.fields_container(my_fields_container) + """ + return self._fields_container + + @property + def streams_container(self) -> Input: + r"""Allows to connect streams_container input to the operator. + + result file container allowed to be kept open to cache data + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> # or + >>> op.inputs.streams_container(my_streams_container) + """ + return self._streams_container + + @property + def data_sources(self) -> Input: + r"""Allows to connect data_sources input to the operator. + + result file path container, used if no streams are set + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> # or + >>> op.inputs.data_sources(my_data_sources) + """ + return self._data_sources + + @property + def bool_rotate_to_global(self) -> Input: + r"""Allows to connect bool_rotate_to_global input to the operator. + + if true the field is rotated to global coordinate system (default true) + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> # or + >>> op.inputs.bool_rotate_to_global(my_bool_rotate_to_global) + """ + return self._bool_rotate_to_global + + @property + def mesh(self) -> Input: + r"""Allows to connect mesh input to the operator. + + prevents from reading the mesh in the result files + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> op.inputs.mesh.connect(my_mesh) + >>> # or + >>> op.inputs.mesh(my_mesh) + """ + return self._mesh + + @property + def read_cyclic(self) -> Input: + r"""Allows to connect read_cyclic input to the operator. + + if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1) + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> op.inputs.read_cyclic.connect(my_read_cyclic) + >>> # or + >>> op.inputs.read_cyclic(my_read_cyclic) + """ + return self._read_cyclic + + +class OutputsNodeOrientationsX(_Outputs): + """Intermediate class used to get outputs from + node_orientations_X operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> # Connect inputs : op.inputs. ... + >>> result_fields_container = op.outputs.fields_container() + """ + + def __init__(self, op: Operator): + super().__init__(node_orientations_X._spec().outputs, op) + self._fields_container = Output( + node_orientations_X._spec().output_pin(0), 0, op + ) + self._outputs.append(self._fields_container) + + @property + def fields_container(self) -> Output: + r"""Allows to get fields_container output of the operator + + Returns + ------- + output: + An Output instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_X() + >>> # Get the output from op.outputs. ... + >>> result_fields_container = op.outputs.fields_container() + """ + return self._fields_container diff --git a/src/ansys/dpf/core/operators/result/node_orientations_Y.py b/src/ansys/dpf/core/operators/result/node_orientations_Y.py new file mode 100644 index 00000000000..f2485d07199 --- /dev/null +++ b/src/ansys/dpf/core/operators/result/node_orientations_Y.py @@ -0,0 +1,494 @@ +""" +node_orientations_Y + +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.operators.specification import PinSpecification, Specification +from ansys.dpf.core.config import Config +from ansys.dpf.core.server_types import AnyServerType + + +class node_orientations_Y(Operator): + r"""Read/compute node euler angles Y component of the vector (2nd component) + by calling the readers defined by the datasources. + + + Parameters + ---------- + time_scoping: Scoping or int or float or Field, optional + 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. + mesh_scoping: ScopingsContainer or Scoping, optional + 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 + fields_container: FieldsContainer, optional + FieldsContainer already allocated modified inplace + streams_container: 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 + bool_rotate_to_global: bool, optional + if true the field is rotated to global coordinate system (default true) + mesh: MeshedRegion or MeshesContainer, optional + prevents from reading the mesh in the result files + read_cyclic: int, optional + if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1) + + Returns + ------- + fields_container: FieldsContainer + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.result.node_orientations_Y() + + >>> # Make input connections + >>> my_time_scoping = dpf.Scoping() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> my_mesh_scoping = dpf.ScopingsContainer() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> my_fields_container = dpf.FieldsContainer() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> my_streams_container = dpf.StreamsContainer() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_bool_rotate_to_global = bool() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> my_mesh = dpf.MeshedRegion() + >>> op.inputs.mesh.connect(my_mesh) + >>> my_read_cyclic = int() + >>> op.inputs.read_cyclic.connect(my_read_cyclic) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.result.node_orientations_Y( + ... time_scoping=my_time_scoping, + ... mesh_scoping=my_mesh_scoping, + ... fields_container=my_fields_container, + ... streams_container=my_streams_container, + ... data_sources=my_data_sources, + ... bool_rotate_to_global=my_bool_rotate_to_global, + ... mesh=my_mesh, + ... read_cyclic=my_read_cyclic, + ... ) + + >>> # Get output data + >>> result_fields_container = op.outputs.fields_container() + """ + + def __init__( + self, + time_scoping=None, + mesh_scoping=None, + fields_container=None, + streams_container=None, + data_sources=None, + bool_rotate_to_global=None, + mesh=None, + read_cyclic=None, + config=None, + server=None, + ): + super().__init__(name="EUL_NODY", config=config, server=server) + self._inputs = InputsNodeOrientationsY(self) + self._outputs = OutputsNodeOrientationsY(self) + if time_scoping is not None: + self.inputs.time_scoping.connect(time_scoping) + if mesh_scoping is not None: + self.inputs.mesh_scoping.connect(mesh_scoping) + if fields_container is not None: + self.inputs.fields_container.connect(fields_container) + if streams_container is not None: + self.inputs.streams_container.connect(streams_container) + if data_sources is not None: + self.inputs.data_sources.connect(data_sources) + if bool_rotate_to_global is not None: + self.inputs.bool_rotate_to_global.connect(bool_rotate_to_global) + if mesh is not None: + self.inputs.mesh.connect(mesh) + if read_cyclic is not None: + self.inputs.read_cyclic.connect(read_cyclic) + + @staticmethod + def _spec() -> Specification: + description = r"""Read/compute node euler angles Y component of the vector (2nd component) +by calling the readers defined by the datasources. +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 0: PinSpecification( + name="time_scoping", + type_names=[ + "scoping", + "int32", + "vector", + "double", + "field", + "vector", + ], + optional=True, + document=r"""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.""", + ), + 1: PinSpecification( + name="mesh_scoping", + type_names=["scopings_container", "scoping"], + optional=True, + document=r"""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""", + ), + 2: PinSpecification( + name="fields_container", + type_names=["fields_container"], + optional=True, + document=r"""FieldsContainer already allocated modified inplace""", + ), + 3: PinSpecification( + name="streams_container", + type_names=["streams_container"], + optional=True, + document=r"""result file container allowed to be kept open to cache data""", + ), + 4: PinSpecification( + name="data_sources", + type_names=["data_sources"], + optional=False, + document=r"""result file path container, used if no streams are set""", + ), + 5: PinSpecification( + name="bool_rotate_to_global", + type_names=["bool"], + optional=True, + document=r"""if true the field is rotated to global coordinate system (default true)""", + ), + 7: PinSpecification( + name="mesh", + type_names=["abstract_meshed_region", "meshes_container"], + optional=True, + document=r"""prevents from reading the mesh in the result files""", + ), + 14: PinSpecification( + name="read_cyclic", + type_names=["enum dataProcessing::ECyclicReading", "int32"], + optional=True, + document=r"""if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1)""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="fields_container", + type_names=["fields_container"], + optional=False, + document=r"""""", + ), + }, + ) + 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="EUL_NODY", server=server) + + @property + def inputs(self) -> InputsNodeOrientationsY: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsNodeOrientationsY. + """ + return super().inputs + + @property + def outputs(self) -> OutputsNodeOrientationsY: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsNodeOrientationsY. + """ + return super().outputs + + +class InputsNodeOrientationsY(_Inputs): + """Intermediate class used to connect user inputs to + node_orientations_Y operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> my_time_scoping = dpf.Scoping() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> my_mesh_scoping = dpf.ScopingsContainer() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> my_fields_container = dpf.FieldsContainer() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> my_streams_container = dpf.StreamsContainer() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_bool_rotate_to_global = bool() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> my_mesh = dpf.MeshedRegion() + >>> op.inputs.mesh.connect(my_mesh) + >>> my_read_cyclic = int() + >>> op.inputs.read_cyclic.connect(my_read_cyclic) + """ + + def __init__(self, op: Operator): + super().__init__(node_orientations_Y._spec().inputs, op) + self._time_scoping = Input(node_orientations_Y._spec().input_pin(0), 0, op, -1) + self._inputs.append(self._time_scoping) + self._mesh_scoping = Input(node_orientations_Y._spec().input_pin(1), 1, op, -1) + self._inputs.append(self._mesh_scoping) + self._fields_container = Input( + node_orientations_Y._spec().input_pin(2), 2, op, -1 + ) + self._inputs.append(self._fields_container) + self._streams_container = Input( + node_orientations_Y._spec().input_pin(3), 3, op, -1 + ) + self._inputs.append(self._streams_container) + self._data_sources = Input(node_orientations_Y._spec().input_pin(4), 4, op, -1) + self._inputs.append(self._data_sources) + self._bool_rotate_to_global = Input( + node_orientations_Y._spec().input_pin(5), 5, op, -1 + ) + self._inputs.append(self._bool_rotate_to_global) + self._mesh = Input(node_orientations_Y._spec().input_pin(7), 7, op, -1) + self._inputs.append(self._mesh) + self._read_cyclic = Input(node_orientations_Y._spec().input_pin(14), 14, op, -1) + self._inputs.append(self._read_cyclic) + + @property + def time_scoping(self) -> Input: + r"""Allows to connect time_scoping input to the operator. + + 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. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> # or + >>> op.inputs.time_scoping(my_time_scoping) + """ + return self._time_scoping + + @property + def mesh_scoping(self) -> Input: + r"""Allows to connect mesh_scoping input to the operator. + + 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 + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> # or + >>> op.inputs.mesh_scoping(my_mesh_scoping) + """ + return self._mesh_scoping + + @property + def fields_container(self) -> Input: + r"""Allows to connect fields_container input to the operator. + + FieldsContainer already allocated modified inplace + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> # or + >>> op.inputs.fields_container(my_fields_container) + """ + return self._fields_container + + @property + def streams_container(self) -> Input: + r"""Allows to connect streams_container input to the operator. + + result file container allowed to be kept open to cache data + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> # or + >>> op.inputs.streams_container(my_streams_container) + """ + return self._streams_container + + @property + def data_sources(self) -> Input: + r"""Allows to connect data_sources input to the operator. + + result file path container, used if no streams are set + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> # or + >>> op.inputs.data_sources(my_data_sources) + """ + return self._data_sources + + @property + def bool_rotate_to_global(self) -> Input: + r"""Allows to connect bool_rotate_to_global input to the operator. + + if true the field is rotated to global coordinate system (default true) + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> # or + >>> op.inputs.bool_rotate_to_global(my_bool_rotate_to_global) + """ + return self._bool_rotate_to_global + + @property + def mesh(self) -> Input: + r"""Allows to connect mesh input to the operator. + + prevents from reading the mesh in the result files + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> op.inputs.mesh.connect(my_mesh) + >>> # or + >>> op.inputs.mesh(my_mesh) + """ + return self._mesh + + @property + def read_cyclic(self) -> Input: + r"""Allows to connect read_cyclic input to the operator. + + if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1) + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> op.inputs.read_cyclic.connect(my_read_cyclic) + >>> # or + >>> op.inputs.read_cyclic(my_read_cyclic) + """ + return self._read_cyclic + + +class OutputsNodeOrientationsY(_Outputs): + """Intermediate class used to get outputs from + node_orientations_Y operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> # Connect inputs : op.inputs. ... + >>> result_fields_container = op.outputs.fields_container() + """ + + def __init__(self, op: Operator): + super().__init__(node_orientations_Y._spec().outputs, op) + self._fields_container = Output( + node_orientations_Y._spec().output_pin(0), 0, op + ) + self._outputs.append(self._fields_container) + + @property + def fields_container(self) -> Output: + r"""Allows to get fields_container output of the operator + + Returns + ------- + output: + An Output instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Y() + >>> # Get the output from op.outputs. ... + >>> result_fields_container = op.outputs.fields_container() + """ + return self._fields_container diff --git a/src/ansys/dpf/core/operators/result/node_orientations_Z.py b/src/ansys/dpf/core/operators/result/node_orientations_Z.py new file mode 100644 index 00000000000..e345523bfc3 --- /dev/null +++ b/src/ansys/dpf/core/operators/result/node_orientations_Z.py @@ -0,0 +1,494 @@ +""" +node_orientations_Z + +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.operators.specification import PinSpecification, Specification +from ansys.dpf.core.config import Config +from ansys.dpf.core.server_types import AnyServerType + + +class node_orientations_Z(Operator): + r"""Read/compute node euler angles Z component of the vector (3rd component) + by calling the readers defined by the datasources. + + + Parameters + ---------- + time_scoping: Scoping or int or float or Field, optional + 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. + mesh_scoping: ScopingsContainer or Scoping, optional + 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 + fields_container: FieldsContainer, optional + FieldsContainer already allocated modified inplace + streams_container: 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 + bool_rotate_to_global: bool, optional + if true the field is rotated to global coordinate system (default true) + mesh: MeshedRegion or MeshesContainer, optional + prevents from reading the mesh in the result files + read_cyclic: int, optional + if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1) + + Returns + ------- + fields_container: FieldsContainer + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.result.node_orientations_Z() + + >>> # Make input connections + >>> my_time_scoping = dpf.Scoping() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> my_mesh_scoping = dpf.ScopingsContainer() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> my_fields_container = dpf.FieldsContainer() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> my_streams_container = dpf.StreamsContainer() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_bool_rotate_to_global = bool() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> my_mesh = dpf.MeshedRegion() + >>> op.inputs.mesh.connect(my_mesh) + >>> my_read_cyclic = int() + >>> op.inputs.read_cyclic.connect(my_read_cyclic) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.result.node_orientations_Z( + ... time_scoping=my_time_scoping, + ... mesh_scoping=my_mesh_scoping, + ... fields_container=my_fields_container, + ... streams_container=my_streams_container, + ... data_sources=my_data_sources, + ... bool_rotate_to_global=my_bool_rotate_to_global, + ... mesh=my_mesh, + ... read_cyclic=my_read_cyclic, + ... ) + + >>> # Get output data + >>> result_fields_container = op.outputs.fields_container() + """ + + def __init__( + self, + time_scoping=None, + mesh_scoping=None, + fields_container=None, + streams_container=None, + data_sources=None, + bool_rotate_to_global=None, + mesh=None, + read_cyclic=None, + config=None, + server=None, + ): + super().__init__(name="EUL_NODZ", config=config, server=server) + self._inputs = InputsNodeOrientationsZ(self) + self._outputs = OutputsNodeOrientationsZ(self) + if time_scoping is not None: + self.inputs.time_scoping.connect(time_scoping) + if mesh_scoping is not None: + self.inputs.mesh_scoping.connect(mesh_scoping) + if fields_container is not None: + self.inputs.fields_container.connect(fields_container) + if streams_container is not None: + self.inputs.streams_container.connect(streams_container) + if data_sources is not None: + self.inputs.data_sources.connect(data_sources) + if bool_rotate_to_global is not None: + self.inputs.bool_rotate_to_global.connect(bool_rotate_to_global) + if mesh is not None: + self.inputs.mesh.connect(mesh) + if read_cyclic is not None: + self.inputs.read_cyclic.connect(read_cyclic) + + @staticmethod + def _spec() -> Specification: + description = r"""Read/compute node euler angles Z component of the vector (3rd component) +by calling the readers defined by the datasources. +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 0: PinSpecification( + name="time_scoping", + type_names=[ + "scoping", + "int32", + "vector", + "double", + "field", + "vector", + ], + optional=True, + document=r"""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.""", + ), + 1: PinSpecification( + name="mesh_scoping", + type_names=["scopings_container", "scoping"], + optional=True, + document=r"""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""", + ), + 2: PinSpecification( + name="fields_container", + type_names=["fields_container"], + optional=True, + document=r"""FieldsContainer already allocated modified inplace""", + ), + 3: PinSpecification( + name="streams_container", + type_names=["streams_container"], + optional=True, + document=r"""result file container allowed to be kept open to cache data""", + ), + 4: PinSpecification( + name="data_sources", + type_names=["data_sources"], + optional=False, + document=r"""result file path container, used if no streams are set""", + ), + 5: PinSpecification( + name="bool_rotate_to_global", + type_names=["bool"], + optional=True, + document=r"""if true the field is rotated to global coordinate system (default true)""", + ), + 7: PinSpecification( + name="mesh", + type_names=["abstract_meshed_region", "meshes_container"], + optional=True, + document=r"""prevents from reading the mesh in the result files""", + ), + 14: PinSpecification( + name="read_cyclic", + type_names=["enum dataProcessing::ECyclicReading", "int32"], + optional=True, + document=r"""if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1)""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="fields_container", + type_names=["fields_container"], + optional=False, + document=r"""""", + ), + }, + ) + 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="EUL_NODZ", server=server) + + @property + def inputs(self) -> InputsNodeOrientationsZ: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsNodeOrientationsZ. + """ + return super().inputs + + @property + def outputs(self) -> OutputsNodeOrientationsZ: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsNodeOrientationsZ. + """ + return super().outputs + + +class InputsNodeOrientationsZ(_Inputs): + """Intermediate class used to connect user inputs to + node_orientations_Z operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> my_time_scoping = dpf.Scoping() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> my_mesh_scoping = dpf.ScopingsContainer() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> my_fields_container = dpf.FieldsContainer() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> my_streams_container = dpf.StreamsContainer() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> my_bool_rotate_to_global = bool() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> my_mesh = dpf.MeshedRegion() + >>> op.inputs.mesh.connect(my_mesh) + >>> my_read_cyclic = int() + >>> op.inputs.read_cyclic.connect(my_read_cyclic) + """ + + def __init__(self, op: Operator): + super().__init__(node_orientations_Z._spec().inputs, op) + self._time_scoping = Input(node_orientations_Z._spec().input_pin(0), 0, op, -1) + self._inputs.append(self._time_scoping) + self._mesh_scoping = Input(node_orientations_Z._spec().input_pin(1), 1, op, -1) + self._inputs.append(self._mesh_scoping) + self._fields_container = Input( + node_orientations_Z._spec().input_pin(2), 2, op, -1 + ) + self._inputs.append(self._fields_container) + self._streams_container = Input( + node_orientations_Z._spec().input_pin(3), 3, op, -1 + ) + self._inputs.append(self._streams_container) + self._data_sources = Input(node_orientations_Z._spec().input_pin(4), 4, op, -1) + self._inputs.append(self._data_sources) + self._bool_rotate_to_global = Input( + node_orientations_Z._spec().input_pin(5), 5, op, -1 + ) + self._inputs.append(self._bool_rotate_to_global) + self._mesh = Input(node_orientations_Z._spec().input_pin(7), 7, op, -1) + self._inputs.append(self._mesh) + self._read_cyclic = Input(node_orientations_Z._spec().input_pin(14), 14, op, -1) + self._inputs.append(self._read_cyclic) + + @property + def time_scoping(self) -> Input: + r"""Allows to connect time_scoping input to the operator. + + 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. + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> op.inputs.time_scoping.connect(my_time_scoping) + >>> # or + >>> op.inputs.time_scoping(my_time_scoping) + """ + return self._time_scoping + + @property + def mesh_scoping(self) -> Input: + r"""Allows to connect mesh_scoping input to the operator. + + 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 + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> op.inputs.mesh_scoping.connect(my_mesh_scoping) + >>> # or + >>> op.inputs.mesh_scoping(my_mesh_scoping) + """ + return self._mesh_scoping + + @property + def fields_container(self) -> Input: + r"""Allows to connect fields_container input to the operator. + + FieldsContainer already allocated modified inplace + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> op.inputs.fields_container.connect(my_fields_container) + >>> # or + >>> op.inputs.fields_container(my_fields_container) + """ + return self._fields_container + + @property + def streams_container(self) -> Input: + r"""Allows to connect streams_container input to the operator. + + result file container allowed to be kept open to cache data + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> op.inputs.streams_container.connect(my_streams_container) + >>> # or + >>> op.inputs.streams_container(my_streams_container) + """ + return self._streams_container + + @property + def data_sources(self) -> Input: + r"""Allows to connect data_sources input to the operator. + + result file path container, used if no streams are set + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> # or + >>> op.inputs.data_sources(my_data_sources) + """ + return self._data_sources + + @property + def bool_rotate_to_global(self) -> Input: + r"""Allows to connect bool_rotate_to_global input to the operator. + + if true the field is rotated to global coordinate system (default true) + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> op.inputs.bool_rotate_to_global.connect(my_bool_rotate_to_global) + >>> # or + >>> op.inputs.bool_rotate_to_global(my_bool_rotate_to_global) + """ + return self._bool_rotate_to_global + + @property + def mesh(self) -> Input: + r"""Allows to connect mesh input to the operator. + + prevents from reading the mesh in the result files + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> op.inputs.mesh.connect(my_mesh) + >>> # or + >>> op.inputs.mesh(my_mesh) + """ + return self._mesh + + @property + def read_cyclic(self) -> Input: + r"""Allows to connect read_cyclic input to the operator. + + if 0 cyclic symmetry is ignored, if 1 cyclic sector is read, if 2 cyclic expansion is done, if 3 cyclic expansion is done and stages are merged (default is 1) + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> op.inputs.read_cyclic.connect(my_read_cyclic) + >>> # or + >>> op.inputs.read_cyclic(my_read_cyclic) + """ + return self._read_cyclic + + +class OutputsNodeOrientationsZ(_Outputs): + """Intermediate class used to get outputs from + node_orientations_Z operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> # Connect inputs : op.inputs. ... + >>> result_fields_container = op.outputs.fields_container() + """ + + def __init__(self, op: Operator): + super().__init__(node_orientations_Z._spec().outputs, op) + self._fields_container = Output( + node_orientations_Z._spec().output_pin(0), 0, op + ) + self._outputs.append(self._fields_container) + + @property + def fields_container(self) -> Output: + r"""Allows to get fields_container output of the operator + + Returns + ------- + output: + An Output instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.node_orientations_Z() + >>> # Get the output from op.outputs. ... + >>> result_fields_container = op.outputs.fields_container() + """ + return self._fields_container diff --git a/src/ansys/dpf/core/result_info.py b/src/ansys/dpf/core/result_info.py index 336a571e0fb..f570e01e2ae 100644 --- a/src/ansys/dpf/core/result_info.py +++ b/src/ansys/dpf/core/result_info.py @@ -110,9 +110,9 @@ class ResultInfo: >>> model = dpf.Model(transient) >>> result_info = model.metadata.result_info # printable result_info - >>> result_info.available_results[0].name + >>> result_info.available_results[1].name 'displacement' - >>> result_info.available_results[0].homogeneity + >>> result_info.available_results[1].homogeneity 'length' """ diff --git a/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll b/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll index 0d4a92e04a1..57677223fd7 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 e8652de1098..2895578c98d 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 0888bb91ada..1628ccee1cb 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/tests/test_resultinfo.py b/tests/test_resultinfo.py index 449bfc385ee..419a9eba649 100644 --- a/tests/test_resultinfo.py +++ b/tests/test_resultinfo.py @@ -137,15 +137,15 @@ def test_byitem_resultinfo(model): assert res[0] is not None -def test_get_result_resultinfo_from_index(model): - res = model.metadata.result_info[2] - assert res.name == "acceleration" - assert res.n_components == 3 - assert res.dimensionality == "vector" - assert res.homogeneity == "acceleration" - assert res.unit == "m/s^2" - assert res.name == "acceleration" - assert res.qualifiers == [] +# def test_get_result_resultinfo_from_index(model): +# res = model.metadata.result_info[3] +# assert res.name == "acceleration" +# assert res.n_components == 3 +# assert res.dimensionality == "vector" +# assert res.homogeneity == "acceleration" +# assert res.unit == "m/s^2" +# assert res.name == "acceleration" +# assert res.qualifiers == [] def test_print_result_info(model):