Skip to content

Commit

Permalink
update generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
PProfizi committed Dec 8, 2023
1 parent 9cfd83b commit bf225b0
Show file tree
Hide file tree
Showing 15 changed files with 299 additions and 58 deletions.
11 changes: 6 additions & 5 deletions docs/source/_static/dpf_operators.html

Large diffs are not rendered by default.

45 changes: 42 additions & 3 deletions src/ansys/dpf/core/operators/mapping/solid_to_skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ class solid_to_skin(Operator):
field : Field or FieldsContainer
Field or fields container with only one field
is expected
mesh : MeshedRegion, optional
mesh : MeshedRegion
Skin mesh region expected
solid_mesh : MeshedRegion, optional
Solid mesh support (optional).
Examples
Expand All @@ -35,25 +37,32 @@ class solid_to_skin(Operator):
>>> op.inputs.field.connect(my_field)
>>> my_mesh = dpf.MeshedRegion()
>>> op.inputs.mesh.connect(my_mesh)
>>> my_solid_mesh = dpf.MeshedRegion()
>>> op.inputs.solid_mesh.connect(my_solid_mesh)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.mapping.solid_to_skin(
... field=my_field,
... mesh=my_mesh,
... solid_mesh=my_solid_mesh,
... )
>>> # Get output data
>>> result_field = op.outputs.field()
"""

def __init__(self, field=None, mesh=None, config=None, server=None):
def __init__(
self, field=None, mesh=None, solid_mesh=None, config=None, server=None
):
super().__init__(name="solid_to_skin", config=config, server=server)
self._inputs = InputsSolidToSkin(self)
self._outputs = OutputsSolidToSkin(self)
if field is not None:
self.inputs.field.connect(field)
if mesh is not None:
self.inputs.mesh.connect(mesh)
if solid_mesh is not None:
self.inputs.solid_mesh.connect(solid_mesh)

@staticmethod
def _spec():
Expand All @@ -72,9 +81,15 @@ def _spec():
1: PinSpecification(
name="mesh",
type_names=["abstract_meshed_region"],
optional=True,
optional=False,
document="""Skin mesh region expected""",
),
2: PinSpecification(
name="solid_mesh",
type_names=["abstract_meshed_region"],
optional=True,
document="""Solid mesh support (optional).""",
),
},
map_output_pin_spec={
0: PinSpecification(
Expand Down Expand Up @@ -136,6 +151,8 @@ class InputsSolidToSkin(_Inputs):
>>> op.inputs.field.connect(my_field)
>>> my_mesh = dpf.MeshedRegion()
>>> op.inputs.mesh.connect(my_mesh)
>>> my_solid_mesh = dpf.MeshedRegion()
>>> op.inputs.solid_mesh.connect(my_solid_mesh)
"""

def __init__(self, op: Operator):
Expand All @@ -144,6 +161,8 @@ def __init__(self, op: Operator):
self._inputs.append(self._field)
self._mesh = Input(solid_to_skin._spec().input_pin(1), 1, op, -1)
self._inputs.append(self._mesh)
self._solid_mesh = Input(solid_to_skin._spec().input_pin(2), 2, op, -1)
self._inputs.append(self._solid_mesh)

