Skip to content

Commit 74c4691

Browse files
update generated code (#2043)
Co-authored-by: PProfizi <[email protected]>
1 parent 77cac38 commit 74c4691

File tree

10 files changed

+97
-3
lines changed

10 files changed

+97
-3
lines changed

doc/source/_static/dpf_operators.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/ansys/dpf/core/operators/result/custom.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ class custom(Operator):
6666
is done, if 3 cyclic expansion is
6767
done and stages are merged (default
6868
is 1)
69+
result_name :
70+
Name of the result that must be extracted
71+
from the file
6972
7073
Returns
7174
-------
@@ -95,6 +98,8 @@ class custom(Operator):
9598
>>> op.inputs.mesh.connect(my_mesh)
9699
>>> my_read_cyclic = int()
97100
>>> op.inputs.read_cyclic.connect(my_read_cyclic)
101+
>>> my_result_name = dpf.()
102+
>>> op.inputs.result_name.connect(my_result_name)
98103
99104
>>> # Instantiate operator and connect inputs in one line
100105
>>> op = dpf.operators.result.custom(
@@ -106,6 +111,7 @@ class custom(Operator):
106111
... bool_rotate_to_global=my_bool_rotate_to_global,
107112
... mesh=my_mesh,
108113
... read_cyclic=my_read_cyclic,
114+
... result_name=my_result_name,
109115
... )
110116
111117
>>> # Get output data
@@ -122,6 +128,7 @@ def __init__(
122128
bool_rotate_to_global=None,
123129
mesh=None,
124130
read_cyclic=None,
131+
result_name=None,
125132
config=None,
126133
server=None,
127134
):
@@ -144,6 +151,8 @@ def __init__(
144151
self.inputs.mesh.connect(mesh)
145152
if read_cyclic is not None:
146153
self.inputs.read_cyclic.connect(read_cyclic)
154+
if result_name is not None:
155+
self.inputs.result_name.connect(result_name)
147156

148157
@staticmethod
149158
def _spec():
@@ -240,6 +249,13 @@ def _spec():
240249
done and stages are merged (default
241250
is 1)""",
242251
),
252+
60: PinSpecification(
253+
name="result_name",
254+
type_names=["any"],
255+
optional=False,
256+
document="""Name of the result that must be extracted
257+
from the file""",
258+
),
243259
},
244260
map_output_pin_spec={
245261
0: PinSpecification(
@@ -313,6 +329,8 @@ class InputsCustom(_Inputs):
313329
>>> op.inputs.mesh.connect(my_mesh)
314330
>>> my_read_cyclic = int()
315331
>>> op.inputs.read_cyclic.connect(my_read_cyclic)
332+
>>> my_result_name = dpf.()
333+
>>> op.inputs.result_name.connect(my_result_name)
316334
"""
317335

318336
def __init__(self, op: Operator):
@@ -333,6 +351,8 @@ def __init__(self, op: Operator):
333351
self._inputs.append(self._mesh)
334352
self._read_cyclic = Input(custom._spec().input_pin(14), 14, op, -1)
335353
self._inputs.append(self._read_cyclic)
354+
self._result_name = Input(custom._spec().input_pin(60), 60, op, -1)
355+
self._inputs.append(self._result_name)
336356

337357
@property
338358
def time_scoping(self):
@@ -527,6 +547,27 @@ def read_cyclic(self):
527547
"""
528548
return self._read_cyclic
529549

550+
@property
551+
def result_name(self):
552+
"""Allows to connect result_name input to the operator.
553+
554+
Name of the result that must be extracted
555+
from the file
556+
557+
Parameters
558+
----------
559+
my_result_name :
560+
561+
Examples
562+
--------
563+
>>> from ansys.dpf import core as dpf
564+
>>> op = dpf.operators.result.custom()
565+
>>> op.inputs.result_name.connect(my_result_name)
566+
>>> # or
567+
>>> op.inputs.result_name(my_result_name)
568+
"""
569+
return self._result_name
570+
530571

531572
class OutputsCustom(_Outputs):
532573
"""Intermediate class used to get outputs from

src/ansys/dpf/core/operators/serialization/hdf5dpf_custom_read.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414

1515
class hdf5dpf_custom_read(Operator):
16-
"""Extract a custom result from an hdf5dpf file.
16+
"""Extract a custom result from an hdf5dpf file. This operator is
17+
deprecated, please use the 'custom' operator instead.
1718
1819
Parameters
1920
----------
@@ -98,7 +99,8 @@ def __init__(
9899

99100
@staticmethod
100101
def _spec():
101-
description = """Extract a custom result from an hdf5dpf file."""
102+
description = """Extract a custom result from an hdf5dpf file. This operator is
103+
deprecated, please use the 'custom' operator instead."""
102104
spec = Specification(
103105
description=description,
104106
map_input_pin_spec={

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,18 @@ def load_api(path):
295295
dll.Client_get_protocol_name.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
296296
dll.Client_get_protocol_name.restype = ctypes.POINTER(ctypes.c_char)
297297

298+
if hasattr(dll, "Client_has_local_server"):
299+
dll.Client_has_local_server.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
300+
dll.Client_has_local_server.restype = ctypes.c_bool
301+
302+
if hasattr(dll, "Client_set_local_server"):
303+
dll.Client_set_local_server.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
304+
dll.Client_set_local_server.restype = None
305+
306+
if hasattr(dll, "Client_get_local_server"):
307+
dll.Client_get_local_server.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
308+
dll.Client_get_local_server.restype = ctypes.c_void_p
309+
298310
#-------------------------------------------------------------------------------
299311
# Collection
300312
#-------------------------------------------------------------------------------

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,15 @@ def client_get_full_address(client):
2727
def client_get_protocol_name(client):
2828
raise NotImplementedError
2929

30+
@staticmethod
31+
def client_has_local_server(client):
32+
raise NotImplementedError
33+
34+
@staticmethod
35+
def client_set_local_server(client, server_streams):
36+
raise NotImplementedError
37+
38+
@staticmethod
39+
def client_get_local_server(client):
40+
raise NotImplementedError
41+

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,30 @@ def client_get_protocol_name(client):
5757
capi.dll.DataProcessing_String_post_event(res, ctypes.byref(errorSize), ctypes.byref(sError))
5858
return newres
5959

60+
@staticmethod
61+
def client_has_local_server(client):
62+
errorSize = ctypes.c_int(0)
63+
sError = ctypes.c_wchar_p()
64+
res = capi.dll.Client_has_local_server(client._internal_obj if client is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
65+
if errorSize.value != 0:
66+
raise errors.DPFServerException(sError.value)
67+
return res
68+
69+
@staticmethod
70+
def client_set_local_server(client, server_streams):
71+
errorSize = ctypes.c_int(0)
72+
sError = ctypes.c_wchar_p()
73+
res = capi.dll.Client_set_local_server(client._internal_obj if client is not None else None, server_streams._internal_obj if server_streams is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
74+
if errorSize.value != 0:
75+
raise errors.DPFServerException(sError.value)
76+
return res
77+
78+
@staticmethod
79+
def client_get_local_server(client):
80+
errorSize = ctypes.c_int(0)
81+
sError = ctypes.c_wchar_p()
82+
res = capi.dll.Client_get_local_server(client._internal_obj if client is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
83+
if errorSize.value != 0:
84+
raise errors.DPFServerException(sError.value)
85+
return res
86+
278 KB
Binary file not shown.
2 KB
Binary file not shown.
410 KB
Binary file not shown.
4.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)