Skip to content

Commit

Permalink
update generated code (#1175)
Browse files Browse the repository at this point in the history
Co-authored-by: rlagha <rlagha@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and rlagha committed Oct 9, 2023
1 parent 2548df5 commit c1f205d
Show file tree
Hide file tree
Showing 56 changed files with 1,151 additions and 313 deletions.
10 changes: 5 additions & 5 deletions docs/source/_static/dpf_operators.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/ansys/dpf/core/operators/logic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
from .identical_fields import identical_fields
from .identical_meshes import identical_meshes
from .identical_property_fields import identical_property_fields
from .identical_string_fields import identical_string_fields
from .included_fields import included_fields
from .solid_shell_fields import solid_shell_fields
246 changes: 246 additions & 0 deletions src/ansys/dpf/core/operators/logic/identical_string_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
"""
identical_string_fields
=======================
Autogenerated DPF operator classes.
"""
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


class identical_string_fields(Operator):
"""Takes two string fields and compares them.
Parameters
----------
string_fieldA : StringField
string_fieldB : StringField
Examples
--------
>>> from ansys.dpf import core as dpf
>>> # Instantiate operator
>>> op = dpf.operators.logic.identical_string_fields()
>>> # Make input connections
>>> my_string_fieldA = dpf.StringField()
>>> op.inputs.string_fieldA.connect(my_string_fieldA)
>>> my_string_fieldB = dpf.StringField()
>>> op.inputs.string_fieldB.connect(my_string_fieldB)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.logic.identical_string_fields(
... string_fieldA=my_string_fieldA,
... string_fieldB=my_string_fieldB,
... )
>>> # Get output data
>>> result_are_identical = op.outputs.are_identical()
>>> result_information = op.outputs.information()
"""

def __init__(
self, string_fieldA=None, string_fieldB=None, config=None, server=None
):
super().__init__(name="compare::string_field", config=config, server=server)
self._inputs = InputsIdenticalStringFields(self)
self._outputs = OutputsIdenticalStringFields(self)
if string_fieldA is not None:
self.inputs.string_fieldA.connect(string_fieldA)
if string_fieldB is not None:
self.inputs.string_fieldB.connect(string_fieldB)

@staticmethod
def _spec():
description = """Takes two string fields and compares them."""
spec = Specification(
description=description,
map_input_pin_spec={
0: PinSpecification(
name="string_fieldA",
type_names=["string_field"],
optional=False,
document="""""",
),
1: PinSpecification(
name="string_fieldB",
type_names=["string_field"],
optional=False,
document="""""",
),
},
map_output_pin_spec={
0: PinSpecification(
name="are_identical",
type_names=["bool"],
optional=False,
document="""""",
),
1: PinSpecification(
name="information",
type_names=["string"],
optional=False,
document="""""",
),
},
)
return spec

@staticmethod
def default_config(server=None):
"""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.DPFServer, optional
Server with channel connected to the remote or local instance. When
``None``, attempts to use the global server.
"""
return Operator.default_config(name="compare::string_field", server=server)

@property
def inputs(self):
"""Enables to connect inputs to the operator
Returns
--------
inputs : InputsIdenticalStringFields
"""
return super().inputs

@property
def outputs(self):
"""Enables to get outputs of the operator by evaluating it
Returns
--------
outputs : OutputsIdenticalStringFields
"""
return super().outputs


class InputsIdenticalStringFields(_Inputs):
"""Intermediate class used to connect user inputs to
identical_string_fields operator.
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.logic.identical_string_fields()
>>> my_string_fieldA = dpf.StringField()
>>> op.inputs.string_fieldA.connect(my_string_fieldA)
>>> my_string_fieldB = dpf.StringField()
>>> op.inputs.string_fieldB.connect(my_string_fieldB)
"""

def __init__(self, op: Operator):
super().__init__(identical_string_fields._spec().inputs, op)
self._string_fieldA = Input(
identical_string_fields._spec().input_pin(0), 0, op, -1
)
self._inputs.append(self._string_fieldA)
self._string_fieldB = Input(
identical_string_fields._spec().input_pin(1), 1, op, -1
)
self._inputs.append(self._string_fieldB)

@property
def string_fieldA(self):
"""Allows to connect string_fieldA input to the operator.
Parameters
----------
my_string_fieldA : StringField
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.logic.identical_string_fields()
>>> op.inputs.string_fieldA.connect(my_string_fieldA)
>>> # or
>>> op.inputs.string_fieldA(my_string_fieldA)
"""
return self._string_fieldA

@property
def string_fieldB(self):
"""Allows to connect string_fieldB input to the operator.
Parameters
----------
my_string_fieldB : StringField
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.logic.identical_string_fields()
>>> op.inputs.string_fieldB.connect(my_string_fieldB)
>>> # or
>>> op.inputs.string_fieldB(my_string_fieldB)
"""
return self._string_fieldB


class OutputsIdenticalStringFields(_Outputs):
"""Intermediate class used to get outputs from
identical_string_fields operator.
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.logic.identical_string_fields()
>>> # Connect inputs : op.inputs. ...
>>> result_are_identical = op.outputs.are_identical()
>>> result_information = op.outputs.information()
"""

def __init__(self, op: Operator):
super().__init__(identical_string_fields._spec().outputs, op)
self._are_identical = Output(
identical_string_fields._spec().output_pin(0), 0, op
)
self._outputs.append(self._are_identical)
self._information = Output(identical_string_fields._spec().output_pin(1), 1, op)
self._outputs.append(self._information)

@property
def are_identical(self):
"""Allows to get are_identical output of the operator
Returns
----------
my_are_identical : bool
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.logic.identical_string_fields()
>>> # Connect inputs : op.inputs. ...
>>> result_are_identical = op.outputs.are_identical()
""" # noqa: E501
return self._are_identical

@property
def information(self):
"""Allows to get information output of the operator
Returns
----------
my_information : str
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.logic.identical_string_fields()
>>> # Connect inputs : op.inputs. ...
>>> result_information = op.outputs.information()
""" # noqa: E501
return self._information
13 changes: 8 additions & 5 deletions src/ansys/dpf/core/operators/mapping/find_reduced_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ class find_reduced_coordinates(Operator):
is set, it should be on the same
label spaces as the coordinates
fields container.
use_quadratic_elements : bool
use_quadratic_elements : bool, optional
If this pin is set to true, reduced
coordinates are computed on the
quadratic element if the element is
quadratic (default is false).
quadratic (more precise but less
performant). default is false.
Examples
Expand Down Expand Up @@ -110,11 +111,12 @@ def _spec():
200: PinSpecification(
name="use_quadratic_elements",
type_names=["bool"],
optional=False,
optional=True,
document="""If this pin is set to true, reduced
coordinates are computed on the
quadratic element if the element is
quadratic (default is false).""",
quadratic (more precise but less
performant). default is false.""",
),
},
map_output_pin_spec={
Expand Down Expand Up @@ -252,7 +254,8 @@ def use_quadratic_elements(self):
If this pin is set to true, reduced
coordinates are computed on the
quadratic element if the element is
quadratic (default is false).
quadratic (more precise but less
performant). default is false.
Parameters
----------
Expand Down
Loading

0 comments on commit c1f205d

Please sign in to comment.