Skip to content

Commit 83baeb6

Browse files
update generated code (#1486)
Co-authored-by: rlagha <[email protected]>
1 parent 5370c52 commit 83baeb6

File tree

11 files changed

+160
-31
lines changed

11 files changed

+160
-31
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/serialization/vtu_export.py

Lines changed: 74 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@ class vtu_export(Operator):
2222
Vtu base file name, (default is file)
2323
mesh : MeshedRegion
2424
Mesh
25-
fields1 : Field or FieldsContainer
26-
Nodal, face, or elemental fields (over time)
27-
to export. when there is no support
28-
available in the exported mesh, that
29-
data is ignored.
30-
fields2 : Field or FieldsContainer
31-
Nodal, face, or elemental fields (over time)
32-
to export. when there is no support
33-
available in the exported mesh, that
34-
data is ignored.
25+
fields1 : Field or FieldsContainer or PropertyField
26+
Nodal, face, or elemental field, fields
27+
container (over time), or property
28+
field to export. when there is no
29+
support available in the exported
30+
mesh, that data is ignored.
31+
fields2 : Field or FieldsContainer or PropertyField
32+
Nodal, face, or elemental field, fields
33+
container (over time), or property
34+
field to export. when there is no
35+
support available in the exported
36+
mesh, that data is ignored.
3537
write_mode : str, optional
3638
Available are rawbinarycompressed, rawbinary,
3739
base64appended, base64inline, ascii,
@@ -43,6 +45,8 @@ class vtu_export(Operator):
4345
Whether to also export faces as shell
4446
elements when the mesh contains
4547
cells. default is false.
48+
mesh_properties : StringField, optional
49+
List of names of mesh properties to export.
4650
4751
4852
Examples
@@ -69,6 +73,8 @@ class vtu_export(Operator):
6973
>>> op.inputs.as_point_cloud.connect(my_as_point_cloud)
7074
>>> my_export_faces = bool()
7175
>>> op.inputs.export_faces.connect(my_export_faces)
76+
>>> my_mesh_properties = dpf.StringField()
77+
>>> op.inputs.mesh_properties.connect(my_mesh_properties)
7278
7379
>>> # Instantiate operator and connect inputs in one line
7480
>>> op = dpf.operators.serialization.vtu_export(
@@ -80,6 +86,7 @@ class vtu_export(Operator):
8086
... write_mode=my_write_mode,
8187
... as_point_cloud=my_as_point_cloud,
8288
... export_faces=my_export_faces,
89+
... mesh_properties=my_mesh_properties,
8390
... )
8491
8592
>>> # Get output data
@@ -96,6 +103,7 @@ def __init__(
96103
write_mode=None,
97104
as_point_cloud=None,
98105
export_faces=None,
106+
mesh_properties=None,
99107
config=None,
100108
server=None,
101109
):
@@ -118,6 +126,8 @@ def __init__(
118126
self.inputs.as_point_cloud.connect(as_point_cloud)
119127
if export_faces is not None:
120128
self.inputs.export_faces.connect(export_faces)
129+
if mesh_properties is not None:
130+
self.inputs.mesh_properties.connect(mesh_properties)
121131

122132
@staticmethod
123133
def _spec():
@@ -145,21 +155,23 @@ def _spec():
145155
),
146156
3: PinSpecification(
147157
name="fields",
148-
type_names=["field", "fields_container"],
158+
type_names=["field", "fields_container", "property_field"],
149159
optional=False,
150-
document="""Nodal, face, or elemental fields (over time)
151-
to export. when there is no support
152-
available in the exported mesh, that
153-
data is ignored.""",
160+
document="""Nodal, face, or elemental field, fields
161+
container (over time), or property
162+
field to export. when there is no
163+
support available in the exported
164+
mesh, that data is ignored.""",
154165
),
155166
4: PinSpecification(
156167
name="fields",
157-
type_names=["field", "fields_container"],
168+
type_names=["field", "fields_container", "property_field"],
158169
optional=False,
159-
document="""Nodal, face, or elemental fields (over time)
160-
to export. when there is no support
161-
available in the exported mesh, that
162-
data is ignored.""",
170+
document="""Nodal, face, or elemental field, fields
171+
container (over time), or property
172+
field to export. when there is no
173+
support available in the exported
174+
mesh, that data is ignored.""",
163175
),
164176
100: PinSpecification(
165177
name="write_mode",
@@ -184,6 +196,12 @@ def _spec():
184196
elements when the mesh contains
185197
cells. default is false.""",
186198
),
199+
103: PinSpecification(
200+
name="mesh_properties",
201+
type_names=["vector<string>", "string_field"],
202+
optional=True,
203+
document="""List of names of mesh properties to export.""",
204+
),
187205
},
188206
map_output_pin_spec={
189207
0: PinSpecification(
@@ -257,6 +275,8 @@ class InputsVtuExport(_Inputs):
257275
>>> op.inputs.as_point_cloud.connect(my_as_point_cloud)
258276
>>> my_export_faces = bool()
259277
>>> op.inputs.export_faces.connect(my_export_faces)
278+
>>> my_mesh_properties = dpf.StringField()
279+
>>> op.inputs.mesh_properties.connect(my_mesh_properties)
260280
"""
261281

262282
def __init__(self, op: Operator):
@@ -277,6 +297,8 @@ def __init__(self, op: Operator):
277297
self._inputs.append(self._as_point_cloud)
278298
self._export_faces = Input(vtu_export._spec().input_pin(102), 102, op, -1)
279299
self._inputs.append(self._export_faces)
300+
self._mesh_properties = Input(vtu_export._spec().input_pin(103), 103, op, -1)
301+
self._inputs.append(self._mesh_properties)
280302

281303
@property
282304
def directory(self):
@@ -342,14 +364,15 @@ def mesh(self):
342364
def fields1(self):
343365
"""Allows to connect fields1 input to the operator.
344366
345-
Nodal, face, or elemental fields (over time)
346-
to export. when there is no support
347-
available in the exported mesh, that
348-
data is ignored.
367+
Nodal, face, or elemental field, fields
368+
container (over time), or property
369+
field to export. when there is no
370+
support available in the exported
371+
mesh, that data is ignored.
349372
350373
Parameters
351374
----------
352-
my_fields1 : Field or FieldsContainer
375+
my_fields1 : Field or FieldsContainer or PropertyField
353376
354377
Examples
355378
--------
@@ -365,14 +388,15 @@ def fields1(self):
365388
def fields2(self):
366389
"""Allows to connect fields2 input to the operator.
367390
368-
Nodal, face, or elemental fields (over time)
369-
to export. when there is no support
370-
available in the exported mesh, that
371-
data is ignored.
391+
Nodal, face, or elemental field, fields
392+
container (over time), or property
393+
field to export. when there is no
394+
support available in the exported
395+
mesh, that data is ignored.
372396
373397
Parameters
374398
----------
375-
my_fields2 : Field or FieldsContainer
399+
my_fields2 : Field or FieldsContainer or PropertyField
376400
377401
Examples
378402
--------
@@ -449,6 +473,26 @@ def export_faces(self):
449473
"""
450474
return self._export_faces
451475

476+
@property
477+
def mesh_properties(self):
478+
"""Allows to connect mesh_properties input to the operator.
479+
480+
List of names of mesh properties to export.
481+
482+
Parameters
483+
----------
484+
my_mesh_properties : StringField
485+
486+
Examples
487+
--------
488+
>>> from ansys.dpf import core as dpf
489+
>>> op = dpf.operators.serialization.vtu_export()
490+
>>> op.inputs.mesh_properties.connect(my_mesh_properties)
491+
>>> # or
492+
>>> op.inputs.mesh_properties(my_mesh_properties)
493+
"""
494+
return self._mesh_properties
495+
452496

453497
class OutputsVtuExport(_Outputs):
454498
"""Intermediate class used to get outputs from

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,10 @@ def load_api(path):
11871187
dll.DpfVector_char_ptr_free.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.POINTER(ctypes.POINTER(ctypes.c_char))), ctypes.POINTER(ctypes.c_int32), ctypes.c_bool, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
11881188
dll.DpfVector_char_ptr_free.restype = None
11891189

1190+
if hasattr(dll, "DpfVector_char_ptr_free_for_next_usage"):
1191+
dll.DpfVector_char_ptr_free_for_next_usage.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.POINTER(ctypes.POINTER(ctypes.c_char))), ctypes.POINTER(ctypes.c_int32), ctypes.c_bool, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
1192+
dll.DpfVector_char_ptr_free_for_next_usage.restype = None
1193+
11901194
if hasattr(dll, "DpfVector_double_commit"):
11911195
dll.DpfVector_double_commit.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_double), ctypes.c_int32, ctypes.c_bool, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
11921196
dll.DpfVector_double_commit.restype = None
@@ -3759,6 +3763,14 @@ def load_api(path):
37593763
dll.CSStringField_GetEntityDataById_For_DpfVector.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.POINTER(ctypes.POINTER(ctypes.c_char))), ctypes.POINTER(ctypes.c_int32), ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
37603764
dll.CSStringField_GetEntityDataById_For_DpfVector.restype = None
37613765

