Skip to content

Commit

Permalink
update generated code (#1745)
Browse files Browse the repository at this point in the history
Co-authored-by: rlagha <rlagha@users.noreply.github.com>
  • Loading branch information
pyansys-ci-bot and rlagha authored Sep 13, 2024
1 parent 8ff23bf commit a314cd0
Show file tree
Hide file tree
Showing 8 changed files with 174 additions and 92 deletions.
10 changes: 5 additions & 5 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions src/ansys/dpf/core/operators/utility/merge_meshes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class merge_meshes(Operator):
Parameters
----------
naive_merge_elements : bool, optional
If true, merge the elemental property fields
of the input meshes assuming that
there is no repetition in their
scoping ids. default is false.
should_merge_named_selections : bool, optional
For certain types of files (such as rst),
scoping from names selection does not
Expand Down Expand Up @@ -48,6 +53,8 @@ class merge_meshes(Operator):
>>> op = dpf.operators.utility.merge_meshes()
>>> # Make input connections
>>> my_naive_merge_elements = bool()
>>> op.inputs.naive_merge_elements.connect(my_naive_merge_elements)
>>> my_should_merge_named_selections = bool()
>>> op.inputs.should_merge_named_selections.connect(my_should_merge_named_selections)
>>> my_meshes1 = dpf.MeshedRegion()
Expand All @@ -63,6 +70,7 @@ class merge_meshes(Operator):
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.utility.merge_meshes(
... naive_merge_elements=my_naive_merge_elements,
... should_merge_named_selections=my_should_merge_named_selections,
... meshes1=my_meshes1,
... meshes2=my_meshes2,
Expand All @@ -77,6 +85,7 @@ class merge_meshes(Operator):

def __init__(
self,
naive_merge_elements=None,
should_merge_named_selections=None,
meshes1=None,
meshes2=None,
Expand All @@ -89,6 +98,8 @@ def __init__(
super().__init__(name="merge::mesh", config=config, server=server)
self._inputs = InputsMergeMeshes(self)
self._outputs = OutputsMergeMeshes(self)
if naive_merge_elements is not None:
self.inputs.naive_merge_elements.connect(naive_merge_elements)
if should_merge_named_selections is not None:
self.inputs.should_merge_named_selections.connect(
should_merge_named_selections
Expand All @@ -110,6 +121,15 @@ def _spec():
spec = Specification(
description=description,
map_input_pin_spec={
-201: PinSpecification(
name="naive_merge_elements",
type_names=["bool"],
optional=True,
document="""If true, merge the elemental property fields
of the input meshes assuming that
there is no repetition in their
scoping ids. default is false.""",
),
-200: PinSpecification(
name="should_merge_named_selections",
type_names=["bool"],
Expand Down Expand Up @@ -213,6 +233,8 @@ class InputsMergeMeshes(_Inputs):
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.utility.merge_meshes()
>>> my_naive_merge_elements = bool()
>>> op.inputs.naive_merge_elements.connect(my_naive_merge_elements)
>>> my_should_merge_named_selections = bool()
>>> op.inputs.should_merge_named_selections.connect(my_should_merge_named_selections)
>>> my_meshes1 = dpf.MeshedRegion()
Expand All @@ -229,6 +251,10 @@ class InputsMergeMeshes(_Inputs):

def __init__(self, op: Operator):
super().__init__(merge_meshes._spec().inputs, op)
self._naive_merge_elements = Input(
merge_meshes._spec().input_pin(-201), -201, op, -1
)
self._inputs.append(self._naive_merge_elements)
self._should_merge_named_selections = Input(
merge_meshes._spec().input_pin(-200), -200, op, -1
)
Expand All @@ -246,6 +272,29 @@ def __init__(self, op: Operator):
)
self._inputs.append(self._remove_duplicate_elements)

@property
def naive_merge_elements(self):
"""Allows to connect naive_merge_elements input to the operator.
If true, merge the elemental property fields
of the input meshes assuming that
there is no repetition in their
scoping ids. default is false.
Parameters
----------
my_naive_merge_elements : bool
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.utility.merge_meshes()
>>> op.inputs.naive_merge_elements.connect(my_naive_merge_elements)
>>> # or
>>> op.inputs.naive_merge_elements(my_naive_merge_elements)
"""
return self._naive_merge_elements

@property
def should_merge_named_selections(self):
"""Allows to connect should_merge_named_selections input to the operator.
Expand Down
125 changes: 85 additions & 40 deletions src/ansys/dpf/core/operators/utility/merge_property_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ class merge_property_fields(Operator):
Parameters
----------
vector_shared_ptr_property_field__1 : PropertyField or PropertyFieldsContainer
naive_merge : bool
If true, merge the input property fields
assuming that there is no repetition
in their scoping ids. default is
false.
property_fields1 : PropertyField or PropertyFieldsContainer
Either a property fields container, a vector
of property fields to merge or
property fields from pin 0 to ...
vector_shared_ptr_property_field__2 : PropertyField or PropertyFieldsContainer
property_fields2 : PropertyField or PropertyFieldsContainer
Either a property fields container, a vector
of property fields to merge or
property fields from pin 0 to ...
Expand All @@ -34,15 +39,18 @@ class merge_property_fields(Operator):
>>> op = dpf.operators.utility.merge_property_fields()
>>> # Make input connections
>>> my_vector_shared_ptr_property_field__1 = dpf.PropertyField()
>>> op.inputs.vector_shared_ptr_property_field__1.connect(my_vector_shared_ptr_property_field__1)
>>> my_vector_shared_ptr_property_field__2 = dpf.PropertyField()
>>> op.inputs.vector_shared_ptr_property_field__2.connect(my_vector_shared_ptr_property_field__2)
>>> my_naive_merge = bool()
>>> op.inputs.naive_merge.connect(my_naive_merge)
>>> my_property_fields1 = dpf.PropertyField()
>>> op.inputs.property_fields1.connect(my_property_fields1)
>>> my_property_fields2 = dpf.PropertyField()
>>> op.inputs.property_fields2.connect(my_property_fields2)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.utility.merge_property_fields(
... vector_shared_ptr_property_field__1=my_vector_shared_ptr_property_field__1,
... vector_shared_ptr_property_field__2=my_vector_shared_ptr_property_field__2,
... naive_merge=my_naive_merge,
... property_fields1=my_property_fields1,
... property_fields2=my_property_fields2,
... )
>>> # Get output data
Expand All @@ -51,39 +59,47 @@ class merge_property_fields(Operator):

def __init__(
self,
vector_shared_ptr_property_field__1=None,
vector_shared_ptr_property_field__2=None,
naive_merge=None,
property_fields1=None,
property_fields2=None,
config=None,
server=None,
):
super().__init__(name="merge::property_field", config=config, server=server)
self._inputs = InputsMergePropertyFields(self)
self._outputs = OutputsMergePropertyFields(self)
if vector_shared_ptr_property_field__1 is not None:
self.inputs.vector_shared_ptr_property_field__1.connect(
vector_shared_ptr_property_field__1
)
if vector_shared_ptr_property_field__2 is not None:
self.inputs.vector_shared_ptr_property_field__2.connect(
vector_shared_ptr_property_field__2
)
if naive_merge is not None:
self.inputs.naive_merge.connect(naive_merge)
if property_fields1 is not None:
self.inputs.property_fields1.connect(property_fields1)
if property_fields2 is not None:
self.inputs.property_fields2.connect(property_fields2)

@staticmethod
def _spec():
description = """Assembles a set of property fields into a unique one."""
spec = Specification(
description=description,
map_input_pin_spec={
-201: PinSpecification(
name="naive_merge",
type_names=["bool"],
optional=False,
document="""If true, merge the input property fields
assuming that there is no repetition
in their scoping ids. default is
false.""",
),
0: PinSpecification(
name="vector_shared_ptr_property_field__",
name="property_fields",
type_names=["property_field", "property_fields_container"],
optional=False,
document="""Either a property fields container, a vector
of property fields to merge or
property fields from pin 0 to ...""",
),
1: PinSpecification(
name="vector_shared_ptr_property_field__",
name="property_fields",
type_names=["property_field", "property_fields_container"],
optional=False,
document="""Either a property fields container, a vector
Expand Down Expand Up @@ -147,66 +163,95 @@ class InputsMergePropertyFields(_Inputs):
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.utility.merge_property_fields()
>>> my_vector_shared_ptr_property_field__1 = dpf.PropertyField()
>>> op.inputs.vector_shared_ptr_property_field__1.connect(my_vector_shared_ptr_property_field__1)
>>> my_vector_shared_ptr_property_field__2 = dpf.PropertyField()
>>> op.inputs.vector_shared_ptr_property_field__2.connect(my_vector_shared_ptr_property_field__2)
>>> my_naive_merge = bool()
>>> op.inputs.naive_merge.connect(my_naive_merge)
>>> my_property_fields1 = dpf.PropertyField()
>>> op.inputs.property_fields1.connect(my_property_fields1)
>>> my_property_fields2 = dpf.PropertyField()
>>> op.inputs.property_fields2.connect(my_property_fields2)
"""

def __init__(self, op: Operator):
super().__init__(merge_property_fields._spec().inputs, op)
self._vector_shared_ptr_property_field__1 = Input(
self._naive_merge = Input(
merge_property_fields._spec().input_pin(-201), -201, op, -1
)
self._inputs.append(self._naive_merge)
self._property_fields1 = Input(
merge_property_fields._spec().input_pin(0), 0, op, 0
)
self._inputs.append(self._vector_shared_ptr_property_field__1)
self._vector_shared_ptr_property_field__2 = Input(
self._inputs.append(self._property_fields1)
self._property_fields2 = Input(
merge_property_fields._spec().input_pin(1), 1, op, 1
)
self._inputs.append(self._vector_shared_ptr_property_field__2)
self._inputs.append(self._property_fields2)

@property
def naive_merge(self):
"""Allows to connect naive_merge input to the operator.
If true, merge the input property fields
assuming that there is no repetition
in their scoping ids. default is
false.
Parameters
----------
my_naive_merge : bool
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.utility.merge_property_fields()
>>> op.inputs.naive_merge.connect(my_naive_merge)
>>> # or
>>> op.inputs.naive_merge(my_naive_merge)
"""
return self._naive_merge

@property
def vector_shared_ptr_property_field__1(self):
"""Allows to connect vector_shared_ptr_property_field__1 input to the operator.
def property_fields1(self):
"""Allows to connect property_fields1 input to the operator.
Either a property fields container, a vector
of property fields to merge or
property fields from pin 0 to ...
Parameters
----------
my_vector_shared_ptr_property_field__1 : PropertyField or PropertyFieldsContainer
my_property_fields1 : PropertyField or PropertyFieldsContainer
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.utility.merge_property_fields()
>>> op.inputs.vector_shared_ptr_property_field__1.connect(my_vector_shared_ptr_property_field__1)
>>> op.inputs.property_fields1.connect(my_property_fields1)
>>> # or
>>> op.inputs.vector_shared_ptr_property_field__1(my_vector_shared_ptr_property_field__1)
>>> op.inputs.property_fields1(my_property_fields1)
"""
return self._vector_shared_ptr_property_field__1
return self._property_fields1

@property
def vector_shared_ptr_property_field__2(self):
"""Allows to connect vector_shared_ptr_property_field__2 input to the operator.
def property_fields2(self):
"""Allows to connect property_fields2 input to the operator.
Either a property fields container, a vector
of property fields to merge or
property fields from pin 0 to ...
Parameters
----------
my_vector_shared_ptr_property_field__2 : PropertyField or PropertyFieldsContainer
my_property_fields2 : PropertyField or PropertyFieldsContainer
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.utility.merge_property_fields()
>>> op.inputs.vector_shared_ptr_property_field__2.connect(my_vector_shared_ptr_property_field__2)
>>> op.inputs.property_fields2.connect(my_property_fields2)
>>> # or
>>> op.inputs.vector_shared_ptr_property_field__2(my_vector_shared_ptr_property_field__2)
>>> op.inputs.property_fields2(my_property_fields2)
"""
return self._vector_shared_ptr_property_field__2
return self._property_fields2


class OutputsMergePropertyFields(_Outputs):
Expand Down
Loading

0 comments on commit a314cd0

Please sign in to comment.