diff --git a/doc/source/_static/dpf_operators.html b/doc/source/_static/dpf_operators.html index 6da6e20b8c6..e5a1ee6d295 100644 --- a/doc/source/_static/dpf_operators.html +++ b/doc/source/_static/dpf_operators.html @@ -8384,7 +8384,283 @@

Configurating operators

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

geo: scoping normals

Description

compute the normals at the given nodes or element scoping based on the given mesh (first version, the element normal is only handled on the shell elements)

-
Version 0.0.0

Inputs

Outputs

Configurations

Scripting

Changelog

result: elastic strain principal 3

Description

Read/compute element nodal component elastic strains 3rd principal component by calling the readers defined by the datasources and computing its eigen values. +

Version 0.0.0

Inputs

Outputs

Configurations

Scripting

Changelog

info: Markdown LaTex example

Description

This operator showcases the use of Markdown and LaTeX in operator and pin descriptions:

+

Headings

+

h2

+

h3

+

h4

+
h5
+

Text

+

This should result in a paragraph +it's that simple.

+

italic, bold

+

Lists

+
    +
  • an unordered list
      +
    • with some hierarchy
        +
      1. and an ordered
      2. +
      3. mixed
      4. +
      +
        +
      • list
      • +
      • directly
      • +
      +
    • +
    • inside
    • +
    +
  • +
+

Code

+

Code block

+
std::string a = 'test';
+
+
var a = 'test';
+
+
a: str = 'test'
+
+

Inline code

+

And well inline code should also work.

+

Quotes

+
+

A Quote

+

With some text blocks inside

+
    +
  • even a list
  • +
  • should be
  • +
  • possible
  • +
+
+

Links

+

Links such as link.

+

Images

+

an image

+

Separations

+
+

Checklists

+
    +
  • how
  • +
  • about
      +
    • a
    • +
    • nice
    • +
    +
  • +
  • check
  • +
  • list
  • +
+

Tables

+ + + + + + + + + + + + + + + + + + + + +
Left headermiddle headerlast header
cell 1cell 2cell 3
cell 4cell 5cell 6
+

LaTeX

+

An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters.

+

An inline equation (x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.) using LaTeX parenthesis delimiters.

+

An equation on its own using dollar delimiters: +$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$

+

An equation on its own using square bracket delimiters: +[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.]

+
Version 0.0.0

Inputs

This pin showcases the use of Markdown and LaTeX in pin descriptions:

+

Headings

+

h2

+

h3

+

h4

+
h5
+

Text

+

This should result in a paragraph +it's that simple.

+

italic, bold

+

Lists

+
    +
  • an unordered list
      +
    • with some hierarchy
        +
      1. and an ordered
      2. +
      3. mixed
      4. +
      +
        +
      • list
      • +
      • directly
      • +
      +
    • +
    • inside
    • +
    +
  • +
+

Code

+

Code block

+
std::string a = 'test';
+
+
var a = 'test';
+
+
a: str = 'test'
+
+

Inline code

+

And well inline code should also work.

+

Quotes

+
+

A Quote

+

With some text blocks inside

+
    +
  • even a list
  • +
  • should be
  • +
  • possible
  • +
+
+

Links

+

Links such as link.

+

Images

+

an image

+

Separations

+
+

Checklists

+
    +
  • how
  • +
  • about
      +
    • a
    • +
    • nice
    • +
    +
  • +
  • check
  • +
  • list
  • +
+

Tables

+ + + + + + + + + + + + + + + + + + + + +
Left headermiddle headerlast header
cell 1cell 2cell 3
cell 4cell 5cell 6
+

LaTeX

+

An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters.

+

An inline equation (x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.) using LaTeX parenthesis delimiters.

+

An equation on its own using dollar delimiters: +$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$

+

An equation on its own using square bracket delimiters: +[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.]

+

Outputs

This pin showcases the use of Markdown and LaTeX in pin descriptions:

+

Headings

+

h2

+

h3

+

h4

+
h5
+

Text

+

This should result in a paragraph +it's that simple.

+

italic, bold

+

Lists

+
    +
  • an unordered list
      +
    • with some hierarchy
        +
      1. and an ordered
      2. +
      3. mixed
      4. +
      +
        +
      • list
      • +
      • directly
      • +
      +
    • +
    • inside
    • +
    +
  • +
+

Code

+

Code block

