Skip to content

Commit

Permalink
update generated code (#1486)
Browse files Browse the repository at this point in the history
Co-authored-by: rlagha <[email protected]>
  • Loading branch information
pyansys-ci-bot and rlagha authored Apr 1, 2024
1 parent 5370c52 commit 83baeb6
Show file tree
Hide file tree
Showing 11 changed files with 160 additions and 31 deletions.
2 changes: 1 addition & 1 deletion doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

104 changes: 74 additions & 30 deletions src/ansys/dpf/core/operators/serialization/vtu_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ class vtu_export(Operator):
Vtu base file name, (default is file)
mesh : MeshedRegion
Mesh
fields1 : Field or FieldsContainer
Nodal, face, or elemental fields (over time)
to export. when there is no support
available in the exported mesh, that
data is ignored.
fields2 : Field or FieldsContainer
Nodal, face, or elemental fields (over time)
to export. when there is no support
available in the exported mesh, that
data is ignored.
fields1 : Field or FieldsContainer or PropertyField
Nodal, face, or elemental field, fields
container (over time), or property
field to export. when there is no
support available in the exported
mesh, that data is ignored.
fields2 : Field or FieldsContainer or PropertyField
Nodal, face, or elemental field, fields
container (over time), or property
field to export. when there is no
support available in the exported
mesh, that data is ignored.
write_mode : str, optional
Available are rawbinarycompressed, rawbinary,
base64appended, base64inline, ascii,
Expand All @@ -43,6 +45,8 @@ class vtu_export(Operator):
Whether to also export faces as shell
elements when the mesh contains
cells. default is false.
mesh_properties : StringField, optional
List of names of mesh properties to export.
Examples
Expand All @@ -69,6 +73,8 @@ class vtu_export(Operator):
>>> op.inputs.as_point_cloud.connect(my_as_point_cloud)
>>> my_export_faces = bool()
>>> op.inputs.export_faces.connect(my_export_faces)
>>> my_mesh_properties = dpf.StringField()
>>> op.inputs.mesh_properties.connect(my_mesh_properties)
>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.serialization.vtu_export(
Expand All @@ -80,6 +86,7 @@ class vtu_export(Operator):
... write_mode=my_write_mode,
... as_point_cloud=my_as_point_cloud,
... export_faces=my_export_faces,
... mesh_properties=my_mesh_properties,
... )
>>> # Get output data
Expand All @@ -96,6 +103,7 @@ def __init__(
write_mode=None,
as_point_cloud=None,
export_faces=None,
mesh_properties=None,
config=None,
server=None,
):
Expand All @@ -118,6 +126,8 @@ def __init__(
self.inputs.as_point_cloud.connect(as_point_cloud)
if export_faces is not None:
self.inputs.export_faces.connect(export_faces)
if mesh_properties is not None:
self.inputs.mesh_properties.connect(mesh_properties)

@staticmethod
def _spec():
Expand Down Expand Up @@ -145,21 +155,23 @@ def _spec():
),
3: PinSpecification(
name="fields",
type_names=["field", "fields_container"],
type_names=["field", "fields_container", "property_field"],
optional=False,
document="""Nodal, face, or elemental fields (over time)
to export. when there is no support
available in the exported mesh, that
data is ignored.""",
document="""Nodal, face, or elemental field, fields
container (over time), or property
field to export. when there is no
support available in the exported
mesh, that data is ignored.""",
),
4: PinSpecification(
name="fields",
type_names=["field", "fields_container"],
type_names=["field", "fields_container", "property_field"],
optional=False,
document="""Nodal, face, or elemental fields (over time)
to export. when there is no support
available in the exported mesh, that
data is ignored.""",
document="""Nodal, face, or elemental field, fields
container (over time), or property
field to export. when there is no
support available in the exported
mesh, that data is ignored.""",
),
100: PinSpecification(
name="write_mode",
Expand All @@ -184,6 +196,12 @@ def _spec():
elements when the mesh contains
cells. default is false.""",
),
103: PinSpecification(
name="mesh_properties",
type_names=["vector<string>", "string_field"],
optional=True,
document="""List of names of mesh properties to export.""",
),
},
map_output_pin_spec={
0: PinSpecification(
Expand Down Expand Up @@ -257,6 +275,8 @@ class InputsVtuExport(_Inputs):
>>> op.inputs.as_point_cloud.connect(my_as_point_cloud)
>>> my_export_faces = bool()
>>> op.inputs.export_faces.connect(my_export_faces)
>>> my_mesh_properties = dpf.StringField()
>>> op.inputs.mesh_properties.connect(my_mesh_properties)
"""

def __init__(self, op: Operator):
Expand All @@ -277,6 +297,8 @@ def __init__(self, op: Operator):
self._inputs.append(self._as_point_cloud)
self._export_faces = Input(vtu_export._spec().input_pin(102), 102, op, -1)
self._inputs.append(self._export_faces)
self._mesh_properties = Input(vtu_export._spec().input_pin(103), 103, op, -1)
self._inputs.append(self._mesh_properties)

@property
def directory(self):
Expand Down Expand Up @@ -342,14 +364,15 @@ def mesh(self):
def fields1(self):
"""Allows to connect fields1 input to the operator.
Nodal, face, or elemental fields (over time)
to export. when there is no support
available in the exported mesh, that
data is ignored.
Nodal, face, or elemental field, fields
container (over time), or property
field to export. when there is no
support available in the exported
mesh, that data is ignored.
Parameters
----------
my_fields1 : Field or FieldsContainer
my_fields1 : Field or FieldsContainer or PropertyField
Examples
--------
Expand All @@ -365,14 +388,15 @@ def fields1(self):
def fields2(self):
"""Allows to connect fields2 input to the operator.
Nodal, face, or elemental fields (over time)
to export. when there is no support
available in the exported mesh, that
data is ignored.
Nodal, face, or elemental field, fields
container (over time), or property
field to export. when there is no
support available in the exported
mesh, that data is ignored.
Parameters
----------
my_fields2 : Field or FieldsContainer
my_fields2 : Field or FieldsContainer or PropertyField
Examples
--------
Expand Down Expand Up @@ -449,6 +473,26 @@ def export_faces(self):
"""
return self._export_faces

@property
def mesh_properties(self):
"""Allows to connect mesh_properties input to the operator.
List of names of mesh properties to export.
Parameters
----------
my_mesh_properties : StringField
Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.serialization.vtu_export()
>>> op.inputs.mesh_properties.connect(my_mesh_properties)
>>> # or
>>> op.inputs.mesh_properties(my_mesh_properties)
"""
return self._mesh_properties


class OutputsVtuExport(_Outputs):
"""Intermediate class used to get outputs from
Expand Down
20 changes: 20 additions & 0 deletions src/ansys/dpf/gate/generated/capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,10 @@ def load_api(path):
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), )
dll.DpfVector_char_ptr_free.restype = None

