Skip to content

Commit 2a686e0

Browse files
PProfizigithub-actions[bot]
authored andcommitted
update generated code
1 parent 49920d5 commit 2a686e0

File tree

4 files changed

+61
-26
lines changed

4 files changed

+61
-26
lines changed

doc/source/_static/dpf_operators.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6185,7 +6185,8 @@ <h2 class="h2-main">Configurating operators</h2>
61856185
</div></figure><div class="op-version">Version 0.0.0</div><h2 class="op-des-h2">Supported file types</h2><supported-file-types content='{"mapdl":["rst","rth","rstp"]}'></supported-file-types><h2 class="op-des-h2">Inputs</h2><div><table class="pin-box"><tbody><tr><td><pin-number-optional n="1" ellipsis = "false"></pin-number-optional></td><td><pin-name name="solver_element_types_ids"></pin-name></td><td><req-type typeName="(int32 | vector<int32>)"></req-type></td><td><div class = "pin-des-text"><p>Element Type ids to recover used by the solver. If not set, all available element types to be recovered.</p>
61866186
</div></td></tr></tbody></table><table class="pin-box"><tbody><tr><td><pin-number-optional n="3" ellipsis = "false"></pin-number-optional></td><td><pin-name name="streams"></pin-name></td><td><req-type typeName="(streams_container)"></req-type></td><td><div class = "pin-des-text"><p>Result file container allowed to be kept open to cache data.</p>
61876187
</div></td></tr></tbody></table><table class="pin-box"><tbody><tr><td><pin-number n="4" ellipsis = "false"></pin-number></td><td><pin-name name="data_sources"></pin-name></td><td><req-type typeName="(data_sources)"></req-type></td><td><div class = "pin-des-text"><p>Result file path container, used if no streams are set.</p>
6188-
</div></td></tr></tbody></table></div><h2 class="op-des-h2">Outputs</h2><div><table class="pin-box"><tbody><tr><td><pin-number n="0" ellipsis = "false"></pin-number></td><td><pin-name name="element_types_data"></pin-name></td><td><req-type typeName="(generic_data_container)"></req-type></td><td><div class = "pin-des-text"><p>The generic_data_container has a class_name: ElementTypesProperties. It contains the following property fields: element_routine_number: Element routine number. E.g 186 for SOLID186, keyopts: Element type option keys, kdofs: DOF/node for this element type.This is a bit mapping, nodelm: Number of nodes for this element type, nodfor: Number of nodes per element having nodal forces, nodstr: Number of nodes per element having nodal stresses, new_gen_element: Element of new generation.</p>
6188+
</div></td></tr></tbody></table><table class="pin-box"><tbody><tr><td><pin-number-optional n="200" ellipsis = "false"></pin-number-optional></td><td><pin-name name="output_type"></pin-name></td><td><req-type typeName="(int32)"></req-type></td><td><div class = "pin-des-text"><p>Get the output as a GenericDataContainer (pin value 1, default) or as a PropertyField (pin value 2). If a PropertyField is recovered, the 200 ElementTypesProperties are recovered for each element type, in order.</p>
6189+
</div></td></tr></tbody></table></div><h2 class="op-des-h2">Outputs</h2><div><table class="pin-box"><tbody><tr><td><pin-number n="0" ellipsis = "false"></pin-number></td><td><pin-name name="element_types_data"></pin-name></td><td><req-type typeName="(generic_data_container | property_field)"></req-type></td><td><div class = "pin-des-text"><p>The generic_data_container has a class_name: ElementTypesProperties. It contains the following property fields: element_routine_number: Element routine number. E.g 186 for SOLID186, keyopts: Element type option keys, kdofs: DOF/node for this element type.This is a bit mapping, nodelm: Number of nodes for this element type, nodfor: Number of nodes per element having nodal forces, nodstr: Number of nodes per element having nodal stresses, new_gen_element: Element of new generation.</p>
61896190
</div></td></tr></tbody></table></div><h2 class="op-des-h2">Configurations</h2><config-spec name="mutex" default="false" doc="If this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads." types="bool" ></config-spec><config-spec name="num_threads" default="0" doc="Number of threads to use to run in parallel" types="int32" ></config-spec><config-spec name="run_in_parallel" default="true" doc="Loops are allowed to run in parallel if the value of this config is set to true." types="bool" ></config-spec><h2 class="op-des-h2">Scripting</h2><scripting-part scripting_name="element_types_provider" license="none" cat="metadata" plugin="core" cpp-name="element_types_provider"></scripting-part><h2 class="op-des-h2">Changelog</h2><op-changelog content='{"0.0.0":"New"}'></op-changelog></div><div class="operator" id="delegate to operator" scripting_name="delegate_to_operator"plugin="core"cat="utility"><h1 class="op-des-h1">utility: delegate to operator</h1><figure class="figure-op-des"> <figcaption > Description </figcaption><div class = "figure-op-des-text"><p>Delegate the run to an Operator instantiated by the name in input (forwards all the input of this Operator to the sub Operator).</p>
61906191
</div></figure><div class="op-version">Version 0.0.0</div><h2 class="op-des-h2">Inputs</h2><div><table class="pin-box"><tbody><tr><td><pin-number n="-1" ellipsis = "false"></pin-number></td><td><pin-name name="operator_name"></pin-name></td><td><req-type typeName="(string)"></req-type></td></tr></tbody></table></div><h2 class="op-des-h2">Outputs</h2><div><table class="pin-box"><tbody><tr><td><pin-number n="0" ellipsis = "true"></pin-number></td><td><pin-name name="any"></pin-name></td><td><req-type typeName="(any)"></req-type></td><td><div class = "pin-des-text"><p>inputs</p>
61916192
</div></td></tr></tbody></table></div><h2 class="op-des-h2">Configurations</h2><config-spec name="mutex" default="false" doc="If this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads." types="bool" ></config-spec><h2 class="op-des-h2">Scripting</h2><scripting-part scripting_name="delegate_to_operator" license="none" cat="utility" plugin="core" cpp-name="delegate_to_operator"></scripting-part><h2 class="op-des-h2">Changelog</h2><op-changelog content='{"0.0.0":"New"}'></op-changelog></div><div class="operator" id="acceleration Y" scripting_name="acceleration_Y"plugin="core"cat="result"><h1 class="op-des-h1">result: acceleration Y</h1><figure class="figure-op-des"> <figcaption > Description </figcaption><div class = "figure-op-des-text"><p>Read/compute nodal accelerations Y component of the vector (2nd component) by calling the readers defined by the datasources.</p>