+
std::string a = 'test';
+
+
var a = 'test';
+
+
a: str = 'test'
+
+

Inline code

+

And well inline code should also work.

+

Quotes

+
+

A Quote

+

With some text blocks inside

+
    +
  • even a list
  • +
  • should be
  • +
  • possible
  • +
+
+

Links

+

Links such as link.

+

Images

+

an image

+

Separations

+
+

Checklists

+
    +
  • how
  • +
  • about
      +
    • a
    • +
    • nice
    • +
    +
  • +
  • check
  • +
  • list
  • +
+

Tables

+ + + + + + + + + + + + + + + + + + + + +
Left headermiddle headerlast header
cell 1cell 2cell 3
cell 4cell 5cell 6
+

LaTeX

+

An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters.

+

An inline equation (x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.) using LaTeX parenthesis delimiters.

+

An equation on its own using dollar delimiters: +$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$

+

An equation on its own using square bracket delimiters: +[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.]

+

Configurations

Scripting

Changelog

result: elastic strain principal 3

Description

Read/compute element nodal component elastic strains 3rd principal component by calling the readers defined by the datasources and computing its eigen values. This operation is independent of the coordinate system unless averaging across elements is requested, in which case a rotation to the global coordinate system is performed. The off-diagonal strains are first converted from Voigt notation to the standard strain values.

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

@@ -9499,7 +9775,7 @@

Configurating operators

if this pin is set to 0, the classical ERP is computed, 1 the corrected ERP is computed (a mesh of one face has to be given in the pin 1) and 2 the enhanced ERP is computed. Default is 0.

if this pin is set to true, the ERP level in dB is computed

erp reference value. Default is 1E-12

-

Outputs

Configurations

Scripting

Changelog

compression: quantization fields container

Description

Scales all the fields of a fields container to a given precision threshold, then rounds all the values to the unit.

+

Outputs

Configurations

Scripting

Changelog

compression: quantization (fields container)

Description

Scales all the fields of a fields container to a given precision threshold, then rounds all the values to the unit.

Version 0.0.0

Inputs

Fields container to be quantized.

Precision threshold desired. Case double : the threshold is applied on all the fields of the input fields container. @@ -14207,7 +14483,16 @@

Configurating operators

Version 0.0.0

Inputs

Vector or tensor field that must be rotated, expressed in global coordinate system.

Nodal euler angles defined from a result file. Those must be the rotations from Nodal to Global.

Outputs

Rotated field

-

Configurations

Scripting

Changelog

filter: low pass (timescoping)

Description

The low pass filter returns all the values below (but not equal to) the threshold value in input.

+

Configurations

Scripting

Changelog

averaging: elemental fraction (fields container)

Description

Transforms Elemental Nodal fields into Elemental fields. Each elemental value is the fraction between the elemental difference and the entity average. The result is computed on a given element's scoping.

+
Version 0.0.0

Inputs

The mesh region in this pin is used to perform the averaging. It is used if there is no fields support.

+

Average only on these elements. If it is a scoping container, the label must correspond to the one of the fields containers.

+

If a fields container is set in this pin, it is used as the denominator of the fraction instead of entity_average_fc.

+

If true, the data across different shell layers is averaged as well (default is false).

+

Outputs

Configurations

Scripting

Changelog

result: layer orientation provider

Description

Read the layer orientations.

+
Version 0.0.0

Inputs

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

+

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

+

Outputs

Requested data as FieldsContainer.

+

Configurations

Scripting

Changelog

filter: low pass (timescoping)

Description

The low pass filter returns all the values below (but not equal to) the threshold value in input.

Version 0.0.0

Inputs

a threshold scalar or a field containing one value is expected

The default is false. If set to true, the complement of the filtered fields container is returned on output pin 1.

Outputs

Configurations

Scripting

Changelog

scoping: rescope

Description

Rescopes a field on the given scoping. If an ID does not exist in the original field, the default value (in 2) is used when defined.

@@ -14671,22 +14956,17 @@

Configurating operators

if this pin is set to true, each field of the input fields container is defined by time freq scoping and not by ids. Default is false

Outputs

weighted data in dB units.

Configurations

Scripting

Changelog

mapping: solid to skin

Description

Maps a field defined on solid elements to a field defined on skin elements. Three cases are possible, based on the solid field data location; (i) Elemental: The values associated with the solid elements are copied according to those underlying the skin, (ii) Nodal: The solid field is rescoped with respect to the nodes of the skin mesh, (iii) ElementalNodal: The values are copied from the solid mesh to the skin mesh for each element face and the nodes associated with it.