3766+
if hasattr(dll, "StringField_GetEntityData_For_DpfVector"):
3767+
dll.StringField_GetEntityData_For_DpfVector.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.POINTER(ctypes.POINTER(ctypes.c_char))), ctypes.POINTER(ctypes.c_int32), ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3768+
dll.StringField_GetEntityData_For_DpfVector.restype = None
3769+
3770+
if hasattr(dll, "StringField_GetEntityDataById_For_DpfVector"):
3771+
dll.StringField_GetEntityDataById_For_DpfVector.argtypes = (ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.POINTER(ctypes.POINTER(ctypes.c_char))), ctypes.POINTER(ctypes.c_int32), ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3772+
dll.StringField_GetEntityDataById_For_DpfVector.restype = None
3773+
37623774
if hasattr(dll, "CSStringField_GetCScoping"):
37633775
dll.CSStringField_GetCScoping.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
37643776
dll.CSStringField_GetCScoping.restype = ctypes.c_void_p
@@ -3779,6 +3791,10 @@ def load_api(path):
37793791
dll.CSStringField_PushBack.argtypes = (ctypes.c_void_p, ctypes.c_int32, ctypes.c_int32, ctypes.POINTER(ctypes.POINTER(ctypes.c_char)), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
37803792
dll.CSStringField_PushBack.restype = None
37813793

3794+
if hasattr(dll, "StringField_PushBack"):
3795+
dll.StringField_PushBack.argtypes = (ctypes.c_void_p, ctypes.c_int32, ctypes.c_int32, ctypes.POINTER(ctypes.POINTER(ctypes.c_char)), ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3796+
dll.StringField_PushBack.restype = None
3797+
37823798
if hasattr(dll, "CSStringField_Resize"):
37833799
dll.CSStringField_Resize.argtypes = (ctypes.c_void_p, ctypes.c_int32, ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
37843800
dll.CSStringField_Resize.restype = None
@@ -3787,6 +3803,10 @@ def load_api(path):
37873803
dll.CSStringField_Reserve.argtypes = (ctypes.c_void_p, ctypes.c_int32, ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
37883804
dll.CSStringField_Reserve.restype = None
37893805

3806+
if hasattr(dll, "StringField_fast_access_ptr"):
3807+
dll.StringField_fast_access_ptr.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
3808+
dll.StringField_fast_access_ptr.restype = ctypes.c_void_p
3809+
37903810
if hasattr(dll, "CSStringField_new_on_client"):
37913811
dll.CSStringField_new_on_client.argtypes = (ctypes.c_void_p, ctypes.c_int32, ctypes.c_int32, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
37923812
dll.CSStringField_new_on_client.restype = ctypes.c_void_p

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ def dpf_vector_int_free(dpf_vector, data, size, modified):
3131
def dpf_vector_char_ptr_free(dpf_vector, data, size, modified):
3232
raise NotImplementedError
3333

34+
@staticmethod
35+
def dpf_vector_char_ptr_free_for_next_usage(dpf_vector, data, size, modified):
36+
raise NotImplementedError
37+
3438
@staticmethod
3539
def dpf_vector_double_commit(dpf_vector, data, size, modified):
3640
raise NotImplementedError

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ def dpf_vector_char_ptr_free(dpf_vector, data, size, modified):
6262
raise errors.DPFServerException(sError.value)
6363
return res
6464

65+
@staticmethod
66+
def dpf_vector_char_ptr_free_for_next_usage(dpf_vector, data, size, modified):
67+
errorSize = ctypes.c_int(0)
68+
sError = ctypes.c_wchar_p()
69+
res = capi.dll.DpfVector_char_ptr_free_for_next_usage(dpf_vector._internal_obj, utils.to_char_ptr_ptr_ptr(data), utils.to_int32_ptr(size), modified, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
70+
if errorSize.value != 0:
71+
raise errors.DPFServerException(sError.value)
72+
return res
73+
6574
@staticmethod
6675
def dpf_vector_double_commit(dpf_vector, data, size, modified):
6776
errorSize = ctypes.c_int(0)

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ def csstring_field_get_entity_data_for_dpf_vector(dpf_object, out, data, size, E
3939
def csstring_field_get_entity_data_by_id_for_dpf_vector(dpf_object, vec, data, size, EntityId):
4040
raise NotImplementedError
4141

42+
@staticmethod
43+
def string_field_get_entity_data_for_dpf_vector(dpf_object, out, data, size, EntityIndex):
44+
raise NotImplementedError
45+
46+
@staticmethod
47+
def string_field_get_entity_data_by_id_for_dpf_vector(dpf_object, vec, data, size, EntityId):
48+
raise NotImplementedError
49+
4250
@staticmethod
4351
def csstring_field_get_cscoping(field):
4452
raise NotImplementedError
@@ -59,6 +67,10 @@ def csstring_field_set_cscoping(field, scoping):
5967
def csstring_field_push_back(field, EntityId, size, data):
6068
raise NotImplementedError
6169

70+
@staticmethod
71+
def string_field_push_back(field, EntityId, size, data):
72+
raise NotImplementedError
73+
6274
@staticmethod
6375
def csstring_field_resize(field, dataSize, scopingSize):
6476
raise NotImplementedError
@@ -67,6 +79,10 @@ def csstring_field_resize(field, dataSize, scopingSize):
6779
def csstring_field_reserve(field, dataSize, scopingSize):
6880
raise NotImplementedError
6981

82+
@staticmethod
83+
def string_field_fast_access_ptr(field):
84+
raise NotImplementedError
85+
7086
@staticmethod
7187
def csstring_field_new_on_client(client, numEntities, data_size):
7288
raise NotImplementedError

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,24 @@ def csstring_field_get_entity_data_by_id_for_dpf_vector(dpf_object, vec, data, s
8282
raise errors.DPFServerException(sError.value)
8383
return res
8484

85+
@staticmethod
86+
def string_field_get_entity_data_for_dpf_vector(dpf_object, out, data, size, EntityIndex):
87+
errorSize = ctypes.c_int(0)
88+
sError = ctypes.c_wchar_p()
89+
res = capi.dll.StringField_GetEntityData_For_DpfVector(dpf_object, out._internal_obj, utils.to_char_ptr_ptr_ptr(data), utils.to_int32_ptr(size), utils.to_int32(EntityIndex), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
90+
if errorSize.value != 0:
91+
raise errors.DPFServerException(sError.value)
92+
return res
93+
94+
@staticmethod
95+
def string_field_get_entity_data_by_id_for_dpf_vector(dpf_object, vec, data, size, EntityId):
96+
errorSize = ctypes.c_int(0)
97+
sError = ctypes.c_wchar_p()
98+
res = capi.dll.StringField_GetEntityDataById_For_DpfVector(dpf_object, vec._internal_obj, utils.to_char_ptr_ptr_ptr(data), utils.to_int32_ptr(size), utils.to_int32(EntityId), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
99+
if errorSize.value != 0:
100+
raise errors.DPFServerException(sError.value)
101+
return res
102+
85103
@staticmethod
86104
def csstring_field_get_cscoping(field):
87105
errorSize = ctypes.c_int(0)
@@ -127,6 +145,15 @@ def csstring_field_push_back(field, EntityId, size, data):
127145
raise errors.DPFServerException(sError.value)
128146
return res
129147

148+
@staticmethod
149+
def string_field_push_back(field, EntityId, size, data):
150+
errorSize = ctypes.c_int(0)
151+
sError = ctypes.c_wchar_p()
152+
res = capi.dll.StringField_PushBack(field, utils.to_int32(EntityId), utils.to_int32(size), utils.to_char_ptr_ptr(data), ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
153+
if errorSize.value != 0:
154+
raise errors.DPFServerException(sError.value)
155+
return res
156+
130157
@staticmethod
131158
def csstring_field_resize(field, dataSize, scopingSize):
132159
errorSize = ctypes.c_int(0)
@@ -145,6 +172,15 @@ def csstring_field_reserve(field, dataSize, scopingSize):
145172
raise errors.DPFServerException(sError.value)
146173
return res
147174

175+
@staticmethod
176+
def string_field_fast_access_ptr(field):
177+
errorSize = ctypes.c_int(0)
178+
sError = ctypes.c_wchar_p()
179+
res = capi.dll.StringField_fast_access_ptr(field._internal_obj if field is not None else None, ctypes.byref(utils.to_int32(errorSize)), ctypes.byref(sError))
180+
if errorSize.value != 0:
181+
raise errors.DPFServerException(sError.value)
182+
return res
183+
148184
@staticmethod
149185
def csstring_field_new_on_client(client, numEntities, data_size):
150186
errorSize = ctypes.c_int(0)
7.5 KB
Binary file not shown.
14 KB
Binary file not shown.
13 KB
Binary file not shown.

0 commit comments

Comments
 (0)