if hasattr(dll, "DpfVector_char_ptr_free_for_next_usage"):
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), )
dll.DpfVector_char_ptr_free_for_next_usage.restype = None

if hasattr(dll, "DpfVector_double_commit"):
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), )
dll.DpfVector_double_commit.restype = None
Expand Down Expand Up @@ -3759,6 +3763,14 @@ def load_api(path):
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), )
dll.CSStringField_GetEntityDataById_For_DpfVector.restype = None

if hasattr(dll, "StringField_GetEntityData_For_DpfVector"):
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), )
dll.StringField_GetEntityData_For_DpfVector.restype = None

if hasattr(dll, "StringField_GetEntityDataById_For_DpfVector"):
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), )
dll.StringField_GetEntityDataById_For_DpfVector.restype = None

if hasattr(dll, "CSStringField_GetCScoping"):
dll.CSStringField_GetCScoping.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.CSStringField_GetCScoping.restype = ctypes.c_void_p
Expand All @@ -3779,6 +3791,10 @@ def load_api(path):
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), )
dll.CSStringField_PushBack.restype = None

if hasattr(dll, "StringField_PushBack"):
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), )
dll.StringField_PushBack.restype = None

if hasattr(dll, "CSStringField_Resize"):
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), )
dll.CSStringField_Resize.restype = None
Expand All @@ -3787,6 +3803,10 @@ def load_api(path):
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), )
dll.CSStringField_Reserve.restype = None

if hasattr(dll, "StringField_fast_access_ptr"):
dll.StringField_fast_access_ptr.argtypes = (ctypes.c_void_p, ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.c_wchar_p), )
dll.StringField_fast_access_ptr.restype = ctypes.c_void_p