-
Version 0.2.0

Inputs

field or fields container with only one field is expected

+
Version 0.2.1

Inputs

field or fields container with only one field is expected

skin mesh region expected

Solid mesh support (optional).

-

Outputs

Configurations

Scripting

Changelog

mapping: solid to skin fc

Description

Maps a fields container defined on solid elements to a fields container defined on skin elements. Three cases are possible, based on the solid field data location; (i) Elemental: The values associated with the solid elements are copied according to those underlying the skin, (ii) Nodal: The solid field is rescoped with respect to the nodes of the skin mesh, (iii) ElementalNodal: The values are copied from the solid mesh to the skin mesh for each element face and the nodes associated with it.

-
Version 0.2.0

Inputs

skin mesh region expected

+

Outputs

Configurations

Scripting

Changelog

mapping: solid to skin fc

Description

Maps a fields container defined on solid elements to a fields container defined on skin elements. Three cases are possible, based on the solid field data location; (i) Elemental: The values associated with the solid elements are copied according to those underlying the skin, (ii) Nodal: The solid field is rescoped with respect to the nodes of the skin mesh, (iii) ElementalNodal: The values are copied from the solid mesh to the skin mesh for each element face and the nodes associated with it.

+
Version 0.2.1

Inputs

skin mesh region expected

Solid mesh support (optional).

-

Outputs

Configurations

Scripting

Changelog

averaging: elemental difference (field)

Description

Transforms an Elemental Nodal or Nodal field into an Elemental field. Each elemental value is the maximum difference between the computed result for all nodes in this element. The result is computed on a given element scoping.

+

Outputs

Configurations

Scripting

Changelog

averaging: elemental difference (field)

Description

Transforms an Elemental Nodal or Nodal field into an Elemental field. Each elemental value is the maximum difference between the computed result for all nodes in this element. The result is computed on a given element scoping.

Version 0.0.0

Inputs

field or fields container with only one field is expected

average only on these entities

The maximum elemental difference is taken through the different shell layers if true (default is false).

-

Outputs

Configurations

Scripting

Changelog

averaging: elemental fraction (fields container)

Description

Transforms Elemental Nodal fields into Elemental fields. Each elemental value is the fraction between the elemental difference and the entity average. The result is computed on a given element's scoping.

-
Version 0.0.0

Inputs

The mesh region in this pin is used to perform the averaging. It is used if there is no fields support.

-

Average only on these elements. If it is a scoping container, the label must correspond to the one of the fields containers.

-

If a fields container is set in this pin, it is used as the denominator of the fraction instead of entity_average_fc.

-

If true, the data across different shell layers is averaged as well (default is false).

-

Outputs

Configurations

Scripting

Changelog

averaging: extend to mid nodes (fields container)

Description

Extends Elemental Nodal or Nodal fields defined on corner nodes to Elemental Nodal fields defined also on the mid nodes.

+

Outputs

Configurations

Scripting

Changelog

averaging: extend to mid nodes (fields container)

Description

Extends Elemental Nodal or Nodal fields defined on corner nodes to Elemental Nodal fields defined also on the mid nodes.

Version 0.0.0

Inputs

The mesh region in this pin is used to perform the averaging. It is used if there is no fields support.

Outputs

Configurations

Scripting

Changelog

geo: rotate cylindrical coordinates

Description

Rotates a field to its corresponding values into the specified cylindrical coordinate system (corresponding to the field position). If a coordinate system is not set in the coordinate_system pin, the field is rotated on each node following the local polar coordinate system.

Version 1.0.0

Inputs

field or fields container with only one field is expected

@@ -14794,9 +15074,9 @@

Configurating operators

expanded meshed region.

Orthonormalized mode shape transformation

Configurations

Scripting

Changelog

result: pres to field

Description

Read the presol generated file from mapdl.

-
Version 0.0.0

Inputs

filepath

+
Version 0.0.1

Inputs

filepath

columns_to_read

-

Outputs

Configurations

Scripting

Changelog

result: prns to field

Description

Read the presol of nodal field generated file from mapdl.

+

Outputs

Configurations

Scripting

Changelog

result: prns to field

Description

Read the presol of nodal field generated file from mapdl.

Version 0.0.0

Inputs

filepath

columns_to_read

Outputs