src/ansys/dpf/core/operators/metadata/element_types_provider.py

Lines changed: 59 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from ansys.dpf.core.dpf_operator import Operator
1111
from ansys.dpf.core.inputs import Input, _Inputs
1212
from ansys.dpf.core.outputs import Output, _Outputs
13+
from ansys.dpf.core.outputs import _modify_output_spec_with_one_type
1314
from ansys.dpf.core.operators.specification import PinSpecification, Specification
1415
from ansys.dpf.core.config import Config
1516
from ansys.dpf.core.server_types import AnyServerType
@@ -28,10 +29,12 @@ class element_types_provider(Operator):
2829
Result file container allowed to be kept open to cache data.
2930
data_sources: DataSources
3031
Result file path container, used if no streams are set.
32+
output_type: int, optional
33+
Get the output as a GenericDataContainer (pin value 1, default) or as a PropertyField (pin value 2). If a PropertyField is recovered, the 200 ElementTypesProperties are recovered for each element type, in order.
3134
3235
Returns
3336
-------
34-
element_types_data: GenericDataContainer
37+
element_types_data: GenericDataContainer or PropertyField
3538
The generic_data_container has a class_name: ElementTypesProperties. It contains the following property fields: element_routine_number: Element routine number. E.g 186 for SOLID186, keyopts: Element type option keys, kdofs: DOF/node for this element type.This is a bit mapping, nodelm: Number of nodes for this element type, nodfor: Number of nodes per element having nodal forces, nodstr: Number of nodes per element having nodal stresses, new_gen_element: Element of new generation.
3639
3740
Examples
@@ -48,12 +51,15 @@ class element_types_provider(Operator):
4851
>>> op.inputs.streams.connect(my_streams)
4952
>>> my_data_sources = dpf.DataSources()
5053
>>> op.inputs.data_sources.connect(my_data_sources)
54+
>>> my_output_type = int()
55+
>>> op.inputs.output_type.connect(my_output_type)
5156
5257
>>> # Instantiate operator and connect inputs in one line
5358
>>> op = dpf.operators.metadata.element_types_provider(
5459
... solver_element_types_ids=my_solver_element_types_ids,
5560
... streams=my_streams,
5661
... data_sources=my_data_sources,
62+
... output_type=my_output_type,
5763
... )
5864
5965
>>> # Get output data
@@ -65,6 +71,7 @@ def __init__(
6571
solver_element_types_ids=None,
6672
streams=None,
6773
data_sources=None,
74+
output_type=None,
6875
config=None,
6976
server=None,
7077
):
@@ -77,6 +84,8 @@ def __init__(
7784
self.inputs.streams.connect(streams)
7885
if data_sources is not None:
7986
self.inputs.data_sources.connect(data_sources)
87+
if output_type is not None:
88+
self.inputs.output_type.connect(output_type)
8089

8190
@staticmethod
8291
def _spec() -> Specification:
@@ -104,11 +113,17 @@ def _spec() -> Specification:
104113
optional=False,
105114
document=r"""Result file path container, used if no streams are set.""",
106115
),
116+
200: PinSpecification(
117+
name="output_type",
118+
type_names=["int32"],
119+
optional=True,
120+
document=r"""Get the output as a GenericDataContainer (pin value 1, default) or as a PropertyField (pin value 2). If a PropertyField is recovered, the 200 ElementTypesProperties are recovered for each element type, in order.""",
121+
),
107122
},
108123
map_output_pin_spec={
109124
0: PinSpecification(
110125
name="element_types_data",
111-
type_names=["generic_data_container"],
126+
type_names=["generic_data_container", "property_field"],
112127
optional=False,
113128
document=r"""The generic_data_container has a class_name: ElementTypesProperties. It contains the following property fields: element_routine_number: Element routine number. E.g 186 for SOLID186, keyopts: Element type option keys, kdofs: DOF/node for this element type.This is a bit mapping, nodelm: Number of nodes for this element type, nodfor: Number of nodes per element having nodal forces, nodstr: Number of nodes per element having nodal stresses, new_gen_element: Element of new generation.""",
114129
),
@@ -174,6 +189,8 @@ class InputsElementTypesProvider(_Inputs):
174189
>>> op.inputs.streams.connect(my_streams)
175190
>>> my_data_sources = dpf.DataSources()
176191
>>> op.inputs.data_sources.connect(my_data_sources)
192+
>>> my_output_type = int()
193+
>>> op.inputs.output_type.connect(my_output_type)
177194
"""
178195

179196
def __init__(self, op: Operator):
@@ -188,6 +205,10 @@ def __init__(self, op: Operator):
188205
element_types_provider._spec().input_pin(4), 4, op, -1
189206
)
190207
self._inputs.append(self._data_sources)
208+
self._output_type = Input(
209+
element_types_provider._spec().input_pin(200), 200, op, -1
210+
)
211+
self._inputs.append(self._output_type)
191212

192213
@property
193214
def solver_element_types_ids(self) -> Input:
@@ -252,6 +273,27 @@ def data_sources(self) -> Input:
252273
"""
253274
return self._data_sources
254275

276+
@property
277+
def output_type(self) -> Input:
278+
r"""Allows to connect output_type input to the operator.
279+
280+
Get the output as a GenericDataContainer (pin value 1, default) or as a PropertyField (pin value 2). If a PropertyField is recovered, the 200 ElementTypesProperties are recovered for each element type, in order.
281+
282+
Returns
283+
-------
284+
input:
285+
An Input instance for this pin.
286+
287+
Examples
288+
--------
289+
>>> from ansys.dpf import core as dpf
290+
>>> op = dpf.operators.metadata.element_types_provider()
291+
>>> op.inputs.output_type.connect(my_output_type)
292+
>>> # or
293+
>>> op.inputs.output_type(my_output_type)
294+
"""
295+
return self._output_type
296+
255297

256298
class OutputsElementTypesProvider(_Outputs):
257299
"""Intermediate class used to get outputs from
@@ -267,27 +309,19 @@ class OutputsElementTypesProvider(_Outputs):
267309

268310
def __init__(self, op: Operator):
269311
super().__init__(element_types_provider._spec().outputs, op)
270-
self._element_types_data = Output(
271-
element_types_provider._spec().output_pin(0), 0, op
312+
self.element_types_data_as_generic_data_container = Output(
313+
_modify_output_spec_with_one_type(
314+
element_types_provider._spec().output_pin(0), "generic_data_container"
315+
),
316+
0,
317+
op,
272318
)
273-
self._outputs.append(self._element_types_data)
274-
275-
@property
276-
def element_types_data(self) -> Output:
277-
r"""Allows to get element_types_data output of the operator
278-
279-
The generic_data_container has a class_name: ElementTypesProperties. It contains the following property fields: element_routine_number: Element routine number. E.g 186 for SOLID186, keyopts: Element type option keys, kdofs: DOF/node for this element type.This is a bit mapping, nodelm: Number of nodes for this element type, nodfor: Number of nodes per element having nodal forces, nodstr: Number of nodes per element having nodal stresses, new_gen_element: Element of new generation.
280-
281-
Returns
282-
-------
283-
output:
284-
An Output instance for this pin.
285-
286-
Examples
287-
--------
288-
>>> from ansys.dpf import core as dpf
289-
>>> op = dpf.operators.metadata.element_types_provider()
290-
>>> # Get the output from op.outputs. ...
291-
>>> result_element_types_data = op.outputs.element_types_data()
292-
"""
293-
return self._element_types_data
319+
self._outputs.append(self.element_types_data_as_generic_data_container)
320+
self.element_types_data_as_property_field = Output(
321+
_modify_output_spec_with_one_type(
322+
element_types_provider._spec().output_pin(0), "property_field"
323+
),
324+
0,
325+
op,
326+
)
327+
self._outputs.append(self.element_types_data_as_property_field)
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)