if hasattr(dll, "CSStringField_new_on_client"):
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), )
dll.CSStringField_new_on_client.restype = ctypes.c_void_p
Expand Down
4 changes: 4 additions & 0 deletions src/ansys/dpf/gate/generated/dpf_vector_abstract_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def dpf_vector_int_free(dpf_vector, data, size, modified):
def dpf_vector_char_ptr_free(dpf_vector, data, size, modified):
raise NotImplementedError

@staticmethod
def dpf_vector_char_ptr_free_for_next_usage(dpf_vector, data, size, modified):
raise NotImplementedError

@staticmethod
def dpf_vector_double_commit(dpf_vector, data, size, modified):
raise NotImplementedError
Expand Down
9 changes: 9 additions & 0 deletions src/ansys/dpf/gate/generated/dpf_vector_capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ def dpf_vector_char_ptr_free(dpf_vector, data, size, modified):
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def dpf_vector_char_ptr_free_for_next_usage(dpf_vector, data, size, modified):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
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))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def dpf_vector_double_commit(dpf_vector, data, size, modified):
errorSize = ctypes.c_int(0)
Expand Down
16 changes: 16 additions & 0 deletions src/ansys/dpf/gate/generated/string_field_abstract_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ def csstring_field_get_entity_data_for_dpf_vector(dpf_object, out, data, size, E
def csstring_field_get_entity_data_by_id_for_dpf_vector(dpf_object, vec, data, size, EntityId):
raise NotImplementedError

@staticmethod
def string_field_get_entity_data_for_dpf_vector(dpf_object, out, data, size, EntityIndex):
raise NotImplementedError

@staticmethod
def string_field_get_entity_data_by_id_for_dpf_vector(dpf_object, vec, data, size, EntityId):
raise NotImplementedError

@staticmethod
def csstring_field_get_cscoping(field):
raise NotImplementedError
Expand All @@ -59,6 +67,10 @@ def csstring_field_set_cscoping(field, scoping):
def csstring_field_push_back(field, EntityId, size, data):
raise NotImplementedError

@staticmethod
def string_field_push_back(field, EntityId, size, data):
raise NotImplementedError

@staticmethod
def csstring_field_resize(field, dataSize, scopingSize):
raise NotImplementedError
Expand All @@ -67,6 +79,10 @@ def csstring_field_resize(field, dataSize, scopingSize):
def csstring_field_reserve(field, dataSize, scopingSize):
raise NotImplementedError

@staticmethod
def string_field_fast_access_ptr(field):
raise NotImplementedError

@staticmethod
def csstring_field_new_on_client(client, numEntities, data_size):
raise NotImplementedError
Expand Down
36 changes: 36 additions & 0 deletions src/ansys/dpf/gate/generated/string_field_capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ def csstring_field_get_entity_data_by_id_for_dpf_vector(dpf_object, vec, data, s
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def string_field_get_entity_data_for_dpf_vector(dpf_object, out, data, size, EntityIndex):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
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))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def string_field_get_entity_data_by_id_for_dpf_vector(dpf_object, vec, data, size, EntityId):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
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))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def csstring_field_get_cscoping(field):
errorSize = ctypes.c_int(0)
Expand Down Expand Up @@ -127,6 +145,15 @@ def csstring_field_push_back(field, EntityId, size, data):
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def string_field_push_back(field, EntityId, size, data):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
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))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def csstring_field_resize(field, dataSize, scopingSize):
errorSize = ctypes.c_int(0)
Expand All @@ -145,6 +172,15 @@ def csstring_field_reserve(field, dataSize, scopingSize):
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def string_field_fast_access_ptr(field):
errorSize = ctypes.c_int(0)
sError = ctypes.c_wchar_p()
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))
if errorSize.value != 0:
raise errors.DPFServerException(sError.value)
return res

@staticmethod
def csstring_field_new_on_client(client, numEntities, data_size):
errorSize = ctypes.c_int(0)
Expand Down
Binary file modified src/ansys/dpf/gatebin/Ans.Dpf.GrpcClient.dll
Binary file not shown.
Binary file modified src/ansys/dpf/gatebin/DPFClientAPI.dll
Binary file not shown.
Binary file modified src/ansys/dpf/gatebin/libAns.Dpf.GrpcClient.so
Binary file not shown.
Binary file modified src/ansys/dpf/gatebin/libDPFClientAPI.so
Binary file not shown.

0 comments on commit 83baeb6

Please sign in to comment.