Configurations

Scripting

Changelog

result: remove rigid body motion (field)

Description

Removes rigid body mode from a total displacement field by minimization. Use a reference point in order to subtract its displacement to the result displacement field.

@@ -15368,7 +15648,7 @@

Configurating operators

average the elemental nodal result to the requested location (default is nodal).

if true, cyclic expansion is done. If false, it's ignored..

for multibody simulations, the stresses are averaged across bodies if true or not if false (default).

-

Outputs

Configurations

Scripting

Changelog

compression: quantization field

Description

Scales a field to a given precision threshold, then rounds all the values to the unit.

+

Outputs

Configurations

Scripting

Changelog

compression: quantization (field)

Description

Scales a field to a given precision threshold, then rounds all the values to the unit.

Version 0.0.0

Inputs

Field to quantize.

Precision threshold desired. Case double : the threshold is applied on all the input field. diff --git a/src/ansys/dpf/core/operators/__init__.py b/src/ansys/dpf/core/operators/__init__.py index 42ff1927792..d6cc6da1f45 100644 --- a/src/ansys/dpf/core/operators/__init__.py +++ b/src/ansys/dpf/core/operators/__init__.py @@ -2,6 +2,7 @@ from . import compression from . import filter from . import geo +from . import info from . import invariant from . import logic from . import mapping diff --git a/src/ansys/dpf/core/operators/info/__init__.py b/src/ansys/dpf/core/operators/info/__init__.py new file mode 100644 index 00000000000..c48c735b3a9 --- /dev/null +++ b/src/ansys/dpf/core/operators/info/__init__.py @@ -0,0 +1 @@ +from .markdown_latex_example import markdown_latex_example diff --git a/src/ansys/dpf/core/operators/info/markdown_latex_example.py b/src/ansys/dpf/core/operators/info/markdown_latex_example.py new file mode 100644 index 00000000000..8883471f600 --- /dev/null +++ b/src/ansys/dpf/core/operators/info/markdown_latex_example.py @@ -0,0 +1,950 @@ +""" +markdown_latex_example + +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 markdown_latex_example(Operator): + r"""This operator showcases the use of Markdown and LaTeX in operator and + pin descriptions: # Headings ## h2 ### h3 #### h4 ##### h5 + + Text + ==== + + This should result in a paragraph it’s that simple. + + *italic*, **bold** + + Lists + ===== + + - an *unordered list* + + - with **some hierarchy** + + 1. and an ordered + 2. mixed + + - list + - directly + + - inside + + Code + ==== + + Code block + ---------- + + .. code:: c + + std::string a = 'test'; + + .. code:: js + + var a = 'test'; + + .. code:: python + + a: str = 'test' + + Inline code + ----------- + + And well ``inline code`` should also work. + + Quotes + ====== + + A Quote + + With *some text* **blocks inside** + + - even a list + - should be + - possible + + Links + ----- + + Links such as `link `__. + + Images + ------ + + .. figure:: + https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png + :alt: an image + + an image + + Separations + ----------- + + -------------- + + Checklists + ---------- + + - ☐ how + - ☐ about + + - ☐ a + - ☒ nice + + - ☒ check + - ☐ list + + Tables + ------ + + =========== ============= =========== + Left header middle header last header + =========== ============= =========== + cell 1 cell **2** cell 3 + cell 4 cell 5 cell 6 + =========== ============= =========== + + LaTeX + ----- + + An inline equation :math:`x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.` using + LaTeX dollar delimiters. + + An inline equation (x = :raw-latex:`\frac{-b \pm \sqrt{b^2-4ac}}{2a}`.) + using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + + .. math:: x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}. + + An equation on its own using square bracket delimiters: [x = + :raw-latex:`\frac{-b \pm \sqrt{b^2-4ac}}{2a}`.] + + + Inputs + ------ + bogus_input: str, optional + This pin showcases the use of Markdown and LaTeX in pin descriptions: + # Headings + ## h2 + ### h3 + #### h4 + ##### h5 + + # Text + This should result in a paragraph + it's that simple. + + + *italic*, **bold** + + # Lists + * an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + + # Code + ## Code block + ```c + std::string a = 'test'; + ``` + ```js + var a = 'test'; + ``` + ```python + a: str = 'test' + ``` + ## Inline code + And well `inline code` should also work. + + # Quotes + + > A Quote + > + > With *some text* **blocks inside** + > + > * even a list + > * should be + > * possible + + ## Links + Links such as [link](https://docs.pyansys.com/). + + ## Images + ![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + + ## Separations + + --- + + ## Checklists + + - [ ] how + - [ ] about + - [ ] a + - [x] nice + - [x] check + - [ ] list + + ## Tables + + | Left header | middle header | last header | + |-------------|---------------|-------------| + | cell 1 | cell **2** | cell 3 | + | cell 4 | cell 5 | cell 6 | + + + ## LaTeX + + An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + + An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + + An equation on its own using square bracket delimiters: + \[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] + + + Outputs + ------- + bogus_output: + This pin showcases the use of Markdown and LaTeX in pin descriptions: + # Headings + ## h2 + ### h3 + #### h4 + ##### h5 + + # Text + This should result in a paragraph + it's that simple. + + + *italic*, **bold** + + # Lists + * an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + + # Code + ## Code block + ```c + std::string a = 'test'; + ``` + ```js + var a = 'test'; + ``` + ```python + a: str = 'test' + ``` + ## Inline code + And well `inline code` should also work. + + # Quotes + + > A Quote + > + > With *some text* **blocks inside** + > + > * even a list + > * should be + > * possible + + ## Links + Links such as [link](https://docs.pyansys.com/). + + ## Images + ![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + + ## Separations + + --- + + ## Checklists + + - [ ] how + - [ ] about + - [ ] a + - [x] nice + - [x] check + - [ ] list + + ## Tables + + | Left header | middle header | last header | + |-------------|---------------|-------------| + | cell 1 | cell **2** | cell 3 | + | cell 4 | cell 5 | cell 6 | + + + ## LaTeX + + An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + + An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + + An equation on its own using square bracket delimiters: + \[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] + + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.info.markdown_latex_example() + + >>> # Make input connections + >>> my_bogus_input = str() + >>> op.inputs.bogus_input.connect(my_bogus_input) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.info.markdown_latex_example( + ... bogus_input=my_bogus_input, + ... ) + + >>> # Get output data + >>> result_bogus_output = op.outputs.bogus_output() + """ + + _inputs: InputsMarkdownLatexExample + _outputs: OutputsMarkdownLatexExample + + def __init__(self, bogus_input=None, config=None, server=None): + super().__init__(name="markdown_latex_example", config=config, server=server) + self._inputs = InputsMarkdownLatexExample(self) + self._outputs = OutputsMarkdownLatexExample(self) + if bogus_input is not None: + self.inputs.bogus_input.connect(bogus_input) + + @staticmethod + def _spec() -> Specification: + description = r"""This operator showcases the use of Markdown and LaTeX in operator and +pin descriptions: # Headings ## h2 ### h3 #### h4 ##### h5 + +Text +==== + +This should result in a paragraph it’s that simple. + +*italic*, **bold** + +Lists +===== + +- an *unordered list* + + - with **some hierarchy** + + 1. and an ordered + 2. mixed + + - list + - directly + + - inside + +Code +==== + +Code block +---------- + +.. code:: c + + std::string a = 'test'; + +.. code:: js + + var a = 'test'; + +.. code:: python + + a: str = 'test' + +Inline code +----------- + +And well ``inline code`` should also work. + +Quotes +====== + + A Quote + + With *some text* **blocks inside** + + - even a list + - should be + - possible + +Links +----- + +Links such as `link `__. + +Images +------ + +.. figure:: + https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png + :alt: an image + + an image + +Separations +----------- + +-------------- + +Checklists +---------- + +- ☐ how +- ☐ about + + - ☐ a + - ☒ nice + +- ☒ check +- ☐ list + +Tables +------ + +=========== ============= =========== +Left header middle header last header +=========== ============= =========== +cell 1 cell **2** cell 3 +cell 4 cell 5 cell 6 +=========== ============= =========== + +LaTeX +----- + +An inline equation :math:`x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.` using +LaTeX dollar delimiters. + +An inline equation (x = :raw-latex:`\frac{-b \pm \sqrt{b^2-4ac}}{2a}`.) +using LaTeX parenthesis delimiters. + +An equation on its own using dollar delimiters: + +.. math:: x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}. + +An equation on its own using square bracket delimiters: [x = +:raw-latex:`\frac{-b \pm \sqrt{b^2-4ac}}{2a}`.] +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 0: PinSpecification( + name="bogus_input", + type_names=["string"], + optional=True, + document=r"""This pin showcases the use of Markdown and LaTeX in pin descriptions: +# Headings +## h2 +### h3 +#### h4 +##### h5 + +# Text +This should result in a paragraph +it's that simple. + + +*italic*, **bold** + +# Lists +* an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + +# Code +## Code block +```c +std::string a = 'test'; +``` +```js +var a = 'test'; +``` +```python +a: str = 'test' +``` +## Inline code +And well `inline code` should also work. + +# Quotes + +> A Quote +> +> With *some text* **blocks inside** +> +> * even a list +> * should be +> * possible + +## Links +Links such as [link](https://docs.pyansys.com/). + +## Images +![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + +## Separations + +--- + +## Checklists + +- [ ] how +- [ ] about + - [ ] a + - [x] nice +- [x] check +- [ ] list + +## Tables + +| Left header | middle header | last header | +|-------------|---------------|-------------| +| cell 1 | cell **2** | cell 3 | +| cell 4 | cell 5 | cell 6 | + + +## LaTeX + +An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + +An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + +An equation on its own using dollar delimiters: +$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + +An equation on its own using square bracket delimiters: +\[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] +""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="bogus_output", + optional=False, + document=r"""This pin showcases the use of Markdown and LaTeX in pin descriptions: +# Headings +## h2 +### h3 +#### h4 +##### h5 + +# Text +This should result in a paragraph +it's that simple. + + +*italic*, **bold** + +# Lists +* an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + +# Code +## Code block +```c +std::string a = 'test'; +``` +```js +var a = 'test'; +``` +```python +a: str = 'test' +``` +## Inline code +And well `inline code` should also work. + +# Quotes + +> A Quote +> +> With *some text* **blocks inside** +> +> * even a list +> * should be +> * possible + +## Links +Links such as [link](https://docs.pyansys.com/). + +## Images +![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + +## Separations + +--- + +## Checklists + +- [ ] how +- [ ] about + - [ ] a + - [x] nice +- [x] check +- [ ] list + +## Tables + +| Left header | middle header | last header | +|-------------|---------------|-------------| +| cell 1 | cell **2** | cell 3 | +| cell 4 | cell 5 | cell 6 | + + +## LaTeX + +An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + +An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + +An equation on its own using dollar delimiters: +$$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + +An equation on its own using square bracket delimiters: +\[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] +""", + ), + }, + ) + 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="markdown_latex_example", server=server) + + @property + def inputs(self) -> InputsMarkdownLatexExample: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsMarkdownLatexExample. + """ + return self._inputs + + @property + def outputs(self) -> OutputsMarkdownLatexExample: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsMarkdownLatexExample. + """ + return self._outputs + + +class InputsMarkdownLatexExample(_Inputs): + """Intermediate class used to connect user inputs to + markdown_latex_example operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.info.markdown_latex_example() + >>> my_bogus_input = str() + >>> op.inputs.bogus_input.connect(my_bogus_input) + """ + + def __init__(self, op: Operator): + super().__init__(markdown_latex_example._spec().inputs, op) + self._bogus_input = Input( + markdown_latex_example._spec().input_pin(0), 0, op, -1 + ) + self._inputs.append(self._bogus_input) + + @property + def bogus_input(self) -> Input: + r"""Allows to connect bogus_input input to the operator. + + This pin showcases the use of Markdown and LaTeX in pin descriptions: + # Headings + ## h2 + ### h3 + #### h4 + ##### h5 + + # Text + This should result in a paragraph + it's that simple. + + + *italic*, **bold** + + # Lists + * an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + + # Code + ## Code block + ```c + std::string a = 'test'; + ``` + ```js + var a = 'test'; + ``` + ```python + a: str = 'test' + ``` + ## Inline code + And well `inline code` should also work. + + # Quotes + + > A Quote + > + > With *some text* **blocks inside** + > + > * even a list + > * should be + > * possible + + ## Links + Links such as [link](https://docs.pyansys.com/). + + ## Images + ![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + + ## Separations + + --- + + ## Checklists + + - [ ] how + - [ ] about + - [ ] a + - [x] nice + - [x] check + - [ ] list + + ## Tables + + | Left header | middle header | last header | + |-------------|---------------|-------------| + | cell 1 | cell **2** | cell 3 | + | cell 4 | cell 5 | cell 6 | + + + ## LaTeX + + An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + + An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + + An equation on its own using square bracket delimiters: + \[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] + + + Returns + ------- + input: + An Input instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.info.markdown_latex_example() + >>> op.inputs.bogus_input.connect(my_bogus_input) + >>> # or + >>> op.inputs.bogus_input(my_bogus_input) + """ + return self._bogus_input + + +class OutputsMarkdownLatexExample(_Outputs): + """Intermediate class used to get outputs from + markdown_latex_example operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.info.markdown_latex_example() + >>> # Connect inputs : op.inputs. ... + >>> result_bogus_output = op.outputs.bogus_output() + """ + + def __init__(self, op: Operator): + super().__init__(markdown_latex_example._spec().outputs, op) + self._bogus_output = Output(markdown_latex_example._spec().output_pin(0), 0, op) + self._outputs.append(self._bogus_output) + + @property + def bogus_output(self) -> Output: + r"""Allows to get bogus_output output of the operator + + This pin showcases the use of Markdown and LaTeX in pin descriptions: + # Headings + ## h2 + ### h3 + #### h4 + ##### h5 + + # Text + This should result in a paragraph + it's that simple. + + + *italic*, **bold** + + # Lists + * an *unordered list* + * with **some hierarchy** + 1. and an ordered + 2. mixed + * list + * directly + * inside + + # Code + ## Code block + ```c + std::string a = 'test'; + ``` + ```js + var a = 'test'; + ``` + ```python + a: str = 'test' + ``` + ## Inline code + And well `inline code` should also work. + + # Quotes + + > A Quote + > + > With *some text* **blocks inside** + > + > * even a list + > * should be + > * possible + + ## Links + Links such as [link](https://docs.pyansys.com/). + + ## Images + ![an image](https://docs.pyansys.com/version/dev/_static/pyansys_logo_transparent_white.png) + + + ## Separations + + --- + + ## Checklists + + - [ ] how + - [ ] about + - [ ] a + - [x] nice + - [x] check + - [ ] list + + ## Tables + + | Left header | middle header | last header | + |-------------|---------------|-------------| + | cell 1 | cell **2** | cell 3 | + | cell 4 | cell 5 | cell 6 | + + + ## LaTeX + + An inline equation $x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$ using LaTeX dollar delimiters. + + An inline equation \(x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\) using LaTeX parenthesis delimiters. + + An equation on its own using dollar delimiters: + $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.$$ + + An equation on its own using square bracket delimiters: + \[x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.\] + + + Returns + ------- + output: + An Output instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.info.markdown_latex_example() + >>> # Get the output from op.outputs. ... + >>> result_bogus_output = op.outputs.bogus_output() + """ + return self._bogus_output diff --git a/src/ansys/dpf/core/operators/result/__init__.py b/src/ansys/dpf/core/operators/result/__init__.py index 90cd25dd985..5cae26b6e05 100644 --- a/src/ansys/dpf/core/operators/result/__init__.py +++ b/src/ansys/dpf/core/operators/result/__init__.py @@ -189,6 +189,7 @@ from .joint_relative_rotation import joint_relative_rotation from .joint_relative_velocity import joint_relative_velocity from .kinetic_energy import kinetic_energy +from .layer_orientation_provider import layer_orientation_provider from .mach_number import mach_number from .magnetic_field import magnetic_field from .magnetic_field_X import magnetic_field_X diff --git a/src/ansys/dpf/core/operators/result/layer_orientation_provider.py b/src/ansys/dpf/core/operators/result/layer_orientation_provider.py new file mode 100644 index 00000000000..6792af1c0d6 --- /dev/null +++ b/src/ansys/dpf/core/operators/result/layer_orientation_provider.py @@ -0,0 +1,251 @@ +""" +layer_orientation_provider + +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 layer_orientation_provider(Operator): + r"""Read the layer orientations. + + + Inputs + ------ + streams: StreamsContainer, optional + Result file container allowed to be kept open to cache data. + data_sources: DataSources + Result file path container, used if no streams are set. + + Outputs + ------- + layer_orientation_data: FieldsContainer + Requested data as FieldsContainer. + + Examples + -------- + >>> from ansys.dpf import core as dpf + + >>> # Instantiate operator + >>> op = dpf.operators.result.layer_orientation_provider() + + >>> # Make input connections + >>> my_streams = dpf.StreamsContainer() + >>> op.inputs.streams.connect(my_streams) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + + >>> # Instantiate operator and connect inputs in one line + >>> op = dpf.operators.result.layer_orientation_provider( + ... streams=my_streams, + ... data_sources=my_data_sources, + ... ) + + >>> # Get output data + >>> result_layer_orientation_data = op.outputs.layer_orientation_data() + """ + + _inputs: InputsLayerOrientationProvider + _outputs: OutputsLayerOrientationProvider + + def __init__(self, streams=None, data_sources=None, config=None, server=None): + super().__init__( + name="layer_orientation_provider", config=config, server=server + ) + self._inputs = InputsLayerOrientationProvider(self) + self._outputs = OutputsLayerOrientationProvider(self) + if streams is not None: + self.inputs.streams.connect(streams) + if data_sources is not None: + self.inputs.data_sources.connect(data_sources) + + @staticmethod + def _spec() -> Specification: + description = r"""Read the layer orientations. +""" + spec = Specification( + description=description, + map_input_pin_spec={ + 3: PinSpecification( + name="streams", + 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.""", + ), + }, + map_output_pin_spec={ + 0: PinSpecification( + name="layer_orientation_data", + type_names=["fields_container"], + optional=False, + document=r"""Requested data as FieldsContainer.""", + ), + }, + ) + 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="layer_orientation_provider", server=server) + + @property + def inputs(self) -> InputsLayerOrientationProvider: + """Enables to connect inputs to the operator + + Returns + -------- + inputs: + An instance of InputsLayerOrientationProvider. + """ + return self._inputs + + @property + def outputs(self) -> OutputsLayerOrientationProvider: + """Enables to get outputs of the operator by evaluating it + + Returns + -------- + outputs: + An instance of OutputsLayerOrientationProvider. + """ + return self._outputs + + +class InputsLayerOrientationProvider(_Inputs): + """Intermediate class used to connect user inputs to + layer_orientation_provider operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.layer_orientation_provider() + >>> my_streams = dpf.StreamsContainer() + >>> op.inputs.streams.connect(my_streams) + >>> my_data_sources = dpf.DataSources() + >>> op.inputs.data_sources.connect(my_data_sources) + """ + + def __init__(self, op: Operator): + super().__init__(layer_orientation_provider._spec().inputs, op) + self._streams = Input( + layer_orientation_provider._spec().input_pin(3), 3, op, -1 + ) + self._inputs.append(self._streams) + self._data_sources = Input( + layer_orientation_provider._spec().input_pin(4), 4, op, -1 + ) + self._inputs.append(self._data_sources) + + @property + def streams(self) -> Input: + r"""Allows to connect streams 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.layer_orientation_provider() + >>> op.inputs.streams.connect(my_streams) + >>> # or + >>> op.inputs.streams(my_streams) + """ + return self._streams + + @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.layer_orientation_provider() + >>> op.inputs.data_sources.connect(my_data_sources) + >>> # or + >>> op.inputs.data_sources(my_data_sources) + """ + return self._data_sources + + +class OutputsLayerOrientationProvider(_Outputs): + """Intermediate class used to get outputs from + layer_orientation_provider operator. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.layer_orientation_provider() + >>> # Connect inputs : op.inputs. ... + >>> result_layer_orientation_data = op.outputs.layer_orientation_data() + """ + + def __init__(self, op: Operator): + super().__init__(layer_orientation_provider._spec().outputs, op) + self._layer_orientation_data = Output( + layer_orientation_provider._spec().output_pin(0), 0, op + ) + self._outputs.append(self._layer_orientation_data) + + @property + def layer_orientation_data(self) -> Output: + r"""Allows to get layer_orientation_data output of the operator + + Requested data as FieldsContainer. + + Returns + ------- + output: + An Output instance for this pin. + + Examples + -------- + >>> from ansys.dpf import core as dpf + >>> op = dpf.operators.result.layer_orientation_provider() + >>> # Get the output from op.outputs. ... + >>> result_layer_orientation_data = op.outputs.layer_orientation_data() + """ + return self._layer_orientation_data diff --git a/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll b/src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll index 911fbf95bd6..42c8d93816c 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 d3676609e96..ac2b7d9ed86 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 4824b72ab43..4a3ccb4879c 100644 Binary files a/src/ansys/dpf/gatebin/libAns.Dpf.GrpcClient.so and b/src/ansys/dpf/gatebin/libAns.Dpf.GrpcClient.so differ