Skip to content

Commit cf7e292

Browse files
Update generated code for DPF 261_daily on master (#2306)
Co-authored-by: PProfizi <[email protected]>
1 parent 154a460 commit cf7e292

15 files changed

+271
-149
lines changed

doc/source/_static/dpf_operators.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8108,7 +8108,10 @@ <h2 class="h2-main">Configurating operators</h2>
81088108
</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_container"></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>
81098109
</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>
81108110
</div></td></tr></tbody></table><table class="pin-box"><tbody><tr><td><pin-number-optional n="50" ellipsis = "false"></pin-number-optional></td><td><pin-name name="unit_system"></pin-name></td><td><req-type typeName="(int32 | string | class dataProcessing::unit::CUnitSystem)"></req-type></td><td><div class = "pin-des-text"><p>Unit System ID (int), semicolon-separated list of base unit strings (str) or UnitSystem instance</p>
8111-
</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="fields_container"></pin-name></td><td><req-type typeName="(fields_container)"></req-type></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="beam_s_bending_moment" license="none" cat="result" plugin="core" cpp-name="B_M1"></scripting-part></div><div class="operator" id="beam RS shear stress (LSDyna)" scripting_name="beam_rs_shear_stress"plugin="core"cat="result"><h1 class="op-des-h1">result: beam RS shear stress (LSDyna)</h1><figure class="figure-op-des"> <figcaption > Description </figcaption><div class = "figure-op-des-text"><p>Read Beam RS Shear Stress (LSDyna) by calling the readers defined by the datasources.</p>
8111+
</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="fields_container"></pin-name></td><td><req-type typeName="(fields_container)"></req-type></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="beam_s_bending_moment" license="none" cat="result" plugin="core" cpp-name="B_M1"></scripting-part></div><div class="operator" id="operator changelog" scripting_name="operator_changelog"plugin="core"cat="utility"><h1 class="op-des-h1">utility: operator changelog</h1><figure class="figure-op-des"> <figcaption > Description </figcaption><div class = "figure-op-des-text"><p>Return a GenericDataContainer used to instantiate the Changelog of an operator based on its name.</p>
8112+
</div></figure><h2 class="op-des-h2">Inputs</h2><div><table class="pin-box"><tbody><tr><td><pin-number n="0" ellipsis = "false"></pin-number></td><td><pin-name name="operator_name"></pin-name></td><td><req-type typeName="(string)"></req-type></td><td><div class = "pin-des-text"><p>Operator internal name.</p>
8113+
</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="changelog_gdc"></pin-name></td><td><req-type typeName="(generic_data_container)"></req-type></td><td><div class = "pin-des-text"><p>GenericDataContainer used to instantiate a Changelog.</p>
8114+
</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="operator_changelog" license="none" cat="utility" plugin="core" cpp-name="operator_changelog"></scripting-part></div><div class="operator" id="beam RS shear stress (LSDyna)" scripting_name="beam_rs_shear_stress"plugin="core"cat="result"><h1 class="op-des-h1">result: beam RS shear stress (LSDyna)</h1><figure class="figure-op-des"> <figcaption > Description </figcaption><div class = "figure-op-des-text"><p>Read Beam RS Shear Stress (LSDyna) by calling the readers defined by the datasources.</p>
81128115
</div></figure><h2 class="op-des-h2">Inputs</h2><div><table class="pin-box"><tbody><tr><td><pin-number-optional n="0" ellipsis = "false"></pin-number-optional></td><td><pin-name name="time_scoping"></pin-name></td><td><req-type typeName="(scoping | int32 | vector<int32> | double | field | vector<double>)"></req-type></td><td><div class = "pin-des-text"><p>time/freq values (use doubles or field), time/freq set ids (use ints or scoping) or time/freq step ids (use scoping with TimeFreq_steps location) required in output. To specify time/freq values at specific load steps, put a Field (and not a list) in input with a scoping located on &quot;TimeFreq_steps&quot;. Linear time freq intrapolation is performed if the values are not in the result files and the data at the max time or freq is taken when time/freqs are higher than available time/freqs in result files. To get all data for all time/freq sets, connect an int with value -1.</p>
81138116
</div></td></tr></tbody></table><table class="pin-box"><tbody><tr><td><pin-number-optional n="1" ellipsis = "false"></pin-number-optional></td><td><pin-name name="mesh_scoping"></pin-name></td><td><req-type typeName="(scopings_container | scoping)"></req-type></td><td><div class = "pin-des-text"><p>elements scoping required in output.</p>
81148117
</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_container"></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>

src/ansys/dpf/core/operators/utility/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
from .mesh import mesh
6060
from .mesh_to_mc import mesh_to_mc
6161
from .meshes_container import meshes_container
62+
from .operator_changelog import operator_changelog
6263
from .operator_id import operator_id
6364
from .overlap_fields import overlap_fields
6465
from .producer_consumer_for_each import producer_consumer_for_each
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
"""
2+
operator_changelog
3+
4+
Autogenerated DPF operator classes.
5+
"""
6+
7+
from __future__ import annotations
8+
9+
from warnings import warn
10+
from ansys.dpf.core.dpf_operator import Operator
11+
from ansys.dpf.core.inputs import Input, _Inputs
12+
from ansys.dpf.core.outputs import Output, _Outputs
13+
from ansys.dpf.core.operators.specification import PinSpecification, Specification
14+
from ansys.dpf.core.config import Config
15+
from ansys.dpf.core.server_types import AnyServerType
16+
17+
18+
class operator_changelog(Operator):
19+
r"""Return a GenericDataContainer used to instantiate the Changelog of an
20+
operator based on its name.
21+
22+
23+
Parameters
24+
----------
25+
operator_name: str
26+
Operator internal name.
27+
28+
Returns
29+
-------
30+
changelog_gdc: GenericDataContainer
31+
GenericDataContainer used to instantiate a Changelog.
32+
33+
Examples
34+
--------
35+
>>> from ansys.dpf import core as dpf
36+
37+
>>> # Instantiate operator
38+
>>> op = dpf.operators.utility.operator_changelog()
39+
40+
>>> # Make input connections
41+
>>> my_operator_name = str()
42+
>>> op.inputs.operator_name.connect(my_operator_name)
43+
44+
>>> # Instantiate operator and connect inputs in one line
45+
>>> op = dpf.operators.utility.operator_changelog(
46+
... operator_name=my_operator_name,
47+
... )
48+
49+
>>> # Get output data
50+
>>> result_changelog_gdc = op.outputs.changelog_gdc()
51+
"""
52+
53+
def __init__(self, operator_name=None, config=None, server=None):
54+
super().__init__(name="operator_changelog", config=config, server=server)
55+
self._inputs = InputsOperatorChangelog(self)
56+
self._outputs = OutputsOperatorChangelog(self)
57+
if operator_name is not None:
58+
self.inputs.operator_name.connect(operator_name)
59+
60+
@staticmethod
61+
def _spec() -> Specification:
62+
description = r"""Return a GenericDataContainer used to instantiate the Changelog of an
63+
operator based on its name.
64+
"""
65+
spec = Specification(
66+
description=description,
67+
map_input_pin_spec={
68+
0: PinSpecification(
69+
name="operator_name",
70+
type_names=["string"],
71+
optional=False,
72+
document=r"""Operator internal name.""",
73+
),
74+
},
75+
map_output_pin_spec={
76+
0: PinSpecification(
77+
name="changelog_gdc",
78+
type_names=["generic_data_container"],
79+
optional=False,
80+
document=r"""GenericDataContainer used to instantiate a Changelog.""",
81+
),
82+
},
83+
)
84+
return spec
85+
86+
@staticmethod
87+
def default_config(server: AnyServerType = None) -> Config:
88+
"""Returns the default config of the operator.
89+
90+
This config can then be changed to the user needs and be used to
91+
instantiate the operator. The Configuration allows to customize
92+
how the operation will be processed by the operator.
93+
94+
Parameters
95+
----------
96+
server:
97+
Server with channel connected to the remote or local instance. When
98+
``None``, attempts to use the global server.
99+
100+
Returns
101+
-------
102+
config:
103+
A new Config instance equivalent to the default config for this operator.
104+
"""
105+
return Operator.default_config(name="operator_changelog", server=server)
106+
107+
@property
108+
def inputs(self) -> InputsOperatorChangelog:
109+
"""Enables to connect inputs to the operator
110+
111+
Returns
112+
--------
113+
inputs:
114+
An instance of InputsOperatorChangelog.
115+
"""
116+
return super().inputs
117+
118+
@property
119+
def outputs(self) -> OutputsOperatorChangelog:
120+
"""Enables to get outputs of the operator by evaluating it
121+
122+
Returns
123+
--------
124+
outputs:
125+
An instance of OutputsOperatorChangelog.
126+
"""
127+
return super().outputs
128+
129+
130+
class InputsOperatorChangelog(_Inputs):
131+
"""Intermediate class used to connect user inputs to
132+
operator_changelog operator.
133+
134+
Examples
135+
--------
136+
>>> from ansys.dpf import core as dpf
137+
>>> op = dpf.operators.utility.operator_changelog()
138+
>>> my_operator_name = str()
139+
>>> op.inputs.operator_name.connect(my_operator_name)
140+
"""
141+
142+
def __init__(self, op: Operator):
143+
super().__init__(operator_changelog._spec().inputs, op)
144+
self._operator_name = Input(operator_changelog._spec().input_pin(0), 0, op, -1)
145+
self._inputs.append(self._operator_name)
146+
147+
@property
148+
def operator_name(self) -> Input:
149+
r"""Allows to connect operator_name input to the operator.
150+
151+
Operator internal name.
152+
153+
Returns
154+
-------
155+
input:
156+
An Input instance for this pin.
157+
158+
Examples
159+
--------
160+
>>> from ansys.dpf import core as dpf
161+
>>> op = dpf.operators.utility.operator_changelog()
162+
>>> op.inputs.operator_name.connect(my_operator_name)
163+
>>> # or
164+
>>> op.inputs.operator_name(my_operator_name)
165+
"""
166+
return self._operator_name
167+
168+
169+
class OutputsOperatorChangelog(_Outputs):
170+
"""Intermediate class used to get outputs from
171+
operator_changelog operator.
172+
173+
Examples
174+
--------
175+
>>> from ansys.dpf import core as dpf
176+
>>> op = dpf.operators.utility.operator_changelog()
177+
>>> # Connect inputs : op.inputs. ...
178+
>>> result_changelog_gdc = op.outputs.changelog_gdc()
179+
"""
180+
181+
def __init__(self, op: Operator):
182+
super().__init__(operator_changelog._spec().outputs, op)
183+
self._changelog_gdc = Output(operator_changelog._spec().output_pin(0), 0, op)
184+
self._outputs.append(self._changelog_gdc)
185+
186+
@property
187+
def changelog_gdc(self) -> Output:
188+
r"""Allows to get changelog_gdc output of the operator
189+
190+
GenericDataContainer used to instantiate a Changelog.
191+
192+
Returns
193+
-------
194+
output:
195+
An Output instance for this pin.
196+
197+
Examples
198+
--------
199+
>>> from ansys.dpf import core as dpf
200+
>>> op = dpf.operators.utility.operator_changelog()
201+
>>> # Get the output from op.outputs. ...
202+
>>> result_changelog_gdc = op.outputs.changelog_gdc()
203+
"""
204+
return self._changelog_gdc

src/ansys/dpf/gate/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@
6363
from .generated import result_info_capi
6464
from .generated import scoping_abstract_api
6565
from .generated import scoping_capi
66-
from .generated import semantic_version_abstract_api
67-
from .generated import semantic_version_capi
6866
from .generated import serialization_stream_abstract_api
6967
from .generated import serialization_stream_capi
7068
from .generated import session_abstract_api

src/ansys/dpf/gate/generated/capi.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,12 +3195,12 @@ def load_api(path):
31953195
dll.Operator_specification_GetPinDerivedClassTypeName.restype = ctypes.POINTER(ctypes.c_char)
31963196

31973197
if hasattr(dll, "Operator_specification_SetVersion"):
3198-
dll.Operator_specification_SetVersion.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3198+
dll.Operator_specification_SetVersion.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
31993199
dll.Operator_specification_SetVersion.restype = None
32003200

32013201
if hasattr(dll, "Operator_specification_GetVersion"):
32023202
dll.Operator_specification_GetVersion.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3203-
dll.Operator_specification_GetVersion.restype = ctypes.c_void_p
3203+
dll.Operator_specification_GetVersion.restype = ctypes.POINTER(ctypes.c_char)
32043204

32053205
if hasattr(dll, "Operator_specification_GetPinNumAliases"):
32063206
dll.Operator_specification_GetPinNumAliases.argtypes = (ctypes.c_void_p, ctypes.c_bool, ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
@@ -3210,6 +3210,10 @@ def load_api(path):
32103210
dll.Operator_specification_GetPinAlias.argtypes = (ctypes.c_void_p, ctypes.c_bool, ctypes.c_int32, ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
32113211
dll.Operator_specification_GetPinAlias.restype = ctypes.POINTER(ctypes.c_char)
32123212

3213+
if hasattr(dll, "Operator_specification_SetChangelog"):
3214+
dll.Operator_specification_SetChangelog.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3215+
dll.Operator_specification_SetChangelog.restype = None
3216+
32133217
if hasattr(dll, "Operator_specification_new_on_client"):
32143218
dll.Operator_specification_new_on_client.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_char), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
32153219
dll.Operator_specification_new_on_client.restype = ctypes.c_void_p
@@ -3832,25 +3836,6 @@ def load_api(path):
38323836
dll.Scoping_getCopy.argtypes = (ctypes.c_int32, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
38333837
dll.Scoping_getCopy.restype = ctypes.c_void_p
38343838

3835-
#-------------------------------------------------------------------------------
3836-
# SemanticVersion
3837-
#-------------------------------------------------------------------------------
3838-
if hasattr(dll, "SemanticVersion_new"):
3839-
dll.SemanticVersion_new.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3840-
dll.SemanticVersion_new.restype = ctypes.c_void_p
3841-
3842-
if hasattr(dll, "SemanticVersion_getComponents"):
3843-
dll.SemanticVersion_getComponents.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3844-
dll.SemanticVersion_getComponents.restype = None
3845-
3846-
if hasattr(dll, "SemanticVersion_eq"):
3847-
dll.SemanticVersion_eq.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3848-
dll.SemanticVersion_eq.restype = ctypes.c_bool
3849-
3850-
if hasattr(dll, "SemanticVersion_lt"):
3851-
dll.SemanticVersion_lt.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3852-
dll.SemanticVersion_lt.restype = ctypes.c_bool
3853-
38543839
#-------------------------------------------------------------------------------
38553840
# SerializationStream
38563841
#-------------------------------------------------------------------------------

src/ansys/dpf/gate/generated/operator_specification_abstract_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ def operator_specification_get_pin_num_aliases(specification, binput, numPin):
155155
def operator_specification_get_pin_alias(specification, binput, numPin, numAlias):
156156
raise NotImplementedError
157157

158+
@staticmethod
159+
def operator_specification_set_changelog(specification, changelog):
160+
raise NotImplementedError
161+
158162
@staticmethod
159163
def operator_specification_new_on_client(client, op):
160164
raise NotImplementedError

src/ansys/dpf/gate/generated/operator_specification_capi.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def operator_specification_get_pin_derived_class_type_name(specification, binput
323323
def operator_specification_set_version(specification, semver):
324324
errorSize = ctypes.c_int(0)
325325
sError = ctypes.c_wchar_p()
326-
res = capi.dll.Operator_specification_SetVersion(specification._internal_obj if specification is not None else None, semver._internal_obj if semver is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
326+
res = capi.dll.Operator_specification_SetVersion(specification._internal_obj if specification is not None else None, utils.to_char_ptr(semver), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
327327
if errorSize.value != 0:
328328
raise errors.DPFServerException(sError.value)
329329
return res
@@ -335,7 +335,9 @@ def operator_specification_get_version(specification):
335335
res = capi.dll.Operator_specification_GetVersion(specification._internal_obj if specification is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
336336
if errorSize.value != 0:
337337
raise errors.DPFServerException(sError.value)
338-
return res
338+
newres = ctypes.cast(res, ctypes.c_char_p).value.decode("utf-8") if res else None
339+
capi.dll.DataProcessing_String_post_event(res, ctypes.byref(errorSize), ctypes.byref(sError))
340+
return newres
339341

340342
@staticmethod
341343
def operator_specification_get_pin_num_aliases(specification, binput, numPin):
@@ -357,6 +359,15 @@ def operator_specification_get_pin_alias(specification, binput, numPin, numAlias
357359
capi.dll.DataProcessing_String_post_event(res, ctypes.byref(errorSize), ctypes.byref(sError))
358360
return newres
359361

362+
@staticmethod
363+
def operator_specification_set_changelog(specification, changelog):
364+
errorSize = ctypes.c_int(0)
365+
sError = ctypes.c_wchar_p()
366+
res = capi.dll.Operator_specification_SetChangelog(specification._internal_obj if specification is not None else None, changelog._internal_obj if changelog is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
367+
if errorSize.value != 0:
368+
raise errors.DPFServerException(sError.value)
369+
return res
370+
360371
@staticmethod
361372
def operator_specification_new_on_client(client, op):
362373
errorSize = ctypes.c_int(0)

0 commit comments

Comments
 (0)