Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for DPF 252_deep_copy2 on master #2023

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/ansys/dpf/core/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Collection(CollectionBase[TYPE]):

Parameters
----------
collection : ansys.grpc.dpf.collection_pb2.Collection or
collection : ansys.grpc.dpf.collection_message_pb2.Collection or
ansys.dpf.core.Collection, optional
Create a collection from a collection message or create a copy from an
existing collection. The default is ``None``.
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/collection_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class CollectionBase(Generic[TYPE]):

Parameters
----------
collection : ansys.grpc.dpf.collection_pb2.Collection, optional
collection : ansys.grpc.dpf.collection_message_pb2.Collection, optional
Collection to create from the collection message. The default is ``None``.
server : server.DPFServer, optional
Server with the channel connected to the remote or local instance. The
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/dpf/core/custom_fields_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ElShapeFieldsContainer(FieldsContainer):

Parameters
----------
fields_container : ansys.grpc.dpf.collection_pb2.Collection or FieldsContainer, optional
fields_container : ansys.grpc.dpf.collection_message_pb2.Collection or FieldsContainer, optional
Fields container created from either a collection message or by copying an existing
fields container. The default is ``None``.
server : server.DPFServer, optional
Expand Down Expand Up @@ -278,7 +278,7 @@ class BodyFieldsContainer(FieldsContainer):

Parameters
----------
fields_container : ansys.grpc.dpf.collection_pb2.Collection or FieldsContainer, optional
fields_container : ansys.grpc.dpf.collection_message_pb2.Collection or FieldsContainer, optional
Fields container created from either a collection message or by copying an existing
fields container. The default is ``None``.
server : server.DPFServer, optional
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/fields_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class FieldsContainer(CollectionBase[field.Field]):

Parameters
----------
fields_container : ansys.grpc.dpf.collection_pb2.Collection, ctypes.c_void_p,
fields_container : ansys.grpc.dpf.collection_message_pb2.Collection, ctypes.c_void_p,
FieldsContainer, optional
Fields container created from either a collection message or by copying an existing
fields container. The default is "None``.
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/meshes_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MeshesContainer(CollectionBase[meshed_region.MeshedRegion]):

Parameters
----------
meshes_container : ansys.grpc.dpf.collection_pb2.Collection or
meshes_container : ansys.grpc.dpf.collection_message_pb2.Collection or
ansys.dpf.core.MeshesContainer, optional
Create a meshes container from a collection message or create a copy from an
existing meshes container. The default is ``None``.
Expand Down
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
Loading