@property
def field(self):
Expand Down Expand Up @@ -186,6 +205,26 @@ def mesh(self):
"""
return self._mesh

@property
def solid_mesh(self):
"""Allows to connect solid_mesh input to the operator.
Solid mesh support (optional).
Parameters
----------
my_solid_mesh : MeshedRegion
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.mapping.solid_to_skin()
>>> op.inputs.solid_mesh.connect(my_solid_mesh)
>>> # or
>>> op.inputs.solid_mesh(my_solid_mesh)
"""
return self._solid_mesh


class OutputsSolidToSkin(_Outputs):
"""Intermediate class used to get outputs from
Expand Down
50 changes: 47 additions & 3 deletions src/ansys/dpf/core/operators/mapping/solid_to_skin_fc.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ class solid_to_skin_fc(Operator):
fields_container : FieldsContainer
Field or fields container with only one field
is expected
mesh : MeshedRegion, optional
mesh : MeshedRegion
Skin mesh region expected
solid_mesh : MeshedRegion, optional
Solid mesh support (optional).
Examples
Expand All @@ -35,25 +37,37 @@ class solid_to_skin_fc(Operator):
>>> op.inputs.fields_container.connect(my_fields_container)
>>> my_mesh = dpf.MeshedRegion()
>>> op.inputs.mesh.connect(my_mesh)
>>> my_solid_mesh = dpf.MeshedRegion()
>>> op.inputs.solid_mesh.connect(my_solid_mesh)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.mapping.solid_to_skin_fc(
... fields_container=my_fields_container,
... mesh=my_mesh,
... solid_mesh=my_solid_mesh,
... )
>>> # Get output data
>>> result_fields_container = op.outputs.fields_container()
"""

def __init__(self, fields_container=None, mesh=None, config=None, server=None):
def __init__(
self,
fields_container=None,
mesh=None,
solid_mesh=None,
config=None,
server=None,
):
super().__init__(name="solid_to_skin_fc", config=config, server=server)
self._inputs = InputsSolidToSkinFc(self)
self._outputs = OutputsSolidToSkinFc(self)
if fields_container is not None:
self.inputs.fields_container.connect(fields_container)
if mesh is not None:
self.inputs.mesh.connect(mesh)
if solid_mesh is not None:
self.inputs.solid_mesh.connect(solid_mesh)

@staticmethod
def _spec():
Expand All @@ -72,9 +86,15 @@ def _spec():
1: PinSpecification(
name="mesh",
type_names=["abstract_meshed_region"],
optional=True,
optional=False,
document="""Skin mesh region expected""",
),
2: PinSpecification(
name="solid_mesh",
type_names=["abstract_meshed_region"],
optional=True,
document="""Solid mesh support (optional).""",
),
},
map_output_pin_spec={
0: PinSpecification(
Expand Down Expand Up @@ -136,6 +156,8 @@ class InputsSolidToSkinFc(_Inputs):
>>> op.inputs.fields_container.connect(my_fields_container)
>>> my_mesh = dpf.MeshedRegion()
>>> op.inputs.mesh.connect(my_mesh)
>>> my_solid_mesh = dpf.MeshedRegion()
>>> op.inputs.solid_mesh.connect(my_solid_mesh)
"""

def __init__(self, op: Operator):
Expand All @@ -144,6 +166,8 @@ def __init__(self, op: Operator):
self._inputs.append(self._fields_container)
self._mesh = Input(solid_to_skin_fc._spec().input_pin(1), 1, op, -1)
self._inputs.append(self._mesh)
self._solid_mesh = Input(solid_to_skin_fc._spec().input_pin(2), 2, op, -1)
self._inputs.append(self._solid_mesh)

@property
def fields_container(self):
Expand Down Expand Up @@ -186,6 +210,26 @@ def mesh(self):
"""
return self._mesh

@property
def solid_mesh(self):
"""Allows to connect solid_mesh input to the operator.
Solid mesh support (optional).
Parameters
----------
my_solid_mesh : MeshedRegion
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.mapping.solid_to_skin_fc()
>>> op.inputs.solid_mesh.connect(my_solid_mesh)
>>> # or
>>> op.inputs.solid_mesh(my_solid_mesh)
"""
return self._solid_mesh


class OutputsSolidToSkinFc(_Outputs):
"""Intermediate class used to get outputs from
Expand Down
12 changes: 9 additions & 3 deletions src/ansys/dpf/core/operators/mesh/mesh_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class mesh_provider(Operator):
read and a workflow will be bounded
to the properties to be evaluated on
demand, with 0 they are read (default
is 0).
is 0). - "all_available_properties"
option set to 0 will return all
possible properties
Examples
Expand Down Expand Up @@ -181,7 +183,9 @@ def _spec():
read and a workflow will be bounded
to the properties to be evaluated on
demand, with 0 they are read (default
is 0).""",
is 0). - "all_available_properties"
option set to 0 will return all
possible properties""",
),
},
map_output_pin_spec={
Expand Down Expand Up @@ -398,7 +402,9 @@ def laziness(self):
read and a workflow will be bounded
to the properties to be evaluated on
demand, with 0 they are read (default
is 0).
is 0). - "all_available_properties"
option set to 0 will return all
possible properties
Parameters
----------
Expand Down
Loading

0 comments on commit bf225b0

Please sign in to comment.