Skip to content

Commit

Permalink
update generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
PProfizi authored and github-actions[bot] committed Jan 17, 2025
1 parent 404befa commit e2642c8
Show file tree
Hide file tree
Showing 27 changed files with 10,866 additions and 13 deletions.
14 changes: 7 additions & 7 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/ansys/dpf/core/operators/metadata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from .boundary_condition_provider import boundary_condition_provider
from .coordinate_system_data_provider import coordinate_system_data_provider
from .cyclic_mesh_expansion import cyclic_mesh_expansion
from .cyclic_support_provider import cyclic_support_provider
from .datasources_provider import datasources_provider
from .element_types_provider import element_types_provider
from .integrate_over_time_freq import integrate_over_time_freq
from .is_cyclic import is_cyclic
from .material_support_provider import material_support_provider
Expand All @@ -10,6 +12,7 @@
from .mesh_selection_manager_provider import mesh_selection_manager_provider
from .mesh_support_provider import mesh_support_provider
from .property_field_provider_by_name import property_field_provider_by_name
from .real_constants_provider import real_constants_provider
from .result_info_provider import result_info_provider
from .streams_provider import streams_provider
from .time_freq_provider import time_freq_provider
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,323 @@
"""
coordinate_system_data_provider
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 coordinate_system_data_provider(Operator):
"""Reads coordinate systems data from the result files contained in the
streams or data sources.
Parameters
----------
solver_coordinate_system_ids : int, optional
Coorfinate system ids to recover used by the
solver. if not set, all available
materials to be recovered.
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.
Returns
-------
coordinate_system_data1 : GenericDataContainer
coordinate_system_data2 : GenericDataContainer
Examples
--------
>>> from ansys.dpf import core as dpf
>>> # Instantiate operator
>>> op = dpf.operators.metadata.coordinate_system_data_provider()
>>> # Make input connections
>>> my_solver_coordinate_system_ids = int()
>>> op.inputs.solver_coordinate_system_ids.connect(my_solver_coordinate_system_ids)
>>> 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.metadata.coordinate_system_data_provider(
... solver_coordinate_system_ids=my_solver_coordinate_system_ids,
... streams=my_streams,
... data_sources=my_data_sources,
... )
>>> # Get output data
>>> result_coordinate_system_data1 = op.outputs.coordinate_system_data1()
>>> result_coordinate_system_data2 = op.outputs.coordinate_system_data2()
"""

def __init__(
self,
solver_coordinate_system_ids=None,
streams=None,
data_sources=None,
config=None,
server=None,
):
super().__init__(
name="coordinate_systems_data_provider", config=config, server=server
)
self._inputs = InputsCoordinateSystemDataProvider(self)
self._outputs = OutputsCoordinateSystemDataProvider(self)
if solver_coordinate_system_ids is not None:
self.inputs.solver_coordinate_system_ids.connect(
solver_coordinate_system_ids
)
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():
description = """Reads coordinate systems data from the result files contained in the
streams or data sources."""
spec = Specification(
description=description,
map_input_pin_spec={
1: PinSpecification(
name="solver_coordinate_system_ids",
type_names=["int32", "vector<int32>"],
optional=True,
document="""Coorfinate system ids to recover used by the
solver. if not set, all available
materials to be recovered.""",
),
3: PinSpecification(
name="streams",
type_names=["streams_container"],
optional=True,
document="""Result file container allowed to be kept open
to cache data.""",
),
4: PinSpecification(
name="data_sources",
type_names=["data_sources"],
optional=False,
document="""Result file path container, used if no
streams are set.""",
),
},
map_output_pin_spec={
0: PinSpecification(
name="coordinate_system_data1",
type_names=["generic_data_container"],
optional=False,
document="""""",
),
1: PinSpecification(
name="coordinate_system_data2",
type_names=["generic_data_container"],
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="coordinate_systems_data_provider", server=server
)

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

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


class InputsCoordinateSystemDataProvider(_Inputs):
"""Intermediate class used to connect user inputs to
coordinate_system_data_provider operator.
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.metadata.coordinate_system_data_provider()
>>> my_solver_coordinate_system_ids = int()
>>> op.inputs.solver_coordinate_system_ids.connect(my_solver_coordinate_system_ids)
>>> 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__(coordinate_system_data_provider._spec().inputs, op)
self._solver_coordinate_system_ids = Input(
coordinate_system_data_provider._spec().input_pin(1), 1, op, -1
)
self._inputs.append(self._solver_coordinate_system_ids)
self._streams = Input(
coordinate_system_data_provider._spec().input_pin(3), 3, op, -1
)
self._inputs.append(self._streams)
self._data_sources = Input(
coordinate_system_data_provider._spec().input_pin(4), 4, op, -1
)
self._inputs.append(self._data_sources)

@property
def solver_coordinate_system_ids(self):
"""Allows to connect solver_coordinate_system_ids input to the operator.
Coorfinate system ids to recover used by the
solver. if not set, all available
materials to be recovered.
Parameters
----------
my_solver_coordinate_system_ids : int
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.metadata.coordinate_system_data_provider()
>>> op.inputs.solver_coordinate_system_ids.connect(my_solver_coordinate_system_ids)
>>> # or
>>> op.inputs.solver_coordinate_system_ids(my_solver_coordinate_system_ids)
"""
return self._solver_coordinate_system_ids

@property
def streams(self):
"""Allows to connect streams input to the operator.
Result file container allowed to be kept open
to cache data.
Parameters
----------
my_streams : StreamsContainer
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.metadata.coordinate_system_data_provider()
>>> op.inputs.streams.connect(my_streams)
>>> # or
>>> op.inputs.streams(my_streams)
"""
return self._streams

@property
def data_sources(self):
"""Allows to connect data_sources input to the operator.
Result file path container, used if no
streams are set.
Parameters
----------
my_data_sources : DataSources
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.metadata.coordinate_system_data_provider()
>>> op.inputs.data_sources.connect(my_data_sources)
>>> # or
>>> op.inputs.data_sources(my_data_sources)
"""
return self._data_sources


class OutputsCoordinateSystemDataProvider(_Outputs):
"""Intermediate class used to get outputs from
coordinate_system_data_provider operator.
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.metadata.coordinate_system_data_provider()
>>> # Connect inputs : op.inputs. ...
>>> result_coordinate_system_data1 = op.outputs.coordinate_system_data1()
>>> result_coordinate_system_data2 = op.outputs.coordinate_system_data2()
"""

def __init__(self, op: Operator):
super().__init__(coordinate_system_data_provider._spec().outputs, op)
self._coordinate_system_data1 = Output(
coordinate_system_data_provider._spec().output_pin(0), 0, op
)
self._outputs.append(self._coordinate_system_data1)
self._coordinate_system_data2 = Output(
coordinate_system_data_provider._spec().output_pin(1), 1, op
)
self._outputs.append(self._coordinate_system_data2)

@property
def coordinate_system_data1(self):
"""Allows to get coordinate_system_data1 output of the operator
Returns
----------
my_coordinate_system_data1 : GenericDataContainer
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.metadata.coordinate_system_data_provider()
>>> # Connect inputs : op.inputs. ...
>>> result_coordinate_system_data1 = op.outputs.coordinate_system_data1()
""" # noqa: E501
return self._coordinate_system_data1

@property
def coordinate_system_data2(self):
"""Allows to get coordinate_system_data2 output of the operator
Returns
----------
my_coordinate_system_data2 : GenericDataContainer
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.metadata.coordinate_system_data_provider()
>>> # Connect inputs : op.inputs. ...
>>> result_coordinate_system_data2 = op.outputs.coordinate_system_data2()
""" # noqa: E501
return self._coordinate_system_data2
Loading

0 comments on commit e2642c8

Please sign in to comment.